OnDeviceConnectionChanged
Event invoked when the connection state of the device changed
⚡ Event
void OnDeviceConnectionChanged(
deviceName: string,
IP: string,
connected: boolean
)
⚙️ Parameters
Name | Type | Description |
---|---|---|
device |
String | The name of the device. |
IP |
String | The IP Address that the device is/was connected to. |
connected |
Boolean | The connection state of the device. |
📝 Example
SubscribeToEvent("OnDeviceConnectionChanged", "PLC1", "Device", ConnectionChanged);
function ConnectionChanged(device, IP, connected) {
if (connected == true)
result = "connected";
else
result = "disconnected";
LogDebug("Device " + device + " with IP = " + IP + " is now " + result);
}