LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array or Daqmx causing the issue?....or just me

Solved!
Go to solution

Hi, Hope all is well. I have an issue with a vi that i was trying to write that read voltages into a MyDaq on ai0 and ai1. I thought it was working as i had connected a battery pack connected to both ai0 and ai1 that read in the 3 volts, it wasn't until i disconnected the ai1 voltage that i realised there was still a voltage being shown on ai1, after trying rewriting using daq assistant i keep getting the same issue i always get a voltage showing on both inputs. This is the first time ive tried using the myDaq for multiple input voltage(im looking to set up a ldr circuit on each input and detect if two leds are on). Could someone check please if im using the array wrong or if im just not setting up multiple channels correctly. Any help will be greatly appreciated.

0 Kudos
Message 1 of 10
(1,083 Views)

Is the voltage showing even after you disconnected the battery? And you want to read zero when disconnected, but you are reading some value. is that right?

I just want to understand your issue.

 

 

0 Kudos
Message 2 of 10
(1,080 Views)

Thanks for the quick reply, when i have the battery connected to just aio im getting a reading from the vi on both aio and ai1 even though there is no physical wiring now to ai1,initially i had both ai0 and ai1 connected to the battery and assumed everything was ok , buit now there is only aio connected but the vi is showing a reading ai1.

So i thought either im not setting multiple channels correctly and just reading of the one or i havent set the array up and am getting the same result on both indicators.....hope im making sense

0 Kudos
Message 3 of 10
(1,076 Views)

Those channels are multiplexed. When you leave the input open but include it in a scan the channel will usually read whatever voltage was read on the previous channel because there is no current path to discharge the tiny parasitic capacitance on the analog input of the AD converter directly behind the multiplexer. Try to shorten the open input to GND and it should read the 0V you were expecting.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 10
(1,055 Views)

Hi Rolf, i just tried that . I shorted agnd to 1+ and 1- and im still seeing the 3v that im inputting to only 0+ 0- (0- is shorted to agnd)

 

thanks

0 Kudos
Message 5 of 10
(1,048 Views)

I am surprised that it's still reading 3V even when you short it to GND. Now I am curious to see how you wired it. Can you share it sketch? And What NI device are you using?

Can you check that voltage with a multimeter? Just check if 3V is really 3V. 

If your multimeter is not reading 3V or if it's reading around 0 V. You can modify your code so that when nothing is connected, it can read 0 instead of 3V.

0 Kudos
Message 6 of 10
(1,022 Views)

GRCK5000, here's the thing when i measure the the voltage at ai0 i get 3.2V (expected), when i measure the voltage at ai1 i get 2v (although it is reading 3.2v on the vi).

I then disconnected the aio wiring and connected it to ai1 , i now get the 3.2 v on ai1 as expected but get 2V at aio...again the vi is reading 3.2v on both inputs, with 1 disconnected.

 

i tried also chasnging the input to nsre, which i couldnt do when i tried daq assistant

 

im using a ni myDaqIMG_20230705_215638449_HDR.jpg

 

0 Kudos
Message 7 of 10
(1,000 Views)
Solution
Accepted by topic author Chizzy42

Try wiring like this below, but set your device to single ended or differential as I'm showing with the code below. Each one of these has its own way of wiring as I show below. 

GRCK5000_0-1688594367433.png

 

 

 

Note: 

 

SINGLE ENDED CONNECTION:

GRCK5000_0-1688593016320.png

OR 

 

DIFFERENTIAL CONNECTION:

GRCK5000_1-1688593096975.png

 

Try this schematic above with the attached code. Let us know if it works. 

 

Message 8 of 10
(982 Views)

HI GRCK5000, I think youve nailed it with the differential setting, i had a problem with that setting with the daq assistant as well as the Daqmx setup, it would default to default(?), but after adding a control to the Daqmx it seems to allow me to the input terminal configuration with no issues. For some reason though the RSE still reads 0v need to look into that one why (maybe try adding 100k resistor to ground), i've updated the original vi i was writing and this now allows multiple channels and outputs the corresponding values i  need , just still to add in some greater than logic etc to the vi and once i make up the ldr circuits to read the voltage i can determine what voltage values are on and off. i have the possibility now to trial other circuits on the bench.

 

 

thanks for all you help and taking the time correspond, it was greatly appreciated

 

 

Message 9 of 10
(924 Views)

You're welcome Chizzy42. I find pleasure in helping others. Any new questions you have, please post it. 

 

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ John 14: 6 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 Kudos
Message 10 of 10
(894 Views)