Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

USB 6501 Square Waveform

Solved!
Go to solution

Hello everyone,

 

I WOULD REALLY APPRECIATE if someone could help me with the following issue:

 

I am using the NI USB 6501 board for a DIO application. I would like to be able to output a digital square waveform of about 1 or 2 Hz so that I can use it as an INPUT to an AND gate. The square wave form does NOT have to be perfect, as long as it is close to 1-2 Hz and the duty cycle is close to 50%, it's OKAY!

 

The AND gate has 2 inputs: the square wave is one and a Boolean control on the front panel will be the other one (i.e. the user can change it anytime). FOR EXAMPLE, if the the user sets the Boolean control on the front panel to a logic "1", the output of the AND gate should be the same as the other input, which is the square wave. On the other hand, if the Boolean control is set to a logic "0", the output of the AND gate will be "0" all the time. I would also like to display the 2 inputs and 1 output on a Digital Waveform Graph as a function of time.

 

The attached VI has ALL the connections already in a loop (with everything labeled) except for the square wave and graph. THANK YOU IN ADVANCE!!!

0 Kudos
Message 1 of 6
(5,144 Views)
Solution
Accepted by topic author Argon
Try this simple example.
Message 2 of 6
(5,136 Views)

Dennis,

 

Thank you SO much for your fast reply. It is EXACTLY what I needed!!! 

0 Kudos
Message 3 of 6
(5,106 Views)

Dennis,

 

Can you create a Mex file for this example?

0 Kudos
Message 4 of 6
(4,388 Views)

I have no idea what a Mex file is or how to create one.

0 Kudos
Message 5 of 6
(4,384 Views)

I mean a Mex function ..which can be used in Matlab.

0 Kudos
Message 6 of 6
(4,381 Views)