From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to add channel of data to a given facotry Labview array code

Hello, so I'm a student research assistant trying to add microphone data into an 6 axis sensor which reads into a NI USB-6210. The 6 axis sensor came with a LabView code, which seems pretty confusing (I'm fairly new to Labview), and I'm trying to add the channel from the microphone already connected to the DAQ to the Labview code.

20201219_170556.jpg

I tried multiple things and it constantly outputs and ambiguous error. (Attached)

 

I'm not sure if to create a second DAQmx or to edit the while loop. Any feedback or help would be greatly appreciated 

 

 

0 Kudos
Message 1 of 3
(791 Views)

Please ignore the above error image, I also just attached the LabVIEW code.

0 Kudos
Message 2 of 3
(784 Views)

I assume the code that you attached came from ATI, who I assume furnished the 6-dof sensor you are using.  You appear to be taking 6 Analog signals (single-ended?  differential?), sampling 1000 points at a time at 10 kHz.  [The code you attached is pretty messy, by the way, but it does give an idea of what you are trying to do.]

 

So what did you want to do with this microphone?  Is it supposed to be another channel sampled simultaneously (and with the same voltage range setting) as the other 6 channels?  That is, are you going from 6 to 7 channels?  Or are you planning on capturing 6 channels as before, but adding a separate loop that records from the microphone (at some rate, starting at some time, and being saved some where)?

 

You would be well-served to spend a few weeks doing your best to learn some LabVIEW.  Finding a colleague or mentor who could provide guidance to get you started would be advised.  Try to make your code as readable as possible -- it will be a big help to you and to anyone else who takes a look at it.  Thing to consider --

  • Bury the Messy Details (like setting up DAQmx) in a sub-VI so you don't have wire running all over the place.
  • Try to keep your wire running horizontally and with few bends.
  • Use the Error Line to serialize the order of operations.
  • Try to write every VI with a 4-2-2-4 Connector pattern, with Error In on the lower left and Error Out on the lower right.
  • Avoid the Dreaded DAQ Assistant!  Learn how easy it is to use DAQmx.  Do a search for "Learn 10 Functions in NI DAQmx and Handle 80% of your Data Acquisition Applications" (or something close to that title).  
  • Before writing LabVIEW code, try your device(s) out with MAX.  You have a 6 dof sensor -- plug it in, open MAX, and have MAX run a Test Panel sampling 6 AI channels at 10 kHz.  See if you can wire your microphone, especially if it just a 7th channel.  Playing with MAX and its Test Panels is the best way to learn how to use NI Hardware to take data.  Best of all (as you'll learn if you follow the previous Bullet Point), once you see how to get your device to work in a Test Panel, make a Task in MAX and write LabVIEW code that has the following DAQmx functions:  Create Task, Start Task, Read (or Write), Stop Task, and Clear Task.  5 DAQmx functions!

Bob Schor

0 Kudos
Message 3 of 3
(763 Views)