Code examples PLCcom for Modbus

The integration of PLCcom for Modbus is very easy and user-friendly.
In the following examples will show you the most important functionality.

You will find other documentations with more code examples in our example application in the downloadpackage or under the button „Documentation“ in the download area.

Example:

Simple creation of a Modbus Master instance.
After creation, a connector will be bind to the instance (in this case a TCP-connector).

Your Content Goes Here

Example:

Simple creation of a Modbus Master instance.
After creation, a connector will be bind to the instance (in this case a TCP-connector).
Read raw data from puffer.

More examples to read data with a certain data type you’ll find in the documentation or with the download of the PLCcom trial versions!

Example:

Simple creation of a Modbus Master instance.
After creation, a connector will be bind to the instance (in this case a TCP-connector).

Read data from several plc regions with one access. Creating a 'ReadRequestCollection'. The device receives this collection for reading. The necessary reading accesses will be automatically reduced and optimized.

You will find more 'read' examples of specific data types (String, DINT, etc.) in our documentation or in our example application!

Example:

Simple creation of a Modbus Master instance.
After creation, a connector will be bind to the instance (in this case a TCP-connector).
Writing raw data to PLC.

More examples to read data with a certain data type you’ll find in the documentation or with the download of the PLCcom trial versions!

Example:

Simple creation of a Modbus Master instance.
After creation, a connector will be bind to the instance (in this case a TCP-connector).
Read diagnostic data from plc.

Example:

Create a Modbus Slave instance.

Example:

After creating a Modbus Slave instance, different listeners are bound to the slave and hereby provide different communication paths.

Example:

Code of a simple Modbus Slave with different listerners and the possibility to read and write from the data store directly.