06-06-2019 11:27 AM
I'm very new to LabVIEW. I have been working with Thorlabs Kinesis control with Matlab, and the support and functionality is poor. My experimental setup is as follows: Computer is connected to an NI USB-6363 and Thorlabs KDC101 K-cube controller via USB. A Phantom high speed camera is connected to the computer via Ethernet. A Futek load cell and signal conditioner/amplifier is BNC connected to the analog input on the NI DAQ. I have a BNC cable connected to two analog outputs on the NI DAQ, one for the Thorlabs trigger and one for the Phantom camera trigger.
I would like to output a 5V analog signal (AO0) to trigger the Thorlabs control to start the program I have written (attached). The Thorlabs LabVIEW tutorial is great, that part is fine. I'd also like to output another analog 5V signal (AO1) to trigger the camera to record.
While this is happening i'd like to also record an analog voltage input into AI0.
I'd like to record the analog input signal for 10 s (specifying number of samples and/or sample rate), time delay the trigger for the Thorlabs by 1 second, and time delay the triggering for the phantom camera by 2 seconds. I have found plenty of basic tutorials to complete each part of this process separately, but i'm at a loss for how to have all of these signals playing together in one synchronized code (due to my complete and utter lack of experience). Any advice that you can offer would be incredibly helpful.
Thank you!
06-06-2019 11:36 AM
We prefer looking at code, not pictures, especially if all labels are just generic and there is no way to tell which part does what. Could you at least add some diagram comments explaining the purpose of the main sections?
(The flat sequence in the thorlabs code is completely unnecessary and just clutters the diagram. Execution order would be identical without it)
06-06-2019 12:18 PM
Thanks @altenbach, I've attached the vi here. It is a conglomeration of examples that I found searching online. The Thorlabs code is verbatim what they had in their tutorial code.
06-06-2019 12:29 PM
Go to Help -> Find Examples and look for the Hardware Input/Output, then DAQmx section. There are some good examples in there you can follow.
06-06-2019 12:51 PM
@BertMcMahan wrote:
Go to Help -> Find Examples and look for the Hardware Input/Output, then DAQmx section. There are some good examples in there you can follow.
That's where I got what I currently have in the vi that I attached. Just examples from DAQmx help
06-06-2019 01:00 PM - edited 06-06-2019 01:01 PM
Try the example "Analog Input- Voltage and Thermocouple in a Single Task" under Synchronization. It will show you how to do multiple channels in a single AI task, but the process is the same for AO tasks.
One thing to keep in mind, you will need to make one multichannel AO task, not multiple single channel AO tasks. They will all start at the same time, so if you want one to go to 5V after 1 second, you'll need 1 second worth of 0V outputs in your waveform on that channel.
Also take a look at Analog Input- Synchronization. That shows how to do multiple AI on two devices, but it's similar to how you do synchronized AI and AO on the same device. Instead of doing two AI, repeat the pattern but using one AI and one AO.
06-06-2019 01:09 PM
@Microburn12 wrote:
The Thorlabs code is verbatim what they had in their tutorial code.
Sorry, not near a computer, but that does not surprise me. Also a sgl indicator connected to a dbl wire hurts my eyes. 🙂
06-06-2019 01:17 PM - edited 06-06-2019 01:18 PM
Examples for coordinated DAQmx code have already been suggested, so I'll address a different part of your question...
Why analog output? Based on a quick search, you have lots of available Digital IO connections. Is it just for the ease of wiring to BNC?
Of course the analog output will work, but for triggering you might find digital lines easier to manipulate.
I'm also interested to hear how you go on with your load cell.