LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Failure of LabVIEW DSC 8.0.1 to yield values of Modbus RTU holding registers

So, I know what I'm doing--or used to. Have done this before in LV 6 and 7. Previously used Lookout OPC drivers and the "Tag Engine".

Recently with 8.0.1, I first set up the Industrial Automation OPC servers (AKA Lookout) to communicate with the holding registers (40,001-49,999) of my modbus rtu Watlow 96 and MLS316 temperature controllers. Subsequently, with the Server Explorer all of my 133 parameters on our 2 rs485 serial ports are communicating bidirectionally.

So now Duh, why can I not bind a shared variable to register, say 40,334, and eliminate the OPC? The data is always reported as bad. Neither can I link shared variables to these addresses through the OPC I/O server.

Am I missing something? Are there any examples of code available where individual modbus holding registers are communicated with bidirectionally?
0 Kudos
Message 1 of 7
(7,221 Views)
Hello,
 
If you're using LabVIEW DSC 8.0, then you can create a Modbus I/O server within your project, and then bind r shared variables directly to the registers you wish to access.  We have a good tutorial of this on our website at this link that you may find useful (it requires the Macromedia Flash Player).  This will show you all of the steps necessary to set up this kind of communication in LabVIEW.
Cheers,

Matt Pollock
National Instruments
0 Kudos
Message 2 of 7
(7,209 Views)
Well, this may seem rather silly but I viewed the video demo that NI has on binding modbus registers to shared variables before I even made my attempt.
 
Now, differing from the demo video, I am using modbus RTU on a serial port.  Also differing from the video, when I create my shared variables, they are not placed in the same lvlib as the modbus server just created--LabVIEW prompts for a new library to be created.
 
Could the NI product service staff please test with a serial modbus RTU device (a real living creature and not just a simulation please) the bidirectional communications and prove functionality with the Shared Variable Monitor of your product?  I suggest that you attempt communicating with holding registers 40,001 through 49,837.
 
By the way, my com is set up correctly for I can view and or change all of the desired modbus RTU registers using the OPC Lookout Protocol Drivers through the Server Explorer.
 
Please do not send me any more links to videos that test with simulations.  A real solution is required.
 
Lloyd Ploense
0 Kudos
Message 3 of 7
(7,200 Views)
Hi Lloyd,
 
We are sorry for the inconvenience. I think it's maybe one of the following two reasons caused the communication problem:
 
1. The COM port you were using for the Modbus I/O Server was occupied by other applications. (such as the Lookout). Please make sure the COM port is available for our I/O Server.
 
2. The Modbus I/O Server uses a 6-digits address space in stead of 5-digits. So please specify the address 400001, 409837 for 40001 or 49837,  otherwise the I/O Server would regard it as an invalid address.
 
Thanks!
Message 4 of 7
(7,156 Views)
Thanks KennnyHe. The answer was that both of those issues were the cause of the problem. Lookout runs as a TSR now in LabVIEW DSC 8 unlike 6 and 7. Also, for some reason NI changed the time honored values of Modbus registers by a factor of 10.
Lloyd
0 Kudos
Message 5 of 7
(7,087 Views)
so KennyHe according to what your saying, address 40001 on serial modbus is address 400001 on modbus using shared variable. I couldn't find this documented anywhere but on this post. 
 
I'm using a Watlow PM controller, its manual list register address value from a offset of 40001. I'm not sure yet what to do with this offest since with Shared Variable modbus I have a 6 digit address (400001) instead of a 5 (40001) digit address.
 
Can someone tell me the correct way to read a specific address using Shared Variable modbus LV 8.2 and 8.5.
 
0 Kudos
Message 6 of 7
(5,959 Views)
OK, after doing more test, the modbus tcp/ip shared variable address scheme is shifted 400001 (6 digits) instead of 40001 (5 digits) per the serial modus address scheme.
0 Kudos
Message 7 of 7
(5,955 Views)