Dynamic Signal Acquisition

cancel
Showing results for 
Search instead for 
Did you mean: 

Can PCI 4462 gain be changed on the fly in VB 2005 express?

Solved!
Go to solution
hI,

My present chanil configuration comes form:
 myTask.AIChannels.CreateVoltageChannel(physicalChannelComboBox.Text, "", _
                 AITerminalConfiguration.Differential, Convert.ToDouble(minimumValueNumeric.Value), _
                Convert.ToDouble(maximumValueNumeric.Value), AIVoltageUnits.Volts)

Where "physicalChannelComboBox.Text" = "Dev1/AI0:3

This creats all the channels at one time but I need to have different Min and Max voltages.

Here is a MAX 4462 configuration.

I am trying to do this configuration in VB

DAQmx] MajorVersion MinorVersion

        8       6       
[DAQmxChannel] AI.Coupling AI.Max AI.MeasType AI.Min AI.TermCfg I.Voltage.Units ChanType PhysicalChanName
PPI2/PrimaryVolts DC 42 Voltage -42 Differential Volts Analog Input Dev1/ai0
PPI2/PrimaryCurrent DC 0.316 Voltage -0.316 Differential Volts Analog Input Dev1/ai1
PPI2/SecondaryVolts DC 31.6 Voltage -31.6 Differential Volts Analog Input Dev1/ai2
PPI2/SecondaryCurrent DC 0.316 Voltage -0.316 Differential Volts Analog Input Dev1/ai3
[DAQmxTask] Channels SampClk.ActiveEdge SampClk.Rate SampClk.Src SampQuant.SampMode SampQuant.SampPerChan SampTimingType
Rising 195000 Continuous Samples 2000 "" Sample Clock
PPI2 PPI2/PrimaryVolts, PPI2/PrimaryCurrent, PPI2/SecondaryVolts, PPI2/SecondaryCurrent
[DAQmxDevice] BusType DevSerialNum PCI.BusNum PCI.DevNum ProductNum ProductType
Dev1 PCI 0x127B518 0x5 0x6 0x7170 PCI-4462


I would like to be able to look at data values over time and change the gain/rainge of each channel while still recording data. How can I change the gain on the fly.
 

thanks.
john
0 Kudos
Message 1 of 6
(7,802 Views)
Hello again, John!

For your first question you can call CreateVoltageChannel multiple times, giving it a different channel with different Min/Max settings to do what you want.

As far as changing gain on the fly, there is no way through our API to do this "on-the-fly" for DSA products.  You will need to stop the task, reconfigure the min/max (two function calls) by setting the properties AI.Min and AI.Max, and then restart the task.

I'll try to find an example to help in the meantime.

Good luck,


Sincerely,
Gavin Goodrich
Software Engineer
National Instruments




0 Kudos
Message 2 of 6
(7,787 Views)
OK, changing the min/max can be done like this
stop the task
myTask.AIChannels.Item(0).Maximum = whatever
myTask.AIChannels.Item(0).Minimum = -whatever


the index "0", I believe, is the index of what order you added channels, so if you call CreateVoltageChannel once with ai0, once with ai1, and once with ai2, you will have Item(0) = ai0, Item(1) = ai1, and so on.

enjoy

Gavin Goodrich
Software Engineer
National Instruments
0 Kudos
Message 3 of 6
(7,781 Views)
Thank you Gaving,

Just to make sure that I understand what you are saying:

 myTask.AIChannels.CreateVoltageChannel(physicalChannelComboBox.Text, "", _
                 AITerminalConfiguration.Differential, Convert.ToDouble(minimumValueNumeric.Value), _
                Convert.ToDouble(maximumValueNumeric.Value), AIVoltageUnits.Volts)

myTask.AIChannels.Item(0).Maximum = 31.6
myTask.AIChannels.Item(0).Minimum = -31.6

myTask.AIChannels.Item(1).Maximum = 0.316
myTask.AIChannels.Item(1).Minimum = -0.316

myTask.AIChannels.Item(2).Maximum = 31.6
myTask.AIChannels.Item(2).Minimum = -31.6

myTask.AIChannels.Item(3).Maximum = 3.16
myTask.AIChannels.Item(3).Minimum = -3.16

 
Is that what your are saying?

Thanks again,

John
0 Kudos
Message 4 of 6
(7,773 Views)
Solution
Accepted by topic author johnd01
Yes, that will work.
Just remember that you can't change AI Min and Max while the task is running.
well...at least you won't see a difference while running
Smiley Happy

Gavin Goodrich
Software Engineer
National Instruments

0 Kudos
Message 5 of 6
(7,771 Views)
thanks

0 Kudos
Message 6 of 6
(7,760 Views)