LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Analogic input data switched between channels

Hello,

 

I am facing strange problem - I collect data with PCI 6221 DAQ Card (I read two analogic inputs at the same time, samples are being acquired due to fast counter input to which encoder is connected).

What happens from time to time is that signals are switched between two analogic inputs - I confirmed it by adding constant offset of the voltage from the device that generates analogic signals.

 

The biggest trouble is that it happens not in a regular way, so its hard to diagnose - I would really appreciate information if issue is rather software or hardware connected.

I attached VI's responsible for the data acquisition - I save data to global variables which are then respresented at GUI.

 

Thank you for any support.

 

BR,

Pawel

Download All
0 Kudos
Message 1 of 4
(2,978 Views)

Hi Pawel,

 

you need to debug your code: where are those data switched? Are they switched right after DAQmxRead, are they switch when writing to your global variables, are they switched when displaying them in your GUI?

 

Beside of this your subVI might also look like this:

check.png

No need to check array sizes or use more than just one IndexArray node…

 

General hints:

- You should set a "number of samples" at DAQmxRead. Relying on some jittering loop timing isn't the best approach…

- There are better ways to handle data than global variables: FGVs aka AEs, notifiers, queues…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,965 Views)

Hello,

 

Thank you for your hints.

 

I don't want to set the number of samples, because their number is determined by encoder resolution - we are acquiring profile of the product by rotating it with servodrive, and we wan't to get sampels in the equal angle positions (so we sample at signal rise of encoder).

 

OK I agree that global variables may not be the best solution to handle data, but I don't that it is possible that two global arrays are switched for some unexplainable reason?

First I noticed this at GUI, later I was checking global variables Profile1 and Profile2, so I think that data is switched right after DAQmxRead.

 

What is also strange is that it never happens during the product profile reading - always between cycles. I am considering that our measurement device is corrupted (at least its analogic outputs), but for I can't prove it without oscilloscope, and I am trying to rule out any software or NI hardware issue.

 

Thank you for suggestions, I will study on different ways to handle data.

 

BR,

Pawel

0 Kudos
Message 3 of 4
(2,958 Views)

Hello,

 

I think the problem is described here:

http://digital.ni.com/public.nsf/allkb/73CB0FB296814E2286256FFD00028DDF

 

BR

0 Kudos
Message 4 of 4
(2,942 Views)