LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

connecting case structure to base program

Hello,
 
My program reads strain and then uses this strain value to calculate the axial load placed onto my specimen. For me to know exactly what load I am applying, I need to constantly read strain values, calculate the load and watch the load as the actuator is moving. The logic that I would like to implement into my program is as follows:
 
I want to first null the strain gauges (done this with the offset null calibration.vi by clicking onto a button in the front panel) and once this is complete, record those initial values. Once everything is nulled and recorded, I want to move the actuator so that load is now being placed on the specimen. I would like to control the actuator  and load in increments (choose increment through front panel, say 10 lb increments). Once the axial load (Ch.2) has reached a the specified load (10lbs), I want the actuator to stop, the values recorded and then start again to load to the next load increment (20 lbs). I would like this to continue until my load has reached the maximum load (specified through the front panel, 50 lbs). Once it has reached this max load, actuator stops, values are recorded and the actuator unloads back down to zero pounds. Now once load is back to zero, actuator stops, disables and program stops.
 
As of right now I have all of these commands (to the best of my knowledge) implemented in labview. I use boolean logic to compare my axial load value to a constant but I am not sure how to exactly connect my boolean logic to my case structure so that the program will go through as I have stated above.  
 
How would I go about programming this? How would I implement the load increments that continually checks with my axial load value? Right now I have an ENUM control connected to the case structure, what would be better?
 
I would appreciate any comments or suggestions that you may have.
Thank you
Jena
 
 
 
 
0 Kudos
Message 1 of 4
(2,760 Views)
I have LabVIEW 7.1, so can't view the vi you've posted. If you could post a jpg of the block diagram, I may be able to help.
0 Kudos
Message 2 of 4
(2,750 Views)

i wasnt able to get it all in but i have it in a couple pics.

hope you can help!

Thanks

jena

 

 

Download All
0 Kudos
Message 3 of 4
(2,744 Views)
A couple of quick tips.  Doing an equals to True as you are doing in 3 locations doesn't do anything.  Just wire the outputs of those express VI's directly to your indicators.  Also, go into those indicators on your block diagram and turn off view as icon.  The icon view takes up too much screen real estate.
 
As for your question,  you can use your boolean logic to connect to a Select Function that is on the comparison palette.  If your condition is True, you can feed in one particular constant of your enum.  If it is false, you can feed in another.  It would also be a good idea to make your enum a TypeDef so that no matter where you use it or the constants, they can maintain the same values.  If you decide you need to add another case to your case structure, you can add it to the saved typedef, then all the constants will have the new value.
 
You will still need to add more to your program like how to determine if you are stopping at load 1, load 2, load 3, etc, and the pause mode.  I think you should look at the state machine architecture which you can find by going File then New.... the from template.  This carries the next state through to the next iteration of the main program loop through a shift register.  You already have some states defined such as start actuator, stop actuator, read record.  (By the way Quit seems to do nothing.)  Other states would be putting all of the data acquisition in a case and doing a comparison with the stop actuator condition there.  If the condition is not met, then you feed an Acquire again in the shift register.  If it is met, then you feed a stop actuator in.  The stop actuator would feed in a Record.  The record would feed in a start (unless it was the last step).  The start actuator leads to the acquire.
0 Kudos
Message 4 of 4
(2,742 Views)