LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus TCP

I am trying to read some registers using modbus vi's

Specifically - read holding registers.vi

but for some reason i can only ever read 1 register even if i put >1 in number of registers,

Is anyone able to help

Many thanks in advance

Lee

240922.png

0 Kudos
Message 1 of 28
(1,308 Views)

Hi Lee,

 


@LeeBowers1 wrote:

Is anyone able to help


Well, I could start PaintNET, GIMP or Photoshop to edit your image, but I don't think you would like the resulting image…

 

Keep in mind: we cannot edit/debug/run images in LabVIEW! When you need help with your code then you should attach your code!

 

What's the reason of that coercion dot?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 28
(1,249 Views)

@LeeBowers1 wrote:

I am trying to read some registers using modbus vi's

Specifically - read holding registers.vi

 

 

Check your UnitID and Starting Address of your Holding registers where your expected data starts.

 

Any Specific reason for polling continuously, because you will get all defined register values at one instance of your read.

 

I mostly prepare writing to holding registers and reading from Input register, when i am defining the communication matrix (Mostly with PLC).


 

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 3 of 28
(1,228 Views)

Thank you for your reply, makes good sense to attach the vi - why i didnt do that initially - no idea!

I could not see a coercion dot?

Would you be able to help?

For fullness, the data is coming from a receiver which transmit RS485, i am then using am RS485/Eth adapter. I can see the tx/rx lights flash as I poll for data and I get something, but just not the 10 addresses as i need

0 Kudos
Message 4 of 28
(1,208 Views)

Hello, thank you for replying.

 

Yes, I have the correct unit ID and holding register address.

 

I poll constantly as the data that will be coming in is from temperature transmitters

 

I just find it confusing that the data coming from the read holding registers vi only has an array size of 1 ?

0 Kudos
Message 5 of 28
(1,210 Views)

What device is your rs485 to Ethernet ? 

Have you configured that device? 

0 Kudos
Message 6 of 28
(1,189 Views)

It is a device from company called Perle.
yes, i can, and have configured that device.

Set to modbus slave, modbus RTU, UID 1

0 Kudos
Message 7 of 28
(1,177 Views)

@LeeBowers1 wrote:

It is a device from company called Perle.
yes, i can, and have configured that device.

Set to modbus slave, modbus RTU, UID 1

 

If Modbus Slave is RTU then you should use Modbus RTU Master rite?


 

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 8 of 28
(1,174 Views)

maybe read 5 and set to read every 1 second or so. Also, you have double registers as in 32 bit? Usually its 16bit in modbus. Maybe this is where it gets funky

0 Kudos
Message 9 of 28
(1,140 Views)

in your image, only every 2nd register is used. So either they are set as 32 bit or only every 2nd is populated with 16 bit. Then maybe you cannot do a bulk read. Instead read each on its own.

0 Kudos
Message 10 of 28
(1,107 Views)