Read/Write discrete Input/output using modbus tcp
I am an experienced software programmer (mainly PC and microcontrollers).
I am new with PLC and started evaluating the PM554-ETH to be used in one of our products. The PLC has two tasks: The first is to control an simple process, using some inputs and outputs. The second is to be used as a simple input output controller to be accessed by the PC. For the secound task I need the PC to communicate with the PLC via modbus tcp and read all inputs, read/write all outputs (digital and analog).
By reading some documents on the modbus protocol, it seems possible to use read/write single coil function etc.
My questions are:
1. Can it be done?
2. Do you have a .NET dll that implements the modbus interface?
Voted best answer
it's simple, first you have to add the Modbus tcp ip server in the protocol section (under Ethernet item) in automation builder and set OMB time to 150000, be sure you have the last firmware for your Eco (must be 22.214.171.124... and you can show it if you go online and double click to the PLC_500 and if no, you can update the firmware by Update firmware button) .
Now you can assign the variables addresses in your application from line 0 to line 1 of %M area. In this manner you can define only variables you want to read write. Try the examples given by gss if you have some problems.
About reatain variables (I'm trying this) I don't know if is possible to declare a modbus address and at the same time retain..I think you have to copy this variable only when the value change.
Suggesting you to take a look at some application examples
I am using Automation Builder version 126.96.36.19975.
In the link you sent I found this line:
"Inputs and outputs cannot be directly accessed using Modbus."
What does it mean?
Are the input and outputs mapped to a memory that I can access in order to modify them?
Do I need to do the mapping?
Is the mapping done in Automation Builder or by programming?
Thanks a lot,