LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use DAQ

Hi all, I have a problem with my project and do not know how to progress at beyond this point in time.
 
I have wrote a program that is suppose to detect interharmonics in the power source, capturing the first 25 hz in action. If there were any interharmonics , it should be shown in the normalized graph. I follow the lab standards to normalize the output.
 
However, I want to put it into real time testing , connecting it to power source and testing it with a DAQ card that my lab has, NI USB 6215 with a light detecting diode. I would say, mine is hard-coded with all the parameters set in place. I am not sure how I should change which parts of the program and get it up and running in real time.
 
Would most appreciate any help rendered. Thank you!
 
I am thinking of using DAQ assistant but not sure how to,despite reading up the guide. Could someone guide me?
Download All
0 Kudos
Message 1 of 8
(3,732 Views)

Hi how81,

post your code rather that several pictures. makes it hard to read like that.
but your problem i understand is to aquire data. i would suggest 2 things: first open the MAX (measurement and automation explorer, in the NI folder). in there, if you have installed your card, you should be able to recognise it and test it, with your real input.

second, browse the LV examples for data aquisition:
NI example finder -> hardware input and output ->DAQmx->analog measurements->...

for example the voltage->ack&Graph Voltage EXtclk.vi.

then come back with a piece of code if you have troubles. good luck Smiley Wink

-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 2 of 8
(3,711 Views)
Hmm...Thanks for pointing out a way for me to try it out at least ,Gabi1 ! Deeply appreciated!
 
I am not too sure how to post the code up as most of it are in blocks, pardon me, still quite a novice after trying LV out for some time.
 
I have been reading up LV textbooks, but I am uncertain of some terms,
 
1) channels, what are they used for?
2) error in, out
 
Going to try out the examples now,meanwhile. 🙂

Message Edited by How81 on 10-01-2007 03:29 AM

0 Kudos
Message 3 of 8
(3,706 Views)

Hmm...Thanks for pointing out a way for me to try it out at least ,Gabi1 ! Deeply appreciated!

No problem Smiley Happy
browsing and deciphering examples is a great way to learn labview.


I am not too sure how to post the code up as most of it are in blocks, pardon me, still quite a novice after trying LV out for some time.

if you dont have subvis, simply attach the vi itself.
if you have subvis, you can either zip them together we recieve all of them, or save your application under what is call a llb : save with options - > development distribution.

you will create a new file with llb extension, that is effectively a containing library of all the subvis you use in your project.

once you are started, and you still have problems, ask again on this forum Smiley Happy

-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 4 of 8
(3,701 Views)
oh...that's true...I never thought of that...I forgot it can be done..Smiley Surprised oops...heh , i should be posting soon again after trying out tonight.
 
Once again, thanks for helping out Gabi1 !
 
Will post the .vi once I pinpoint a more exact question I need to ask. Smiley Happy
0 Kudos
Message 5 of 8
(3,702 Views)

HI,

Below is a link to our getting started with NI-DAQmx series.
http://zone.ni.com/devzone/cda/tut/p/id/5434

This document has tutorials and explanations of our most common questions. I would recommend this as resource to start from as well as the shipping examples as Gabi1 suggested which can be found by going to Help>>Find Examples... Then once the example finder is open browse the following Hardware Input & Output>> DAQmx>>Analog Measurements>>Voltage. These examples are a great starting points if you need help with program flow and Data input.

With regards to your question about channels and error handler:

Channels, Physical Versus Virtual (Taken from DAqmx Help)

<SCRIPT type=text/javascript> </SCRIPT> A physical channel is a terminal or pin at which you can measure or generate an analog or digital signal. A single physical channel can include more than one terminal, as in the case of a differential analog input channel or a digital port of eight lines. Every physical channel on a device has a unique name (for instance, SC1Mod4/ai0, Dev2/ao5, and Dev6/ctr3) that follows the NI-DAQmx physical channel naming convention.

Virtual channels are software entities that encapsulate the physical channel along with other channel specific information—range, terminal configuration, and custom scaling—that formats the data. To create virtual channels, use the DAQmx Create Virtual Channel function/VI or the DAQ Assistant.

Virtual channels created with the DAQmx Create Virtual Channel function/VI are called local virtual channels and can only be used within the task. With this function/VI, you choose the name to assign for the virtual channel, which is used in the rest of the NI-DAQmx software framework to refer to the physical channel.

If you create virtual channels with the DAQ Assistant, you can use them in other tasks and reference them outside the context of a task. Because these channels can apply to multiple tasks, they are called global virtual channels. You can select global virtual channels with the NI-DAQmx API or DAQ Assistant and add them to a task. If you add a global virtual channel to several tasks and modify that global virtual channel with the DAQ Assistant, the change applies to all tasks that use that global virtual channel.

Error Clusters (Taken from LabVIEW Help)

The error in and error out clusters include the following components of information:

  • status is a Boolean value that reports TRUE if an error occurred.
  • code is a 32-bit signed integer that identifies the error numerically. A nonzero error code coupled with a status of FALSE signals a warning rather than a error.
  • source is a string that identifies where the error occurred.

Some VIs, functions, and structures that accept Boolean data also recognize an error cluster. For example, you can wire an error cluster to the Boolean inputs of the Select, Quit LabVIEW, or Stop functions. If an error occurs, the error cluster passes a TRUE value to the function.

The above information can all be found in either the LabVIEW or DAQmx help files. Which are found by going to Start>>All Programs>> National Instruments then the respective piece of software and opening the help file.

Thanks,

JaceD

JaceD
Signal Sources Product Support Engineer
National Instruments
0 Kudos
Message 6 of 8
(3,661 Views)

Thank you for your help too, JaceD!

 

I just started trying out on individual DAQmx blocks, rather than the DAQ assistant hoping that I can grasp it better that way, although time is an essential quantity as of now..:( Appreciate all your kind assistance!

0 Kudos
Message 7 of 8
(3,644 Views)

Hi How81,

I have attached a screen shot of an example program that explains the basic program flow when performing data acquisition. I have also attached a screen shot of how to have code generated from a DAQ Assistant, this is done by right clicking on the DAQ Assistant. This is a great comparison tool so that you can see what the DAQ Assistant is doing. I have also provided links to tutorials which are extremely helpful and explain in great detail why certain things are done and how.

Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications

Complete Data Acquisition Tutorial 

DAQ Assistant code generation

Program Flow explanation

I hope this helps!!

Message Edited by jaced on 10-03-2007 12:59 PM

JaceD
Signal Sources Product Support Engineer
National Instruments
Download All
0 Kudos
Message 8 of 8
(3,604 Views)