LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Monitoring numeric variables over a network

Hello to all,

First of all thanks a lot for reading this post and being able to help.

 

I have the next scenario:

arquitechture.png

 

I have some numeric variables in PC Clients that I would like to monitoring (read) on a different executable in PC Server.

 

For best performance, I would like to read them when user click on a button "connect" in PC Server executable (or instead of press a button, when user open the PC Server executable).

 

 

I develop this features with network -published shared variable but it looks like that performance of the client server decrease. (shared variables are hosted on PC Server).

 

My question is if there is another way to do this simple task.

 

I also have a look at Simple Messaging (STM) Communication Library. Could STM work for what I want to get?

 

Thanks a lot.

0 Kudos
Message 1 of 13
(2,910 Views)

Hi Alvaro,

 

I have some numeric variables in PC Clients that I would like to monitoring (read) on a different executable in PC Server.

Usually it's the other way around: you have one server (which is running 24/7) and the clients will connect with the server…

 

My question is if there is another way to do this simple task.

Yes, sure.

Like creating your own messaging routines using UDP or TCP communication.

Or use that STM library, which also uses UDP/TCP under the hood.

Best regards,
GerdW


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

Usually it's the other way around: you have one server (which is running 24/7) and the clients will connect with the serve.

I have "shared variables" hosted in PC Server. But the PC Client has the executable which calculate the numeric variables to read. They have to be here because of I use sensors etc...

 

Or use that STM library, which also uses UDP/TCP under the hood.

Is this library a better solution than using network-published shared variables? will the whole system has a better performance?

 

Thanks a lot.

 

0 Kudos
Message 3 of 13
(2,899 Views)

Hi Alvaro,

 

I have "shared variables" hosted in PC Server. But the PC Client has the executable which calculate the numeric variables to read. They have to be here because of I use sensors etc...

Read about the principles of using server/client architectures like any web server, MQTT and other stuff to get the basics.

Once you get rid of "shared variables" you only need to thinkn of "server" (maintaining the data) and "clients" (reading/writing the data from/to server)…

 

Is this library a better solution than using network-published shared variables? will the whole system has a better performance?

AFAIK yes. (Only read about it, but never used it for my own projects.)

I use my own solution based on UDP messages. This way I can easily distribute data/messages/commands between several computers/cRIO devices in the same network…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 13
(2,892 Views)

@Alvaro.S wrote:

 

Or use that STM library, which also uses UDP/TCP under the hood.

Is this library a better solution than using network-published shared variables? will the whole system has a better performance? 


Better how? Reliability? Network load? Responsibility? Development time? Throughput? Clarity? Flexibility? Maintainability?

 

You'll usually want a good solution, not necessarily the best. It's sometimes hard enough to find a solution that fits all requirements good enough. One that excels in one, often lose on the other specs, and might turn out to be a bad choice.

 

Spec what you need, then choose a solution that fits the spec (well). Tests might be required...

0 Kudos
Message 5 of 13
(2,889 Views)

Read about the principles of using server/client architectures like any web server, MQTT and other stuff to get the basics.

Once you get rid of "shared variables" you only need to thinkn of "server" (maintaining the data) and "clients" (reading/writing the data from/to server)…

Yes absolutly, sorry. The PC Clients write the variable to the server and PC Server executable monitor the shared variables in the front panel.

0 Kudos
Message 6 of 13
(2,879 Views)

Better how? Reliability? Network load? Responsibility? Development time? Throughput? Clarity? Flexibility? Maintainability?

Network load and scalable.

 

Imagine 2 lines producion (where PC Clients executables are installed). These executables write variables to the PC Server.

PC Server is in the office. Operator manager goes to the office because he want to monitoring these 2 lines produccion in his office in one PC. So turn on the PC, open executable and now he can monitor the variables.

In the future imagine that instead of 2 lines produccion there will be 4 lines produccion (so 4 clients).

With the same PC Server executable (with minor changes) operator manager will want to monitor those 4 lines.

 

What is the best way? Network-published Shared variables?

 

Thanks a lot

0 Kudos
Message 7 of 13
(2,877 Views)

@Alvaro.S wrote:

 

What is the best way? Network-published Shared variables?


What data is communicated? Current values? All values after connection? All values with history? What kind of speed are you talking about?

0 Kudos
Message 8 of 13
(2,866 Views)

What data is communicated? Current values? All values after connection? All values with history? What kind of speed are you talking about?

Current values, not buffer is needed.

Data type is uint32.

About 15 variables per client.

Variables can be refreshed each 500ms or 1sec.

 

0 Kudos
Message 9 of 13
(2,863 Views)

@Alvaro.S wrote:

What data is communicated? Current values? All values after connection? All values with history? What kind of speed are you talking about?

Current values, not buffer is needed.

Data type is uint32.

About 15 variables per client.

Variables can be refreshed each 500ms or 1sec.


Pick the easiest. Whatever suits you.

 

4 bytes X 4 clients X 15 variables = 240 bytes per second.

 

Unless you'll get 10000 clients or 10000 variables (and even then), you are nowhere near any problem zone.

0 Kudos
Message 10 of 13
(2,858 Views)