FUXA icon indicating copy to clipboard operation
FUXA copied to clipboard

How to read coil status on Modbus TCP?

Open IonuDragomir1 opened this issue 2 years ago • 9 comments

Hi, I want to read, using Modbus TCP, coil's status from Schneider PLC. Coil's address is Q0.4. In Fuxa, I have created a tag, using Coil Status register, type bool. What address should I use to read coil's status? I have tried address 3, 4 and 5, but none of them returns coil's status.

IonuDragomir1 avatar Aug 08 '23 10:08 IonuDragomir1

I believe that these addresses are not mapped to modbus in Schneider PLCs, which exact model are you using? Try to do the same with modscan or another modbus test software.

rvbatista avatar Aug 09 '23 11:08 rvbatista

@rvbatista, I am using TM221CE24R model. I have used, as you suggested, modscan. Scanning 100 coils (addressing from 1 to 100), I've noticed that coil 41 is changing its value as Q0.4 does. I put the same address (41) in FUXA and it works as expected. Now the question is what's the relation between Q0.4 and address 41?

IonuDragomir1 avatar Aug 09 '23 12:08 IonuDragomir1

Great, I didn't know that the outputs are mapped to Modbus in M221.

rvbatista avatar Aug 09 '23 12:08 rvbatista

What's strange is that I changed Q0.4 with Q0.5 and still coil 41 is changing it's value accordingly with Q0.5 value. Shouldn't have been another address instead of 41?

IonuDragomir1 avatar Aug 09 '23 12:08 IonuDragomir1

What's strange is that I changed Q0.4 with Q0.5 and still coil 41 is changing it's value accordingly with Q0.5 value. Shouldn't have been another address instead of 41?

You figured out if what you are reading are really related to the digital outputs? Searched a little the documentation and didn't found this relation.

rvbatista avatar Nov 19 '23 15:11 rvbatista

Hi, @rvbatista, unfortunately I didn't figure out. The TM221CE24R PLC has 8 DO (DigitalOutputs). On it can be added DO extensions. A DO extension has outputs with address from Q1.0 to Q1.31. I really don't know how I can read on FUXA Q0.4's or Q1.13's status. It's not clear what address should I use to read coil's status. Maybe @unocelli or somebody else can help with this issue.

IonuDragomir1 avatar Nov 20 '23 08:11 IonuDragomir1

@IonuDragomir1 the issue is related to the hardware found M221 function code list.

servlet.png

Believe that this issue can be closed.

rvbatista avatar Nov 21 '23 08:11 rvbatista

@rvbatista thanks for the reply! So the only way to read coil's status is to transfer its value to a %M internal bit and read it on FUXA. Maybe DOs from Schneider's premium PLC class can be read directly with FUXA. Sometime I'll give it a try.

IonuDragomir1 avatar Nov 21 '23 09:11 IonuDragomir1

@rvbatista thanks for the reply! So the only way to read coil's status is to transfer its value to a %M internal bit and read it on FUXA. Maybe DOs from Schneider's premium PLC class can be read directly with FUXA. Sometime I'll give it a try.

Yes, to read outputs we need to move the %Q to %M or even %MW. It's good to find similar table for PREMIUM.

rvbatista avatar Nov 21 '23 16:11 rvbatista

I assume the issue has been resolved in the meanwhile. I'm therefore going to close this issue.

unocelli avatar May 22 '24 19:05 unocelli