LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

best method for data acquisition application

Another Newbie question:

I have a different application that I am working on (preliminary development stage) and I would to perform the following steps but I am not quite sure what the best method to complete the task
1) acquire data   
2) wait 60 minutes (at this point at a later time I will add code to turn oven on)
3) acquire data
4) wait 60 minutes ( at this point, at a later time I will add code to turn oven OFF)
5) acquire data
6) END


Currently I am using a modified example of the Agilent 34970A.  I can sucessfully contol the agilent meter and get data using labview (chart and log to lvm only).

I am looking ahead for the main intention:
Ideally the user of the application will list channels desired to acquire data from and make an association to a serial number (havent figured this part out yet) and then push the START button and walk away.  At the very end the Initial / Hot / Return data would be obtained, calculations performed, and a printout made.



I am looking a good starting point to work off of whereby I can continue my baby steps.  Should I use Event driven or a sequence?

Any good examples?


Thank you for your time

0 Kudos
Message 1 of 8
(3,642 Views)
The event structure is mainly used for front panel user events and the sequence structure should seldom be used for anything. You might wnat to look at using a simple state machine or the Product/Consumer Design Pattern (Data) framework.
0 Kudos
Message 2 of 8
(3,633 Views)

jqm,

A state machine is probably your best bet.  You can find a great example for how to use a state machine to sequence tests by opening the example finder (Help->Find Examples) and searching for "state machines".  One of the results that comes up is the "State Machine Test Sequencer.vi".  This would probably be a good place to start for you.

I hope this helps,
Justin D.
Applications Engineer
National Instruments

0 Kudos
Message 3 of 8
(3,599 Views)
Thank you for the responses.

I starting going through some examples of state machines, and upon first glance it seems pretty imposing, half the time I dont understand what I am looking at...but  I am sure that it is just a matter of experience / actual use.

Sitting back and looking at it my future application looks as if it can have multiple states:

Setup State - a state where the user sets up conditions ; makes serial number associations to specific channels, setting the desired oven temperatures, and the dwell times.
Verification State- a state where the specific channels are sampled and data returned (to ensure output is appropriate)
Initial State - set initial temperature, get data, store it
Hot State - set hot temperature, wait dwell time, get data and store it
Return State - set return temperature, wait dwell time, get data and store it
Calculations State - perform calculations, print output, store data to computer.
Shutdown State - close down equipment connections.

Again, thank you for your time. 
I am back off to stare at some more examples.


jqm
0 Kudos
Message 4 of 8
(3,584 Views)
jqm,
 
It seems like you have figured a good state machine model for your application. I am attaching a more elaborate state machine example than what is available in Example Finder. It uses a Producer/Consumer scenario with queues to pass data between two loops. You can follow that example to create your application. You might not be able to run the program unless you configure your Data Acquisition hardware to correspond to the software settings. However, you will be able to see the overall structure pretty well.
Study the example well to see how data is passed from one state to another. For your wait time you can use either Elapsed Time VI or Wait VI.
Hope that helps.
 
Kalin T
Applications Engineer
National Instruments
 
Kalin T.
0 Kudos
Message 5 of 8
(3,561 Views)
Thank you for your responses!

Programming labview is not my main job function at this time. 
I had to take time off from Labview ....just able to get back into this after 2 months of alternate work related tasks.
That plus I just installed LV8.2  .... so far so good....


If anyone has any state machines examples that are not found in the examples  I would appreciate it if you could share....
as I have to go back and try to re-hash everything to refresh my memory and plow through the various usergroups for any examples that came up
in the last couple of months....

Thank you for your time,

jqm


0 Kudos
Message 6 of 8
(3,496 Views)

I have a query regarding similar type of application......like for Data mining of data acquired in *.csv file.

  1. Independent value(X-axis value) should hold constant(dwell) for 5 seconds.
  2. Dependent value(Y-axis value) should increase and reach a steady state value.
  3. When mining data, take Average of Y-axis value over a period.
  4. Start padding(ignore the first 10points) and Stop padding(ignore last 10 points) in selected Y-axis value.

These are some of the data mining sequences i need to add to the tool.

 

Any suggestions

 

Thanks in Advance

 

Kirit

 

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

Hi Kirit,

 

Do you have any existing code, or are you writing this from scratch?

 

If from scratch, I would point you in the direction of using a loop and the VIs in the Array palette (on the Block Diagram). 

 

The Array Max & Min vi looks promising, for example, in determining the max and min values in an array (or array subset as it would be in your case).  You could use this to see if a specific array subset is in steady state.

 

Kevin S.

Applications Engineer

National Instruments

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