03-23-2007 11:58 AM
03-23-2007 03:02 PM
03-23-2007 08:13 PM
03-23-2007 09:33 PM - edited 03-23-2007 09:33 PM
Hi Paulbin,
Do you want to supply a function-pointer to a DLL so it can call[back] your VI? Here's how it can be done with .NET, though, that solution requires a C compiler.
A single "VI_to_function-reference" utility could handle all cases where the callback passes no parameters. Maybe someday somebody will share that dll.![]()
Did you know that LabVIEW can use Events for some COM-signals change? See pic. (Note: DTR is not listed -
- )

Another question is another function's prototype is WORD SetTestType(WORD comHandle, bool type1, bool type2, bool type3), I tried to use a boolean control and a Boolean to (0,1) node in labVIEW to pass parameters to CLF, I config the bool input value as U8(according to C++ bool type) and U32(according to WIN32 BOOL type), it dose not help, when I execute the VI, LabVIEW will be disappeare, it seems to be closed, I must start it again.Could someone has similar experience on this points?
It's easy to crash LabVIEW misusing CLF - maybe there's another reason for the crash besides bool mis-match(?) Do you know which "Calling convention" is required? What type is comHandle? (where does comHandle come from?)
Cheers!
Message Edited by tbd on 03-23-2007 09:34 PM
Message Edited by tbd on 03-23-2007 09:35 PM
03-24-2007 12:47 AM
Hi tbd
I have read the post which is use .net to handle this case last night. but I have not went to more deeper:)
I known VISA event can do this but the dll function from custom is handling this, I do not know the SetCallback_DTR function just only monitor DTR, if it is, I can use VISA to instead, but if not, I will lose something in it. The custom dll has a SetCallback_DTR function without Callback function, so I need to do this function by VI and make it is known by the caller SetCaback_DTR. I tried to pass a VI reference to the CLF node but unsuccessful.
And, the comHandle comes from open com function
Argument 1: [in] WORD i_wMode
Argument 2: [in] WORD i_wComNr
Argument 3: [out] WORD* i_pwHandle
this handle is used for all the process like a VISA session.
If I use VISA event, how can I handle the com handle from the dll?
Calling convention is _cdecl.
03-24-2007 12:57 AM
03-24-2007 06:52 PM
03-24-2007 07:13 PM
03-24-2007 09:20 PM
Hi Alan
Just got your name right now.
Thanks very much for your sincere reply.I am trying to look for the callback function from the custom, and I will wrap the caller and callback in another dll using CVI, hope this helpful. I know that LabVIEW8.2 has a callback feature in CLF node:)
I will try to use Olly to track the ASM code to find out whether the bool is a 8bit or 16bit or more:)
Thanks again.
03-24-2007 09:41 PM