Mange
In my project, a Raspberry PI is master and connected to a slave by Modbus RTU, I want intially to write some words to specific holding registers of the slave.
These values shall then never be written to again as they are basic settings of the slave.
I made a LD where I initially activate a swith which after some delays write the values to the registers.
But if I have not the switch closed all the time, in Editor debugger (at least), the values go back to initial values (0) again. Does this means that its writing 0 again to all these registers?
I would like to take away that part of my logic so it later will not be written by mistake etc, but how can I first time make sure that its not rewritten to initial values?
Or is simply nothing happening physically to the modbus interface even if there is showing initial value again?
Reply 0 0
thiagoralves
You might see a zero on the ladder diagram just because the line is evaluated to false. Click on the glasses in front of the variables with the debugger running to see exactly what is inside the variable.
Reply 1 0
Mange
You might see a zero on the ladder diagram just because the line is evaluated to false. Click on the glasses in front of the variables with the debugger running to see exactly what is inside the variable.
But ofcourse. Now I can see it works as my intent! Values are simply only written when there is a change of something.
Right now, the online-debug of the master isnt working, but if I want to force a value when running runtime active, how can I do that?
Reply 0 0
thiagoralves
You can only force things in the debugger. Alternatively, if you change your %IX inputs to %QX, you will be able to write to them from the monitoring page.
Reply 1 0
Mange
You can only force things in the debugger. Alternatively, if you change your %IX inputs to %QX, you will be able to write to them from the monitoring page.
You mean under real run with my slave? I get it to work now, I can force all in the editor during debug, but %IX are not updated in the runtime webpage. I would like to be able to control all variables during normal operation of the Modbus master. Or at least the %IX so I can make some logic for adjusting the speeds of the 2 motors. (Pushbutton at the PI that also are controllable over my LAN by the monitor page). Is it possible in a near future? For beginning, I can do with only physical pushbuttons on the PI ofcourse.
Reply 0 0
fg71
If you like to control a condition with physical input you need to use OR block with your input. If the physical input is FALSE
You could still use Modbus to send a message to trigger the input to TRUE If the physical input is TRUE you couldn't change the state
of the condition with Modbus to send a message to trigger the input to FALSE.
 
In reality you have other logic that set your plc program to Auto or Manuel. If Manuel is TRUE Auto is FALSE you could change the state
If you Auto is TRUE and Manuel is FALSE you could only set the state with physical input. Ex start a machine with pushbutton.
 
Machine that is in Auto and running set the state of all input and outputs. And the only way to change anything is to first stop the machine
and next set the machine to manuell mode. And most of the time to changing parameters is password protected. Or a machine could have preset parameters to load for different recipe.
 
You have to know the difference between physical input and access a memory register directly. Physical input is read only and that's why
you do not have access to it from Modbus to write to it or using any other communication protocol.
Reply 1 0
thiagoralves
By definition of the Modbus standard, you can only write to coils (%QX), not inputs (%IX). The monitoring page uses Modbus to visualize your program, so you can only write to coils. As I said, if you change the location of your %IX variables to %QX you will be able to write to them from the Monitoring page.
Reply 0 0
Mange
By definition of the Modbus standard, you can only write to coils (%QX), not inputs (%IX). The monitoring page uses Modbus to visualize your program, so you can only write to coils. As I said, if you change the location of your %IX variables to %QX you will be able to write to them from the Monitoring page.
Its a very nice feature to be able to remotely force varibles on a running PLC.
Did I understood right that you today, on a running PLC Master like a RaspberryPI, are able to force %QXin the Monitoring page, but not yet %QW ?
How about other variables, can that be possible?
I also understood that by internal logic in the PLC, I can set up classical + and - pushbuttons to stepwise increase or decrase a speed or something.
That would make possible for me to then adjust speed on the running machine by forcing a pair of coils in the Monitor page (?)
Even if forcing %QW directly isnt yet in place (?)
I can do this today, even if no physical buttons are attached to the pins I have adressed? (And not only in the debugger)
Reply 0 0
thiagoralves
Let's try again... You CAN force variables running on the Raspberry Pi through the debugger on the editor. You CANNOT force variables on the Monitoring page.
Reply 0 0
Mange
Let's try again... You CAN force variables running on the Raspberry Pi through the debugger on the editor. You CANNOT force variables on the Monitoring page.
OK, sorry for stupid questions. But it will never be possible to force anything on the Monitor page?
Reply 0 0
thiagoralves
No, that's just a monitoring page, not a debugger. It works like an HMI. With that being said, if you use %QX locations in your contacts (instead of %IX), you will be able to write to them as if you were pressing buttons on an HMI from the monitoring page.
Reply 1 0
Mange
No, that's just a monitoring page, not a debugger. It works like an HMI. With that being said, if you use %QX locations in your contacts (instead of %IX), you will be able to write to them as if you were pressing buttons on an HMI from the monitoring page.
OK, thats great! Currently, it is not possible, my example in the other thread is only possible to force from the editor currently. For instance K here, can not be forced in tthe Monitor: [203128%2F9118841%2Fmceclip0]
Reply 0 0
thiagoralves
As I said before, your Modbus write request to K don't take any effect because it is a coil in your program
pic1.png
 
In the end, the ladder logic program will always prevail and define the state of this K coil.
 
You could, however, make write requests to VP for example if that's located in a %QX location
Screenshot 2024-12-20 at 10.20.01 AM.png
Reply 0 0
fg71
I thought I explain to you that you couldn't change a reference of coil (output) with a contact (input).
The variable K in your plc program is coil (output) and you use contact with same variable name to be input for other logic.
Reply 0 0
Mange
As I said before, your Modbus write request to K don't take any effect because it is a coil in your program
pic1.png
 
In the end, the ladder logic program will always prevail and define the state of this K coil.
 
You could, however, make write requests to VP for example if that's located in a %QX location
Screenshot 2024-12-20 at 10.20.01 AM.png
OK, I understand. I had a problem making VP to a %QX, but I will try again. It didnt want to compile that.
Reply 0 0
Reply