LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to collect data from DAQ assistant

Greetings,

I am trying to collect data from DAQ assistant and show it in excel file with date + time and to be able to add to the same excel file a data that will be collected by pressing ''zero'' button in the second it will be pressed, what's more to find a calibration using the follow formula, Y = (x-x0)* (100/x1-x0)

where x0 is the first value from the data

           x1 is the data from the pressed ''zero'' button

           x   is a variable that will be chose by the operator

First, I can't add the DAQ assistant data to the pressed ''zero'' button data in the same file.

Second, I can't add the date + time to the excel files.

Third, I can't use the Scaling and Mapping function to find the Calibration.

 

THE FILE IS INCLUDED ALONG WITH SCREENSHOTS.

any help would be appreciated,

Download All
0 Kudos
Message 1 of 7
(1,392 Views)

I don't see X, X1, a Zero button, etc. in the VI you attached.  Here's what I suggest:

 

Write a different VI that includes the DAQ Assistant and the Waveform Graph (why a Graph rather than a Chart?).'  Run it, and see if "what you see" makes sense to you (it doesn't, to me ...).

 

You configured the DAQ Assistant to sample 1000 samples continuously at 120 Hz, but you wired Number of Samples in, and have a default value of 10 in there.  Did you want to collect 100 10-sample "chunks of data" per second?

 

It's not clear to me what you really trying to do.  I don't mean "Sample xxx and do yyy with it", but rather describe "what" you are trying to accomplish (talk about the signal, what you are trying to learn about the signal, what parameters are important, etc.).  Once you see plots that make sense as "data", thYou'llen you are in position to say "and now I want to process XXX and YYY to learn ZZZ".

 

Another thing to think about is to write a little VI that "generates" data for you.  For example, generate N random numbers and put a Wait (ms) in the loop to get N points in k msec (so 100 points in 1000 ms is equivalent to 100 Hz) and plot them.  Plotting known data can give you a sense of what your code is doing.

 

Bob Schor

0 Kudos
Message 2 of 7
(1,354 Views)

First, let me thank you for replaying.

What I'm trying to do here to connect NI6009 to a potentiometer and see the results on a waveform graph where the x-axis should be shown to 5s and save the data on an Excel file.

 

Also, 1- To be able to obtain a detected signal in the second the ZERO button is pressed.

         2- To put these values in the written equation to calculate Calibration.

         3- To save all the save (from the graph and the detected signal) in One Excel file.

 

The attached pic will show what I'm trying to do.

I would appreciate if we can chat more privately about it.

 

with regards;

0 Kudos
Message 3 of 7
(1,312 Views)

Hello, Oday.  I see you are a fairly new member, so you might not know that many of us can "smell" requests to "do my homework for me", which we resist, in part because we like LabVIEW, find it easy to learn (especially if well-taught), and want to see more people using it.  We also know that the best way to learn any programming language is to Write Programs.

 

Your Instructor provided you with a lot of very nice visual hints, including formulas (how would you take numeric controls named x, s0, x1, and produce a value in a Indicator called Y according to the formula in the assignment?  What functions on the Numeric Palette do you need?).  There's a "hint to the sharp-eyed Student" in the particular image of the Zero and Calibration buttons.  A very nice (and simple) assignment, indeed.

 

Give it a try.  Post your VI.  [Many of us, myself included, prefer actual VIs, as we can examine them, modify them, and even run them much better than we can a screen-shot, or worse, a phone picture of a screen -- we might gripe if you use the "just released" version of LabVIEW, since "students get the latest LabVIEW installed before seasoned developers make the switch", but don't let this deter you].

 

Oooh -- I just re-read the previous paragraph to myself -- read the two first sentences aloud, and think "LabVIEW Forum Cheerleader".

 

Bob Schor

0 Kudos
Message 4 of 7
(1,294 Views)
Thanks, for the advice Bob
Well I’m using version 2007 where I can’t use any newer versions.
I’m limited in the time for finishing the code, and both of YouTube and Labview help/examples are not providing what I need to do.
That’s why I wanted for someone’s help, I’m not denying it, that’s part of learning that I can't gain by myself.
 
With regards;
0 Kudos
Message 5 of 7
(1,279 Views)

Hello, Oday.

 

Please help me understand something.  You said "I’m using version 2007 where I can’t use any newer versions", but the code you attached was written in LabVIEW 2017.  Did you mean "I'm using version 2017"?  I'm not even sure that the Dreaded DAQ Assistant was even around in 2007 (which was about the time I started using LabVIEW).  I do remember that when it was first release, I was eager to try it, and after about 2-3 weeks, I promised myself I would never use it again, and would triple-never use its Evil Twin, the Dynamic Data Wire.

 

Fortunately, DAQmx is powerful, easy to use (with a little help and instruction), and there's even a pretty good not-quite-tutorial on the Web (you have to read selectively, as it starts with the Dreaded DAQ Assistant, so skip Section 1, and also includes other non-LabVIEW languages (which you should also skip).  Search for "Learn 10 Functions in NI-DAQmx and Handle 80 Percent of your Data Acquisition Applications".

 

But first, please download and read Getting Started with NI DAQmx (I'm providing the URL here, largely because I thought the key point was in "Learn 10 Functions", but I was mistaken, so I had to find the article that I want to you read first).  Notice the third point in "Getting Started" -- "Use NI MAX to Test and Configure your Hardware".  Do that -- plug in your 6009, put a resistor across a pair of A/D pins (say a few kilo-ohms connected to Pins 2 and 3, AI0+ and AI0-.  [Do you know why they are labelled + and -?  They also have the name AI0 and AI4 -- do you know why?  Do you know how to configure MAX to "make the right choice" to use this set of pins?].  Run some test panels, play with the settings until you understand them.  

 

Here's a question -- when you do this and run a Test Panel, you should see a signal.  Touch the resistor wire going into Pin 2.  What happens?  Can you explain why?

 

Once you understand your device, understand how MAX allows you to configure your device, you are ready to read "Learn 10 Functions" and write a 4 or 5 function VI that will give you the same kind of continuous display on a Waveform ----- (I'm putting 5 dashes here -- what five letters belong in place of the dashes?  Remember the Display you saw in MAX).

 

Now, you have to put in a little effort and do some learning.  Like a good Professor, I've tried to show you how to get started, what to read, what to try, how to "discover" things you need to know.  Once you get familiar with the USB-6009 and how DAQmx can be configured to get you the data that you need, you should be well on your way to finishing your homework assignment and learning something, to boot.

 

Bob Schor

 

Message 6 of 7
(1,260 Views)

Yes, exactly as you said it's 2017,

I appreciate the directions, will do as you said.

 

 

0 Kudos
Message 7 of 7
(1,255 Views)