05-19-2022 03:54 PM
I am relatively new to writing Labview code, and not experienced at all in interfacing with instruments. I have a cDAQ-9174 with an NI9421 Digital Input card and a NI9229 card. I am attempting to read the phase -phase voltage of a rotating BLDC and the Hall Sensors installed in the perimeter. Then correlate the zero transitions of the phase voltages to the corresponding Hall Sensor transitions.
I have used the DAQ Assistant VI (two of them ) to read the Signals , and I can output them on separate graphs. I can also output the Digital Signals to separate graph .
I can convert the Analog Signal DDT to an array , but haven't determined how to extract the Digital Signals from their Digital Waveform append them to the array of analog values. And they need to be correlated to the correct sample times.
Is it possible to read two separate instruments on the same DAQ Assistant so that they are sampled simultaneously? And if so, can the data from each be output in the same DDT so I can create a complete 2D array with the samples correlated to columns, with three Analog columns and three digital columns? All of which row entries are sampled at the same time? Can the cDAQ - 9174 supply a single sample clock and trigger for the DI and Analog Cards? The DAQ Assistant doesn't show a Sample Clock input.
If I can get the Digital and Analog measurements sampled simultaneously, is there a function to combine the data into a single array?
Sorry this are all basic questions, but I haven't designed with Labview before
05-19-2022 05:25 PM
Only have time for some basic answers.
1. Start by looking at shipping examples for AI and DI that use regular DAQmx functions instead of the DAQ Assistant. The DAQ Assistant cannot help you accomplish sync across different task types (AI and DI).
2. Your 9229 is special in that it induces a delay between the real world signal and A/D conversion. You'll have to compensate for this delay when you align your AI and DI data.
3. Your best bet for sync is to consider the 9229 AI to be your master task. Export its sample clock out for the DI task to use as its own sample clock. Then be sure to start the DI task before the AI task.
Sorry, no time for more details now, just some keywords and breadcrumbs...
-Kevin P