LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

why it display zero when I use NI labview sample code " Multiple OPC Items Monitor.vi" to communicate with Dynisco UPR700 using RS485 with Modbus procotol?

When I try to communicate with UPR700, the VI shows zero. I am sure that the connection and serial setting are right because I used a demo software from other company to verify them. Could you give me any clue or any resources? Thank!
0 Kudos
Message 1 of 9
(3,612 Views)
Hi

A good way to troubleshoot OPC Server is using the Server Explorer software that can be downloaded here :

http://digital.ni.com/softlib.nsf/954feaeea92d90918625674b00658b83/34e67fa9f8ff7a0686256ae60054198c?OpenDocument

This software has been designed to troubleshoot problems with any OPC Server, so you may want to monitor the data from your OPC Server using this software first and make sure the OPC Server is really providing the expected values.

The "Multiple OPC Items Monitor.vi" does work fine, as can be seen by just running the program, it will read data from the National Instruments OPC Demo Server.
So, the misbehave of your readings should stem either from the OPC Server or from a incorrect URL used in the "Datasocket Open Connection.vi"


The easiest way to make sure your URL is correc is by doing a Datasocket Front Panel connection to the Server:
1 - Place an indicator on the front panel of a new VI;
2 - Right-click on the indicator and choose "Data Operations >> Datasocket Connection >> Browse >> Measurement Data", then navigate to the item you desire on your OPC Server.


I hope it helps

Best Regards

Andre Oliveira
0 Kudos
Message 2 of 9
(3,612 Views)
Hi,
I just followed your suggestion. but the server explorer gave me the information about bad data, does it mean the connection is wrong or others.I used a software Modscan32 from win-tech, it gave me the right information. Please give me any clue that is anything wrong with the OPC server in Labview. Thanks!
0 Kudos
Message 3 of 9
(3,612 Views)
Hi,

If Server Explorer is giving you a bad data status is because the OPC Server is not providing good values, have in mind that Server Explorer is an independent OPC Client, it is not related to LabVIEW at all and for that reason should work fine if the problem was in LabVIEW.

I bet with you that any other OPC Client you download form the internet will not be able to read good values from your OPC Server, you have to check with the OPC Server providers for troubleshooting techniques.

Also, the fact that the manufacturers software worked fine do not mean that the OPC Server works fine, most likely the manufacturer software is talking to the hardware through a proprietary software interface, it is easier for software providers to defi
ne proprietary ways of inter software communication, rather then using a OPC server interface which obviously does not support features particular to each specific software package.

So I strongly believe the OPC Server interface is not being used by the software that was able to succesfully connect to the hardware.

My suggestion at this point would be to contact the OPC Server provider to check on troubleshooting tips.

I hope it helps

Best Regards

Andre
0 Kudos
Message 4 of 9
(3,612 Views)
Hi, Andre:

Thank you so much for your help. I am working on a project that is about online measurement and control of polymer rheological property. I have to use the Dynisco UPR700 to get the pressure and temperature, which has a modbus communcation procotol. I used the RS485 to connect them. I am using labview to do the data collection and control. How can I commnucate with them? I did not have the driver, so I tried the NI Lookout procotol driver server 4.5 to talk with them, there is a modbus driver. just like I talked with you, I cannot get the data. I use the sever explorer, I found it got the bad data. I have no idea to deal with them, so can you give me more suggestion to do the trouble shoot? whether or not I can not use the NI l
ookout procotol driver sever 4.5 to do the communication? Appreciate your help!

Yizhong
0 Kudos
Message 5 of 9
(3,612 Views)
Hi, Andre:
When I was using the NI sever explorer, I got the bad data, and the Lookout Protocol told me that " Modbus exception response 2 (illegal data address) --function code 1 (start=0, count=1)", so where can I find the data address and change the address? please give me any suggestion. Thanks!

Yizhong
0 Kudos
Message 6 of 9
(3,612 Views)
Hi,

Yes you can definetelly use Lookout Protocol driver to communicate with your device, as long as your device has a Modbus interface.

If you have Modbus serial, a good way to start troubleshooting is to make sure the serial port is working fine, you should do that even before connecting the device to your serial port.

These page has a good starting point for troubleshooting serial ports :

http://digital.ni.com/public.nsf/websearch/E22DA85E97818DE78625678C0069BFC9?OpenDocument

If you have RS-485, pay attention to the fact that you need to connect both the + and the - terminals, RS 485 is a differential interface.

So if you have successfully performed the serial loop back test, you should be able to configur
e the Modbus driver in Lookout Protocol drivers to communicate with your device.

I hope it helps

Andre
0 Kudos
Message 7 of 9
(3,612 Views)
Hi,

From the Modbus help files we have :

"02 ILLEGAL DATA ADDRESS The data address received in the query is not an allowable address for the slave. "

So that means you are trying to access a address (register) that either does not exist in your external device or is not accessable.

The best reference to find out what are the register that your hardware supports is the hardware manual. All the hardware manufactures have sections on their manuals that describe the registers available and what you can do with them (write or read or even both).

So my suggestion is to make reference to the hardware manual.

I hope it helps

Andre
0 Kudos
Message 8 of 9
(3,612 Views)
Hi, Andre:
Thanks for your help. I read the Look out OPC driver help, I think it should work well for this instrument. they have a same modbus protocol. I got a demo about OPC modbus sever from Win-tech,it works well, in that software, I can select point type, such as "coil status, input status,holding register, input register", and point address,scan length. also i found in NI Lookout OPC driver, Modbus object class uses Modbus function codes 01, 02, 03, 04, 05, 06, 15 and 16, so there are the same function with win-tech modbus sever. In the advanced set in NI OPC divers, there are several settings, how can I set this paramters, or just let it uses the default. Pleasemgive me any suggestion. Appreciate your help!

Yizh
ong
0 Kudos
Message 9 of 9
(3,612 Views)