NI Labs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

NI LabVIEW Modbus API Discussion

Glad to hear you got it working. Taking a random guess here, is your new error something along the lines of "538182 occured at <APPEND> Function 3"?

Message 461 of 529
(3,638 Views)

@sbusbyepri wrote:

Glad to hear you got it working. Taking a random guess here, is your new error something along the lines of "538182 occured at <APPEND> Function 3"?


How did you guess? I was just writing a post about that except it's Function 4

 

Error 538181 occurred at <APPEND>Function 4

Possible reason(s):

Modbus Error: Illegal Function. This function is not implemented on the server.
Function 4

 

Using the Modbus Master Example.vi

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 462 of 529
(3,636 Views)

It's the error I got as soon as I got communications working. That's an error with the actual communication, rather than a timeout because of a failed connection. With mine, it was because of an invalid address. I was trying to query address 0 which isn't a legal address on Acuvims. Changing it to 3000 (make sure it's in hexadecimal) worked. The last digit of your error code tells you the MODBUS exception code. This document has the exception codes on page 47. It looks like yours is an invalid function. What function are you trying to use?

0 Kudos
Message 463 of 529
(3,628 Views)

Well it would seem that none of the functions are implemented on the Accuvim?

 

Every function I try in the Modbus Master Example returns an error that the specific function is not implemented.

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 464 of 529
(3,625 Views)

That's strange. Try using the "Read holding registers" SubVI, and see if that changes anything. Looking at the manual, the Acuvim should recognize function codes 1, 2, 3, 5, and 16.

0 Kudos
Message 465 of 529
(3,622 Views)

@sbusbyepri wrote:

That's strange. Try using the "Read holding registers" SubVI, and see if that changes anything. Looking at the manual, the Acuvim should recognize function codes 1, 2, 3, 5, and 16.


Read Holding Registers returns the error "An unknown message was sent in the code"

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 466 of 529
(3,619 Views)

That's very strange. I've not seen that error before. Make sure your numeric constants for the read holding registers VI are correct. The address input should be formatted for hexadecimal. If that turns up nothing, try looking at the Acuvim while you try querying it. A small computer icon should pop up in the bottom left corner of the display when it receives data.

0 Kudos
Message 467 of 529
(3,617 Views)

@sbusbyepri wrote:

That's very strange. I've not seen that error before. M


That is the default case message in the Modbus Master Example.

 

I figured it out embarrassing myself with a misspelled case.

 

It seems to be working now

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 468 of 529
(3,610 Views)

How can I read a register as a float? 

 

---Email from Accu Energy---
In order to read the primary registers correctly you will need to poll them as a float data type. If you are unable to poll as a float you will need to convert the integer values into float values to correctly read from the Primary registers.

The secondary registers are polled as integer which is why you were able to see the value of 120.3V for phase A voltage. The main difference between the Primary and secondary registers is that you do get more accurate readings from the Primary registers because of the additional decimal places as opposed to just 1 decimal place for the secondary registers.

---end email---

floatCapture.PNG

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 469 of 529
(3,595 Views)

Read adjacent registers, combine to 32 wide, then run through a type cast to SGL.

Assuming your meter handles these as IEEE 754 floats.

 

 

Message 470 of 529
(3,591 Views)