12-14-2010 03:59 PM
Hi there, let start by saying, i am totally new to Labview. I have experience programming in C, C++, visual basic etc, but never in Labview. I thought Labview won't be much difference, but i was very wrong. I went and bought the USB-6008 DAQ and downloaded the trial labview to explore and i am totally stuck and have no clue how to proceed. I probably can start from scratch and learn all the basics but i don't want to take up too much of my time. Anyways, here is a description of my project:
Setup: USB-6008 - for measuring the voltage of a Lithium battery ~3.6V
Circuit board with a switch that either connects the battery to a resistor or not. the switch can be turned on/off by a analog voltage output from the USB-6008
What i want to do in pseudo code:
if START is clicked,
take a reading from DAQ and store to voltage 1 indicator and graph
if voltage is > 3.6, then
for 30 seconds
output a voltage to DAQ to turn on switch, and turn on load LED indicator
read from DAQ and update the reading to voltage 2 indicator and graph
if DAQ reading is < 3.5, STATUS indicator = OFF, else = ON
end 30 second loop
if last reading after the 30 seconds from DAQ is > 3.5, display message " pass " else display message " fail "
else
indicate voltage is less than 3.6V and stop program
end if and stop program.
NOTE: voltage 1 indicator ONLY show the first reading before the circuit board switch is turned ON.
I didn't think it is very hard to program this, as everything is very basic, but since i don't know Labview, i don't know how to proceed. attached is a front panel.
Thank you for all your help.
John
Solved! Go to Solution.
12-15-2010 12:42 PM
Hi there!
To get you started here are a few things.
1. Learning LabVIEW:
This has all kind of step by step videos on the basics of LabVIEW and is a great resource just get started...it's really great because you can click on a video regarding any topic you are interested in. There's a set of tabs at the top that categorize the videos.
2. DAQ examples. In LabVIEW go to Help menu > Find Examples... Then in the window that opens up (this is called the Example Finder) you can navigate to Hardware Input and Output folder > DAQmx > Analog Measurements > Voltage
We have tons of DAQ examples, so this should at least allow you to read a voltage quickly.
Hope this helps!
12-15-2010 02:33 PM
i was hoping there is a shortcut, but i guess you can't do that. i will just have to start from beginning and learn the basics first. thanks for your response.
12-16-2010 11:08 AM
Yeah, if you run into any specific questions about how to program the UI or if your acquisition doesn't seem quite right, feel free to post again. If you're getting errors, please post the error code and text as well as attaching your code - that helps a lot!
12-16-2010 01:09 PM
Hi Michelle,
i worked day and night yesterday, trying to learn as much as possible through examples and tutorials, and here what i have done so far. i have managed to get most of my requirements done, but still a few thing in question. see attached vi.
1. the STOP function inside my case structure just after the first compare is stopping the whole program, whereas i only want to stop the code going into the inside loop, and go back to the outside while loop. is there a function that i can use to accomplish that? something similar to the end loop function.
2. in the INSIDE LOOP, i am using a time delay of 0.1 seconds and loop a 100 times to estimate the 10 seconds that is not always very accurate. is there a better way to implement this?
3. For some reason, the DAQ read in the INSIDE LOOP is not plotting on the graph that i attached to it. i configure the voltage on a ON-DEMAND basis because i only want to update the voltage reading every time the loop runs. i tried changing that to a N-sampling, and the graph plots, but it screws up my x funtion before the Status LED. i would rather to have the voltage reading on a ON-DEMAND basis anyways because i think that will make the DAQ not to work too hard, is that true?
4. in the INSIDE LOOP, i use the loop iteration to control a digital output to the DAQ, there is two data conversion before the DAQ assistance, i tried wiring directly from the NOT function to the DAQ assistance, because the output of the NOT function is boolean, and so is the input for the DAQ assistance, but the program give me an error stating they are two different data types. i force the NOT output into dynamic then back to boolean and everything connected. that seems weird to me. can you explain why is that?
i will continue to work on this and see... Question 1 and 3 is more urgent to solve than the rest. Thank you.
John
12-16-2010 02:18 PM
Michelle,
i just found out that on my Question 3, the reason the plot is not plotting is because it is plotting at the same point all the time since the waveform resets the x value to 0 everytime the loop starts, and because i am measuring voltage, which is the same ( or very close to be the same ) all the time. if i plot an xy graph with x = to the iteration number, and y = voltage, will that work?
John
12-16-2010 03:08 PM
Why don't you simply use a chart?
12-16-2010 04:43 PM
chart worked like a charm. thanks. i am totally new to labview so i am still not familar with all of the functions and tools.
John