LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Best pattern to use for multithread in vi ?

Hi,

I need to create an app, which will communicate to 5x usb to serial converters at the same time.

App needs to detect individually when the USB device is connected, upon connection, send it a few commands, and wait for removal. This repeats when the next unit is connected.
This all needs to happen, 5 x in parralel

I am not sure what would be the besy approach to use?
The obvious would be 5 while loops, but I am sure there must be something better?

Thanks!

Goose
0 Kudos
Message 1 of 4
(2,806 Views)

5 loops might be an over complication, you might consider a queued state machine architecture.  Are these processes very time intensive?

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 4
(2,785 Views)
Thanks for the reply.
They are processor intensive I would say, as it involves downloading commands through a serial port, 5 at the same time

Do you have a example of a queued state machine architecture ?
I am fimiliar with the state machine, but a novice with queues

Thanks
0 Kudos
Message 3 of 4
(2,779 Views)
Hi Goose,

There is an example in the Find Examples option under the Help menu in LabVIEW called Queue Basics.vi - this should be useful for you if you want to get started in understanding how to use queues within your code.

Regards,

Dan - Applications Engineer
NIUK
0 Kudos
Message 4 of 4
(2,741 Views)