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: 

error in calling .net modules

Hi,

I am having problem in calling .net assemblies. I got error like this,

 

Error calling method  of ObjectId handle: 0x4F51154 for obj 0xC2D16[--------] in domain [123.lvproj for Run] and thread 3400, (System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.

 

I saw solution for similar kind of problem in this forum, but i am anable to figure it out what actually i have to do.

The STA apartment is the "Single Threaded Apartment" and is usually the same thing as saying "the UI thread". So the object you have requires that any calls to it must be on the UI thread. To do this, go to the VI properties (right click on the VI icon to get to the properties) and select the Execution from the pull down. From this panel you can force the VI to run on a specific thread - in this case the UI thread. Do this on any VI which calls this object. 

Thnaks
0 Kudos
Message 1 of 2
(2,179 Views)

Hi there

 

Well, just do what the message says:

 

1. go to the VI properties (right click on the VI icon to get to the properties)

2. select the Execution (category) from the pull down

3. For "preferred execution system" select "user interface" 

 

Repeat 1-3 for each of your VIs calling the assembly.

Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 2 of 2
(2,163 Views)