How can i adjust the sequence of reading and writing in modbus?

ahmedyasser77

Member
Join Date
Jun 2018
Location
Alexandria
Posts
4
Hey guys, i'm controlling altivar 71 drive from modicon m340 cpu 2020 plc through modbus communication, when I read and write at the same time, the drive enters a stop mode, how can i adjust the time between reading and writing using readvar and writevar functions to have a real time controlling and monitoring? Thanks in advance.
 
Last edited:
Set yourself up two timers. Perhaps your controller has a "flasher" instruction that you can utilize. It works something like this:

If "BitB" is 0, set CommsEnableRead flasher
If "BitA" is 0, set CommsEnableWrite flasher

You will use timers to alternate the two for one second or so each, so that neither is on at the time same. Then:

If CommsEnableRead is 1, [Modbus reads]
If CommsEnableWrite is 1, [Modbus writes]

You may have to adjust timings, but that should do it.
 
If you use a half duplex communication, for example RS-485, it can not physically transmit and receive at the same time.

In addition MODBUS is a Request-Response protocol so both physical and per protocol every time you make a request you should wait for the answer before launch another request.
 
I'm using MODBUS RTU, and when i read and write using read/write var functions at the same time, the drive graphical interface unit starts flashing between ready and NST (which is a stop mode).
 
You should interlock the messages so that they occur as fast as possible but not at the same time. Some additional delay may be useful too, since some Modbus RTU slave devices could still be overwhelmed with requests.

I don't know your PLC, but with those that I have worked with, I used the message done and error bits to trigger the next message in a sequence.
 

Similar Topics

Hello Gents, I have got a request to stop the system at fixed times through the day (at End of Day/Night shifts) which could be done using the...
Replies
2
Views
917
Hello all! This is probably a silly question but, hey, I can't figure it out. Is there a way to adjust the order that the pens are displayed...
Replies
2
Views
1,618
Hello guys, I use Tia Portal V16. What is the best way to change the indexed HMI tags when I change the format of an Udt in my plc program...
Replies
0
Views
1,302
Good Evening , After running for 2 years , I have a few Powerflex 525 drives faulting out with a F 73 Ethernet Fault . What have you guys...
Replies
5
Views
2,556
Hi all I thought I had this working but upon doing a checkup a few months after the machine was commissioned, I found that adjusting the RTC via...
Replies
4
Views
1,843
Back
Top Bottom