LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Measuring resistance, changing excitation current

Hi, I am using a cDAQ-9172 and some 9219 modules to measure several resistances. The problem I have is that the resistances aren't entirely electrically isolated from each other, and I suspect the excitation current from measuring one resistance affects the value I record on another. For this reason I would like to sequentially switch off the excitation current on all but the channel which I'm measuring. (e.g. excite channel 1, record resistance, switch off excitation, excite channel 2, record resistance, switch off excitation and so on). Frankly I'm a little baffled on where to start with this. Until now I've been using the DAQ Assistant to set everything up, but I don't think I can achieve what I want with this, so I'm going to have to delve more deeply into communicating with the DAQ. Has anyone got any suggestions on where to start and where I can find some guides on changing the programming of the DAQ sub vi's?

Cheers

 

0 Kudos
Message 1 of 11
(4,267 Views)

With a schematic of your hardware it would be easier to understand your problem 🙂

 

Anyway, before start coding anything:

Make a flow chart on how to control your hardware

Then define states that has to run through sequentially

Then setup a state machine architecture

 

Start coding 🙂

Message Edited by Alain S on 11-25-2009 07:02 PM
Message 2 of 11
(4,260 Views)

I've been having a poke around in the sub-vi's for DAQ assistant to see if I can modify any of this code to do what I'm after. But I'm coming up against a problem that whenever I try to turn off the excitation current for a channel (set the excitation source to none) I get the following error:

Measurements: Requested value is not a supported value for this property.

Property: AI.Excit.Src
You Have Requested: None
You Can Select: Internal, External

 

So I tried selecting External and then I get the following message:

Possible reason(s):

Measurements: Requested value is not a supported value for this property.

Property: AI.Excit.Src
You Have Requested: External
You Can Select: Internal

 

So how can I turn off the excitation current? Where can I find a detailed documentation for how the DAQ Assistant VI is put together so I can understand how it works?

0 Kudos
Message 3 of 11
(4,197 Views)

timswait wrote:

.... Where can I find a detailed documentation for how the DAQ Assistant VI is put together so I can understand how it works?


A DAQ Assistant VI is an Express VI, which can be exploded into proper code with Right Mouse Button.... select "Convert to DAQmx Code..". From there you'll have the DAQmx components, complete with how each channel has been configured with regards to Excitation.

 

The code is going to expect an excitation valve.

Richard






0 Kudos
Message 4 of 11
(4,187 Views)

Clicking the convert to DAQmx code gives the error message:

"Not implemented for this I/O control type"

However if I click "show front panel" it gives the option to convert to standard Sub VI, which does work.

However it still won't let me select any excitation source other than internal, and no excitation current other than 500uA, even though I know the hardware is able to turn the excitation current on and off (I've measured the excitation current with a multimeter as 0 while the module is taking a voltage measurement and 400 odd uA while it is taking a resistance measurement). So I know the excitation current can be turned on and off by software, but I can't work out how to do it!

 

0 Kudos
Message 5 of 11
(4,153 Views)
Can you post the working DAQ Assistant?
Richard






0 Kudos
Message 6 of 11
(4,147 Views)
Here's the DAQ set up to measure all channels simultaneously. This works fine, the problem is that when I try to change the excitation source to anything other than external, either by the Express VI or by changing it to a standard Sub VI and changing the setting in that then it won't work.
0 Kudos
Message 7 of 11
(4,139 Views)

Can all but one of the channels be set to read voltage, and the one channel you are interested in be set to read resistance...?

 

Hummer1

Message 8 of 11
(4,125 Views)

1) First the error message re: internal external or none.

 

The DAQmx driver knows what the device can do and not do depending on th hardware and the type of channel configured. So go with the version that DAQmx allows without errors.

 

Re: Setting up a task with mixed types

 

Yes, create a task, then add and config each channel one at at time before the task is started.

 

Sorry the only example of this i have is locked behind a barbed wire fence and would take an act of congress to get it out.

 

If you are trying to make two type of measurement with the same input and the sample rates are not too high (test to determine if too high is too high on your config) then it is possible to configure multiple tasks (for each type of measurement) BUT only start one of the tasks at a time. The start/stop of a task can be pretty quick. It is configuring and allocating that takes a lot of time.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 9 of 11
(4,115 Views)

I'm getting somewhere with this, configuring one channel to read resistance and all the others to read voltage does work, but I can't get it to change which one is set to resistance. I modified the DAQ Assistant Express VI to accept channel inputs, and then I've set up for loops to generate channel numbers (of the form cDAQ1Modxaiy). The modified DAQ Assistant accepts these numbers and carries out the measurement, but then for subsequent iterations of the for loop, instead of accepting the new channel numbers it just carries out the same measurements on the same channels. Is there some way to force the DAQ to reset the channel allocations between iterations of the loop? I've attached VIs of the scanner VI and the modified DAQ assistant.

Cheers

 

Download All
0 Kudos
Message 10 of 11
(3,898 Views)