LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQMx has no output when the pulse width is less than 0.1sec

Hi,
 
    I am developing a application to generate square wave(voltage) and out put from a DAQMx card (PCI-6723   - 32 point analog in/out).  I attache a simplified code (labview8.5) I wish somebody can help me to figure out what is the problem
 
    When I set pulse width longer than 0.1 sec. everything works fine. If I set the pulse width less than 0.1 sec, the output from DAQ eithet gets nothing or incorrect(I used a Osclliscope to monitor the  DAQ output), although my labview monitor showed correct output.   I wonder if it is a sampling issue of the DAQ card.
 
 
     Thanks
 
    Guang
0 Kudos
Message 1 of 5
(3,090 Views)

I think one or two things could be causing the problem.

1.  Your DAQmx write is set for 1 sample.  I don't know how that dynamic signal type works with such a setting.  Perhaps it is just putting out the first sample of the signal that is generated.

2.  The math for the frequency of the square wave does not make sense.  You are adding a pulse delay with the pulse period, then inverting it to get the frequency.  So a 1 second delay with 1 second pulse is a 1/2 Hz wave.  A 4 second delay with a 2 second pulse would be a 1/6 Hz wave.  That doesn't make sense to me.

I would recommend building your own waveform or array and not using the express VI.  If you have a 1000 Hz frequency established let's say, build a 1000 element array.  For a .1 second pulse, set replace 100 of those elements with a 100 element array of the voltage value you want.  You can index it wherever you want in the array to account for whatever delay you want.  If you want a 1 msec pulse, then just replace a single element of that array wherever you want.

0 Kudos
Message 2 of 5
(3,084 Views)
Thanks for your response. In fact I am generating unregular square waveform which I can control the pulse width(high) and delay(low). I still don't get why the long pulse works whild the short one doesn't. Because the waveform generation seems oK(labview monitor is fine all the time. The trick probably is in Daq card setting.
 
   Guang
0 Kudos
Message 3 of 5
(3,081 Views)
Hi,
 
   I missed input of dutycycle in my previous attached code. I add DAQmx timing in the revised code (see attached file), it still has the same problem------no output from DAQ when width is less than 0.1sec.   Can anybody tell me what can be the problem?
 
    Thanks.
 
   Guang
0 Kudos
Message 4 of 5
(3,068 Views)

Hi Guang,

I recommend taking a look at the DAQmx shipping example called Cont Gen Voltage Wfm-Int Clk-Variable Rate.vi which can be found in the Example Finder (Help » Find Examples…) by browsing by Task to Hardware Input and Output » DAQmx » Analog Generation » Voltage. This example allows you to generate a square (or other) waveform and change its parameters on the fly.

And some quick pointers: make sure you are checking the status of your error cluster in your while loop. That way when your write VI encounters an error, it will quit the generation loop automatically. Also, it’s a good idea to close the task after the loop has executed.

Post back if you have any questions. Have a great day!

Ryan D.
District Sales Manager for Boston & Northern New England
National Instruments
0 Kudos
Message 5 of 5
(3,050 Views)