Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I start a VI without executing the program, untill I press a start icon on the user interface?

I created a VI, (for my Agilent 35670A Digital Signal Analyzer) that (via USB GPIB using VISA) initializes, sets up, performs a Swept Sine Frequency Response, and exports the Magnitude and Phase out to a .txt file.

I used the 35670A driver from the LV site and other VIs. I placed them in a flat structure to force execution in a specific order..

This works but:

 

How can I make the program not execute, After I press the main Run arrow, until I press a Start Sweep (Trigger a Sweep) control that is part of my vi?

When I enclose it in a While loop it always executes once. I need it to not execute until I command it to do so.

 

Also:

 

How can I make my VI respond to the Pause, Continue, vi control while a sweep is in progress?

Right now once I run the VI I cannot make it pause. I have to wait for it to complete the sweep.

 

Thank you

Don Hogue 

0 Kudos
Message 1 of 5
(3,933 Views)
Post your code.  We can walk you through getting what you want.

"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 5
(3,907 Views)

So a few things...

 

1. the only that your sequence structure is doing currently is that it is forcing the last VI (in the second frame) to execute after all of the other VIs.  other than that the fact that you are using the the error wire cluster and the reference wires to wire one VI to the next is forcing execution to occur left to right.  

 

2.Currently you have nothing that will force your execution to repeat or start when you press a given button on your front panel.  To do this you will need to implement a different program architecture (currentlyt you are simply using sequential programming.  Your Best bet is to either use Event Driven Programming  or a State machine Architecture.  I suggest looking at the following knowledgebase articles that will outline how you can implement this type of programming architecture to make your program behave as you desire. 

 

Event Driven Programming

https://www.ni.com/en/support/documentation/supplemental/06/event-driven-programming-in-labview.html

http://zone.ni.com/devzone/cda/tut/p/id/2962 

 

Event Structure Help

https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/structures/event-structure.html

 

State Machine Architectures

https://www.ni.com/en/support/documentation/supplemental/16/simple-state-machine-template-documentat...

http://zone.ni.com/devzone/cda/tut/p/id/7595 

Charley Dahan

Global Account Manager
0 Kudos
Message 4 of 5
(3,848 Views)
Thanks. I'm studying the Event Driven method now.
0 Kudos
Message 5 of 5
(3,845 Views)