09-05-2008 02:03 AM
I am using shared variables to share the data across a master and the client PCs connected in a network. (Network published & no buffering)
I have created an integer type shared variable(I32) and a string type shared variable (data size is 60 bytes) in the Master and subscribing to the same in the client PCs. In the master PC, I am modifying the data in this order - update the data in the string type variable and then update the data in the integer vaiable.
But in the client PCs, due to the size difference in the variables, I am receiving the data of the integer first and after that about 3-4 sec later only I am receiving the string data. Can any optimization be done to reduce this latency period? Instead of the string data type any better data type will reduce this delay?
Please suggst. Advnced thanks.
09-05-2008 07:34 AM
depending on what you are doing you might be able to use an enum instead of a string. If your string list is a static set of strings, just pass an enum which is just an ordered mapping of the static string list to an integer. This is only if you know the string list at compile time
09-05-2008 04:44 PM
Latency has a lot to do with your network. 3-4 seconds is a long time though. This could also be due to the larget data size of your string. The integer data size is definitaly not 60 bytes. If you're looking for better performance, I would highly recommend looking into Datasocket communication or TCP/IP communication. (There are shipping example for both.)
When it comes to performance of throughput and efficiency, network-published variables are lower on the totem pole.
I hope this helps,
Kevin S.
Applications Engineer
National Instruments
09-07-2008 11:28 PM
Thanks for the rreply..but the string values are not static. They are the values returned by an RFID reader.
And I have mentioned that the size of the string is 60 bytes. Integer size if 4 (I32).