08-14-2014 07:41 AM - last edited on 11-14-2024 07:59 PM by Content Cleaner
Hello,
I use dsc module to connect to OPC server. I created UA client using OPC servers configuration. Then i watched tutorial http://www.ni.com/webcast/273/en/ and bound needed variables, so i can read/write them using labview. But when labview is running, it doesnt connect to the server every time and can lose connection during working. Moreover, sometimes it takes lots of time to write/read variables. What can be the problem?
08-14-2014 10:38 AM - edited 08-14-2014 10:50 AM
Try using front panel binding to your OPC server to check connection's and if the problem is with DSC or the Server. You can also use the datasocket vi's to programatically connect to the OPC server . This gives you more control because you can then set the timeout values. If you use front panel bindings it is easy but you are at the limitations and settings of windows. (Com and DCom settings for the OPC Server Security settings) and the OPC server settings(timeout, polling rate,conection settings). is the lib file properly deployed that is created by the DSC module?
08-15-2014 02:10 PM
Hey Katerina,
It is important to distinguish between OPC UA and OPC DA. You mention setting up an OPC UA client, but then you say you used bound variables (bound to OPC DA data items). These protocols are not compatible without a server to connect them.
If you desired to use OPC UA, you'll have to use the LabVIEW API which was added in 2012 sp1 if I am not mistaken.
If you desired to use OPC DA, bound variables will work but you'll need to ensure your OPC server is configured correctly. If you are currently bound to OPC DA variables which are in turn bound to OPC UA variables in the client you generated, my guess would be that the errors and slow read/write speeds are indeed the correct behavior.
What are you attempting to communicate with? A PLC? Shared variables?
Thanks,
Daniel
08-18-2014 05:35 AM
I am trying to connect to Siemnent Microbox. So i try to connect to PLC via OPC server. How can i use API? do you have any expample?
08-19-2014 03:09 PM
If you need to use OPC UA, the example ships with the product and can be found in the example finder.
If you need to use OPC DA, the video you followed should be sufficient.
My main point about what you want to do is this:
Are you trying to connect LabVIEW directly to your controller? If so, does the device support OPC UA? If yes, use the API.
In any other case I can think of, you'll have to use the OPC server to communicate with the controller, and then use EITHER LabVIEW DSC OPC I/O servers OR a OPC UA driver in your OPC server communicating with the OPC UA API in LabVIEW. My guess is that using the I/O servers is better, and what you want to do.
If thats the case, follow that video to communicate with the OPC server and confirm that you can grab data from the server using I/O servers. If not, thats where you would investigate settings as Dave suggested above.
08-20-2014 09:49 AM - edited 08-20-2014 10:16 AM
Siemnent Microbox? Do you mean Siemens Microbox. Is this were the OPC Server is Run? What is the OS your OPC Server runs on. If it is a remote machine? . You need to check the security settings to allow remote clients if the Server is not on your machine you have your vi running. Have you also tried NI OPC server's OPC Server Quick Client? This will test the OPC server connection to ensure you have access to the server and can browse tags and get values from the server.