LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems using radio buttons and multiple channels

I am somewhat new at using LabVIEW.

 

The setup I am making will control 8 units. Each unit has a pressure sensor, a strain gauge and an output. I want each of the 8 units to be "Line 1, Line 2.."  and so on so that when the user is testing the equipment, he or she only needs to select the lines they are using.

 

I have created an array of DAQ 1/0 boxes where I can select the input and output channels I want to use.  In the program, when I am testing one line against another, I decided that radio buttons were the best option.

 

Where I am running into difficulty is with parallel reading and writing. I am currently taking the list of DAQ 1/0 and removing one index from the array according to the output from the radio buttons*. This has worked fine with one reading. My difficulty is that I cannot find out how to merge two outputs, such as two of the pressure sensors, into one channel so I can put it through a DAQ Read NChannel NSignals.

 

 I know it can be done. I can link the list of DAQ 1/0 boxes right up to the DAQ Read NChannel NSignal with a DAQ 1/0 list =>DAQmx Flatten Channel String=>DAQmx Create New Task=>DAQmx Timing=>DAQmx Start Task =>enter loop=>DAQmx Read Channels/Task=> exit loop =>DAQmx Clear Task. How can I make a shortened list of DAQ 1/0 boxes from two radio lists?

 

Any help would be appreciated.

 

note: 

*radio buttons start at 1, so I subtract 1 from the radio button result

0 Kudos
Message 1 of 8
(3,263 Views)

What is a DAQ 1/0 box?

 

If you attach a VI of what you have done so far, we might be able to help you better.

0 Kudos
Message 2 of 8
(3,253 Views)

Ravens Fan wrote:

What is a DAQ 1/0 box?

 

If you attach a VI of what you have done so far, we might be able to help you better.


 

I think he is meaning DAQ I/O, for input.output.

 

NicholasA:  Are you creating two lists of DAQ channels?  Why not just one checkbox list where you can select more than one item.  Whichever you use, you have to get the DAQmx physical channel name from the selection.  If you have an array of physical channel names, and the list is in the same order as the actual list of channels, you can take the index of the selected item and use it as the index number to Index Array to get the physical channel name.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 3 of 8
(3,243 Views)

Hey, Its confusing so little difficult to ans exactly wat u want ..

 

I suppose u have 8 unit each having "combination of sensors and output" and  then one DAQ unit ?  you just shift among the units and want to see results on same DAQ coded in labview..

 

If u have sufficient number of channels then connect all sensors and outputs to DAQ.. then just shift the channel of reading based on system radio box selection ..

 

Incase u don't have that much channel u can go for harware solution to use relay for switching among line as per system radio box selection..

 

Hope it helps

 

HS

 

 

0 Kudos
Message 4 of 8
(3,237 Views)

HS,

 

It has been good to see your frequent responses in the forum.  But please do us a favor and use full words and not use text messaging shortcuts like "u" instead of "you".

0 Kudos
Message 5 of 8
(3,230 Views)

Ravens Fan,

 

I will take care.. Thanks

0 Kudos
Message 6 of 8
(3,225 Views)

Okay,

I realize I was not very clear in my explanation, so here is a small visual...I did find a solution after discussing this with a few other people here. It was one of those problems where one spends a day on it, and solves it in a few seconds on the following day.

 

In the Front Pannel. These are all selection boxes where I can select the global channels

 

Global Channels A

I/0PressureAI0 

I/0PressureAI1

I/0PressureAI2

I/0PressureAI3 

 

Global Channels B

I/0SourceAO0 

I/0SourceAO1

I/0SourceAO2

I/0SourceAO3

 

 

Now, on each sub-program, I have the following radio buttons

 

LINE A        LINE B

o Line 1     o Line 1  

o Line 2     o Line 2

o Line 3     o Line 3  

o Line 4     o Line 4  

o Line 5     o Line 5

 

 Each line relates to a pressure sensor and a source

 

What I had used before was as follows:

 

For all signals 

Global Channels A => DAQmx Flatten String => DAQmx New Task => DAQmx Sample Count => DAQmx Start Task => DAQmx Read Channels

The output was an array with time, readings and channels as the axis 

 

For one channel 

 Global Channels A =>Index Array => DAQmx Read Channels 

                              Line A =^ 

The output was an array with time and readings as the axis

 

 

 What I needed now was a way of reading two channels at the same time. What I did is as follows

 

 Global Channels A =>Index Array

                              Line A =^         => Merge Array => DAQmx Flatten String => DAQmx New Task => DAQmx Sample Count => DAQmx Start Task => DAQmx Read Channels 

                              Line B =^         =^^

 

The output is in the form of an array with time, readings and only two channels as the axis. I can now use these to read the two data sets I need.

 

 

This is just one way that I have found to read two channels of data. If someone knows a better way, I would appreciate it. 

I must apologize if I was confusing in my first post. 

Message Edited by NicholasA on 06-02-2010 10:50 AM
0 Kudos
Message 7 of 8
(3,195 Views)
If your way works, then why not!  If you post your code, perhaps that would be better then your explanation.  A picture is worth 1000 words...  Well with inflation and the economy and everything, maybe just 765 words.  And in Canada, it is just 751 words.
- tbob

Inventor of the WORM Global
0 Kudos
Message 8 of 8
(3,180 Views)