ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Shared variable

Solved!
Go to solution

Hi to all.

I collect data from different computers. The data forms one array. How can I set the specific elements of the array on different computers? I did it on a local machine use notifier array. But via network that will not work. If I'm going to use shared variable then I need read all array and write it on each computer. Or I need to create many shared variables and write to them. But in this case they have a quantity limit.

0 Kudos
Message 1 of 14
(5,667 Views)

HI Forest,

 

How can I set the specific elements of the array on different computers?

You cannot…

 

Or I need to create many shared variables and write to them.

Yes.

 

But in this case they have a quantity limit.

Why? Which limit? Which quantity?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 14
(5,652 Views)

You might also consider a different architecture. For instance, you could create your own "network notifier" using, for instance, UDP. If you need lossless communication then Network Streams might be an option.

Message 3 of 14
(5,637 Views)

@GerdW wrote:

But in this case they have a quantity limit.

Why? Which limit? Which quantity?


I mean if quantity of parameters will increase I need add them and recompile the app.

0 Kudos
Message 4 of 14
(5,627 Views)

Hi Forest,

 

you could also change the datatype of your shared variables to something like [number of channel, value of channel] (or even better [name of channel, value of channel].

Then combine this with a key-value-pair based table to hold the values of all channels…

Best regards,
GerdW


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

@GerdW wrote:

Hi Forest,

...combine this with a key-value-pair based table…

The problem is each computer must read all the table(or array), change a few parameters values and then write all table. And it's wrong. I need something, which will be in server and have a variable size.

Like if I could programmatically create shared variables.

0 Kudos
Message 6 of 14
(5,601 Views)

Hi Forest,

 

have your clients read the whole table, but send back only the changed parameters/entries!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 14
(5,595 Views)

Would you show, how it possible? I don't imagine how I do this with shared variables.

0 Kudos
Message 8 of 14
(5,559 Views)

Hi Forest,

 

I don't imagine how I do this with shared variables.

Have your server provide two variables:

  1. the whole table so your client can read them
  2. a cluster of (atleast) "index, new value" so the clients can send commands to update single values

Now a client can read the table, do its changes and send the information changes to the server…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 14
(5,553 Views)

Do you mean like that?

Безымянный.png

But if the clients will in asynchronous write. They will not interfere each other?

 

0 Kudos
Message 10 of 14
(5,542 Views)