09-15-2010 02:37 PM
Hi guys,
I need some advice on what is the best approach.
I am modifying a current Labview program (the same VI just renamed) to take advantage of two readings from a Force Gauge. My requirements are:
I have four fields: 1st Peak Force, 1st Distance, 2nd Peak Force, 2nd Distance.
Do I use multiple case statements, a while loop, or something else?
I've enclosed my VI. I know, there are a lot of local references in here , but I've got a short time frame and I'll have to rewrite this later.
09-15-2010 02:38 PM
By the way, it's #23 in the case structure.
09-15-2010 03:02 PM
Could you reduce the problem to a simple VI with an array of typical test data?
(btw, all these "read local variable-modify-write to the same local variable" constructs should be done with shift registers instead of locals of hidden controls/indicators. If you keep the data in a shift register, you don't need to involve the front panel. This is not text based programming 😉 Overall, the code is very hard to read. There is also something wrong with your state enum, because it gets coerced to a simple number. Most likely you are mixing different enums. You should have made it a type def. )
09-15-2010 03:12 PM
Sounds like you might want to look into the peak finding vi's. Search the examples for "peak"
09-15-2010 03:18 PM - edited 09-15-2010 03:19 PM
@altenbach wrote:
Most likely you are mixing different enums. You should have made it a type def. )
In case "10", the two enums with selection "User Input (Start Button)" have an extra item "Read Gauge (R.T.C.)", replace those with the more common enum and things will look much better. Make it a type def to keep things manageable.
09-15-2010 03:24 PM
Thank you so much! That would have taken me hours to find out.
09-15-2010 03:50 PM
09-16-2010 07:08 AM
tbob, won't I still need the date/time vi wired into the format date/time string?
09-16-2010 07:28 AM
@BadAzzS10 wrote:
tbob, won't I still need the date/time vi wired into the format date/time string?
No, that's an implicit input, it per default uses the current timestamp, you can always use another moment in time.
If you are looking for information of a typedef, see this video.
Ton
09-16-2010 08:11 AM
I don't think the Peak Reading VI will work. I need to read the force of the gauge and at what distance it was taken at. I don't think that the Peak Finding VI will do that (although my knowledge level is very low with labview).