Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Output a digital wave I get from the analog to digital VI.

I am trying to make a square wave form that has a variable duty cycle. I was able to do this with an analog wave, but we need three outputs, and the DAQ we are using only has two analog outputs. I tried to use the Analog to Digital VI to convert the analog wave into a digital wave, however, when I tried to output it from the DAQ, an error came up that said I was trying to output too many outputs through one channel. The error it gives me is:
[
Possible reason(s):


Measurements: Specified read or write operation failed, because the number of lines in the data for a channel does not match the number of lines in the channel.

 


If you are using the Digital Waveform datatype, make sure the number of lines in the digital waveform matches the number of lines in the channel. If you are using boolean data, make sure the array dimension for lines in the data matches the number of lines in the channel.

 

Number of Lines in Channel: 1

Number of Lines in Data: 16

Task Name: MyDigitalOutChannel
]


What I need to do is output a square wave with a variable duty cycle, frequency of 30 kHz, and a range from 0-5 volts. Is there a way i can get the Analog to Digital VI to work, or is there a better way of doing this.

I'm adding an attachment of the a test code I have made.

Thanks for any help you can give me.

-Joe
0 Kudos
Message 1 of 2
(2,757 Views)

Hi JJAJoe,

This error is because your Digital Waveform has 16 lines and the DAQmx Write vi is defined to write one digital channel with multiple samples. The Analog to Digital vi represents each value of the analog waveform with n number of bits for resolution (in this case 16 bits), therefore 16 lines in the Digital Waveform. One way to get the Analog to Digital vi to work for you would be to use the Digital Signal Subset vi, and select one signal to write in the digital line. You can find that vi in the Functions palette > Programming > Waveform > Digital Waveform > Digital Signal Subset. I hope this is helpful,

Ana P
National Instruments
Applications Engineer
0 Kudos
Message 2 of 2
(2,731 Views)