LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dwell profile

I'm having trouble understanding why this program doesn't dwell for the time period I indicate.
It immediately jumps to the next setpoint. What am I missing?
Thanks
 
 
0 Kudos
Message 1 of 8
(3,988 Views)
Your interior while loop is set to auto index the setpoints and dwell times.  But, you are also using it to determine if the dwell time is expired.  So, the first iteration through the loop, your dwell time hasn't expired, so it executes again, and you index your arrays.  I think you want to index on the outside while loop instead.  Also note that you case statement where you set the datapoint executes every iteration except for the last iteration.  You should move that code to your outside while loop, as that is the only time you need to set the temperature.
0 Kudos
Message 2 of 8
(3,977 Views)

Thanks!

I moved the case statement outside the while loop and moved the index to the outside loop. The dwell time now works for the first dwell time period only but boolean control for the case statement doesn't pass outside the loop to set the setpoint. how do I pass a boolean condition outside a while loop to enable the case statement? 

0 Kudos
Message 3 of 8
(3,960 Views)
You don't need it to be in a case statement anymore if you've moved it outside.  Before the interior while loop executes, perform your VISA writes.  It will happen every data point (setpoints/dwell times).  You have no need to comment it out.
0 Kudos
Message 4 of 8
(3,956 Views)

Thanks Matthew,

I've done as you said and the program works for the first setpoint/dwell setting then halts. Why doesn't it jump to the next setpoint/dwell setting after the completing the first. Please excuse my ingorance, this is all new to me.

Thanks again, nglabrat

0 Kudos
Message 5 of 8
(3,952 Views)
It seems to run fine for me as long as I remember to set the number of cycles to match the size of my arrays.
0 Kudos
Message 6 of 8
(3,948 Views)
I see. It now works for me too. My thinking was "# of cycles" represented the number of iterations the loop would run. Also the indicator I labeled as "Dwell time" actually isn't, (it's the elapse time of the current setpoint). To help me further understand I included some notes on the front panel (in yellow). I also added code to monitor actual temperature compared to setpoint.
 
Now that I understanding this, how can I do the following?  
1. Set temp setpoint, wait for temp to stablize (+/- 1 degree), start and display dwell time.
2. Once dwell time is complete, set next setpoint, wait for temp to stablize,  etc.... 
 
nglabrat
0 Kudos
Message 7 of 8
(3,935 Views)

Hi nglabrat,

Instead of having your Dwell Time (as you've currently called it) determine whether the inner loop continues iterating, compare the Actual Temp. to the Set Temp.  If Actual > Set, stop the inner loop.  After that, use a Wait function to determine the Dwell Time.  Then proceed to the next setpoint.  This application would work well with a state machine architecture, by the way.

Regards,

James R.
National Instruments
0 Kudos
Message 8 of 8
(3,919 Views)