LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Finite AO Voltage Generator

Solved!
Go to solution

Hi all,

 

I am attempting to build a trigger input application for the external device as per the spec sheet attached...

 

The application I built outputs X number of square wave pulses between 0 and 3.5 V at X frequency as specified by the user control inputs... This has worked fine in the past when triggering at 50 Hz or 100 Hz...

 

I now need to use frequencies of 20 Hz and 80 Hz... However, at those frequencies the pulse widths are inconsistent for some pulses within each train...

 

It appears to have something to do with the square wave duty cycle% for the functional generator, but I cannot identify what specifically the problem is...

 

Would anyone have any ideas?

 

Thanks... 

0 Kudos
Message 1 of 5
(170 Views)

Hi Jack,

 


@jcannon wrote:

I now need to use frequencies of 20 Hz and 80 Hz... However, at those frequencies the pulse widths are inconsistent for some pulses within each train...

 

It appears to have something to do with the square wave duty cycle% for the functional generator, but I cannot identify what specifically the problem is...


Seems like rounding errors when you need 8% duty cylce at 12.5ms pulse interval for a waveform with a dt of 1.0ms…

 

  • Why don't you create a simple array of values 3.5 and 0.0, with the exact amount of needed samples?
  • Why do you create a waveform and use the DAQmxWrite with a simple array as input? There's an instance that expects a waveform…
Best regards,
GerdW


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

Hi GerdW,

 

Thanks for your feedback... I thought a rounding error may have been the issue but wasn't sure how to fix it...

 

I have revised the vi by removing the square waveform generator and replacing it with a for-loop that builds an array of data to be written using 3.5 and 0 values as needed. A shift register builds an array based on the number of pulses necessary in the AO...

 

To remove the rounding error with the 12.5ms inter-pulse-interval, I have used a 2000Hz time base (25 data points per pulse with a width of 1ms or 2 datapoints)... In the attached vi I have plotted the data in a graph and presented it in anarray indicator... However, the graph appears to be missing the first 3.5 value data point in the array, which means that the timing of all subsequent pulses occur 0.5ms too early on the graph... But the timing of the values in the array indicator is correct...

 

Any idea why this might be happening? I assume the AO will write the values in the array and will be correct... But I am obviously missing something with plotting the data to the graph...

 

Any ideas?

0 Kudos
Message 3 of 5
(116 Views)
Solution
Accepted by topic author jcannon

I don't see the problem here.  The first 3 values in the graph are 3.5, 3.5, 0 just like in the array.   Were you just visually misinterpreting because of the absence of a preceding 0 value, such that the initial pulse would start at 3.5 rather than rising from 0? 

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 4 of 5
(111 Views)

Ahhh!... Thanks, Kevin... Much appreciated...

0 Kudos
Message 5 of 5
(109 Views)