Write and Read Modbus RTU on PLC Micro850 CCW

zanker99

Lifetime Supporting Member
Join Date
Feb 2016
Location
Sunnyvale, CA
Posts
3
Protocol: Modbus RTU
PLC: AB/Rockwell Micro850 as master
Programming environment: CCW

Background Info:

I am trying to use Modbus rtu to communicate with 20 devices for only read on one Modbus channel and on another channel I have 1 device which the PLC writes to and reads from. I have no experience using Modbus in PLC. It will be very helpful if someone who knows using mdobus RTU on PLC can help me find answers to some questions I have regarding this implementation.

Question:

1. How does one handle continuous communication with a device on Modbus RTU using a PLC like Micro850: i.e. write a command to the device, wait for it to process and read from the device.

I am using only holding registers ( say 50 registers ). "The MSG_MODBUS block for the Micro850 in CCW says that a maximum of 4 message request per channel can be processed in one scan. For ladder program, message requests are executed at the end of a ladder scan."

I am sure I am missing something here but what I am not able to understand is, if all Modbus messages in a scan are executed together at the end of the scan, how can I wait for the write command to be sent and processed before reading the response. It looks like any delays/timers before or after the MSG_MODBUS block do not take effect to provide the time required between a write and a read. Any suggestions on how to implement this?

I have an example attached. The blocks used are as follows:

TONOFF delays turning on an output on a true rung, then delays turning off the output on the false rung.

MSG_MODBUS sends a Modbus message over a serial port. A maximum of four message requests per channel can be processed in one scan. For Ladder Diagram programs, message requests are executed at the end of a ladder scan.


Thank you!

ModbusReadAndWriteWithTimer.jpg
 
Buonasera,
qualcuno di voi mi può dare un'esempio di programmazione per poter leggere via modbus seriale degli indirizzi con valori analogici oppure se mi date conferma che con l'istruzione msg_modbus riseco a leggere direttamente sul serial_isol un determinato registro?

Grazie della vostra disponibilità
 
Buonasera,
qualcuno di voi mi può dare un'esempio di programmazione per poter leggere via modbus seriale degli indirizzi con valori analogici oppure se mi date conferma che con l'istruzione msg_modbus riseco a leggere direttamente sul serial_isol un determinato registro?

Grazie della vostra disponibilità
There'are some examples in the following manuals:

Micro800 Programmable Controllers General Instructions (page 249)

Micro830 and Micro850 Programmable Controllers (page 195)

Configure Micro800 for Modbus Communications to a PanelView Component
 
I have never worked with the Micro850 so I will have to be General in my response.

The important thing to keep in mind is that Modbus is a "Standard" in the loosest sense of the word. Every device you work with will be slightly different. So you will have to really put your head in the manual to find the little details to make everything work.

For Reading Only: This should be the easiest to get going. You will want to issue the read command (Function Code 3 or 4) and if all the registers you want to read are in continuous registers then you read xxxxx for x registers and place them into your PLC tags. The one thing to keep in mind is not to issue the commands too fast. Depending on the device you are reading if you read too fast the device may not send back the info. I have had that happen. So keep your polls to a reasonable time. If the data is not changing very fast then every 5-10 Sec should be good.

Issuing Commands is where it tends to get more challenging. This is also where you will be spending most of your time in the manual. What you want to do is look for coils in the device that will respond to your commands. For example: If you tell a device to START, look for a coil that you can read that will indicate that the unit is running. Some devices have a special register that holds the response to a issued command. Some of my equipment does that. If you read the register and get a 254 you know the command was received and done.

This is how I issue commands to a lot of my equipment: I will issue the command and start a timer at the same time. I will then read the coil or register that tells me that the device accepted my command. The timer is used to keep issuing the command over and over until the device confirms that it has done what I wanted. I then move on to the next command with a timer and read the next status coil. I just keep going like that.

Depending on the number of commands, the device, your PLC and traffic it can take a few seconds to get through your command list.

I hope this helps you out
 
Buonasera, ma per caso qualcuno di voi mi potrebbe inviare qualche esempio, perchè sinceramente seguendo le istruzioni del manuale il problema ancora persiste.

Grazie
 

Similar Topics

Hi everyone, I am working on a project that needs to expose the SV (Set Value) of a temperature controller to a SCADA system. SCADA <-...
Replies
4
Views
134
Lately, I've been using Modbus for reading sensor values in process programming. I haven't used Modbus much, so I spent some time looking at...
Replies
4
Views
1,811
Dear all, glad to be here and I hope that we all can benefit from this great community. I am trying to send and receive data between two Mico850...
Replies
4
Views
2,668
Hello! I am using S7-1200 PLC 1212C AC/DC with configured Modbus TCP Server. I can already read/write Inputs/Outputs (Coils) and Memory Words...
Replies
7
Views
2,898
Back
Top Bottom