09-27-2010 05:43 AM
Hi,
I'm currently trying to write a Labview program to record voltages and passes/fails for a piece of test equipment. I'm still a bit new to this level of programming with Labview (previously used 6 to record a few bits at uni), but i've had some help and have given it a go.
The attached program is my attempt to solve the problem.
The test equipment has 25 individual channels to test 25 individual battery packs. Leading from the test equipment are the DAQs. One DAQ analog channel tells Labview what Test Number the equipment is on, 25 analog channels record voltages from the test equipment, and 25 digital channels tell labview whether the test equipment detects a failure in each of the 25 batteries.
I need to:
Please can anyone have a look at my program and see if it will do all of the above, and if it does suggest any improvements/further reading for next time.
I'm really keen to get into labview, but i'm working to a deadline on this one and would like to get it out of the way so i can really get into learning Labview properly 🙂
Thanks,
Christian
p.s. i have posted a part of this program before and had some fantastic help, but i've decided to try and code the whole thing from scratch this time (this version is also a lot more complex):smileywink:
10-12-2010 10:11 AM
Hi CClear87
I have had a look at your code and it looks good. I think it would be benefitial if you could send me the following subvi's:
- Test Number to Integer.vi
- Analog Task Set Up.vi
- Digital Task Set Up.vi
- State Machine States.ctl
Thanks for posting!
10-12-2010 11:00 AM
Hi Michael,
Big thanks for looking at my code. (Very pleasing to know that it is not a complete mess!). Here are the files - the "test number to integer.vi" also multiplies by a factor of 10 as the inputed voltages only increment in 100mV.
Cheers,
Christian
10-12-2010 11:03 AM
and the last one.......
10-12-2010 03:45 PM
I'm really keen to get into labview, but i'm working to a deadline on
this one and would like to get it out of the way so i can really get
into learning Labview properly
Somtimes it actually did speed up me developement process even when facing a deadline to do things right (so rebuilding the architecture instead of constantly fixing the wrongs of my initial design.
The main reason for this introduction is your usage of local variables. Start reading here to understand why they will hurt you.
Your code looks perfect using a producer-consumer design pattern.
You can find some introductions to this using the search (an alternative name is master/slave architecture). The only link I've at hand at the moment is this nugget of mine where I discuss some advanced issues.
Now some code improvements:
* Place the terminals of Start and Exit buttons in the event cases that are registered for their value change events. Then you can use the mechanical action of 'latch' (they are latched when their terminal is read).
* Top Loop->Log Data->Pass-Fail-Array: here you can use autoindexing of the for loop, you don't need the index from array at all; depending on the order the same works on the 2D arrays (otherwise transpose them).
* element 1..25: make them a 2D array instead of 25 booleans. Use the reshape array function to get the 1D array into the 2D array as desired.
Felix