LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a channel list for user options to do multiple data acquisition?

Hi,
 
I'm using USB-6218 DAQ to do multiple data acquisition. I wanted to do a data acquisition for a system, but users might have different number of DUTs to test. Channel selection will be for AI. So how can I build a channel selection list for users? And not allowing users to modify the program. Are there examples for this type of application? Thanks.
0 Kudos
Message 1 of 21
(4,155 Views)

Hi,

I am a little confused as to what exactly you would like to do. If I understand correctly you would like the user to be able to select the channels they are testing on. This can be accomplished by using the physical channels control which can be created by right-clicking on the physical channels input of the create channel vi and selecting create control. If you would like to specify certain configurations that the user can choose from then you can use a combo box for this input found in the string and path palette found on the controls palette. You can then edit the combo box to display certain items and when selected output strings containing the proper syntax for your channel configuration (i.e. dev1/ai0:3). I hope this helps

JaceD
Signal Sources Product Support Engineer
National Instruments
0 Kudos
Message 2 of 21
(4,124 Views)
Hi JaceD,
 
Thanks for the advice. Yes, my application function includes no. of chns for user to select. Presently I'm using usb-6009 to acquire analog input signals. In few days time, I'll be changing to 6218 for more chns. Unfortunately the sampling rate has to be shared depending on the no. of chns activated. Btw, I'm experimenting with accelerometer. This off-the-shelf accelerometer output direct analog voltage that is proportional to acceleration. It need some calculation to process acceleration. Are there any vi in labview which can process the data and convert it to acceleration, displacement?
 
I've attached a vi on channel selection that I did. Seems to be working but not for finite no. of samples.
 
Another question. Accelerometer measurement includes single-ended or differential measurement. In differential mode, ie. in 6009 case, I've connected my +ve o/p to AI0 and -ve to AI4. Does that mean the output measurement plot should show AI0 and AI4 signals? Meaning the user have to choose two different chn when performing differential mode.
 
Thanks.
0 Kudos
Message 3 of 21
(4,110 Views)

Hi,

Your channel configuration section of your vi looks fine, I believe the issue with finite samples stems from the while loop. you are basically reading 1000 samples each time the while loop iterates thus attempting to read nonexistent samples on the second iteration, because you have only acquired 1000. You can solve this by removing the while loop. If you would like the user to be able to select between continuous and finite then I suggest a case structure: one case containing the read with a while loop the other without a while loop. With regard to scaling your data you can right click on the graph and select properties from which you can select scales which will allow you to create custom scales for your data, You can also use VIs from the numeric palette to perform mathematic operations on your data.  To answer your last question differential mode does take two channels but will only display one. For example if you use AI0 and AI8 as your positive and negative channels respectively you will read AI0, For more information I suggest this document Field Wiring and Noise Considerations for Analog Signals. I hope this helps clear things up.

 
JaceD
Signal Sources Product Support Engineer
National Instruments
0 Kudos
Message 4 of 21
(4,095 Views)
Hi,
 
Thanks for the advice, will try it out and update you the outcome. However when I tried out to measure the voltage using 6009, AI0 and Gnd (single-ended mode), it doesn't give me the expected output. I double check it using DAQ assist and found out that the VI i created previously gave the wrong output.The result is right for differential measurement. I hope to have both mode for users to select. In this case, how can I further improve the VI?
 
And I do realized that under continuous mode, there is a limitation on the no. of samples the system can read. Due to buffer size. How can I increase or should I increase the buffer? Thanks alot.
 
 
 
0 Kudos
Message 5 of 21
(4,082 Views)

Hi,

 

 

I would check the input terminal configuration input on your DAQmx create channel VI. This will need to be configured for the type of measurement that you are performing.  You can create a control for this input that will allow users to select which input configuration that they are using.  With regard to the buffer size the following document goes into detail on how the buffer is configured and how to manually configure the buffer if you wish.  How is the DAQmx Buffer Size Allocated for a Finite or Continuous Acquisition?

 

 

JaceD
Signal Sources Product Support Engineer
National Instruments
0 Kudos
Message 6 of 21
(4,063 Views)
Hi JaceD,
 
Sorry for the late reply. So far my application is working fine. Just that right now I've got a tricky problem here. I'm doing acquiring of AI data at the same time with more than a channel. So my output is a 1-D array of waveform (DBL). I have to wrtie all data into an excel file respectively according to individual AI chn. I'm able to write into the file but found that it save like a stack. Meaning the first row of my saved file are the last row of data acquired. So I got a problem reading back the file in correct sequence. So far no luck breaking through.
 
 
0 Kudos
Message 7 of 21
(4,013 Views)

HI,

I have attempted to reproduce this issue but have been unsuccessful so far my data seems to write correctly, Could you please post a screenshot of your code along with a screen shot of the file that is written so that I can better understand what exactly is happening. It is my understanding that your data writes correctly only in the reverse order is this correct?

JaceD
Signal Sources Product Support Engineer
National Instruments
0 Kudos
Message 8 of 21
(3,984 Views)
Hi JaceD,
 
Yes, it is in the reverse order. How can I recall the data back in sequence in this case in order to view it on a chart and retrieve the numericals for manipulation?
Also, I'm not sure if my data are written correctly. I've attached the screenshots. I'm using LabView7.1.
 
Questions:
1) Am I right to say that if I read 1000 samples, the table will record 1000 samples?
2) Since data is processing and writting onto the table and waveform array for viewing, why is there differences in the data written?
3) I'm using usb-6009 to do my testing. I found that when I test all the AI under RSE mode, they all read the same values of 1.39~1.4. I didn't connect any load. I do the same test by creating DAQmx task and it gave the same results. Again I tested it with an accelerometer using differential mode. It gave different reading before and after I connected it with the 6009. Is there any offset in this case? Because the reading is not accurate.
 
Thanks. Merry X'mas and a happy new year!
Download All
0 Kudos
Message 9 of 21
(3,971 Views)

Hi,

Thank you for posting the screen shots I have been unsuccessful in determining exactly where the problem is coming from. Would it be possible for you to post the actual VI so that I can work with it so see if I can reproduce this issue using your code? In regard to your questions:

1.    You are correct 1000 samples read should write 1000 samples to the table

2.    I believe the discrepancy is due to amount of manipulation done between the read and the file write but I cannot be certain, without the code to work with.

3.     I am unclear as to exactly what is happening. If you are reading empty channels then you may receive erroneous readings this is to be expected. When you connected your accelerometer did you connect in RSE or differential? You can also manipulate the signal range with will affect the gain setting, how off are the readings?

JaceD
Signal Sources Product Support Engineer
National Instruments
0 Kudos
Message 10 of 21
(3,949 Views)