05-08-2017 11:28 AM
Hi, I have a PCIe-6323 and I want it to generates outputs on two analog outputs, on the Nth falling edge of the input signal. Each analog channel has a pre-defined array of values, and each analog output is the next value in the array.
Is this doable? Is there a similar VI that I can start with?
05-08-2017 11:38 AM
Sure. You've provided no code of your own, so it is difficult to guess what level of LabVIEW Experience you have, what you may or may not know about DAQmx, what version of LabVIEW you are using, etc.
Your device has Counter/Timers that can detect edges (and I presume you know how to make something that can "Count to N in a cyclic manner", meaning it repeats when it gets to N). Have you thought (not in LabVIEW, but in "Pencil and Paper") what your various Tasks should be? Whether you have, perhaps, independent tasks? Do you know about using Data Flow to manage simultaneously-executing independent Tasks (a.k.a. Parallel Execution)? Have you heard about the Producer/Consumer Design Pattern?
Bob Schor
05-08-2017 01:08 PM
This is a starting point which assumes that the external camera flash signal is digital TTL (and thus usable as an external clock.) The basic idea is to treat that signal as a "timebase" signal and configure the AO task to divide it down into a sample clock.
It ran as shown without error on a 6341 device.
-Kevin P
05-08-2017 01:13 PM
I have created couple NI programs running on this PCIe-6323 board a while ago using NI-DAQmx in C. I wanted to switch to VI and see if that'd make things easier since there seems to be more discussions and resources around. LabView 2015 is installed, but I can get 2016 if needed.
I am not very familiar with the "task" concept in NI. The two analog outputs have independent output values, but their timings are the same, so I should create one task of two outputs?
To my understanding, in the producer/consumer design pattern, there is a queue/buffer in the middle, and producer'd focus on putting jobs into the queue and consumer'd take jobs out of the queue, and they work independently in terms of timings.
I have no experience with LabView and don't know what component are there and how flexible they are. But from a very high level point of view, I will have three main components, camera signal, counter, and counter output. Camera signal is the input to the counter. The counter is a N cyclic counter as you mentioned. Each time a falling edge comes in, the counter increases. When it reaches N, it'd send outputs signals (two in my case) and reset counter back to 1. I need to configure those output values so they are from a pre-determined array.
05-08-2017 01:16 PM
Thanks Kevin! I'll start from your design.
05-08-2017 02:15 PM
Here's the same snippet after saving back to LV 2013, same functions but easier to work with from LV 2015:
-Kevin P
06-06-2017 12:20 PM
Kevin, your example helps a lot.
You use a "Divisor" to determine the actually frequency of the master clock, and all the outputs follow it.
Now I have an additional AO channel for output and I want it to synchronize with the master clock too but two times slower, that's output on every 2nd rising/falling edge. Is there a way to do that?
06-14-2017 01:12 PM
1. No*, but...
2. You can just add that other AO channel to the same task and generate 2 samples of every output value at the 2x higher rate. It'll have the same effect.
-Kevin P
*Most (if not all?) NI multifunction DAQ boards only allow one hardware-timed task for the entire AO subsystem. You can't clock out two different channels at two different rates with two separate tasks. You have to put all the channels into one task and define appropriate "oversampling" for the slower-changing channels.