cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Connect Thingworx and PLC

SOLVED
Highlighted

Re: Connect Thingworx and PLC

Click on my name and that will lead you to my profile page - there is attached zip file Microserver 5.3.1 Modbus example. The package you pointing is TWEMS is the example package I originally used, but it need a bit of configuration to get it work. There are also some issues with coils and discrete inputs as it was designed for TWEMS and not current WSEMS Microserver. I have some workaround in my Modbus example package. Compare them and use them as source examples for your project.

Re: Connect Thingworx and PLC

Thank you Peter,

I had re-download the EMS with Modbus package to my device, and got this error.

root@SL3000-1191D6:/opt/thingworx/MicroServer# ./luaScriptResource
[INFO ] 2016-04-08 12:52:59,244 ./luaScriptResource: Using config file: /opt/thingworx/MicroServer/etc/config.lua
[FORCE] 2016-04-08 12:52:59,253 ./luaScriptResource: Starting up ....

[TRACE] 2016-04-08 12:52:59,282 luaConfigurator::doGetItem: Global property or script log_level not found
[TRACE] 2016-04-08 12:52:59,284 luaConfigurator::doGetItem: Global property or script rap_host not found
[TRACE] 2016-04-08 12:52:59,287 luaConfigurator::doGetItem: Global property or script rap_host not found
[TRACE] 2016-04-08 12:52:59,291 luaConfigurator::doGetItem: Global property or script rap_host not found
[TRACE] 2016-04-08 12:52:59,293 luaConfigurator::doGetItem: Global property or script rap_host not found
[TRACE] 2016-04-08 12:52:59,294 luaConfigurator::doGetItem: Global property or script rap_port not found
[TRACE] 2016-04-08 12:52:59,295 luaConfigurator::doGetItem: Global property or script rap_port not found
[TRACE] 2016-04-08 12:52:59,296 luaConfigurator::doGetItem: Global property or script rap_port not found
[TRACE] 2016-04-08 12:52:59,297 luaConfigurator::doGetItem: Global property or script rap_port not found
[TRACE] 2016-04-08 12:52:59,299 luaConfigurator::doGetItem: Global property or script rap_ssl not found
[TRACE] 2016-04-08 12:52:59,299 luaConfigurator::doGetItem: Global property or script rap_ssl not found
....

[DEBUG] 2016-04-08 12:52:59,375 ./luaScriptResource: Appending /opt/thingworx/MicroServer/etc/thingworx/clibs;/opt/thingworx/MicroServer/etc/custom/clibs;/opt/thingworx/MicroServer/etc/community/clibs to current path /usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
[INFO ] 2016-04-08 12:52:59,376 ./luaScriptResource: New path is /opt/thingworx/MicroServer/etc/thingworx/clibs:/opt/thingworx/MicroServer/etc/custom/clibs:/opt/thingworx/MicroServer/etc/community/clibs:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
....
[DEBUG] 2016-04-08 12:52:59,515 luaScriptProxy::initialize: Name = modbus_handler

File = /opt/thingworx/MicroServer/etc/thingworx/scripts/modbus_handler.lua

LibraryPath = /opt/thingworx/MicroServer/etc/?.lua;/opt/thingworx/MicroServer/etc/thingworx/?.lua;/opt/thingworx/MicroServer/etc/thingworx/lua/?.lua;/opt/thingworx/MicroServer/etc/custom/?.lua;/opt/thingworx/MicroServer/etc/custom/lua/?.lua;/opt/thingworx/MicroServer/etc/community/lua/?.lua
InitData Ptr = 0

Persisted Props:
file = modbus_handler.lua
host = 128.100.20.49
name = modbus_handler

GlobalProps:
config_file_path = /opt/thingworx/MicroServer/etc
keepAliveRate = 6000
log_level = TRACE
rap_host = localhost
rap_port = 8000
script_clib_path = /opt/thingworx/MicroServer/etc/thingworx/clibs/?.so;/opt/thingworx/MicroServer/etc/custom/clibs/?.so;/opt/thingworx/MicroServer/etc/community/clibs/?.so
script_directory = /opt/thingworx/MicroServer/etc/custom/scripts
script_library_path = /opt/thingworx/MicroServer/etc/?.lua;/opt/thingworx/MicroServer/etc/thingworx/?.lua;/opt/thingworx/MicroServer/etc/thingworx/lua/?.lua;/opt/thingworx/MicroServer/etc/custom/?.lua;/opt/thingworx/MicroServer/etc/custom/lua/?.lua;/opt/thingworx/MicroServer/etc/community/lua/?.lua
script_resource_host = 127.0.0.1
script_resource_port = 80

[DEBUG] 2016-04-08 12:52:59,607 luaScriptProxy::runScript: Starting Script
[TRACE] 2016-04-08 12:52:59,613 luaConfigurator::doGetItem: Global property or script modbus_handler not found

hope you can help. thank you