LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use one channel when declaring two and change this when the program runs.

Solved!
Go to solution

Hello,

 

For the use of a 4461 card:

 

With the use of the DAQmx library:

 

When i use the "create Channel.vi" i can to use "Ai0:1" to use the 2 input channels. Then i use the Nchannel Read and split the signal with for example a "index array".

But is there a way to changes the channel numbers "on the fly" so when the program is running?

 

The same question with the outputs

When i use the Create channel for the outputs and i use Ao0:1 to use 2 output channels, but can i switch to one channel when the program is running. The Nchan write.vi is used, and this demands 2 channels. The use of one channel will give a error.

 

Is there a nice way to handel this?

 

Greetings.

0 Kudos
Message 1 of 5
(3,118 Views)
Why would you need to do this? You've got two simultaneously sampled channels and changing from two channels to one is not going to change anything. You just have to use the index array function that you already have to display one or two channels. In order to change the task, you would first have to stop and clear the one that is running. With a state machine, you can certainly do that but of course your acquisition would be interrupted.
0 Kudos
Message 2 of 5
(3,109 Views)

 

I would like to create some flexibility.

On the inputs i can connect 2 mic and calculate the rms values and send this value to the outputs.

However when i use only one mic, the second output generates "static". So i thought i switch that output off with a software button/switch.

 

 

But if i understand correctly the program always has to stop running, and then change Ao0:1 to Ao0 or Ao1.

And i have to change the write.vi from Nchan to 1Chan.

 

0 Kudos
Message 3 of 5
(3,102 Views)
Solution
Accepted by Homerus1
You can change the output to a 0 volt level instead of what you are reading. That would just require a case statement and the write remains the same.
0 Kudos
Message 4 of 5
(3,097 Views)

That is what i am doing now, but i don't think it is a beautliful solution.

But thank you for your reply (again).

0 Kudos
Message 5 of 5
(3,087 Views)