LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

98% duty cycle on NI myDAQ using LabVIEW?

Solved!
Go to solution

I'm trying to output a square wave with frequency 100Hz and a duty cycle of 98% but when I do this with labview I just read a flat 5v's and don't see any edges. I can output the square wave using NI ELVIS(and having it work) so I figure it should be doable with labview. Any sudjestions on how to make this work would be great thanks. I will atach my vi file.

0 Kudos
Message 1 of 11
(8,114 Views)

Your attached VI shows a DAQ Assistant with no input device wired.  Are you not using the NI ELVISmx library for your myDAQ device?

 

Bob Schor

0 Kudos
Message 2 of 11
(8,072 Views)

Uhmmmmm...Smiley Embarassed

you have a 1000 sample per second task with 100 samples being written.

 

Lets just check this box and make it a bit simpler:

Capture.PNG


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 11
(8,065 Views)

Alright I have the box checked now.

0 Kudos
Message 4 of 11
(8,058 Views)

I'm using an external oscilloscope to measure the output and I belive I'm using the NI ELVIS mx libary.

0 Kudos
Message 5 of 11
(8,056 Views)

When you enter the duty cycle, be sure and enter it as 0.98, not 98.  You can add a Waveform Graph indicator and you can see what the signal out should look like.

0 Kudos
Message 6 of 11
(8,044 Views)

Alright I tried the .98 and put it on the graph this is what I get.

0 Kudos
Message 7 of 11
(8,038 Views)

If this would be easyier to do using a digital output I would be open to that method aswell.

0 Kudos
Message 8 of 11
(8,035 Views)

Something is clearly wrong.  What happens if you use 0.5 and 50?  Do either of them look like 50%?  If so, that tells you where the decimal point goes.  Then you can try 75%, 85%, 90% to see where it breaks down.  When you have the answers, post them, along with your current code (please post the VI, not a picture).

 

Bob Schor

0 Kudos
Message 9 of 11
(8,021 Views)

Okay so I have something that appears to work but I feel as theres probably a more elegent way of preforming it 

2ms edge.png

here is the output.

0 Kudos
Message 10 of 11
(8,017 Views)