From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Feedback loop in event structure

Solved!
Go to solution

Hi

My application allows users to load one of several VIs in a subpanel.Each VI disolaying a part of system. The user enters the name of the required VI  and by pressing Return or Enter(Num Pad) the VI is loaded. I want to add a feature thst allows user to go back and forth between these loaded VIs. I am trying to write unique index of every VI in an array within the same event handler. I am using feedback but the array is rewritten with every key event i.e.only the index of the currently oaded VI is written to the array at 0 index. This is confusing as paths, refnum etc. are passed on to the next iteration (of while loop) just fine using shift registers

 

Any suggestion would be welcome

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

I suggest posting code.

 

I think I know what you are doing and I think I have something in mind.  An easy way is to just keep the last VI ref open and keep it in a shift register, and if the user presses undo or back or what ever, then reinsert it.

Message 2 of 7
(2,751 Views)

Thanks for the reply. There are around 12 VIs plus user generated displays so keeping refnums open may not work. 

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

@Nustian wrote:

Thanks for the reply. There are around 12 VIs plus user generated displays so keeping refnums open may not work. 


Why would that not work because you have 12 VIs?  If you wanted to have a full history to undo then sure you need to limit it somewhere, but how far back do you need to let them go?  No undo on any program is limitless in size.

Message 4 of 7
(2,720 Views)
Solution
Accepted by topic author Nustian

As i understand it, you can have some or all running, regardless if you're looking at them or not, so i'd say the easiest solution is to build an array of vi refs (which is easily done in the init step through vi-ref constants) and use a Ring control with names. On the value change event on the control, empty subpanel and insert new ref.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 5 of 7
(2,692 Views)

Thanks. Very helpful

0 Kudos
Message 6 of 7
(2,660 Views)

Thanks. Very helpful

0 Kudos
Message 7 of 7
(2,659 Views)