11-12-2019 11:01 AM
Hello,
I have a setup driven by a sawtooth wave of very low frequency (0.005 Hz). This is to ramp an electromagnet up and down. This is my primary siganl and the other signal is a pure dc voltage signal taken from from 4-point-probe measurement. I connected the first siganl the analog input (port AI0) of a USB DAQ (NI 6341) and the other siganl to port AI1 in the same DAQ. The code was giving an error 50103 but I moved the error notifier out of the while-loop and this helps.
Howerver, the code is not working properly and I need help to acquire the two signals and plot them in an XYgraph. The code is attached with this message.
Thank you
Hadi
11-12-2019 12:29 PM - edited 11-12-2019 12:30 PM
Your code makes no sense. Create a task with both channels and one single read operation. You are reading Nchan, 1 sample where N-1 for each train. If you want to read both samples, N=2 and the array contains a single reading form each channel, one for X and one for Y. Convert that to a single complex scalar and build it up into an array of data in a shift register. You can connect the complex array directly to the xy graph terminal.
Don't clear the task at each iteration (Why would you do that???).
11-13-2019 07:36 AM
Hello Altenbach
Thank you so much for your comments. I tried to alter my code and here it is attached with my reply. The code is working without error but with no display or progression for the XY plot. I don't know about how to implement shift registers correctly. Therefore I need some help or guidance to do that.
Thank you
Hadi
11-13-2019 08:47 AM - edited 11-13-2019 08:53 AM
Ouch. That is actually worse. I don't know which of Altenbach's comments you actually tried.
Two channels. One task. See below. A better concept would be to set up continuous sample and acquire multiple samples at the rate the card is set for.

11-13-2019 10:11 AM
Thanks. How do you combine two-channel inputs in the same task? I tried but I couldn't.
11-13-2019 10:34 AM
Click the drop down on the constant. Click Browse.... You get a dialog where you can select multiple channels. (use Control and Shift as necessary.)