12-18-2018 03:06 AM
Hello to all,
First of all thanks a lot for reading this post and being able to help.
I have the next scenario:
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.
12-18-2018 03:13 AM
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.
12-18-2018 03:35 AM
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.
12-18-2018 03:44 AM
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…
12-18-2018 03:48 AM
@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...
12-18-2018 04:13 AM
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.
12-18-2018 04:19 AM
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
12-18-2018 05:10 AM
@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?
12-18-2018 05:20 AM
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.
12-18-2018 06:23 AM
@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.