Showing results for 
Search instead for 
Did you mean: 

DataSocket binding in run mode

According NI manual I can't do that

Attach DataSocket Method

Method of Control.

National Instruments recommends using front panel data binding through the Shared Variable Engine or using the Bind To Network Path method to attach a data connection to a control.

This method allows you to attach a dstp, opc, ftp, http, or file connection to a control. You can add new connections only at edit time. This method is similar to the Data Binding Selection, DataSocket URL, and Mode options on the Data Binding page of the Properties dialog box.


Maybe anyone has found trick to avoid this restriction Smiley Very Happy

The same question for shared variable.

Also I don't understand where can I uses this method?

0 Kudos
Message 1 of 5
There is no way around this restriction.  Setting up the data binding for both datasocket or PSP requires a VI recompile since all that information is stored in the VI, and we can't recompile your code in the middle of running it.  Just one of those things I guess....

best of luck,

Message Edited by Travis M. on 05-18-2007 09:50 AM

Travis M
National Instruments
Message 2 of 5
Anyone can say about Measurement Studio?
0 Kudos
Message 3 of 5

It might be worth posting in the Measurment Studio discussion forum for this new question.

With LabVIEW, although you cannot add a new binding to a control at run-time, you can enable or disable an existing connection with the Datasocket»enable property node, and even change the URL at run-time with the Datasocket»URL property.

Best regards,
-Sam F, DAQ Marketing Manager
Message 4 of 5

Agh ... there is something ... but lets do that more clearly. Acually there are 5 actions. Create variable in DataSocket server, write into variable by my server and client, read from variable by my server and client.

1. My server prepares variables in DataSocket server. I can use the same vi with DataSocket  I will call some times with slightly different Names (like, dstp://localhost/dev1_wave, dstp://localhost/dev2_wave and so on) and I will have variables in DataSocket server. I hope until I will not close (I suppose - last?) connection DataSocket server will hold variable. But what about connection status - disconnected? How much time does disconnection/reconnection eat?

So I can easy initialize some set of similar variables using just one vi.

2. I don't see problem with server or client writing. I will save Connection ID as string in object and use it.

3. It looks there is not problem with client reading.  I can simple read by polling. But also I can catch event when variable value of client's front panel changes. To do that I will change URL.

4. At last moment, server reading. Again polling is not problem. But if in this moment vi connects to dev1_variables then dev2_variables are not connected. So events are losted. And I suppose there is not solution for that?Smiley Tongue


0 Kudos
Message 5 of 5