News:

  • June 06, 2026, 09:39:10 PM

Login with username, password and session length

Author Topic: Telemecanique Schneider MODBUS  (Read 19846 times)

mhw

  • Hero Member
  • *****
  • Posts: 250
Telemecanique Schneider MODBUS
« 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.


franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3827
    • Host Engineering
Re: Telemecanique Schneider MODBUS
« Reply #1 on: June 30, 2016, 10:03:39 AM »
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.

mhw

  • Hero Member
  • *****
  • Posts: 250
Re: Telemecanique Schneider MODBUS
« Reply #2 on: June 30, 2016, 10:13:19 AM »
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

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: Telemecanique Schneider MODBUS
« Reply #3 on: June 30, 2016, 10:19:44 AM »
If you do a byte swap then 32768 = 1, and 33024 = 24.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3827
    • Host Engineering
Re: Telemecanique Schneider MODBUS
« Reply #4 on: June 30, 2016, 12:27:23 PM »
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?

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3827
    • Host Engineering
Re: Telemecanique Schneider MODBUS
« Reply #5 on: June 30, 2016, 12:39:14 PM »
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.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3827
    • Host Engineering
Re: Telemecanique Schneider MODBUS
« Reply #6 on: June 30, 2016, 12:45:58 PM »
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.
« Last Edit: June 30, 2016, 12:51:02 PM by franji1 »

mhw

  • Hero Member
  • *****
  • Posts: 250
Re: Telemecanique Schneider MODBUS
« Reply #7 on: June 30, 2016, 03:28:24 PM »
I lost internet access on location and have left the job site.
Quote
If you do a byte swap then 32768 = 1, and 33024 = 24.
I tried the byte swap and received results as stated by franji1.
Quote
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

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3827
    • Host Engineering
Re: Telemecanique Schneider MODBUS
« Reply #8 on: June 30, 2016, 03:48:58 PM »
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).

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: Telemecanique Schneider MODBUS
« Reply #9 on: June 30, 2016, 04:19:10 PM »
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...
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3827
    • Host Engineering
Re: Telemecanique Schneider MODBUS
« Reply #10 on: June 30, 2016, 04:56:31 PM »
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

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: Telemecanique Schneider MODBUS
« Reply #11 on: June 30, 2016, 05:47:59 PM »
  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
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

Mike Nash

  • Hero Member
  • *****
  • Posts: 652
Re: Telemecanique Schneider MODBUS
« Reply #12 on: June 30, 2016, 05:59:32 PM »
ATV31 Modbus manual is here 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)

Mike Nash

  • Hero Member
  • *****
  • Posts: 652
Re: Telemecanique Schneider MODBUS
« Reply #13 on: June 30, 2016, 07:00:13 PM »
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.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3607
  • Darth Ladder
Re: Telemecanique Schneider MODBUS
« Reply #14 on: June 30, 2016, 07:21:40 PM »
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)
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.