‎04-12-2023 09:29 PM
I am trying to generate a TTL signal to trigger some device. Currently I am using the following code to generate and output the square wave. However, I do not have an oscilloscope to observe the actual waveform and if I were to use a multimeter to measure the output, I can only see the last value. Is there any way to verify the output waveform is actually what I wanted?
 
Solved! Go to Solution.
‎04-12-2023 10:07 PM
Not really, you need some sort of oscilloscope, you can connect the AO to a headset or speaker to hear the signal generated.
‎04-12-2023 10:36 PM
I do not have the components to construct circuit as well... However, does the attached code generate a voltage that goes from 0V to 2V and back to 0V?
‎04-13-2023 07:06 AM
If you are using a DAQ with an Analog Input, you could use that to measure your signal.
‎04-13-2023 10:40 PM
What DAQ device are you using?
It's usually better to use a digital output or a counter output when connecting to something that needs TTL. But not all devices give yo good options there, so sometimes you might be stuck hoping for the best with AO.
That said, you seem to be trying to generate a square wave signal that transitions between 0 and 2 volts. IIRC, 2 volts is still in no-man's land for TTL. Just going from very old memory, but what I recall is that 0-0.8 V is guaranteed low, 2.4-5.0 volts is guaranteed high, anything between 0.8 and 2.4 gives no guarantees at all.
If I had to use AO, I'd be aiming for 0 to 5 volt transitions. That'd mean a 2.5 V offset and amplitude.
-Kevin P
‎04-13-2023 11:18 PM
I am using the DAQ card from NI and it has a Analog input. I tried that but I don't know how to measure that. Attached is my attempt. Its seems that when I try to send the signal, only the case structure is executed so the measurement outside is stopped.
'0-0.8 V is guaranteed low, 2.4-5.0 volts is guaranteed high, anything between 0.8 and 2.4 gives no guarantees at all.' Yes I read that somewhere but don't understand what that means. My device requires 1.8V or 3.3V to trigger. Why is digital output inferior to the other 2? I don't understand the differences between these outputs
‎04-13-2023 11:40 PM
@Jaywai wrote:
I am using the DAQ card from NI and it has a Analog input. I tried that but I don't know how to measure that. Attached is my attempt. Its seems that when I try to send the signal, only the case structure is executed so the measurement outside is stopped.
'0-0.8 V is guaranteed low, 2.4-5.0 volts is guaranteed high, anything between 0.8 and 2.4 gives no guarantees at all.' Yes I read that somewhere but don't understand what that means. My device requires 1.8V or 3.3V to trigger. Why is digital output inferior to the other 2? I don't understand the differences between these outputs
NI has a lot of DAQ card historically, which exact model?
‎04-14-2023 01:15 AM
I am using the USB 6341 card
‎04-14-2023 09:48 AM
The 6341 is a very flexible and capable device.
I'd very highly recommend that you start exploring and learning from the shipping examples for AO and AI. Open up one of each and you can easily experiment with different AO waveformss while observing what you capture with AI. Then look over the code to see how things are configured.
If you're inclined to tinker with the code, do *NOT* save on top of the original example. Save as a copy into a folder of your own choosing, preferably with a file name change to help show that it's no longer the original example.
-Kevin P
‎04-14-2023 08:33 PM
Do you mean the examples in the labview software? I actually wrote the above code based on that. The card can acquire and generate signal at the same time? My problem is that in my code I am always acquiring voltage and once I generate a signal, the case structure is executed. When that happens, the acquiring stops for a moment but this is exactly the period I need to see the signal.