LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

parallel execution

Hi, all . based on the requirement, I need to creat a parallel execution in my vi.
 
my requirement is the mail vi will read buffer   and the sub vi only for read data from rs232 and then put the data into buffer.
 
in the sub vi, it will be executed at all time. and in the mail vi, i read the data and then compare with my exist data, if it doesn't match and read data from sub vi again.
 
i think i will creat two loops, but not quite sure how to result the parallel execution. it looks like some queue function needed to be used but i don't know how to use that.
 
can anyone show some examples in parallel executions with some queue functions?
 
many thanks
0 Kudos
Message 1 of 7
(3,295 Views)
There area a few examples that ship with LV. Use Help/Find Examples/ search on queue.
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 2 of 7
(3,283 Views)
Heres a basic example of using queues.  Also shows basics of coordinating between the two.  You can use just about any data type for the queue (I usually use a strict type def enum) but for this example I just used a plain double.
0 Kudos
Message 3 of 7
(3,277 Views)

Thanks

at moment, i can use the parallel execution in some queue function, and my new problem is i need to transfer the data (which is in serial port) in subvi to main vi to process. but actually  I don't know which function i will use in lanview to store the data in serial port.

 

thanks

0 Kudos
Message 4 of 7
(3,272 Views)
Why must your serial data be captured in a subvi?  Just do it in your main vi and your problem is solved.  If you must do it in a subvi, have the subvi read the serial port once, then it ends.  Pass the data to main through a connector pane.  In main, put the subvi in a continuous loop to continually get serial data.
- tbob

Inventor of the WORM Global
0 Kudos
Message 5 of 7
(3,268 Views)

The reason why i use parallel execution is: the test system i develop is for testing different termianl. the different termianl will send different bytes at the begining through the rs232.

i firastly set up a bytes to read( thread) , but actually i don't know how many bytes will be send from another termianl. So i try to use the parallel execution, the subvi is only to do read data from rs232 and put in itnto buffer, which is also use to get response from the termianl when doing the test. and the main vi is to do read the data from the buffer and process the data.

so, my questions are:

 1) i try to use a vi to result the function, but the string i read from subvi can't stay, for instance, firstly,  the bytes  is 300 bytes and it dispaly in windows and then 150 bytes come in and then display, but the first one was been flushed. i just want to keep the first received string.

2) in fact, when i received the string, i also need to use them to compare with some existing string. so how to process theses string displayed in windown in labview.

 

many thanks

 

0 Kudos
Message 6 of 7
(3,254 Views)

In your main vi, create a parallel loop and a string indicator array.  Inside the loop, call your subvi that gets the serial data.  Just get the serial data once, and pass it back to the main through the connector pane.  In main, create a shift register in the loop, and each time the serial subvi is called, insert the string received into the array using the shift register and Insert Into Array function.  That way, each time serial data is read, the array becomes populated with the new data.  Old data is still there.  See picture:

Message Edited by tbob on 10-06-2005 11:24 AM

- tbob

Inventor of the WORM Global
Message 7 of 7
(3,236 Views)