LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Shared variable

Solved!
Go to solution
Solution
Accepted by topic author 0Forest0

Hi Forest,

 

it will be ok as long as your server reads the shared variable fast enough, before the 2nd client overwrites values from 1st client. After all this still allows race conditions…

 

That's why we also suggested to implement your own server-client handling using other techniques like TCP/UDP communication or network streams. Have your server create a separate communication channel to each client, so you can avoid the race condition above!

 

(Nobody said it would be super-easy.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 11 of 14
(767 Views)

@GerdW wrote:

...using other techniques like TCP/UDP communication or network streams.


Thank you for your advice. I am going to use UDP connection. And every client will have diferent local port and transmeet data like: "{Index,value}" to the same server port. And server will form the array with all parameters.

What is better network streams or UDP?

And can I use security options if the machines will in domain? Like user-password.

0 Kudos
Message 12 of 14
(749 Views)

Hi Forest,

 

I am going to use UDP connection. And every client will have diferent local port

When you use UDP, then each client can use the same port and send its data to just one port on the server. Your server will "queue" the received UDP messages in its network buffers…

 

What is better network streams or UDP?

Both have their advantages and disadvantages.

Choose for yourself!

 

And can I use security options if the machines will in domain? Like user-password.

Sure. You just need to program your "security options"…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 13 of 14
(731 Views)

@GerdW wrote:

Your server will "queue" the received UDP messages in its network buffers…

Is this bad? And can I affect or choose size of this buffer?

0 Kudos
Message 14 of 14
(691 Views)