LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I add in a pause trigger so that while I am running an experiment I can hold a voltage and keep it constant until I un-pause the experiment?

Hello, I am a Chemistry graduate student doing electrochemical measurements with a Keithley 2400 sourcemeter.

 

I am very new to programming, especially labview programming. I am modifying a pre-existing cyclic voltammetry program so that I can use it as a voltage ramp program.

 

I would like to add a pause button so that the program pauses at a specified voltage and holds the voltage constant until I manually unpause the program. Then the program will continue to act as a cyclic voltammetry experiment. I am not sure about how to do this or what VI's to use...can anyone help me?

 

I have attached a copy of my cyclic voltammetry VI. Its a library with 4 cv VI's in it, the actual program is the cv.vi. Thanks!

 

 

0 Kudos
Message 1 of 6
(2,748 Views)

You are going to need a better design pattern to implement your needs.

 

A Producer - Consumer (Events) would allow for the consumer loop to use a Queued Message Handler, otherwise known as a state machine.  Your States then would become:

  • Init
  • Idle (Pause)
  • Generate and aquire a point
  • Exit

There are some good examples of these patterns that ship with LabVIEW.


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 6
(2,741 Views)

I'm not really sure what you mean by another "design pattern". It appears to me as though this program has the sweeping ability I need, I simply need to pause at a voltage and have it hold until it unpauses.

 

I'm not really sure as well what a "state machine" is and where I would insert it into my pre-existing program.I'm not very good with coding language, so a lot of these terms I don't understand. I'm better with more direction and a dulled down explaination.

 

What I'm trying to say it, I don't really understand your answer and I was hoping that you could explain it to me in more simple terms for someone that doesn't understand coding/labview language. Thanks and I do appreciate your reponse.

0 Kudos
Message 3 of 6
(2,728 Views)

to pause your value, hold it onto a shift reg...

Spoiler
pause.png
0 Kudos
Message 4 of 6
(2,727 Views)

hmmmm.....RG way of saving a file?

cv_BD.png

why dont you just use a case structure with a bool control button marked 'save' with the write to spreadsheet in the true case... 

0 Kudos
Message 5 of 6
(2,708 Views)

@toddfox143 wrote:

I'm not really sure what you mean by another "design pattern". It appears to me as though this program has the sweeping ability I need, I simply need to pause at a voltage and have it hold until it unpauses.

 

I'm not really sure as well what a "state machine" is and where I would insert it into my pre-existing program.I'm not very good with coding language, so a lot of these terms I don't understand. I'm better with more direction and a dulled down explaination.

 

What I'm trying to say it, I don't really understand your answer and I was hoping that you could explain it to me in more simple terms for someone that doesn't understand coding/labview language. Thanks and I do appreciate your reponse.


OK, I can work with that..... BUT let's agree right now you won't get a "Dumb Answer" for a "Smart Solution".

 

Your current vi sends one array of values to a DAQmx device and sends start.  There is no way to pause in the middle of generating that array at the rate specified in the DAQmx Task.  You need a radical change.

 

LabVIEW is more than capable of doing what you want.  Your vi is capable of creating a sweep.  This is not the same as playing a U-Tube clip where you can press buttons to pause, jump ahead, rewind, fast forward, etc...  In fact that U-tube clip player is always listening for those user events (Mouse clicks) and has code behind it to respond to the user clicking those buttons.  Your code will "play" an array out of the DAQmx channel.  It has no code to listen to the user.

 

In very simple terms (if you are older than thirty-ish)  You want a DVD, you have a LP (Vynol Recording)  Some changes will need to be made.

 

 

 

Design Patterns:

Most of the things we want software to do for us fall into one of several catagories.  We do call these catagories design patterns.  LabVIEW does ship with examples of some of the most common design patterns.  Have you found the menu option "Tools>>Example Finder"?  That would be a great place to start.  

 

Come back with any questions you have while looking into that.  Private message me through the forums if I miss a response to any public thread or question.


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 6
(2,693 Views)