LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Modbus TCP I/O Server with new DSC Shared Variables in LabVIEW 8.6

Hello,

 

I'm using LabVIEW 8.6 and want to communicate with a Beckhoff BK9000 Ethernet TCP/IP Bus Coupler via Modbus TCP. Instead of using the NI Modbus Library, I've tried the new LabVIEW 8.6 feature "DSC Shared Variables" as described at the bottom of this page: Latest NI LabVIEW DSC Module Features and Demos. Reading of analog input bus terminals works fine. However, I haven't figured out yet how to write on an anolog output bus terminal with these shared variables.

 

It's about a 16 bit analog output and I need to write to the registers 0x1121 and 0x0801. It works with the NI Modbus Library (just using function code 6 and choosing the registers), but on the other hand I don't know which shared variables I have to choose for these registers. I've tried several data items (e.g. 400001 upwards as well as 402049 for 0x0801) but none of them worked. I would be glad for a short explanation - thanks in advance for your support!

 

Regards

utechle

0 Kudos
Message 1 of 3
(4,380 Views)

Hi Utechle,

 

I tried it here with a Modbus-Demobox and I can write 400011 and 400012 without any problems. 

My question is how you choosed the 40204? Do have some more documentation which tells you that this is the right adress?

 

Regards,

RMathews

Ramona Lombardo
Applications Engineer, NI Germany
Certified LabVIEW Developer
Message 2 of 3
(4,327 Views)

The Beckhoff documentation says, that holding registers start with 0x0800. I've checked this by using the NI Modbus Library. I used the "MB Ethernet Master Query.vi" togehter with the function code 6 for "Write Single Registers", changed the settings of the starting address to hexadecimal view and entered 801 (since it starts with a control byte in 0x0800 and the data out word follows in 0x0801). Furthermore, I had to address register 0x1121 in the same way for resetting the watchdog. As I've mentioned in my first post, this method works fine. However, I haven't found out yet which shared variables i have to use for accessing these registers.

 

On the other hand, it's no problem to read data from analog input bus terminals using shared variables. They start with 0x0000 (status byte) and 0x0001 (data in word) and I can read data with the shared variable and data item 300001, respectively.

Message Edited by utechle on 01-27-2009 11:12 PM
0 Kudos
Message 3 of 3
(4,306 Views)