LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Square Wave on digital out card

Solved!
Go to solution

I want to have a simple square wave (50% duty cycle - doesnt need to change) to be output on a digital IO labview card.

 

My problem: 9472 and a 9403 are the cards I have. When I run my SquareWave VI (attached), I cannot get the frequency to high enough. For example, the 9472 card is accurate up until 25 hertz. I have verified this on a oscilliscope and once I turn the frequency past 25Hz on the VI, the card seems to max out and will not output anything faster than 25Hz. Also, for the 9403 the same thing happens, except that the 9403 card seems to have a frequency limit of around 11Hz. Again, from 1-11Hz the card is very accurate with what my VI is set at, but when I turn the VI above 11Hz, the card seems maxed and just remains at 11Hz. 

 

I am looking to get up to 500-600Hz range. 

 

What is causing my cards to be limited at those frequencies? How can I increase the frequenies they output to around 500-600 Hz? 

 

Thanks!

0 Kudos
Message 1 of 10
(3,262 Views)

For testing purposes, I added a counter to the loop and removed to the DAQ assistant. I then ran the VI and double checked that the counter was actually counting at the correct rate. It was, meaning that the issue is either the DAQ assistant, or the cards.

0 Kudos
Message 2 of 10
(3,238 Views)
Solution
Accepted by topic author g_e_m_i_n_i

The 9472 is a software-timed module. You will never get 500-6000 Hz out of it. When used in an NI CompactDAQ chassis, the NI 9403 can be used as only a static (software-timed), so it has the same problem. 

Message 3 of 10
(3,231 Views)

Could you tell me what to look for in the datasheets so I can tell if a card is software timed vs hardware timed? (I cant seem to find this info in the specifications or datasheet page for either the 9403 or the 9472).

 

This way I can figure out which new card to buy and verify that I do actually need a new card.

 

Thank you!

0 Kudos
Message 4 of 10
(3,223 Views)

Also, shouldn't I be able to get more than 25Hz? According to this article windows (im using XP) should be accurate to 1ms, meaning that I can switch 1,000 times a second so 500Hz for the whole square wave?

0 Kudos
Message 5 of 10
(3,214 Views)

Apoligies, the software/hardware timed info is in the "Overview" - I can't read sometime 😛 

 

Reguardless of that, I still dont understand how the frequencies can be so low 11Hz and 25Hz for the cards. 

 

Again, Thanks!

0 Kudos
Message 6 of 10
(3,207 Views)

The specs here under the Digital show 'Software' for the timing.

 

The windows timing resolution has nothing at all to do with writing one value at a time to your hardware. There's a basic limitation of that. You are also using the DAQ Assistant and that is slower than using the DAQmx calls directly. A single DAQmx Write is pretty simple to do. Try that and see if you get much improvement.

Message 7 of 10
(3,204 Views)

Thank you Dennis, I found it!

 

I'll try replacing my DAQ Assistant with a DAQmx Write when I get time. I'll reply back with the results of that when I get it done! Thanks. 

0 Kudos
Message 8 of 10
(3,197 Views)

Now the card maxes out at roughly 260Hz. I switched the DAQ assistant for a DAQmx write. Is that a good speed to expect? The cards clock freq. is 10kHz so 250Hz still seems pretty low, but is definitely better. 

 

Also, every 41ms, the pulse of my square wave is slightly wider than the others and this repeats. Is that something to do with software timing / OS issue? (using xp)

0 Kudos
Message 9 of 10
(3,166 Views)

The cards' analog clock frequency is irrelevant. Software timing is dependent on the os and the pc. Jitter is expected.

0 Kudos
Message 10 of 10
(3,155 Views)