LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

queue problem!. Put the queue in mainscreen...

Hi,
I am using the queue for get the serial port readings. It works well, but I only got running another vi to get the full readings and later use all the data in the main panel to anothers calculations... Now, I want use subvi to get the data from serial using queue and while is getting the data it sends the data to main panel in real time. My problem is I dont know get it in frontpanel.
That's why I have put one example to see it. Its very simple example, but i think would be enough to solve it.
I hope anyone help me, since I suppose it is one stupid error.
 
In example, exist subvi queue that get the data and put in queue. And this vi send the data to mainpanel. I put simple 3 numbers in array.
I would like to see the 3 numbers in the same time in main vi as subvi.
 
Thanks for your help!.
Regards.
Download All
0 Kudos
Message 1 of 16
(4,248 Views)
You are destroying the queue in the sub-vi.  Threfore there is no queue to read in the main vi.
0 Kudos
Message 2 of 16
(4,242 Views)

Jasonhill,

CAn you adjust it to see in main or tell me how do it?.

Regards.

 

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

Hi, can anyone help me?. I would like hear advise to get it. I dont know a lot on queues.

Regards, Fonsi.

0 Kudos
Message 4 of 16
(4,219 Views)
As Jason said, you are releasing the queue in the sub vi.  remove the "Release Queue" in the sub-vi (indicated in picture), and it should return to normal operation.


Message Edited by Novatron on 08-02-2006 04:25 PM

Message 5 of 16
(4,202 Views)

Hi novatron,

I got it, i did it, and it runs but I have the same problem, the numbers only appear in main vi, when i close the subvi, I would like the data would arrive to main at the same time the sub-vi is getting the numbers. Since i want this subvi show several dials with the data and main vi, show graph with all the data fitted to it. Right now, removing the Release queue, it run JUST when i close the subvi.

Is possible recieve in main at the same time than subvi or bit time later, but not when it is closed???.

Thanks. 

0 Kudos
Message 6 of 16
(4,196 Views)
You could try replacing the Dequeue Element in the sub-vi with a Preview Queue Element.  Basically, you are populating and then immediately emptying the queue in the sub-vi, then the main-vi cannot read anything.
Message 7 of 16
(4,193 Views)

Thanks again Jason,

I tested it, i only got in the subvi- gets the same first number in the 3 possition, since it didnt delete the previous value. And the main got the same problem only when i close the sub-vi it gets the numbers, therefore is wrong for my application.

I am confused with it. Any help?

Thanks for help!.

 

0 Kudos
Message 8 of 16
(4,183 Views)
Do you always have three data points?  In that case, I would set the queue up as an array instead of a single value.  Also, you do not need to pass the queue as a reference.  It already has one, the name.  Just create a queue with the same name and datatype in both the main and sub-vi and they will reference the same block of memory. 

I stripped out the loop logic because it confused me.  Many of the loops seemed unecessary, and I suspect there may be a race condition in at least one of them.  I understand that you probibly simplified the program before posting your example, so I may have simplified a bit much.


Message Edited by jasonhill on 08-02-2006 04:18 PM

Message 9 of 16
(4,179 Views)

Jason,

Yes, the vis is too much difficult than this example. I maintained the loops since i have the same. Keep in mind, I am readings from serial port, each time i read 8 bytes. So it would be 8 readings each time. The values of serial port are sent to the down loop to show the frequency while it is reading the serial port. Right now works in this way. It read serial port, with queue send to down loop to show the freq and another parameters, and when i finish the acquisition, push stop and show all the readings fitted in graph on main vi. But the problem is I got the graph when it is finished. I want the graph goes drawing while it is getting the figures from serial port. I put this example simplified, to easy fitted.

Therefore, it is possible get it with this structure??. Keep in mind in main vi, i call the subvi with if-else then show the subvi, I want read from serial port and draw the graph in the same time on main vi.

If you can send me the last program, i use LV7.1

Mensaje editado por Fonsi

0 Kudos
Message 10 of 16
(4,174 Views)