キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

global variable

解決済み
解決策を見る

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 件の賞賛
メッセージ1/7
4,013件の閲覧回数

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 件の賞賛
メッセージ2/7
4,005件の閲覧回数

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 件の賞賛
メッセージ3/7
3,991件の閲覧回数

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 件の賞賛
メッセージ4/7
3,984件の閲覧回数

0 件の賞賛
メッセージ5/7
3,978件の閲覧回数
解決策
受理者 BOCHEV

Hi Bochev,

 

yes, it's all possible...

 



 



 



 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 件の賞賛
メッセージ6/7
3,975件の閲覧回数

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 件の賞賛
メッセージ7/7
3,969件の閲覧回数