Code examples PLCcom for Modbus

Integrating the PLCcom driver for Modbus is very simple and user-friendly.
The following examples illustrate the most important functionalities.

Further comprehensive documentation with directly executable code examples can be found in the sample application in our download package or under the Documentation button on the download page.

picture: PLCcom Modbus .Net Java C# VB Code Beispiele

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.