LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Show the last state of controller from spreadsheet

In this example, I want to control 6 LEDs, I want to get their last state shown at controllers and indicators when i open the VI again
For Example
Start > all off > i turned on first 3 of them > I closed the program > when i open again i want to find that 3 of them are on and 3 are off and able to change their state using the controller

0 Kudos
Message 1 of 7
(2,403 Views)

Hi El,

 

save the current state of your LEDs when you exit your VI. Upon start of the VI you load that state information and update your front panel as needed...

Best regards,
GerdW


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

I don't want to do it Manually, Is there any way to do it automatically every time using the spreadsheet ?

0 Kudos
Message 3 of 7
(2,386 Views)

Hi @El-Awny,

 

Maybe you can try this, save the last state using write to binary file. 

While u run the program, read that file again to init the last condition..

 

 

Day@


Day@
Certified LabVIEW Associate Developer
0 Kudos
Message 4 of 7
(2,382 Views)

@hidayatmaulud wrote:

Hi @El-Awny,

 

Maybe you can try this, save the last state using write to binary file. 

While u run the program, read that file again to init the last condition..

 

 

Day@


The problem with that VI is that every 10 msec, you are opening a new file reference to write data to, and never closing  those references other than the very last one when the VI ends.  You'll slowly leak memory.

0 Kudos
Message 5 of 7
(2,367 Views)

@El-Awny wrote:

I don't want to do it Manually, Is there any way to do it automatically every time using the spreadsheet ?


They didn't mean by hand.

0 Kudos
Message 6 of 7
(2,358 Views)
You are right,
There are so many method to do that, we can use event structure too to save memory..

Day@
Certified LabVIEW Associate Developer
0 Kudos
Message 7 of 7
(2,357 Views)