Saltar al contenido principal

IOManager (I/O Access)

IOManager Object Methods

These methods allow access to I/O functions to read and write PLC inputs and outputs.

bool GetInput(int num);

  • Description: Returns the PLC input number num status.
  • Example:
if(IOManager.GetInput(1))
{
// Do something
}

bool GetOutput(int num);

  • Description: Returns the PLC output number num status.
  • Example:
if(IOManager.GetOutput(1))
{
// Do something
}

void SetInput(int num, bool stat);

  • Description: Sets the PLC input number num status to stat.
  • Example:
IOManager.SetInput(1, true);

void SetOutput(int num, bool stat);

  • Description: Sets the PLC output number num status to stat.
Warning

These outputs can't be activated while PLC is running, because they will be overwritten by the PLC logic.

  • Example:
IOManager.SetOutput(2, false);

void SetVirtualOutput(int num, bool stat);

  • Description: Sets the PLC output number num status to stat (for virtual Outputs managed by code).
Note

These outputs can be activated while the PLC is running.

  • Example:
IOManager.SetVirtualOutput(2, false);

bool TrigInpUp(int num);

  • Description: Returns the PLC input number num change status from false to true (Rising Edge).
  • Example:
if(IOManager.TrigInpUp(1))
{
// Do something
}

bool TrigInpDwn(int num);

  • Description: Returns the PLC input number num change status from true to false (Falling Edge).
  • Example:
if(IOManager.TrigInpDwn(1))
{
// Do something
}

bool TrigOutUp(int num);

  • Description: Returns the PLC output number num change status from false to true (Rising Edge).
  • Example:
if(IOManager.TrigOutUp(1))
{
// Do something
}

bool TrigOutDwn(int num);

  • Description: Returns the PLC output number num change status from true to false (Falling Edge).
  • Example:
if(IOManager.TrigOutDwn(1))
{
// Do something
}

float GetAInput(int num);

  • Description: Returns the PLC Analogic Input number num.
  • Example:
float d1 = IOManager.GetAInput(1);

void SetAInput(int num, float v);

  • Description: Sets the PLC Analogic Input num value v to be sent to the PLC.
  • Example:
IOManager.SetAInput(3, 10.5f);

float GetAOutput(int num);

  • Description: Returns the PLC Analogic Output number num.
  • Example:
float d1 = IOManager.GetAOutput(1);

void SetAOutput(int num, float v);

  • Description: Sets the PLC Analogic Output num value v.
  • Example:
IOManager.SetAOutput(3, 10.5f);

void SetInputDesc(int num, string desc);

  • Description: Sets a text description for PLC digital Input num.
  • Example:
IOManager.SetInputDesc(1, "Sensor High");

void SetOutputDesc(int num, string desc);

  • Description: Sets a text description for PLC digital Output num.
  • Example:
IOManager.SetOutputDesc(1, "Start Motor");

void SetAnInputDesc(int num, string desc);

  • Description: Sets a text description for PLC analog Input num.
  • Example:
IOManager.SetAnInputDesc(3, "Temperature Sensor Value");

void SetAnOutputDesc(int num, string desc);

  • Description: Sets a text description for PLC analog Output num.
  • Example:
IOManager.SetAnOutputDesc(5, "Vertical Axis Position Value");