Modbus visualization:

For Modbus you need a daemon that reads Modbus signals cyclically into a shared memory. Also the daemon provides a Mailbox for outputting messages to the Modbus. In order to create this daemon do the following.

  • Load your project
  • Choose Daemon->Modbus
  • Per default the INI file is set to Modbus communication over TCP/IP (socket)
  • Input tcpadr and tcpport
  • For every data you want to read from Modbus input a cycle as shown in the example
  • slave= Modbus address
  • function= as shown in the INI file
  • start_adr= start_adr within the Modbus slave
  • num_registers= how may registers have to be transfered over Modbus
  • When you are finished with the INI file, click "Compile" and then "Close"
  • The daemon will be created and stored in modbusdaemon.*
  • Refer to "Help" for instructions howto run the daemon in background
  • Now that you have created your Modbus daemon you have todo something in your ProcessViewServer.

  • Click Project and uncomment rllib in the project file:

  • unix:LIBS += /usr/lib/librllib.so
    unix:INCLUDEPATH += /usr/local/include/rllib
    win32:LIBS += $(RLLIBDIR)\rllib.lib
    win32:INCLUDEPATH += $(RLLIBDIR)
  • Click Main and uncomment:

  • rlModbusClient modbus(modbusdaemon_MAILBOX,modbusdaemon_SHARED_MEMORY,modbusdaemon_SHARED_MEMORY_SIZE);
  • Click Header and uncomment:

  • #include "rlmodbusclient.h" // this is from rllib
    #include "modbusdaemon.h" // this is generated
  • Click into your Mask and uncomment (at top of file):

  • extern rlModbusClient modbus;

    Now you can display Modbus signals within your mask.

  • Click Mask. And then RadioButton "showData"
  • Uncommend the variable "val"
  • Position the cursor under:

  • // (todo: add your code here)
  • Click "Insert Function(...)"
  • Choose a function from rlModbusClient
  • Now the variable "val" contains your Modbus signal. You have to display it.
  • Click "Widget Name" in the toolbox on the left side of the window.
  • Right click on the signal you want to use for displaying a Modbus value.
  • Choose function and click "insert"
  • In case you output to a Table you have to input x,y
  • In case you output to a ListView you have to input the path
  • In order to compile and link your ProcessViewServer click "Action->make"