LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing LabVIEW's Sequence Context control to a Call Library Function Node

I am trying to call a vi from TestStand with the Sequence Context being passed to it then pass the sequence context to a DLL function . 

 

Sequence Context to CallSequence Context to Call

 I was able to get the wire to connect unbroken by using Adapt to Type

but the function does not  work. if I call the function directly from TestStand it will work. 

 

adapt.JPG

 

I want to call the function in a vi because I need to do some additional processing

 

I also tried using Type cast to int and changing the type of the prototype to int

 

any  help is appreciated

0 Kudos
Message 1 of 9
(4,000 Views)

Hey Rusty,

 

I took a moment to look into your issue and stumbled upon a very similar circumstance in another forum post. I believe you are running into the same issue as them where LabVIEW and TestStand are passing the context in different ways. Please take a look over that post and see if it sparks any ideas.

 

 

Hunter D.
Applications Engineer
0 Kudos
Message 2 of 9
(3,953 Views)

I saw that post when researching the problem, but I don't know what an  IDispatch is.

My DLL has      CAObjHandle seqContextCVI         as the input for the Sequence Context.

 

As far as I could tell the type CAObjHandle  is an integer (probably a pointer to the Sequence Context)

 

 

0 Kudos
Message 3 of 9
(3,942 Views)

It's some time that I worked with TestStand in LabVIEW, so I'm not sure. But is this sequence context an ActiiveX refnum or is it another LabVIEW refnum?

 

If it is an ActiveX refnum you can configure the parameter to be of type ActiveX and the subtype to be an IDispatch. LabVIEW will then pass the IDispatch or IUnknown pointer from the ActiveX object to the DLL and that DLL can then retrieve whatever it needs to get at the actual data in the ActiveX object.

 

But I'm not sure if the LabWindows CVI datatype CAObjHandle is directly compatible to a Windows IDispatch pointer or if it is a LabWindows CVI specific datatype that encapsulates an ActiveX object (and either an IDispatch pointer or an IUnknown pointer). So even with that you may not be there yet and need to do an additional step to convert the IDispatch pointer that LabVIEW passes, into the according CAObjHandle.

 

If it is a LabVIEW User refnum (which I doubt, I believe to remember that the TestStand objects are ActiveX based) you can try to configure the parameter as a pointer sized unsigned integer. LabVIEW then converts the User Refnum into the underlaying pointer that the according LabVIEW device driver API expects. This entire User Refnum business is however completely undocumented and only used by NI libraries, so use this part of the info at your own risk (most likely you do not even want to know about it).

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 4 of 9
(3,935 Views)

I have stumbled into similiar problem recently:

 

SeqEdit_s34dY5ZhKM.png

 

I need to call this DLL function from labview but it seems there is no way to correctly privide dll to sequence:

SeqEdit_s34dY5ZhKM.png

 

0 Kudos
Message 5 of 9
(3,774 Views)

I don't understand, if you want to call the DLL from LabVIEW you use the "Call Library Function Node".

Why do you say you can't  provide DLL to sequence?

Are you able to find the DLL when you configure the call library function?

 

0 Kudos
Message 6 of 9
(3,765 Views)

I have attached wrong picture,

I need to properly pass sequence context to CallLibraryFunction node in labview (sequence context is passed to subvi as an argument during TS sequence execution):

 

LabVIEW_6FfHtSkMc8.png

0 Kudos
Message 7 of 9
(3,758 Views)

Hello, i have the same problem did you find a solution ?

0 Kudos
Message 8 of 9
(2,371 Views)

@pawhan11 wrote:

I have attached wrong picture,

I need to properly pass sequence context to CallLibraryFunction node in labview (sequence context is passed to subvi as an argument during TS sequence execution):

 

LabVIEW_6FfHtSkMc8.png


Definitely try to change that Data Type to "IDispatch *Pointer". I can't guarantee that it will work but the Variant Pointer is 100% wrong.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 9 of 9
(2,363 Views)