Visit our LabVIEW Wiki External Code Portal.
![]() |
May 12 2008, 08:00 AM
Post
#1
|
|
|
Active Member Posts: 20 Joined: 16-June 06 From: Houston, TX Member No.: 5335 Using LabVIEW Since:2004 LV:8.5.1 ,7.1.1 ,.
|
I'm having a problem of running multiple activeX instances using LabVIEW (apparently the problem occurs with more than 4 instances). This problem doesn't happen when I do the same thing in C (Visual Studio). I can create as many instances as I wish, but when I run methods that hang or run for a long period of time, only 4 are able to run at each moment. If I stop any one of the methods, the next one starts running. I attached an example (in LabVIEW 8.5.1) of using the excel activeX automation, but it happens with all of the activeX's I tried so far. It even happens when using several different activeXs. Please notice, that the problem is not with creating the instances, but when running methods of the activeX in parallel at the same time (If you run short methods that finish executing fast, you won't notice the problem).
[cross post] Thanks, Ami
Attached File(s)
Tags
This content has not been tagged yet
|
|
|
|
| Ad |
May 12 2008, 08:00 AM
Post
#
|
|
|
Tags
This content has not been tagged yet
|
|
|
|
May 13 2008, 11:27 AM
Post
#2
|
|
|
Extremely Active Premium Member ![]() Posts: 955 Joined: 9-April 04 From: Rotterdam Member No.: 349 Using LabVIEW Since:1992 LV:8.5.1 ,8.2.1 ,7.1.1
|
I'm having a problem of running multiple activeX instances using LabVIEW (apparently the problem occurs with more than 4 instances). This problem doesn't happen when I do the same thing in C (Visual Studio). I can create as many instances as I wish, but when I run methods that hang or run for a long period of time, only 4 are able to run at each moment. If I stop any one of the methods, the next one starts running. I attached an example (in LabVIEW 8.5.1) of using the excel activeX automation, but it happens with all of the activeX's I tried so far. It even happens when using several different activeXs. Please notice, that the problem is not with creating the instances, but when running methods of the activeX in parallel at the same time (If you run short methods that finish executing fast, you won't notice the problem). [cross post] You are likely running into threading limitations. LabVIEW allocates by default 4 threads per execution system and for version 8.5 per CPU core and when executing external code that suspends execution the calling thread is blocked until the external code returns. As long as you stay in LabVIEW altogether LabVIEW will attempt to schedule multiple code sequences to run in parallel even if the 4 threads do not satisfy the need of LabVIEW directly but once in external code LabVIEW has no way of gaining control back from that thread to keep your program working among multiple external calls. Solution would be to avoid blocking calls to external code altogether, or disperse the different calls into different subVIs and assign them to different execution systems, or increase the number of allocated threads to your execution system in threadconfig.vi. These recommendations are in declining order of receommendation as they will be more complicated to setup and maintain in the long run and the last one will eventually burdon the system with a load that may bring it to a halt. Rolf Kalbermatter Tags
This content has not been tagged yet
|
|
|
|
Similar Topics
| Topic Title | Replies | Topic Starter | Views | Last Action | |||
|---|---|---|---|---|---|---|---|
![]() |
7 | Michael_Aivaliotis | 2984 | 30th June 2003 - 03:16 PM Last post by: JasonKing |
|||
![]() |
11 | regisphilbin | 5624 | 26th January 2007 - 06:35 PM Last post by: GustavoK |
|||
![]() |
1 | KB Moderator | 4341 | 11th August 2006 - 04:07 AM Last post by: Cool-LV |
|||
![]() |
10 | gammalight | 2857 | 4th April 2007 - 02:11 PM Last post by: thomas2609 |
|||
![]() ![]() |
| Time is now: 29th August 2008 - 07:02 PM |