LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Run Button without execute the program

Solved!
Go to solution

In case that was what you wanted, here is a solution.  It is NOT the best solution.  You would have to use a more advanced general architecture (e.g. state machine) for that.

 

I saved it back to 8.0 since I don't know your version.  The toolkits won't back save so I hope you can open it.

 

I'm off tommorow but if you need more help I'm sure tbob or one of the other fine forumites will assist.  Good Luck!

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 11 of 32
(1,261 Views)

 


@caahsc wrote:

Hi NIquist,

 

By pressing the "White Arrow Run Button", the program will be executed. So I want to set the parameters before it can execute. Here is what I am trying to do.

 

 

1.  Run the VI (without execute the program)

2.  Set some parameters power supply 1

3.  Enable the output channel 0 for ps1 then if I want to set different power supply 2.

4.  reselect the parameter again for ps2

5.  Enable the output let say channel 1 for ps2

 

Aaron


 

When are you measuring anything?  In any case the VI I posted will allow you to set parms, measure, then change parms measure, etc., etc.

 

As I mentioned it's not the best way for something like this.  You'll notice I used property nodes to disable controls so the operator knows what to expect.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 12 of 32
(1,258 Views)

Hi NIquist,

 

Can you post the file in LabVIEW 8.6? Thanks.

 

Aaron

0 Kudos
Message 13 of 32
(1,237 Views)

Hi tbob,

 

I am unable to open the file provided by NIquist. Can you save it as 8.6? Thanks.

 

Aaron

0 Kudos
Message 14 of 32
(1,231 Views)

@caahsc wrote:

Hi tbob,

 

I am unable to open the file provided by NIquist. Can you save it as 8.6? Thanks.

 

Aaron


Sorry, I can't open it either.  He saved it in LV2010 and I have LV2009.  You can save the file and submit it to the Downconvert VI Request thread and someone there will downconvert it to the version you specify.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 15 of 32
(1,223 Views)

Attached is a vi in 8.6.  This is the way I would do it.  I added an array to hold the device names of the power supplies.  Fill it in for the power supplies you wish to control.  In the block diagram, I changed the outer loop to a For Loop and have the array wired in with indexing enabled.  This way the loop will run once for each power supply you name in the array.  Once you hit the run button, you will have a chance to enter in voltage and current values, and the SET button on/off, then hit the START button.  After you stop the inner loop by hitting the stop button, the For Loop will be ready to control the next power supply in the array.  This continues until there are no more elements in the array.  Then the entire program will stop.

 

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 16 of 32
(1,218 Views)

Hi tbob,

 

Why you removed the loop and replace For loop? I think your first posted was what I want. When I first press the "Run Button", nothing is happening until I press the "Start Button". The instrument icon allows me to select various power supplies on the chassis. If I want to set voltage/current then I simply click the output function. When I am ready with all parameters then I just press "Set button". Now, if I want to set another channel or different power supply then I have reselect the paramenter again and set. Basically, I just want to set power supply.

 

Your modified code is not doing anything when I press "run button". It just run and exit. Thanks.

0 Kudos
Message 17 of 32
(1,212 Views)

@caahsc wrote:

Hi tbob,

 

Why you removed the loop and replace For loop? I think your first posted was what I want. When I first press the "Run Button", nothing is happening until I press the "Start Button". The instrument icon allows me to select various power supplies on the chassis. If I want to set voltage/current then I simply click the output function. When I am ready with all parameters then I just press "Set button". Now, if I want to set another channel or different power supply then I have reselect the paramenter again and set. Basically, I just want to set power supply.

 

Your modified code is not doing anything when I press "run button". It just run and exit. Thanks.


In your very first post you made it clear that you didn't want anything to execute when you pressed the run button.  You wanted to run the vi, enter some power supply settings, then press start to set up the power supply.  So that is the way my vi works.  You run the vi.  Then you set the voltage and current, then you press the Start button.  I think you are being confused by the Set button.  That button is wired to the output setting of the power supply.  When true, it will cause the power supply to come on.  Maybe you should change the labels.  Change Set to On/Off and change Start to Set.

 

Here is one of your previous posts:

 

By pressing the "White Arrow Run Button", the program will be executed. So I want to set the parameters before it can execute. Here is what I am trying to do.

 

 

1.  Run the VI (without execute the program)

2.  Set some parameters power supply 1

3.  Enable the output channel 0 for ps1 then if I want to set different power supply 2.

4.  reselect the parameter again for ps2

5.  Enable the output let say channel 1 for ps2

 

This is exactly what my vi does.  You run the vi without executing the program (step 1.  You set some parameters (step 2), you enable the output (currently called the Set button) (step 3).  Press Start and the power supply is all set up.  The power supply is then read in a loop.  This is leftover from your code.  I didn't add it.  You must press stop to stop that inner loop.  If you don't want this, then delete the inner loop.  After stopping the inner loop, you reselect the parameters for ps2 (step 4).  You enable ps2 by pressing the Set button (step 5).  Then press Start again and ps2 is set up.  This is what you asked for.  If you want something different, please say exactly what you want.  The only thing that should be changed is to remove the inner loop that reads the measurements.  Just read them once, no need for a loop.  The For loop is there to handle all the power supplies you list in the Instruments array.  That way if you want to handle only one ps, just put in one element.  If you want to handle 2, put in 2 elements.  You don't have to change the code to change the number of power supplies you want to handle.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 18 of 32
(1,198 Views)

Hi tbob,

 

I’m really sorry for not explaining my point clearly.  Here is how I would like my program to function.  Please provide guidance for what I may be doing incorrectly.

  1. When I press the white arrow “Run” button the program does not execute.
  2. I have 3 power supplies and 3 SMU units on my pxi chassis. The user can decide what they want to program for the power supply/SMU by selecting the instrument control box.
  3. Then, the user can set all the parameters (Output Function, Channel Name, Level,  and Limit boxes) .
  4. Finally when they are done with parameters, they can enable the output to program that particular power supply (via the “START” button).
  5. These steps can then be repeated again for the next power supply/SMU to be set up. For example, if they want to program another power supply, without turning off the previously setup power supplies.
0 Kudos
Message 19 of 32
(1,179 Views)

Use the vi I gave you.  Remove the inner while loop since it is not needed.  Remove the array and change it to a regular device name I/O control (just move the array element out of the array box).  Change the For loop to a while loop.  Put the new device name control inside the while loop, inside the True case.  You will have to add a stop button for when you are done (outside of the case structure).  Run the vi, enter the SMU name, set the paramters, set the on/off condition (SET button), then press start.  The first SMU will be set.  The loop will wait for you to change the SMU name and the parameters, and when you press start again, the second SMU will be set.  And so on until you press stop.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 20 of 32
(1,170 Views)