LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

not getting an output signal

I built a waveform in labview and connected it to the daq write function. When I plug it up to the oscilloscope I do not get any reading. I am looking for a square wave by the way. Here is a copy of my code attached. current input voltage output is the main vi and the other two files are need to create the waveform and run the waveform through the daq.

0 Kudos
Message 1 of 21
(4,371 Views)

You need to add DAQmx Wait Until Done.vi with a reasonable timeout value between DAQmx Start Task.vi and DAQmx Stop Task.vi. I don't know how you are probing the signal and which daq you are using. Is it able to source enough current?

 

Ben64

0 Kudos
Message 2 of 21
(4,354 Views)

@reggie2016 wrote:

I built a waveform in labview and connected it to the daq write function. When I plug it up to the oscilloscope I do not get any reading. I am looking for a square wave by the way. Here is a copy of my code attached. current input voltage output is the main vi and the other two files are need to create the waveform and run the waveform through the daq.


You are building a 1D array that represent a waveform but it is not the LabVIEW Waveform datatype (note that it will also work with a 1D array but there are advantages using the waveform type). I just realized that you set the sampling clock to continuous so you probably want a continuous output? You should have a look at the DAQmx exemples that are shipped with LabVIEW (Help menu -> Find Exemples ... Browse directory structure -> DAQmx -> Analog Output)..Adding DAQmx Wait Until Done will probably only trigger a one shot waveform generation.

 

Ben64

0 Kudos
Message 3 of 21
(4,339 Views)

Thanks sorry for the late reply had a lot of test last week. I have enocuntered a new problem when i run my vi.

0 Kudos
Message 4 of 21
(4,263 Views)

@reggie2016 wrote:

Thanks sorry for the late reply had a lot of test last week. I have enocuntered a new problem when i run my vi.


What's the new problem specifically?

 

Just looking at the code, I can guess.

  • You are sampling at 1kHz and trying to write 324000 data points. This will take 324 seconds to output... Lower this to how long you would actually like to output.
  • You are set to Continuout output. This will make the timeout never occur because it will wait for you to Stop. Change this to Finite if you want to just output the waveform then stop.
  • Since you set the sample rate at 1000Hz when you configure the task, use that numeric instead of reading the clock rate property node.
  • Your output limits are set to 0 and 0.02, but I think that Sine wave waveform will include negative values, which will throw an error.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 5 of 21
(4,257 Views)

Attempted writing analog data that is too large or too small. Change Minimum Value and Maximum Value to reflect the range of the channel. this is the error im getting.

0 Kudos
Message 6 of 21
(4,215 Views)

Right, so in my last reply, I said that the sine wave is going to give you negative values (because it's a sine wave) and your output limits can't handle that. Shift the sine wave, or something.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 7 of 21
(4,206 Views)

Yes I switched it to a square wave and it still gives me the same error.

0 Kudos
Message 8 of 21
(4,200 Views)

Reggie, my man, a sine wave and a square wave both have negative values.

 

Does your module allow positive and negative output? If so, just change your limits to allow negative. Otherwise, shift your sine or square wave so that no negative values are attempted output.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 9 of 21
(4,192 Views)

i forgot i switched from the step function sorry haha. so what you are saying is to switch the range of the channel to reflect positive and negative channels.

0 Kudos
Message 10 of 21
(4,182 Views)