Jump to content

helpe needed! export all data after the loop terminates executing


Recommended Posts

I am a student and I would like to take continuous temperature measurements using thermocouples. I am using an SCXI-1000 chassis, an SXCI 1102-B module, an SCXI-1303 terminal block and the PCI-6034E board.

I am taking the temperature readings using the Cont Acq Thermocouple Samples-HW Timed.vi.

My problem is that i would like to see in the front panel a continuous updated waveform, while in the end concentrate all the samples taken in a txt file. If I place outside the loop the export waveform to spreadsheet.vi then I will onlytake the last measurements. If i place it inside the loop, the vi will ask me in each iteration to save the samples.

How can solve it?

I have also a of question regarding the Cont Acq Thermocouple Samples-HW Timed.vi. Is it necessary first to adjust in MAX the temperature range that i would like take measures or it is automatically adjusted when I configure the range in the Cont Acq Thermocouple Samples-HW Timed.vi.

Thank you in advance

Papakonstantinou Georgios export all data after the loop terminates executing

Link to comment

Place it outside of the loop. There is a square on the border of the loop where the wire crosses from inside to outside. That's called a tunnel. Pop up on the tunnel and select "Enable Indexing". The result will be an array of your data, each element of the array being one iteration of the loop. You can then write the entire array to disk.

Link to comment

I have also a of question regarding the Cont Acq Thermocouple Samples-HW Timed.vi. Is it necessary first to adjust in MAX the temperature range that i would like take measures or it is automatically adjusted when I configure the range in the Cont Acq Thermocouple Samples-HW Timed.vi.

There are two ways to do this.

1) Create a measurement task in MAX where you specify the temperature range and other parameters of your measurement and then in LabVIEW perform acquisition using that task.

2) Basically create the task in LabVIEW by using DAQmx Create Channel where you can specify the range of your measurement. I believe in your case you are calling DAQmx Create Channel (AI-Temperature Thermocouple).vi where you do specify the limits and also thermocouple type, cjc source ect so for your case you dont need to jump into MAX to set anything up.

Edited by SciWare
  • Like 1
Link to comment

Measurements.txtMeasurements(without while loop).txtGuys I really thank you for the help.

I have uploaded the vi that I am currrently running on Labview 7.0 platform and i also i uploaded the measurements that I take from this vi when I enable indexing in the loop tunnel. The problem is that i get a lot of zero's(!!!!!) inside the txt file. Please take a look.

I simply know that if I delete the while loop and replace the Write to Spreadsheet.vi with the Export Waveforms to Spreadsheet File.vi then only I will read the temperature measurements. (I also uploaded this txt file)

However, I do not want to remove the while loop because I won't be able to watch the continuous updating waveforms. How can I deal with this problem?

Another problem is that by having a while loop in the block diagram I cannot control the number of samples that I would like to take. The vi will continue to execute until I press the stop button. Is it possible to keep it that way or do I have to replace the while loop with a for loop? (when I replace it with a for loop other problems also arise!!)

Finally, I am trying to configure the gain and the polarity from MAX to find the code width and to calculate the accuracy of my measurements, but it seems that they are automatically configured depending on the temperature input range you provide them. Do you knowContinuous Thermocouple Measurements.vi if they can be configured manually?

I really appreciate for the time you take to answer my questions.

Giorgios Papakonstantinou

Link to comment

Hey Ginos

Have a play with putting the write to spreadsheet inside your loop but wire a path to it so it doesn't prompt you every time. Also set append to file = True.

Have a tinker and see how you go.

Thanks SciWare

It really worked. Very peculiar... The strange thing about it, is that if I do not put the append to file=true then i will have the last set of temperatures (!!). Probably because it does not append the previous tempreatures to the file. Instead of putting a constant file path i tried to replace it with a control. The problem is that if the file has not been created then it cannot accept it.

Do you know how to make this vi to take finite measurements for example 2000 samples/channel and then stop but keeping the continually updated waveform?

If I change the sample clock.vi to from continuous samples to finite samples I won't be able to to watch constantly

updated waveform.

Link to comment

Thanks SciWare

Do you know how to make this vi to take finite measurements for example 2000 samples/channel and then stop but keeping the continually updated waveform?

Just put a case structure around the write to spreadsheet. If number of samples is less than or equal to 2000 then write to spreadsheet else don't.

Link to comment

Just put a case structure around the write to spreadsheet. If number of samples is less than or equal to 2000 then write to spreadsheet else don't.

My friend in this occasion it simply will not write the spreadsheet. I do not want this to happen.

Instead I want to have control where I can insert number of samples (for ex.1000 samples) and a control where I will insert the rate (for ex. 100Hz).

Consequently the vi will run t=N/f seconds. the vi that I have so far runs until I press the stop button.

The problem lies in the polymorfic vi's DAQmx Timing.vi and DAQmx Read.vi.

If you have time please take a look. Thank you!

Link to comment

My friend in this occasion it simply will not write the spreadsheet. I do not want this to happen.

Instead I want to have control where I can insert number of samples (for ex.1000 samples) and a control where I will insert the rate (for ex. 100Hz).

Consequently the vi will run t=N/f seconds. the vi that I have so far runs until I press the stop button.

The problem lies in the polymorfic vi's DAQmx Timing.vi and DAQmx Read.vi.

If you have time please take a look. Thank you!

Hi Ginos

Take a look at the code snippet below it should guide you as to how to log N samples to the spreadsheet but continue to display.

post-1058-124832137482_thumb.jpg

If you want to acquire a finite number of samples use the Sample Mode = Finite Samples in the Sample Clock and in your code check if the task is done using DAQmx Is Task Done.vi and if so terminate the loop as shown.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.