LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reading and saving real time data

Hi,

 

I would like to read and save real time data using DAQ card 6004 with my PDA device. There is no problem with reading real time data, I can see it on the PDA's screen successfully. But, when I'm trying to save this real time data, I have the following problem:

 

-It continuosly asks for file name.

-It only saves the data instaneously,i.e. it only saves the data at the moment.

 

I'm stuck with this problem, could you please help meI attached my vi doc.

 

By the way, I'm using Labview PDA 8.5 version

0 Kudos
Message 1 of 5
(2,482 Views)

oozdemir,

 

>> -It continuosly asks for file name.

 

You are prompting the user for a file name each time through the loop.  Do this before you enter the loop and pass that file ref in.

 

>> -It only saves the data instaneously,i.e. it only saves the data at the moment.

 

By this, I am going to assume you want to append to the file as you go.  Two problems, 1.  you are saving an array to the file and additional info about the array structure is being saved.  You would essentially be creating a binary file filled with array "records" (for lack of a better term) appended one after another.  2.  If you want to append to the file, you will need to use the "Set File Position.vi" to locate the file pointer to the end of the file.

 

This task looks like it runs once per second until the stop button is pressed.  You could build an array of all acquired data in the loop and then write it when the loop exits.  Just a thought.  This app could create a lot of data though.

 

-cb

0 Kudos
Message 2 of 5
(2,479 Views)

Your program is not a realtime program. You open and close both the file and the DAQ card in every loop and in this period you will lose data from the DAQ card. You hvae to put the some of the configuration VIs outside the loop. Before you enter the loop configure the DAQ card and open the file. Inside the loop read DAQ data and write to the file. After loop exit close the DAQ and file. I can not give you more help since I do not have your toolkit



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 3 of 5
(2,467 Views)

Hi again,

 

Your suggestion helped me very much, thank you very much. Your suggestion -writing first to an array and then to a file- seemed very reasonable to me but I was just wondering how to achieve this. Probably, I will be reading a very huge bulk of data from DAQ card which has undefinite size, so is there any vi to create an array which has not finite size? Also there are lots of array vi's so I'm confused with which one to use if this is possible.

 

I'll be very happy if you can help me.

Thanks,

Omer

0 Kudos
Message 4 of 5
(2,426 Views)

Omer,

 

I attached a vi (LV2009) & image that shows a few methods and techniques for building arrays in loops in code.  I think you need to read through the LV documentation on arrays because array handling in LabVIEW is both easy, and used all the time as an important centerpoint in data acquisition and analysis applications.  You will do yourself well to take some time and get a thorough understanding of this important topic.

 

I hope the attachment gets you pointed in the right direction!

 

-cb

Download All
0 Kudos
Message 5 of 5
(2,414 Views)