Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: mhw on June 30, 2016, 09:07:50 AM
-
I am reading registers from an ATS48 and ATV31. The data I am receiving is not what I am expecting. For example when reading the motor current (W4062) from the SS, I get 32768 at 0A and 33024 at about 24A. The current is supposed to be presented in tenths of an amp.
I am confident that those of you that have infinite knowledge will be able to look at this and tell what I need to do.
Thanks.
-
It could be the Modbus addressing you need to utilize is not correct. What are your MRX instruction parameters, i.e. function code, Modbus Offset Address value. Is this Modbus/RTU or Modbus/TCP (serial or Ethernet)?
Also, you will need the documentation from your Telemecanique Schneider devices to know how they represent Modbus addresses from their devices. If you can find a link to an online .PDF that contains that info and post the URL here, that would be PERFECT.
-
It is RTU, function code 3, offset 4062. I am pretty sure that I am reading the correct address because the value is changing as the motor load changes. The manual is here: http://www2.schneider-electric.com/resources/sites/SCHNEIDER_ELECTRIC/content/live/FAQS/175000/FA175813/en_US/ATS%2048%20User%20Manual%20Modbus%20Protocol.pdf (http://www2.schneider-electric.com/resources/sites/SCHNEIDER_ELECTRIC/content/live/FAQS/175000/FA175813/en_US/ATS%2048%20User%20Manual%20Modbus%20Protocol.pdf)
-
If you do a byte swap then 32768 = 1, and 33024 = 24.
-
If you do a byte swap then 32768 = 1, and 33024 = 24.
Actually...
32768 = 0x8000, swapped is 0x0080, which is 128
33024 = 0x8100, swapped is 0x0081, which is 129
Could it be sign plus magnitude? Or maybe the MSBit (bit 15) signifies some flag (e.g. current vs. voltage?)
0x8000 = -0
0x8100 = -256, which is -25.6A if it is tenths of an ampere, about 24A?
-
I looked at the .PDF on page 102 talks about register LCR is Modbus Offset 4062.
Code Address: LCR W4062
Name: Motor current
Unit: 0.1A
Range: (1)
Factory Setting: blank
The units are tenths of an amp. There is a footnote in the "range" column "(1)", but I could not find the meaning.
-
Just for giggles, I would look at 4063 and possibly 4061, and see what registers you get.
You could use Function Code 3 in your MRX starting at 4061 with the number of registers equal to 3 to get 4061/4062/4063.
I would also try Modbus Offset Address of 61 (eliminate the 40 portion) and read 3 registers and see what values you get there for registers 61/62/63.
EDIT
eh, looking at the manual, that 2nd scenario doesn't seem to be possible. BUT, Register 4061 is a status register (e.g. 0x8000, 0x8100 seem possible status bit register values). I bet it's the ol' Modbus off-by-one, so I bet Offset 4063 will get you W4062 Motor Current value.
-
I lost internet access on location and have left the job site.
If you do a byte swap then 32768 = 1, and 33024 = 24.
I tried the byte swap and received results as stated by franji1.
Just for giggles, I would look at 4063 and possibly 4061, and see what registers you get.
I had tried that before my original post. No joy. I think I am reading the correct address because the number will change consistent with motor load.
I won't be back on site until Tuesday. Still looking for ideas.
Thanks
-
There are some free Modbus utilities to test Modbus comm generically (don't know any off the top of my head). If you use that, then you can at least divide the problem scope in half (Master side vs. Slave side).
-
What I did was not an actual byte swap (I should not have called it that). I merely looked at the bit pattern for each number (in a word), and then reversed the bits from each byte going from msb to lsb...
-
What I did was not an actual byte swap (I should not have called it that). I merely looked at the bit pattern for each number (in a word), and then reversed the bits from each byte going from msb to lsb...
Funny, 0x8100 bit swapped is 0x0081! What are the odds? ;D
-
What are the odds? ;D
I'm sure Controls Guy will be along soon, and either you or him will tell us what the odds are... literally. ;D
-
ATV31 Modbus manual is here http://www.schneider-electric.com/download/hk/en/details/2557184-ATV31-Modbus-manual/?reference=1624597 (http://www.schneider-electric.com/download/hk/en/details/2557184-ATV31-Modbus-manual/?reference=1624597)
The example for reading W3104 (High Speed) is Hi byte Lo byte hex 01F4 for 50.0 Hz (500)
-
After looking around (so I don't have to think about my own PLC issues) it looks to me like you may need to use 4063 (4062+1) for your offset based on what other forum posts have indicated. The W4061 is a status register of some sort in the ATS48 (ETA6) but I can't find any actual info on that register. 8000h and 8100h look suspiciously like a single status bit, but... maybe you saw other values too?
Anecdotally, I chased a modbus issue for the longest time trying to decipher how the numbers related to anything (swapping hex, decimal, etc.) only to finally realize it had never actually worked as the original programmer had erred. It looked right, sorta.
-
I am reading registers from an ATS48 and ATV31. The data I am receiving is not what I am expecting. For example when reading the motor current (W4062) from the SS, I get 32768 at 0A and 33024 at about 24A. The current is supposed to be presented in tenths of an amp.
I am confident that those of you that have infinite knowledge will be able to look at this and tell what I need to do.
Thanks.
Looks like they're sending signed 16-bit (-32768 to 32767, and you're interpreting it as unsigned 16-bit. (0-65535)
-
Except for this from the ATS48 Modbus Manual:
Representation of data
The ATV48 parameters are 16-bit words designated by "W…" (…address in decimal notation).
They are used to represent unsigned values (0 to 65535), ie. 16 independent logic states.
In this case, they are called "registers", and the notation for their bits is "W…:xk" (k bit number, from 0 to 15).
Yes the manual does say ATV48 here but it is from the ATS48 Modbus Protocol manual.
-
I guess I only thought that I tried +1. 4063 got me where I needed to be.
Sorry for running everyone around over nothing. Thanks for your help.