LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need a little modbus TCP help

Solved!
Go to solution

From the community, can someone help me with the same vi to read the PV (temperature) values from “SOLO 4848” temperature controller. According to the SOLO 48 manual the Hex address for PV is 1000 , or Modbus decimal is 44097. I am getting 6002 error (MODBUS Exception code: 2.). It seems that address that I ask was not correct.  I need to know what to enter for starting address, quantity, data and discrete values to get a response or any help. 

 

 

I think the vi works but I could not successfully entered the Modbus address commands to read the PV or something I am missing. I am attaching the vi, the page of the manual and the page from the software that reads the holding register for PV ( I think it is).

I know the hardware connection is correct because when I use the controller’s own software ( which is limited to connect only 4 controllers) it works. I also attached the command file and response from the same software with send and received holding register values.

thank you in advance..

Download All
0 Kudos
Message 21 of 46
(1,625 Views)
Hex 1000 is NOT decimal 44097, it is 4096. You have specified decimal 10000.
0 Kudos
Message 22 of 46
(1,604 Views)

That is true, but modbus addresses are 1-based, while the actual values used in LabVIEW and the hex string are 0-based.  So an address of 4097 modbus would be 4096 in LabVIEW and thus 1000hex.

 

So I think that entry is actually correct, but it is worth experimenting with those addresses to be sure.

0 Kudos
Message 23 of 46
(1,597 Views)
But he has address 10000 - note the extra zero.
0 Kudos
Message 24 of 46
(1,588 Views)

I don't see where the address is specified as 10000.  In the picture front panel.png,  the starting address is listed as 1000 in the modbus command control.

0 Kudos
Message 25 of 46
(1,563 Views)

Sorry, I was looking at the block diagram and misread the timeout of the modbus function.

0 Kudos
Message 26 of 46
(1,556 Views)

No problem.  I'm guessing you saw some of those timeout values which are 10,000 mec.

 

To the original poster.:

Right now, I can't see anything obviously wrong in what you are doing.

Does it work okay when you are using the vendor's software?  If so, try snooping on their communication and see how it might be different than yours.  Try other parameters to read to see if you can get any of them to read.

0 Kudos
Message 27 of 46
(1,542 Views)

I'm pretty sure the the starting address in that cluster is set to decimal, not hex, so it should be 4096, not 1000. You can check it by right clicking it and showing the radix. Also, your example from the other program shows the address 3, not 0x1000, so that would require the address to be 3 (or something else that's small).

 

Note that in addresses above 10000 the first digit is usually just used to encode to the funtion type and isn't actualy part of the address.


___________________
Try to take over the world!
0 Kudos
Message 28 of 46
(1,528 Views)

Thank you Dennis and RevensFan!.  It seems that I get a response when I enter the 4096 address. What I am getting is values  8.96353E-38 for and -2.3928E+35  etc and no error!!.

When the temperature changes ( say 70F to 72 F ) I also see the 8.96353E-38 is changing..

The next question is to verify that I am getting the actual temp and how to convert the response to an actual number that I can monitor.

Thanks again.

0 Kudos
Message 29 of 46
(1,525 Views)

Good pickup tst.  I got believing that it was showing hex.  And I tried to confirm all the inputs, but all the modbus libraries on my PC are missing at the moment, or updated to newer versions and I couldn't confirm.  (The number of coercion dots showing up in the OP's images were concerning me.)

 

Haluk,

Do you have a link to the documentation for that register?  A single register is a 16 bit word.  Your  2.png image is decimating an array, but that won't work because because there will only be one element in that array of registers.  The manipulation to swapping the registers, and typecasting will fall apart.  (What is the representaiton of the number you are casting to?)

 

With the manual, we'll know how the number is supposed to represent the value, and whether it needs to be typecast or scaled.

0 Kudos
Message 30 of 46
(1,505 Views)