03-09-2018 11:02 AM
Hello guys
I am currently making a PIV system but I need the VI to run according to an external TTL signal.
I need my program to fire an LED for a number of pulses during the high time of the input TTL and not to fire during the low time of the input TTL. I am using an arudino to provide the input TTL.
My code is attached.
Thanks in Advance
03-12-2018
08:04 AM
- last edited on
01-08-2024
02:50 PM
by
migration-bot
Hi shab.yaq,
To me it looks like you are looking for retriggerable DAQmx tasks: Retriggerable Tasks in NI-DAQmx. Each time your DAQ hardware receives the external TTL trigger it will fire the pulses you defined.
Is this what you need? Or do you want the PIV images to be taken as long as your input TTL is "high", so to say use it as an on/off switch?
03-12-2018 11:51 AM
Hi ikaiser,
Sort of. The camera is just activated by TTL and begins to fire according to the settings set on its software. However, the VI is controlling the laser. I want the laser to turn on and off according to the TTL high/low time.
I was trying use a case structure, it activates when the signal is high but then just continues to run until the VI is stopped.
03-13-2018
03:24 AM
- last edited on
01-08-2024
02:50 PM
by
migration-bot
I think what you need is the Digital Pause Trigger as described in chapter F and G here: NI-DAQmx Data Acquisition Triggering Techniques Using LabVIEW
I am still not sure if this is what you mean with "I want the laser to turn on and off according to the TTL high/low time". Is this what you want to achieve?
Digital Pause Trigger triggers Pulsetrain TTL: 0000011111000000111110000011111111110000 LASER: 0000010101000000101010000010101010100000
03-13-2018 06:07 AM
Hello,
Yes this is what I require exactly. I have the mydaq nielvis which has only one counter. How can I achieve this with one counter?
03-13-2018 07:22 AM
I didn't know the myDAQ (had to google it) but I think it should work. You don't need more than one counter. You use a counter to generate a PWM signal to for the laser (like in your VI) and just set it to be triggered.
I included the code from the example linked in my last post into your VI. Find it attached. I have no idea though if it really works as I cannot test it, but you can give it a try.
03-14-2018 09:06 AM
The pause trigger property node doesn't work. It says that its contains a bad terminal or unwired property?
03-14-2018 09:28 AM
Maybe the myDAQ does not support it? As I wrote before I had no chance to test it.
What version of LabVIEW are you using? I saved the VI in 2017 SP1, so maybe it is just a version issue.
Btw, I just opened your VI again and noticed a possible issue with the wiring of your stop button. Will your inner loop ever stop? To me it seems that it never checks the current value of the stop button.
03-14-2018 12:13 PM
The trigger node doesn't seem like a good option so I cant get it to work.
I'm not sure regarding the stop button but Ive changed my VI.
Would you say this would do as I require?
03-19-2018 03:03 AM
Could do, but isn't perfect. There are two caveats I want to make you aware of:
1) You are checking for your trigger in your loop by reading a sample repeatedly. If the trigger pulse is too short or you looptime too long (might happen for some loops on Windows) you could miss the trigger. Won't happen with the hardware trigger (if you can make it work)
2) In the true case you set up the task first and then start it. Setting it up takes some time, to the task does not start immediately. You could set up the task outside of the checking loop and then only have to start it after the trigger. This will lower your delay between the trigger pulse and the start of your output.
(And your outer loop does not do anything, just in case you did not notice)