08-06-2010 05:32 AM
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
Solved! Go to Solution.
08-06-2010 10:48 AM
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.
08-12-2010 04:31 AM
Ahh brilliant, works a treat, thanks for the Solution.