LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Datasocket passing values

Solved!
Go to solution

Hi guys,

 

Im quite new to CVI and the DataSocket facility - so this may sound a trivial problem but much appreciated if you could point me in the right direction.

 

My problem is I have a Client/Server setup - the Server app recieves data from hardware, and then relays updated information (in my case I'm passing Temperature and Humidity values) to the Client.

Using the dsReader and dsWriter example I have managed to introduce the basics into my project - the DS_SetDataValue (from the server), and retrieving it at the Client end using DS_GetDataValue. Now this worked fine when I'm passing just one value. However I need to not only pass the Temperature value but also Humidity (among others in future development), so how would I go about doing this - the current setup only allows one value to be passed over and not both.

 

Can someone please point me in the right direction.

 

Thanks

 

 

PS If you need more information let me know

0 Kudos
Message 1 of 3
(3,362 Views)
Solution
Accepted by topic author 05026652

Create a structure to hold all your data. Then send the structure as type array of uchars. CVI really doesn't care about the composition of the array of uchars, this way you can send almost anything.

Here is the example call for the send:

 

result = DS_SetDataValue(gh_DS, CAVT_ARRAY|CAVT_UCHAR, (void*)&gs_trackGate, sizeof(struct TRACK_GATE_TYPE), 0);              

 

where gs_trackGate is my structure.

Message 2 of 3
(3,344 Views)

Ahh brilliant, works a treat, thanks for the Solution.

 

 

0 Kudos
Message 3 of 3
(3,291 Views)