Check PLC connection

Hi,

What is the function for know if the plc is connected to the scada?

I'm using a M340 PLC with a modnet driver.

Thanks

Parents
  • I would use:

    bOnline = ((StrToInt(IODeviceInfo(sPLC,3)) BITAND 3) <> 0);    // populate sPLC with a valid I/O device name or number

    This example works with redundant I/O devices as well, and will also catch states where the PLC is not fully on-line like 'Starting', 'Stopping', 'Disabled'.

    You could also check for good quality of a known variable:

    bOnline = QualityIsGood(PLCTag.Q);    // substitute PLCTag with a valid tag name

    Regards,
    Patrick

Reply
  • I would use:

    bOnline = ((StrToInt(IODeviceInfo(sPLC,3)) BITAND 3) <> 0);    // populate sPLC with a valid I/O device name or number

    This example works with redundant I/O devices as well, and will also catch states where the PLC is not fully on-line like 'Starting', 'Stopping', 'Disabled'.

    You could also check for good quality of a known variable:

    bOnline = QualityIsGood(PLCTag.Q);    // substitute PLCTag with a valid tag name

    Regards,
    Patrick

Children
No Data