04-13-2011 10:10 AM
This should be simple, but I can not seem to figure it out.
I am using a signal generator to generate a 1KHz 5Vpp (0 - 5V) signal and send it to an NI USB-6008 digital input. I want to log and view this signal.
I use DAQmx Acquire, Continuous samples, 10K samples to read, 10K sample rate. I assume this should give me a signal that looks somewhat like 10 samples low and then 10 samples high, and that the buffer should be refreshed every second.
What I get are samples that range from three samples high and three samples low to one sample high and one sample low and they are not consistent. At the very least I would expect a 50% duty cycle (as that is what I am putting in). By sampling at 10K (10 x the sampled signal) I thought there should be no problems... I even tried sampling at 100k but the results are much the same.
When I move the signal to an analog channel, it looks fine or if I tie an analog channel and a digital channel together, the analog channel looks as I would expect.
As I am new to this program, I expect I am just setting something up incorrectly, but I am having a hard time figuring out what. Any help would be greatly appreciated.
I have attached a text file of the output for reference.
Kind Regards,
Jeff
04-14-2011 05:49 PM
Hi Jeff,
I have a few questions for you. First of all, when you say you move the signal to an analog channel, or if you tie an analog channel and a digital channel together, are you talking about the analog and digital input lines? What exactly do you mean by "tying" the two together, and what do you see? If you can, post screenshots of the signal you are seeing for these cases so we can see what you're seeing. Thanks!
04-14-2011 06:00 PM
When I move the signal to an analog channel I simply mean I disconnect it from a digital input and move it to an analog input, then set up the analog channel at a 5 Khz sample rate. By tying them together, I simply jumper the digital input to the analog input and view both on screen. I get a lot of slewing on the analog display but the timing looks right. I will post screen shots tomorrow when I get back to work so you can see exactly what I mean.
Thanks,
Jeff
04-15-2011 06:08 AM
Please find attached a screenshot of my desktop. The input is a 5Vpp 50% duty cycle 1 KHz square wave. It is connected to Digital Port 0 line 1 and Analog input line 0.
The top waveform is the analog input sampled at 5 KHz with 5k samples to read. As you can see each cycle is 1 mSec which is what I would expect.
The second waveform is the digital input sampled at 5 Khz with 5k samples to read. Here you can see the inconsistency in the waveforms. I would expect these to be 5 samples low and then 5 samples high but that is not what I am getting and I can not figure out why.
The bottom waveform is simply a power spectrum derived from the analog channel to see if there are any harmonics, etc.
Thanks,
Jeff
04-15-2011 11:41 AM
Ooops... that would be 5 samples high and 5 samples low at 10Khz... At 5 Khz, there would be 2.5 high and 2.5 low so in reality 2 or 3 low then 3 or 2 high.
04-18-2011 06:20 AM
Hi Jeff,
I assume the signals you are referring to are the Digital - Radar and Digital - LF WSS? Also, what ports and line number do you have these connected to? Are they each supposed to be the same signal? How is your Digital Line Input task configured? Thanks!
04-18-2011 06:29 AM
Yes those are the correct signals plus the signal on top... They are all the same signal, just sent to different ports. The digital ports are Port 0 Line 1 (Radar) and port 0 line 3 (LF WSS). The analog channel is ai0. The setup for the signals is as I have written above.
Thanks,
Jeff
04-19-2011 04:37 PM
Hi Jeff,
Have you attempted to use port 1's lines on the card to ensure that the port is not malfunctioning? Also, for clarification, you said you're using a USB 6008 but on the screenshot it says that in fact you are using a USB 6009? Also, nice synth setup! Is that how you are generating the signal? Thanks!
04-20-2011 08:17 AM
I have tried the other port with the same results.
You are right it is a USB-6009.
As for the synths, modular / analog synths are a hobby of mine but the signal is coming from a Tektronix AFG3022 Arbitrary waveform generator.
Any other ideas? This is really getting frustrating.
Jeff
04-21-2011 04:29 PM
Hi Jeff,
In looking further at your waveform, it looks like the signal is not rising fast enough to be recognized as a digital signal. For transistor-transistor logic, there is a requirement of no greater than 50 ns of rise and fall time in order for the signal to be read as a digital signal. I have attached a link to a KnowledgeBase article that describes this, as well. Hope this helps!
What Is the Definition of a TTL (Transistor-Transistor Logic) Compatible Signal?