LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

producer/consumer question

Solved!
Go to solution

Hi everyone

 

I am stucked with a problem using the producer/consumer VI.

 

My VI continuously acquires data from the DAQ using a producer/consumer VI.

 

In the maintime, I would like to introduce and save some notes that can help me to identify the acquired data in a separate file without stopping the acquisition.... but  I don't know how to do it or modify the producer/consumer scheme.

 

Any suggestion?

 

Thanks for the reply

 

matomato

 

 

0 Kudos
Message 1 of 16
(3,138 Views)

can you down convert the vi in 8.6 format and attach it again

0 Kudos
Message 2 of 16
(3,126 Views)

I tend not to use the Express VIs but you should be able to use the comment parameter of the Write to Measurement File Express VI that you're using.

 

The bigger question is what do you want to put in the comment field(e.g. timestamp, sample name, descriptive text entered by user, etc . . .).

 

You should just be able to have the consumer portion add a comment while it is storing the data to the file.

0 Kudos
Message 3 of 16
(3,115 Views)

Hi Systemcrash

 

I have Labview at the office... so I will send the version for Labview 8.6  tomorrow.

 

Thanks for the reply

 

matomato

 

0 Kudos
Message 4 of 16
(3,108 Views)

What's the purpose of the code with the Write to Spreadsheet File on the left?

 

You can deal with this a couple of different ways. You could:

  • Add a third loop with an event structure. This way you can have a string control for the note you want to add, and a button to write it to your file.
  • Modify the existing consumer loop to use an event structure with a short timeout. In the Timeout case you check the queue, but you add a really small timeout value so that it doesn't block execution of the consumer loop. If the queue read operation times out, there's no data to save.
0 Kudos
Message 5 of 16
(3,101 Views)

Hi Taki 1999

 

Thanks for the reply. As you, I don't like to use the Express Vi but in this case I need to save every n minutes a file and the Write measurement file realizes this task automatically.

 

 

Anyway, what  I want to save with my comments are strings, one or more (1D array of strings).  I would like to have on the front panel two pages: one for the acquisition with graphs, tabels, etc and another with a list of strings that I can modify and save as I want without stopping the acquisition. Technically these two operations should be not linked... and the acquisition should be the main operation.

 

I will follow your suggestion and I let you know if the result is what I tried to obtain.

 

Thanks

matomato

 

 

 

 

 

 

 

0 Kudos
Message 6 of 16
(3,091 Views)

Hi Smercurio_fc

 

The purpose of the code with the Write to Spreadsheet File on the left is to save some comments without stopping the acquisition.

 

The basic idea of the VI is to have two pages on the front panel, one to visualize the data acquired and one where the user introduces some comment or data as name, surname, data, time, etc  without stopping the acquisition. Since the acquisition can be quite long, many hours, the user can be replaced with another one. The new one should be be to introduce and save his details without stopping the acquisition.

 

Technically, I don't know how to modify the producer/consumer scheme to introduce the new loop with the case structure maintaining the data acquisition as the main loop.

Hope to have answered your question, if not let me know.

 

Thanks

matomato

0 Kudos
Message 7 of 16
(3,081 Views)

@matomato wrote:

Hi Smercurio_fc

 

The purpose of the code with the Write to Spreadsheet File on the left is to save some comments without stopping the acquisition.


The problem with it is that it only runs once at the beginning of the program.

 


...The new one should be be to introduce and save his details without stopping the acquisition.

Save where? In this secondary file, or in the measurement file as a comment?

 


Technically, I don't know how to modify the producer/consumer scheme to introduce the new loop with the case structure maintaining the data acquisition as the main loop.

Hope to have answered your question, if not let me know.


I'm not sure I understand what you are asking. Are you saying you don't know how to add another loop to the code? Or are you saying you don't know how to use the event structure?

0 Kudos
Message 8 of 16
(3,067 Views)

Hi Smercurio_fc

 

Thanks for the reply.

 

1 - I know that the Write Spreadsheet File writes the file just at the beginning of the program and I want to avoid it. I want to be able to write my comments many  times during the acquisition, and I think I should modify the producer/consumer scheme in some way

2- The comments have to be saved  in a new file and not as simple comments on the file saved by the Write Measurements file

3 - I don't know how to introduce a new loop in the producer/consumer scheme

 

Hope to have answer to your questions 🙂

 

matomato

 

0 Kudos
Message 9 of 16
(3,064 Views)

 

Hi Systemcrash

 

this is the vi converted for the version 8.6.

 

matomato

0 Kudos
Message 10 of 16
(3,048 Views)