From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding the Write Measurements To File is tricky

Solved!
Go to solution

I have a piece of code (attached).I want to do two thing with this code:

1) Understanding how this thing works (even in small words, I guess it is a kind of mixture of different subroutines)

 

2) I want to add the feature that allows me to add the write to file capabilities

 

The code is used for saving the data from a PSI (16 channels but using only 8 at the moment) and a temperature scanner (not more in use, now there is an Omega tempscan with software provided, so I'll need to link the tempscan to this ... one day). The software has been written in an old version of labview, so it might not work on 2009. The PSI has an IP address which is linked to a switch linked to the computer. I am new to Labview, and I have done the tutorials, but here is totally different level compared to the tutorials.

 

It might be useful understand how works this program and if someone may add the write to file option or explain to me how to do it. The file PSI-9016 Test Program is the actual file I use for the measurements

 

Kind regards,

Antonio

0 Kudos
Message 1 of 9
(2,613 Views)

Hi mortainn,

  I gone through your program.I think if you click the enable temperature data logging on the front Panel,then you have to add the Measurement to file functionality in PSI-9016 logging.vi.Can you tell me excatly which data you want to store in file,pressure or temperature..?

 

 

Thanks and regards,

srikrishnaNF

Regards,
Srikrishna


0 Kudos
Message 2 of 9
(2,598 Views)

Dear srikrishnaNF,

 

Thanks for your reply. I would like to store the pressure messurements since the device for scanning the temperatures is different and I have the program for doing it.

Would you mind telling me how the software I have attached works, please?

 

At the moment it works, it gets data, but I want to store those data in a file to be able later on to postprocess them and have a history, in order to know if I reach a steady state or not.

 

Thank you very much

 

Regards,

Antonio

0 Kudos
Message 3 of 9
(2,585 Views)

Hey Antonio,

 

I have placed introduced a Producer/Consumer architecture, with the consumer loop writing the data to file. The enqueue function used is defined by a cluster containing an ENUM and variant. The ENUM will determine which data set is written to file and converted into an array. The variant is used to allow for the varying data types as the TX and PX were both different. Please let me know if this has worked for you.

Regards

Andrew George @ NI UK
0 Kudos
Message 4 of 9
(2,561 Views)

Thanks for your interest Andy G., however the folder seems empty 😞

 

Is it a problem of my computer? In case let me know and I can send you my e-mail address.

 

Thank you

Antonio

0 Kudos
Message 5 of 9
(2,554 Views)
Solution
Accepted by topic author mortainn

Ahhh Antonio!!

 

I sent you the wrong file, how embarrassing!! here you go...

Regards

Andrew George @ NI UK
Message 6 of 9
(2,548 Views)

Andy, thank you very much for the software you've made!

 

It works fine and it's perfect.

 

I have a couple of questions:

1) is it possible to tell to the software which channels of the pressure it needs to write (since I don't need all of them)

2) the data are more or less like 10, 0, 10.1, 0, 10, 0 ....I want to mean that in the output file is written one measured number and one zero, is it possible to change this?

 

Again, thank you very much for your work, even if I didn't go through what you did because it seems a bit complicated!

 

Kind regards,

Antonio

0 Kudos
Message 7 of 9
(2,483 Views)

Hey Antonio,

 

It seems complicated due to nature in which the data is passed out of the PSI-9016 VI's, I have essentially bolted on a consumer loop onto the bottom of the code. This loop uses the enqueue function to create essentially a buffer of data which is passed into the consumer loop when the producer or main loop is not executing. I have used variant as the data type for the queue, as the data being passed out of those VI's seem to be very specific in their makeup. The variant will allow my to take any data type and pass it into the queue, and then using the variant to data function i have changed this back into the raw data form. you will also notice i have included the TX or PX data types within the variant, this has allowed me to select which data gets written to a file.

 

Regards

Andrew George @ NI UK
0 Kudos
Message 8 of 9
(2,451 Views)

Hey Andy,

 

thanks for your fast and precise response. HOwever, since I'm a newbie to Labview, the code I provided seems difficult and what you did need to be understood in the context of the code itself, since I don't understand why there are different programs (like 5 VI) they seem to be like subroutine...

 

However, I get it is difficult to get done the second thing I ask, so I will filter the results and it's done.

 

Thanks again

 

Cheers,

Antonio

0 Kudos
Message 9 of 9
(2,433 Views)