Getting Started Modbus

Open Automation Software Tags can be defined to connect directly to Modbus slave devices or host data to Modbus masters with the built in Modbus Driver Interface which supports communications over Ethernet and Serial interfaces for Modbus TCP, Modbus RTU, and Modbus ASCII protocols.

The following steps can be used to setup direct communications with Modbus devices.

Step 1

Getting Started-Tags 1Start Configure OAS application from the program group Open Automation Software.

Step 2

Select Configure-License and verify that Modbus is one of the available Drivers in the lower left of the form.  If you do not see Modbus available contact support@openautomationsoftware.com to update your license.

Getting Started Modbus 1

Note: You will need to be running Open Automation Software Version 8 or greater to support direct Modbus communications.  You can download the latest version at www.openautomationsoftware.com/downloads/open-automation-software/

Step 3

Select Configure-Drivers.

Getting Started Modbus 2

Step 4

Select localhost or the remote service you wish to modify with the Select button to the right of the Network Node list.

Getting Started Modbus 3

Note: Optionally select the Live Data Cloud node if you are hosting Modbus data over the Internet with a standard Internet connection.

Step 5

Enter a meaningful Driver Interface Name that you will refer to this physical connection when defining Tags with a Modbus Data Source.

Specify the Connection as Ethernet or Serial.

Specify the Modbus Type as Master or Slave.

Master will be used when communicating to a Modbus device.

Slave will be used when other Modbus masters will be communicating to OAS.

Note: When setting up a Slave interface over Ethernet set the IP Address to the computer IPv4 IP address or network node name if the master is on a remote PC.  You can also use 127.0.0.1 or localhost if the Modbus master will be on the same computer.

Define the properties for the desired physical connection.

Note: Device Address is defined at the Tag level in the next step.

Note: If you are using a Connection of Ethernet you may need to Set Default Network Adapter for Driver Interfaces.

Getting Started Modbus 4

Getting Started Modbus 5

Note: When using Ethernet as a Master you can setup multiple Driver Interfaces to the same IP Address to provide parallel processing when there are a lot of tags defined to the same IP Address and the Modbus device is slow to respond.

Step 6

Select the Add button in the lower part of the form to add the Driver Interface as an available selection when defining Tags in the next step.

Getting Started Modbus 6

Note: If you need to define several Driver Interfaces you can use the CSV Export and CSV Import on the toolbar in the upper right together with Microsoft Excel.

Step 7

Select Configure-Tags.

Getting Started Modbus 7

Select localhost or the remote service you wish to modify with the Select button to the right of the Network Node list.

Getting Started Modbus 3

Note: Optionally select the Live Data Cloud node if you are hosting Modbus data over the Internet with a standard Internet connection.

Step 8

Select to Add a Tag.

Note: You can also add organizational Groups as many levels deep as you prefer and add tags to groups.  To do this first add a Group to the root level, then right click on the Group in the right window to add additional Groups or Tags.

Getting Started-Tags 8

Step 9

Change the Data Source Tag property to Modbus.

Getting Started Modbus 8

Step 10

Specify the desired Polling Rate for the Tag.

Specify the Device Address (set as -1 if it is not to be used on Ethernet)

Step 11

Select the correct Driver Interface from the Driver Interface pull down list.

Getting Started Modbus 9

Step 12

Select the correct Memory Type from the Memory Type pull down.

Getting Started Modbus 10

Step 13

For Input Register and Holding Register Memory Type select the correct Modbus Data Type.

Getting Started Modbus 11

Note: Use the “As Boolean” types to access bits of a 16, 32, or 64 bit Integer.

Step 14

Specify the Address for the memory location.

Getting Started Modbus 12

Note: Zero Based Addressing will subtract 1 from the address when communicating to the device.

The base of the memory type will be added to the Address.

Example: Communicating to Holding Register 40000 the Memory Type will be Holding Register and the Address would be 1.

Extended addressing is also supported.

To communicate to 410001 set the Memory Type to Holding Register and the address to 10001.

To communicate to 465535 set the address to 65535.

Following are some examples.

  • To access 40,001 use address of 1
    To access 49,999 use address of 9,999
    To access 50,000 use address of 10,000
    To access 410,001 use address of 10,001
    To access 420,000 use address of 20,000
    To access 430,000 use address of 30,000
    To access 440,000 use address of 40,000
    To access 450,000 use address of 50,000
    To access 460,000 use address of 60,000
    To access 465,535 use address of 65,535

Step 15

To define multiple tags use the CSV Export and CSV Import on the toolbar in the upper right together with Microsoft Excel.

Note: You can also programmatically define Tags and Drivers using the OPCSystems .NET component with the TagCSVImport and DriverInterfaceCSVImport methods or the REST API.

Step 16

Select the Save button on the toolbar at the top.

Getting Started-Tags 19

Step 17

Create a directory on the local C: drive with the name OPCSystemsDemo.

Save the file DemoTags.tags in the directory C:\OPCSystemsDemo.

Getting Started-Tags 20

Step 18

Under Configure – Options set the Default Tag Configuration File so when the computer restarts the tag file will automatically be loaded.