LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Two channels reading same value

Platform : WIN_XP Pro.
LV Version : 7.1
Card : PCMCIA 6024E  or PCI M6221
 
Problem : When I run the enclosed data logger, both channels ( AI0 and AI1 ) plot the same values as appearing in AI0  The sampling rate is at 2.5kHz and each channel is the average of 125 samples once every 50mS approx.
 
So whats wrong with the code ?
 
Thanks
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 1 of 5
(2,996 Views)

Hi Raghunathan,

I looked at your VI. I think the problem lies in your AI_Setup.vi. If you look at the physical channels input on the Front Panel, it only lists AI0 even though you've selected AI0 & AI1 from the main vi. You'll need to change that input (if you can, the block diagram is locked).

Regards,

Hillary E
National Instruments
0 Kudos
Message 2 of 5
(2,969 Views)

Hello Hillary,

Yes I understand. But then even if the AI_Setup.vi is configured for only 1 channel, I guess when I call this sub vi in the Main and write new values to the inputs, then th new values will prevail ?

Or am I missing out something basic here ? Of course I can try out your suggestion today.

Sorry the AI_Setup.vi was blocked. I have attached the zip file after removing the password block.

 

Regards

 

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 3 of 5
(2,957 Views)

Raghunathan,

What is your output from the AI Read & Mean  VI? Isn't your output an array of 2 values (one for Channel 1 and one for Channel 2)? I think this might be the root cause of the problem. If you remove the rest of your program (and just have the Analog Setup and AI Read) are you seeing the output you'd expect to see? Perhaps you need to separate the values from the array to then plot them.

Regards,

Hillary E
National Instruments
0 Kudos
Message 4 of 5
(2,940 Views)

Hi Hilary,

The issue is now resolved. Immediatley after my Read_Mean.vi I had configured a Filter Express VI to smooth out the signals. This was configured as "Moving Average - Rectangular - Half Width of Moving Average = 30 ".

This filter did the following things to my signals :

1. All step changes were converted to ramps of about 1.5 sec.

2. When A0 was reading 5V , if I grounded A1 then both read 2.5V

Though I have found the reason I do not know how the above happen ? Could you throw some light ?

Thanks.

 

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 5 of 5
(2,918 Views)