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: 

multithreading RS232 labview

Hi every body,

 

I have to develop an application that execute 16 threads in which I communicate with 16  device via RS232 . I use a Multi port card NI8430/16.

 

Is that possible with labview. Can it work in parallel. I have no idea about multithreading. Can you give me an example. the pc, need it any special configuration.

 

Thank you for help it is very urgent

0 Kudos
Message 1 of 10
(3,796 Views)
Can't you just create 16 of these and then read and write from each?
Message 2 of 10
(3,783 Views)
LabVIEW is definitely capable of multithreading.  All of the threading is handled internally in LabVIEW.  I think that PRCalDude's recommendation is a good one. 
Nick Keel
Product Manager - NI VeriStand and Model Interface Toolkit
National Instruments
Message 3 of 10
(3,746 Views)
I think this vi (visa serial) is not re-entrant. Hence you would not gain much with creating sixteen. I would check into the actual lower level VISA functions and see if those are re-entrant. Otherwise all the threads would be just waiting for the other to finish.
Message 4 of 10
(3,728 Views)

Oskar is definitely right.  The visa serial is not re-entrant by default.  The following KnowledgeBase addresses this issue:

 

 

Accessing Serial Ports Using Parallel Execution Hangs My Program Intermittently in LabVIEW

http://digital.ni.com/public.nsf/allkb/59458684CF7861CC862565410061DB3B?OpenDocument

Nick Keel
Product Manager - NI VeriStand and Model Interface Toolkit
National Instruments
Message 5 of 10
(3,718 Views)

Oskar Bosch wrote:
I think this vi (visa serial) is not re-entrant. Hence you would not gain much with creating sixteen. I would check into the actual lower level VISA functions and see if those are re-entrant. Otherwise all the threads would be just waiting for the other to finish.

Correct, the VISA configure VI is not reentrant.  But so what?  That VI should only be called once per port at the beginning of the code.  And it would not take long to run anyway.

 

You don't even need to use that VI.  It is just a wrapper for setting a bunch of property nodes for the serial port.

Message Edited by Ravens Fan on 05-29-2009 04:51 PM
Message 6 of 10
(3,717 Views)
Hmmmm.... I can definitely see myself running into that problem in the future.  Thanks. 
0 Kudos
Message 7 of 10
(3,707 Views)
Reentrancy is not even relevant. That KB article that Nick posted was written in 1997when there were separate serial functions. Now, all serial functions are VISA. The article on synchronous/asychronous would be more relevant to this discussion.
Message Edited by Dennis Knutson on 05-29-2009 03:13 PM
Message 8 of 10
(3,696 Views)
Good article regarding the synchronous versus asynchronous. Seems useful for everyone to read.
0 Kudos
Message 9 of 10
(3,660 Views)
Thanks for all!
0 Kudos
Message 10 of 10
(3,641 Views)