12-08-2015 03:01 PM - edited 12-08-2015 03:07 PM
Hello everyone,
I'm having some issues with Labview. I am following a tutorial on youtube:
https://www.youtube.com/watch?v=GBhJk5Tnshc
The problem i'm experiencing is when i make the duration it doesn't flow through the proper time. Basically the test is complete in one second, when i have the duration for 30 seconds( doesnt matter what time, it completes the test within a second). The weird part is that it takes readings for the full duration i put. Im sure my coding is correct since i am following the tutorial. Anyone have any insights on what may the problem be? i have attached images of my code. My code varies slightly from the tutorial, since im taking the average of the samples taken. Other than that its the same as the one in the totorial. Hope someone can help.
EDIT:
Im using a NI 6000 usb (Voltage reader) It is different from the one from the tutorial.
12-08-2015 03:08 PM - edited 12-08-2015 03:12 PM
Hi Xx,
why are LabVIEW beginners always afraid to use the Autocleanup tool (Ctrl-U)? Are your afraid of straight wires?
And why do people think we can solve all their problems by looking at images? Why not attach your VI?
When using a dt of 5 your stop criteria is met within 6 samples (or loop iterations)…
12-08-2015 03:19 PM
Hi GerdW
i thought DT was the interation between samples?
In the video, he has the same set up, and it works for him. he uses 0.01 iterations between samples and uses the waveform duration to set the time limit.
I've attached my VI aas well.
12-08-2015 03:31 PM - edited 12-08-2015 03:36 PM
Hi Xx,
instead of watching Youtube you should read the LabVIEW help. It explains the waveform components!
(Edit: NI offers a lot of FREE resources to learn LabVIEW on their website!)
dt is the time distance between samples…
he uses 0.01 iterations between samples
Have you ever worked with any programming language allowing to iterate loops for 0.01 times? Really?
12-08-2015 03:48 PM
Your code looks nothing like the video. You converted your waveforms to an array of doubles, summed up the array, and then tried to convert it back to a waveform. That makes no sense. The video does nothing of that sort. Notice the red coercion dots on your BD? The data going into that function is not the expected datatype, meaning it is wrong.
12-09-2015 03:51 AM - edited 12-09-2015 03:52 AM
Hi aputman,
The data going into that function is not the expected datatype, meaning it is wrong.
Not exactly wrong, but the result after conversion might not be as expected…
@Xx:
Read the LabVIEW help. It also explains the term "Coercion Dots"…
12-09-2015 07:37 AM
Hey aputman,
It may be wrong in terms of value, although i made the same exact one like he showed on the video, but i had the same problem. I changed that part of the code since tthe data on the spreadsheet showed all 100 samples. i just wanted to put one sample that was the average out of 100.. Thats why i wrote the code to take the average of it. IT may as well be wrong. But my problem is that it doesnt do the whole duration.
12-09-2015 07:43 AM
Hi gerd,
Thanks for your help. When i meant iteration i meant the time distance. I just used the wrong word to describe it. Sorry. I know dt is the time distance in which the samples are apart. I did use the contecxt help to look at the waveforms. But like i said, it works for him and not for me. The code isnt complicated. I have the same set up. except that i am using a different module to take voltage. IF his did the samething then i know something is wrong. Im just trying to see why mine is ending so quickly.
12-09-2015 08:08 AM
Hi Xx,
while reprogramming something from scratch might help you to learn the usage of the LabVIEW IDE it could be a better idea to study the example VIs coming with LabVIEW!
Try something like this:
Your DAQAssistent is set to deliver data for 0.1s yet your loop should run (roughly) once a second?
You can even simplify this snippet when you replace the While loop by a FOR loop set to iterate 30 times…
12-09-2015 08:41 AM
Hey Gerd,
Thanks for the example. My loop doesnt have to run every second. I know that would put a toll on the processor. That was just an arbetarry number i picked off the top of my head. Actually if i could vary the sample time and the duration that would be great as well. i will defintely make use out of the examples the VI has to offer. I assume i can pull it off the main website. Thanks again for your help.