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: 

Switching over once button is pressed

Thanks for the help so far everyone! I have this VI almost working. It does 'almost' what i want. It switches within program but not quite how i want. It does it on a time basis and i dont want this.

 

My current system works by pressing a button on my testing kit and recording the result. Within the singlemode loop i then need it to switch to the return loss loop. Press a button and record return loss. I only want it to switch once the test has been completed. Not on a timely basis.as it is at the moment (loop1 loop0 loop1 loop0). I also am trying to send a string out (write buffer) to the serial port so it automatically switches over  from IL to RL and then back again. The issue i have is i send that to the write buffer(REL1550 & RET11550) on the serial line but it keeps showing up within my read buffer and is not switching over my kit.

 

Please help!

 

I hope this makes some sense!

0 Kudos
Message 1 of 2
(2,153 Views)

Hi Printerman,

 

Thank you for contacting National Instruments. Having looked at your code, I don't think that it is changing from one loop to the next. Your conditional teminal has either 0 or 1 but is wired to the While loop iteration terminal. This will go up as the program is run so I suspect the loops will go from Loop 0, Loop 1, Loop 1.... this is certainly what I have witnessed with highlight execution enabled. 

 

If you don't want these loops to be time dependant, I would suggest that you use an Event structure. I have linked an article that explains the basic operation and I would suggest looking at the following example.

 

Draw Graph with Events.vi

 

Please let me know how you get on.

 

Many thanks,

Andrew McLennan
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,099 Views)