LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

large numbers of shared variables

A partial and possible answer to my own question (PLC programming experience needed):

 

Again, I have huge numbers of data points. How much trouble would it be for the PLC programmer to plug all these related data types into arrays and then tag each array? This would cut my workload to <10% of what I was looking at before if it works.

PaulG.

LabVIEW versions 5.0 - 2020

“All programmers are optimists”
― Frederick P. Brooks Jr.
0 Kudos
Message 11 of 14
(666 Views)

Hi - Don't know if this will help at all, but I have an application that acts as a data server between a custom real-time target (like a plc or multiple plc's) and the 'labview' world. All of our visualisation apps are written in LabVIEW. The server (also written in LabVIEW) uses tcp/ip to communicate data to and from the real-time target and pumps/sucks it's data to/from shared variables. So all the real-time data is available as shared variables. The SV's are then accesible over the network by as many remote vis as we choose to run. It works well.

 

However, we have thousands of shared variables - like you. I cannot be bogged down with creating each SV manually in the LabVIEW IDE, so...

1. All of the LabVIEW code uses programmatic access to connect/read/write to the shared variables. None of the SV's is hard coded.

2. The TCP/IP comms are defined in a simple text definition file that we have created to define the message structures, data types, initial values etc. Each data item is defined with a label which we match to an SV name.

3. In the LabVIEW IDE I can run a vi to parse this definition file and 'automatically' create the required shared variable libraries.

4. Once the libraries are created, the server app can dynamically load these and deploy the shared variables on startup.

 

This means that modifications of the interface are relatively straightforward:

i) edit the definition file

ii) in the LabVIEW IDE re-create the SV libraries

iii) Restart the server app with the new libraries

 

The only downside is that LabVIEW runtime engine will not allow dynamic creation of shared variables - you need the DSC run-time for this, which I do not want to pay for!! If it did, then I could make it all automatic create/load/deploy all SV's on startup - and I would be very happy!

0 Kudos
Message 12 of 14
(477 Views)

Have you concidered using datasockets to read and write?

 

Just change the URL and it points somewhere else.

 

No SVs required.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 13 of 14
(473 Views)

If you have LabWindows CVI then you should be able to use the CNVNewVariable function to programmatically create NSV's or Network Variables as they say in CVI.

 

0 Kudos
Message 14 of 14
(470 Views)