ML 1400 as modbus master to communicate with energy meter

mbarrett87

Member
Join Date
Dec 2012
Location
Cork
Posts
9
HI All,

I have some problems communicating with an energy meter through port 0 on a ML1400. I am confident that my network is okay as using the current setting i can see a huge number of errors coming back but by tweeking the settings i just get timeout's.

The error in question is that i am requesting an illegal data address.

for example i am attempting to query 0x1000 which is a data type long. i configure a msg instruction to point at my meter for read holding registers and i tell it to look at MB Data address 4096 (Decimal)

should i be setting some sort off offset? if so how do i do this? or any ideas on how to fix this issue would be greatly appreciated

Mark
 
Modbus is limited to 16 bit registers. If you need to pull a long into your PLC you will need to read 2 registers and use the Copy Word (CPW) command to create the L file. Are you reading 2 registers?
 
Hi Bullzi,

as you can see from the screenshot i've attached i'm looking for 3 addressed described as 'long'

do you think this error could be related to the type of variable i am attempting to read the data into?

Mark

Capture.JPG
 
You will need to read a total of 6 registers to get all 3 in. 4096 thru 4101. Can you post your code? What type of register are you reading the info into the PLC? Integer (N)?

I just went through this type of issue and you need to make sure you put the odd addresses in the MSG instruction. if you can post your code or a screen shot of how you have the message instruction set up it would help.
 
Last edited:
make sure you put the odd addresses in the MSG instruction

Do you mean by this place the initial address - plus 1 - into the MSG box? (In this case 4097.)

Many times in Modbus communication I need to use the 'plus 1' trick to get the alignment right.
 
You are correct Bernie. That is what I meant. Just didn't know how to express it properly :)
 
Thanks for the help guys,
i tried shifting the address by one and reading in as two integers and i seem to be getting response's

the only thing is those responses appear to be complete gibberish!

if you could look at the code i have attached, can you see anything dubiously wrong? im trying to use the CPW function to merge the two integer values that im reading back, i should be seeing a value of 235V but im getting something like -6546 when i go online?

Any ideas?
 
Yeah it is, sorry, i need a few more bits of information form the meter too,
i was merely trying different registers to see would it work
 
I see the same thing as Bernie. You are reading register 782 which is 0x30E in hex. If you want the 0x1000 you will need to put 4097 into the MSG.

You may also have to do some byte swapping to get the proper number. I have had to do that from time to time with the devices that I work with.
 

Similar Topics

Ok, so I have been wading through endless amounts of threads on this issue and I am still having no luck resolving my issue. I am trying to us a...
Replies
25
Views
5,381
I am getting the following error when my msg is enabled: "modbus exception code 02 returned: illegal data address" any idea on what might be...
Replies
3
Views
4,018
Hi all, I am doing communication between Micrologix 1400 and ABB softstarter through modbus ,below I have mentioned details. System:- We have...
Replies
6
Views
15,429
Hi, I'm having an issue with a mircologix not transmitting out. The current setup is a mircologix 1400 connected to a Guardian 100 Radio...
Replies
1
Views
70
I want to learn about modbus communication and I saw on another thread about inexpensive modbus relay units so I found it on Amazon along with a...
Replies
46
Views
7,083
Back
Top Bottom