07-12-2018 07:09 AM - edited 07-12-2018 07:12 AM
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 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.
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
07-16-2018 09:55 AM
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.
07-16-2018 01:14 PM
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)
07-17-2018 03:05 AM - edited 07-17-2018 03:22 AM
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).
02-20-2019 03:45 AM
I have stumbled into similiar problem recently:
I need to call this DLL function from labview but it seems there is no way to correctly privide dll to sequence:
02-20-2019 06:29 AM
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?
02-20-2019 06:49 AM
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):
06-20-2022 04:55 AM
Hello, i have the same problem did you find a solution ?
06-20-2022 08:08 AM
@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):
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.