11-29-2016 08:41 PM
I have two digital input signals, let's call them IN_0 and IN_1. I would like to create a digital output signal, OUT_0, using the USB-6343 DAQ that basically sends a pulse when IN_0 = LOW and IN_1 = HIGH. In other words, it should generally perform the function:
OUT_0 = !IN_0 && IN_1
What are the different ways to implement this using the DAQ? Is it possible to do this without involving the CPU? I am new to using DAQs so would love if someone could point me in the right direction. Thanks so much!
11-29-2016 08:46 PM
Let me just add that IN_0 and IN_1 are both just signals that can either each be HIGH or LOW.
11-30-2016 06:03 AM
airoll wrote: Is it possible to do this without involving the CPU?
Not unless you get an R series board, which you program an FPGA to do the logic.
With your board, you are just going to have to read the two digital lines, perform your logic, and write to your digital output. There is nothing complicated here.
What language are you using to do this task?
11-30-2016 06:14 AM
Or use two NANDs of a single discrete logic and use hard wires ??
With a DIP housing no PCB is needed .. use two 5Ohm resistors to power and GND, add a 100nF buffer cap at the chip 🙂
(and wire the unused inputs to GND 😉 )
11-30-2016 11:37 AM
Thanks for the suggestions. Let me ask a quick follow-up question. Say if I have one digital input, say IN_2, and I want to generate a digital output OUT_1 that continually pulses at 1 kHz when IN_2 is HIGH, will that require the CPU as well?
As for the language, I am using LabVIEW on Windows. If we do the use DAQ and the CPU, then how do we ensure that it won't effectively drop any pulses? Do we need to dedicate a CPU thread to it? How would we do that? Thank you for all your help.
11-30-2016 12:15 PM
@airoll wrote:
Thanks for the suggestions. Let me ask a quick follow-up question. Say if I have one digital input, say IN_2, and I want to generate a digital output OUT_1 that continually pulses at 1 kHz when IN_2 is HIGH, will that require the CPU as well?
How accurate of a 1kHz do you need? How quickly do you need the pulses to stop when the input goes low?
What I would do is use a counter output to generate your pulses and then use external circuitry to AND the pulses with your enable line.
11-30-2016 03:49 PM
If we generate our pulses using a counter output, how accurate is it? Additionally, we want to use the rising edge of the digital input (IN_2) to trigger generating the pulses. The pulses should stop immediately when the digital input is zero.
12-01-2016 05:58 AM
@airoll wrote:
If we generate our pulses using a counter output, how accurate is it? Additionally, we want to use the rising edge of the digital input (IN_2) to trigger generating the pulses. The pulses should stop immediately when the digital input is zero.
The counter is quite accurate. You just tell it to generate a clock with F frequency and X duty cycle. And the logic you are describing is exactly and AND. Use an external circuit (1 chip, possibly a seperate power supply, need to check the DAQ specs to verify if it has a +5V supply). It will make your life a lot easier.
12-01-2016 06:58 AM
one or two transistors (&1-2 R) should do the job to tie the counter output down 🙂