LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ramp up, Hold, Ramp Down

Solved!
Go to solution

Hi pcorrell,

 

are you referring to message #2?

 

All you need to do is to change the step width - use 0.0008 instead of 1.

(Keep in mind the limited precision of floating point operations - you will find a lot of threads on this topic in the forum!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 41 of 44
(482 Views)

Hi there, I am adding to what appears to be a very old thread so I don't know if you're still on here but I have been basing a similar problem off the state machine responses you have made in this thread.

 

I have a similar application except it is mostly a proof of structure before moving on to a more complex task. The plan is to use a vi to ramp several different power supplies at different rates daisy-chained together for an experiment. If i can get this simplified version working then it will go a long way toward the final product.

 

The desired effect of the VI is to ramp the current to a desired value then hold indefinitely until a shutdown command is issued where a ramp down will be performed on the various machines. They are all pretty similar so if one case works then I merely need to extend the vi and eventually add the VISA controller VIs for the power supplies. The ramp procedure should not be repeatable once engaged to stop a sudden jump in current from 28A to 0A or any other sharp changes.

 

Currently the ramp up detection works and the "hold" case works which  essentially just re-displays the current value on the trace. The ramp down however does not trigger and depressing the power down button does nothing and the button locks. I have attached the file, any feedback would be appreciated (labview 2017). I understand most of how the program works, just having a hard time understanding why the shutdown case isn't detected. In your code the stop button doesnt seem to do anything either.

 

This is something of a labview refresher for me. I was good at it when we learned it 6 years ago but haven't used it since. 

 

Thanks

Download All
0 Kudos
Message 42 of 44
(448 Views)

Hi JB,

 

understanding why the shutdown case isn't detected.

Several problems in your VI!

 

1. way too much local variables

2. all of those terminals are unused

3. there are coercion dots even for simple numeric constants…

Have you done any of those free beginner courses for LabVIEW offered by NI? Ever heard of "Think DATAFLOW!"?

(When you were "good" some years ago you should recall this at first.:D)

 

On your specific problem:

4. the "shutdown" state is only called from the "idle" state.

5. when you reached the "hold" state you will NEVER leave it as the next state is ALWAYS "hold"

6. never compare floats for equality. NEVER!

Please rethink your state machine design, especially the logic to select the next state…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 43 of 44
(437 Views)

Hi there, 

 

I didn't expect a reply so soon.

 

I identified most of the errors preventing functionality that afternoon however as an advanced user you have spotted a lot more issues I can work on. The state machine was based on one from this thread that seemed to have the essence of what i was trying to accomplish (although i don't get why the state variable exists as a whole separate file). I did however figure out how the state machine worked and corrected the hold condition.

 

The local variables are to provide feedback to the front panel so indicate the startup status and monitor the ramp phases. 
I will whizz through the tutorials again this morning and see where that gets me.

The statement of being good with the software was more of a statement of sufficient understanding at the time of my university intro course that I frequently completed exercised early. I am not presuming to tread on the experience of people who use the software every day. My supervisor has asked me to automate something so that is the desired output regardless of how pretty it is. If I could use python this would not be an issue but here we are.


Thanks for your reply

 

0 Kudos
Message 44 of 44
(424 Views)