LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

global variable

Solved!
Go to solution

Dear All

 

I create a project in Labview with couple of VI's. I use a modbus tcp ip protocol to read registers from PLC controlers and the tcp open blok  . In the main screen i create a Menu with password  and username and i want to use this menu for changing the ip adresses of the other VI's. I made this task with global value but when i change the value the other VI work fine but when i close the windows and when i open again the global variable is empty. My question is how can i store the new value ???

0 Kudos
Message 1 of 7
(3,623 Views)

Hi bochev,

 

usually values are stored (for later re-use) in files...

 

Global variables hold their value as long as the containing VIs stay in memory. When you close all VIs you also forget about the global variable.

Best regards,
GerdW


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

ok thanks but do you know  any algoritm for storing values in variables after closing the VI's and the program..... and somethimes when it's needs to change the value with newone and then the new value will store again or there is no such function. Because in C; dotnet and other languages is different. You can store , change variables in any screen,menu etc.

0 Kudos
Message 3 of 7
(3,601 Views)

Hi Bochev,

 

as said before: when you want to store values to be available for the next programs run you should use files. LabVIEW provides a full palette of file functions...

 

And I do think other programming languages will handle ths problem the same way.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 7
(3,594 Views)

0 Kudos
Message 5 of 7
(3,588 Views)
Solution
Accepted by BOCHEV

Hi Bochev,

 

yes, it's all possible...

 



 



 



 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 7
(3,585 Views)

Use the Example Finder and examine the use of the Configuration File palette.

 

config.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 7 of 7
(3,579 Views)