Monitoring Incoming Strings to Device Emulators in Pathfinder CorePro
Scope
We will be using the SAPv2 protocol in CorePro to debug incoming strings that are being received with Device Emulator connections. It can be difficult sometimes when creating a Device Emulator with Watchers to determine if the incoming text strings are arriving to Emulator. The following guide will let you see if the data is arriving to the emulator, and how it is formatted so you can better adjust your Watcher match properties. It is also possible to create a custom log writer for long-term logging. Since version 1.9.5.27
Monitoring via SAPv2
Response is the second line
Login Admin Admin
>>login successful
-
In the example below we see one Device Emulator named "Driver_LWRP" exists. You may have more
GET DeviceEmulators#0 $MAX_DEPTH=1
>>indi DeviceEmulators#0.GenericEmulator#Driver_LWRP Id=Driver_LWRP, Failed=False, LastStarted="2021-09-24T23:20:44.287-04:00", FriendlyName="GenericEmulator#Driver_LWRP", SapObjectType=GenericEmulator, SubVersion="0001-01-01T00:00:00.000+00:00" $MAX_DEPTH=1
-
Look for the "LastReceived=" property in the response back, this is the property we are wanting to check on
GET DeviceEmulators#0.GenericEmulator#Driver_LWRP $MAX_DEPTH=1
>>indi DeviceEmulators#0.GenericEmulator#Driver_LWRP.GenericClient#[tcp://10.0.1.100:93/] Buffer="", LastReceived="", AutoReconnect=True, ToSend="", RemoteEndpointUri="tcp://10.0.1.100:93/", Connected=True, Direction=Outbound, FriendlyName="GenericClient#[tcp://10.0.1.100:93/]", SapObjectType=GenericClient, SubVersion="0001-01-01T00:00:00.000+00:00" $MAX_DEPTH=1
>>indi DeviceEmulators#0.GenericEmulator#Driver_LWRP.SapClient#[tcp://127.0.0.1:9600/] RemoteEndpointUri="tcp://127.0.0.1:9600/", Connected=True, Direction=Outbound, LoginState=None, FriendlyName="SapClient#[tcp://127.0.0.1:9600/]", SapObjectType=SapClient, SubVersion="0001-01-01T00:00:00.000+00:00" $MAX_DEPTH=1
-
GET DeviceEmulators#0.GenericEmulator#Driver_LWRP LastReceived
>>indi DeviceEmulators#0.GenericEmulator#Driver_LWRP LastReceived=""
-
The received string is wrapped between %BeginEncap% and %EndEncap%
SUB DeviceEmulators#0.GenericEmulator#Driver_LWRP LastReceived
>>indi DeviceEmulators#0.GenericEmulator#Driver_LWRP LastReceived=%BeginEncap%ERROR 1000 bad command
%EndEncap%
Let us know how we can help
If you have further questions on this topic or have ideas about how we can improve this document, please contact us.