LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI time/duration issue/Data Aquitsition

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.

 

 

0 Kudos
Message 1 of 17
(4,168 Views)

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)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 17
(4,158 Views)

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.

0 Kudos
Message 3 of 17
(4,137 Views)

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?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 17
(4,124 Views)

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.

aputman
0 Kudos
Message 5 of 17
(4,108 Views)

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"…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 17
(4,077 Views)

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.

0 Kudos
Message 7 of 17
(4,056 Views)

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.

0 Kudos
Message 8 of 17
(4,049 Views)

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:

check.png

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 17
(4,035 Views)

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.

0 Kudos
Message 10 of 17
(4,023 Views)