LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus code for Power meter not working

Don't enter 41001.  The 4 is automatically assumed because of the type of register.  It exists in manuals when you are talking about registers, but is never actually sent in the message.  Also, the addresses in the manual start at 1, but in the actual protocol start at 0.  So delete the 4 and subtract 1.  Try sending 1000.

0 Kudos
Message 21 of 57
(1,319 Views)

I did what you suggested but never got the right value. Also each time I click on the run, different values will be shown. Attached is a snapshot for two values with different quantities. Also I beleive changing the Quantity from 2 to 8 has no effect only that values for 8 registers will be shown starting from the stated address. Is this correct? Again in my register, I stated from 0, do I need to change that to 1 so that whatever register being started with in the code will be the first to be shown?

I really appreciate your help so far.

0 Kudos
Message 22 of 57
(1,306 Views)

"I did what you suggested but never got the right value. Also each time I click on the run, different values will be shown."

What would be the right value?  What parameter you trying to read?  And is it something that should be changing like if you were reading a power parameter, I would expect fluctuations in it.

 

I don't understand all of what you say you are doing here.

 

If you want register 41001, then you want to enter 1000 as your starting address.  If you want just that enter 1 as the quantity.  If you want 41001 and 41002, then enter 2 as the quantity.  If you want registers 41001 through 41008, then enter 8 as the quantity.

 

"Again in my register, I stated from 0, do I need to change that to 1 so that whatever register being started with in the code will be the first to be shown?"

 

Whatever register you want first should be the number you enter for starting address.  So if you wanted 41020, then you would enter 1019 as the starting address.  The whole purpose of quantity is that it allows you to read multiple registers at one time in the event they are consecutive.

0 Kudos
Message 23 of 57
(1,303 Views)

I am reading voltage (120VAC) across phase A to Neutral. So when I changed the starting address to 1000 and Quantity = 2, a wrong value was seen (21689). When I run the code again, another different value was seen (46969) (see earlier attachment). When I changed the Quantity to 8 (Address still maintainde at 1000) and run the code, the value seen was  46969 and when I run it again, the value I saw changed to 9607. (These results are snapshot and shown in the earleir email as an attachment).

One other observation I saw was that the starting address as stated in the labview module (see attached PDF) says it should be “Unsigned 16-bit integer” address. Will this determine the addresss to be used because if you rereference the EPM7000 manual of Page B-35 & B-81, some address have the " Format" as Float Value and UNIT16 (see attached PDF per cutouts from the manual).

0 Kudos
Message 24 of 57
(1,297 Views)

Is it possible that you are reading instantaneous voltage?  That would cause it to dramatically change from reading to reading.

 

I'm looking at your manual and it seem like pages 171 and 172 are the most interesting.  Volts from Phase A to Neutral seems to be  a single register of 279 and is in Reading Block (integer values)

Registers 1000 and 1001 make up  the same description but are in Primary Readings Block.  Whenever you have two registers make up a single value as a float, you need to take those two and typecase them to a single precision floating point number.  Whether the first register is the high word or the second regsiter is the high word, I don't know and you may have to experiment

0 Kudos
Message 25 of 57
(1,294 Views)

I tried address 279 and the value was 10000 (see attached). so what do you suggest I do with regards to your comment of two registers making up a single value as a float. what do you mean by taking those two and typecase them to a single precision floating point number and how do you do this? are you saying taking 279 and placing it infront of 1000 or what? please help explain and I will experiment it to see what values I will get.  

0 Kudos
Message 26 of 57
(1,286 Views)

Below is what I mean.  I gave a few different implementations just in case the order of high word and low words are different.  There may be a few other ways to combine the registers.   Also, I meant to say "typecast" but must have mistyped it when I said "typecase".

 

I'm not talking about  combining 279 and 1000.  Just that those two seem to have the same description of Phase A to Neutral volts.  I have no idea why there are different registers and one is a single register to be an integer and the other is two registers to be a fload.  For #279, according the manual, a value of 10,000 is something out of range.

 

When I tried the typecast and a couple other methods (in case the words are swapped), I got some values, but neither of them made obvious sense to me.

 

I don't know anything about the operation of this device to help any more.  I suggest trying to look up values while they are running on the screen and compare to what you are getting from the LabVIEW program.  If the company provides their own software to communicate, try using that to learn how the device works and see if the values it gives makes sense.

 

0 Kudos
Message 27 of 57
(1,283 Views)

Me too very confused with these addressing issues and values. Let me talk once again with the Manufacturer and see if they can help further. Thanks for all your help. I very well appreciated all your efforts. 

0 Kudos
Message 28 of 57
(1,275 Views)

You're welcome.  I tried to help as much as I could.

 

Good luck in your communications with the manufacturer.

0 Kudos
Message 29 of 57
(1,272 Views)

Manufacturer was able to use Modscan64 to see data at Address 1000 (which was converted by the software to adress 41000). But to see this, we had to change the display option to Floating Point Most significant First. Is there anything I need to do to the Vi in order to see this the data? Any help is appreciated.

0 Kudos
Message 30 of 57
(1,257 Views)