How can I access %MW0 (Modbus 1228) in Codesys3 on a Raspberry PI.

JesperDK

Level-1
Beiträge
8
Reaktionspunkte
0
Zuviel Werbung?
-> Hier kostenlos registrieren
How can I access %MW0 (Modbus 1228) in Codesys3 on a Raspberry PI.
I need to be able to read and write like it was possible in Codesys 2.
I know that a modbus slave can be added and use %IW or %QW but then i can't read or write to the same register.
 
You should explain a Little bit more about your requirement.
If something is basicly working with CoDeSys 2 it should be convertible to CoDeSys 3 - so how do you access your PI with CodeSys 2.
Also ... what ist the dependency between your IW's and QW's with the MW ?

You should improve your question a liitle bit ...
 
Zuviel Werbung?
-> Hier kostenlos registrieren
Hi i will try
I have a function block to control a motor there is a status and control word in one word.
From bit 0-5 alarms and from bit 6-10 control bits for start and stop etc.
So in codesys 2 I have the word declared like that statuscontrol AT %MW0: WORD; // Modbus address 1228.
From my HMI I can then read the bits and write to the bits I that word. But when I try the same in Codesys3 I can’t get that to work.
I tried to add a modbus slave to the project but there is only %iw and %qw so not the same possible solution like I need.
 
Sorry ... I'm not familiar with CodeSys - all what I'm writing comes from my basic understanding.
So ... independant from CS2 or CS3 - I can't imagine that CS2 directly read the ModBus-Slave to the MW0 - there must be also an IW and a QW from where the real connection comes
Please try to check this first ...
 
Hi Larry.
You are wrong it is possible from CS2. To read and write to a MW register from a modbus master and as well the plc can read and write to the same MW register.
 
Hi Larry
Thanks for the idea. But i really don't want a solution like that. It's really strange if its not possible anymore to have the register that can be modified from a Scada/HMI system and as well a plc.
 
OK ... then let's start from the beginning ...
At first you should provide your code (CS2) and let's have a look on it.
Then you should provide your converted CS3-Code.
An at least you should give the Information what you want to do and how you want to do it ...

Cheers
Larry
 
Zurück
Oben