LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Analog Voltage

Hey guys, I would be pleasure if any of you can help me!

 

I want measure voltage with a DAQ usb-6009, but there is a strange problem...I add the two vi's. One I use the "timming" and the other (test2) I don't use.

 

If I use the timing like in test1, the graph is a good wave but it has a retard I don't know how to explain good but whern I move the the voltatge (put more or less) it waits like 6 seconds until start to change in the graph and I don't know why :S

 

The second, test2 the problem before doesn't exist but here there is a problem...it doesnt do the correct wave...I don't know but appears strange waves like you can see in the picture.

 

I don't know how to solve this...I tried a lot of things like put the timing before the loop and other things but nothing...pff

 

sorry for my english, 

 

 

thanks.

 

Download All
0 Kudos
Message 1 of 9
(2,993 Views)

Hi jocuma,

 

in your test1.vi you do a lot of things wrong:

- no need to set timing in the loop again and again - once before the loop is enough!

- you set a sample rate of 1000Hz, but then you just read one (1) sample... Read blocks of sample, I suggest blocks of 100 samples per DAQmxRead.

- having a Wait function in a DAQ loop isn't good programming!

 

Did you look at any of all those DAQmx example VIs that you can find in the example finder? Please do so...

 

In test2.vi you read just one sample per DAQmxRead and do the timing with a wait function. That's ok, but you should know that it is very limited in sample/iteration speed. Each DAQmx call adds it's overhead, so you better use the DAQmxTiming as you tried in test1.vi...

 

Side note: you should press Ctrl-U from time to time - or follow the style guidelines more closely on your own!

Best regards,
GerdW


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

Yes I see diferent examples...but the problem is that in the test two the wave is not good....it's a strange wave :S

 

0 Kudos
Message 3 of 9
(2,975 Views)

Well I did what you say but...one question how can I replace the time function to put in the table if I only use the DAQtiming? :S

 

 

 

0 Kudos
Message 4 of 9
(2,954 Views)

Hi jocuma,

 

to understand the wave shown in test2 you should think about Shannon/Nyquist criteria...

 

About timing information: when using DAQmxTiming you should read waveform signal from DAQmxRead as it already contains the timing information you're after!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 9
(2,917 Views)


"About timing information: when using DAQmxTiming you should read waveform signal from DAQmxRead as it already contains the timing information you're after!"

 

No, this is bad thing, because if I read the waveform signal timing this time is like 23:05:09 for example and I don't want this in my table. I want the time like

 

0 seconds

0.1 seconds 

 

like the shift register I have now to count the times that uses the while loop.

 

I tried what you say and I want a method to read a good waveform but the timing is necessary a "wait until next" because when the while loop executates in the table I want to see like now...0 seconds 0.1 0.2.... not like the real time what happens in this moment...

 

 

you understand me?

 

 

sorry for my english,

 

 

thanks 🙂

0 Kudos
Message 6 of 9
(2,894 Views)

Because for example, in test2 can I improve of reading more samples and use the same strucuture?

 

I tried something like this.. but then the graph appears and error-... 

 

"These cannot be wired together because their data types (numeric, string, array, cluster, etc.) do not match. Show the Context Help window to see what data type is required.
Cluster ->data, a 1-D array of
double [64-bit real (~15 digit precision)],
conflicts with cluster Waveform Chart->data, a double [64-bit real (~15 digit precision)]."

 

Have you got another good idea? 

 

thanks a lot 🙂

0 Kudos
Message 7 of 9
(2,878 Views)

Hi jocuma,

 


No, this is bad thing, because if I read the waveform signal timing this time is like 23:05:09 for example and I don't want this in my table. I want the time like 0...


Ever thought about subtracting start time from all following timestamps to get a relative time?

 

For the chart/wire mismatch problem:

The chart takes several kinds of datatypes. All the correct datatypes are shown in the context help. I don't remember a cluster of [Array, DBL] between the expected datatypes...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 9
(2,855 Views)

I tried something like this....but it doesn't work so good...because the problem now is with the time-table...

 

 

😞

0 Kudos
Message 9 of 9
(2,841 Views)