Issue in connecting Thingworx and Modbus PLC Simulator
Hi All,
- I am running Modbus PLC simulator (downloaded from Modbus PLC Simulator) and Thingworx server on windows machine.
- Running EMS on Raspberry pi (all are connected in same network)
- I am using MicroServer-5.3.2-Linux-ARM-HWFPU and Modbus package for LinuxARM
I am following modbus example from Modbus PLC Simulator, ThingWorx and You
This is my ws_servers & auto_bind section of config.json
"ws_servers": [ {
"host": "192.168.0.94",
"port": 8443
} ],
"appKey": "9311c13b-69a1-49fa-9e22-00bd9fe8c333",
"auto_bind": [ {
"name": "ModbusGateway",
"gateway": true
} ],
and config.lua
scripts.MyPLC = {
file = "thing.lua",
template = "modbusExample",
identifier = "plc",
updateRate = 2000
}
scripts.Thingworx = {
file = "thingworx.lua"
}
scripts.modbus_handler = {
file = "modbus_handler.lua",
name = "modbus_handler",
host = "192.168.0.94",
port = "502"
}
The problem is that I can bind remote properties to a created thing but could not able to read modbus registries.
I am getting following error.
pi@raspberrypi:~/microserver/install_services $ sudo journalctl --unit=tw_luaScriptResourced | tail -20
Oct 21 15:36:01 raspberrypi thingworx[5648]: ScriptResource::executeScriptRequest:Path /scripts/modbus_handler/holding_register/1/40001/ not found
Oct 21 15:36:01 raspberrypi thingworx[5648]: luaInterscriptBinding::l_executeCallback:Error executing callback 'modbus_handler//scripts/modbus_handler/holding_register/1/40001'
Returned: 404 /scripts/modbus_handler/holding_register/1/40001/ not found
Oct 21 15:36:01 raspberrypi thingworx[5648]: MyPLC:Could not read current value of Int16HoldRegExample. Setting quality to UNKNOWN. Resp:
Oct 21 15:36:01 raspberrypi thingworx[5648]: MyPLC:Error while getting property Int16HoldRegExample. msg: /scripts/modbus_handler/holding_register/1/40001/ not found
Oct 21 15:36:04 raspberrypi thingworx[5648]: ScriptResource::executeScriptRequest:Path /scripts/modbus_handler/holding_register/1/40001/ not found
Oct 21 15:36:04 raspberrypi thingworx[5648]: luaInterscriptBinding::l_executeCallback:Error executing callback 'modbus_handler//scripts/modbus_handler/holding_register/1/40001'
Returned: 404 /scripts/modbus_handler/holding_register/1/40001/ not found
Oct 21 15:36:04 raspberrypi thingworx[5648]: MyPLC:Could not read current value of ScaledInt16RegExample. Setting quality to UNKNOWN. Resp:
Oct 21 15:36:04 raspberrypi thingworx[5648]: MyPLC:Error while getting property ScaledInt16RegExample. msg: /scripts/modbus_handler/holding_register/1/40001/ not found
Oct 21 15:36:04 raspberrypi thingworx[5648]: ScriptResource::executeScriptRequest:Path /scripts/modbus_handler/holding_register/1/40002/ not found
Oct 21 15:36:04 raspberrypi thingworx[5648]: luaInterscriptBinding::l_executeCallback:Error executing callback 'modbus_handler//scripts/modbus_handler/holding_register/1/40002'
Returned: 404 /scripts/modbus_handler/holding_register/1/40002/ not found
Oct 21 15:36:04 raspberrypi thingworx[5648]: MyPLC:Could not read current value of Uint16RegExample. Setting quality to UNKNOWN. Resp:
Oct 21 15:36:04 raspberrypi thingworx[5648]: MyPLC:Error while getting property Uint16RegExample. msg: /scripts/modbus_handler/holding_register/1/40002/ not found
Oct 21 15:36:04 raspberrypi thingworx[5648]: ScriptResource::executeScriptRequest:Path /scripts/modbus_handler/holding_register/1/40001/ not found
Oct 21 15:36:04 raspberrypi thingworx[5648]: luaInterscriptBinding::l_executeCallback:Error executing callback 'modbus_handler//scripts/modbus_handler/holding_register/1/40001'
Returned: 404 /scripts/modbus_handler/holding_register/1/40001/ not found
Oct 21 15:36:04 raspberrypi thingworx[5648]: MyPLC:Could not read current value of Int16HoldRegExample. Setting quality to UNKNOWN. Resp:
Oct 21 15:36:04 raspberrypi thingworx[5648]: MyPLC:Error while getting property Int16HoldRegExample. msg: /scripts/modbus_handler/holding_register/1/40001/ not found
am I missing something?
2nd query is how to log the messages from luaScriptResource when its running as service? config.lua does not have logger section.

