06-01-2010 11:11 AM
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
06-01-2010 11:59 AM
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.
06-01-2010 12:50 PM
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.
06-01-2010 01:01 PM
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
06-01-2010 01:24 PM
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".
06-01-2010 01:33 PM
Ravens Fan,
I will take care.. Thanks
06-02-2010 10:48 AM - edited 06-02-2010 10:50 AM
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.
06-02-2010 11:35 AM