LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Recording Voltages and Pass/Fail States

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. Smiley Happy

 

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:

  • Read the voltages and digital channels once a minute.
  • Record the voltages if the Test Number channel reads 3 or 4
  • Record which test (if any) each battery fails on.
  • At the end produce 25 word documents (one for each battery) which have: two graphs - one for each set of voltages recorded at test 3 and 4, and some text which shows which test (if any) the battery failed on.

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:

----------------------------------------------------------------------------------------------------------------------------
"If anyone needs me, I'll be in the Angry Dome!"


0 Kudos
Message 1 of 5
(3,584 Views)

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!

Kind Regards

Michael
NIUK Application Engineer
0 Kudos
Message 2 of 5
(3,508 Views)

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

----------------------------------------------------------------------------------------------------------------------------
"If anyone needs me, I'll be in the Angry Dome!"


0 Kudos
Message 3 of 5
(3,499 Views)

and the last one.......

----------------------------------------------------------------------------------------------------------------------------
"If anyone needs me, I'll be in the Angry Dome!"


0 Kudos
Message 4 of 5
(3,495 Views)

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 :smileyhappy:

 

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

0 Kudos
Message 5 of 5
(3,483 Views)