LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Configuring an Activex server to control an ieee1394 instrument

Hi all,

I am desperately  trying to develop a program in Labwindows CVI 8.0 to control an instrument which came with an ActiveX programming interface but I am *really* lost. Could please someone have a quick look to tell me what I do wrong?

 

I have done the following:



0) I verified that the instrument works with the software from the supplier 😉

1) I used the Tools/Create ActiveX Controller Menu which created an .obj, a .sub, a .h and a .fp file

2) I added these files to my project and I tried to get some meaningful result

3) I excute the following function, which I think is needed to start the whole  ActiveX thing: 

status = ASKM48KCEKLib_New_DASKM48kCEK (NULL, 1, LOCALE_NEUTRAL, 0, &device);

and I obtain a status=0, so I believe that so far things are fine       

but any other function I found in the .fp file that I execute using the device handle that I obtain from the one above gives me status=-1 and it fails..

What is wrong? I think I really miss a point about ActiveX addressing because I cannot even run the SimpleEXE ActiveX sample in the CVI samples directory, I get an ActiveX Error: UNKNOWN ERROR (...)

A side question.. Is it possible to use the NY SPY software to monitor the comunication with the FireWire IEEE1394 port? I did not find the way to install it in MAX  (my IEEE1394 card is not from NI though..) even if windows device manager sees it correctly

Thank very much to anyone who feels like helping me. I can also provide two short sample codes in C++ and Visual Basic from the instrument producer  if they can help to debug !

Luigi








0 Kudos
Message 1 of 4
(3,052 Views)
Hi Luigi!

In my opinion that was the right way you habe done to create the instrument driver. You can also have a look at these knowlage bases.
http://zone.ni.com/devzone/cda/tut/p/id/4978
http://digital.ni.com/public.nsf/websearch/4b597f188b89b6dd862568970071f2fc?OpenDocument

The NI Spi logs National Instruments API calls that your application makes. You can configure it by selecting Spy -> Options from the Menu to configure the calls which should be loged. If you using an NI-Driver for a FireWire instrument, like a cemera it shold be no problem to log it, but you can't log the communication with your 3rd Pary driver.

Best regads
Tobias Lange
Message 2 of 4
(3,003 Views)
Tobias, thanks for the support!

but It still does not work..

Everything I do I get an error code which is UNKNOWN to the ActiveX library, so it is kind of difficult to debug..

do you know if there is any difference if you link the .obj file generated by CVI or the .c wrapper code?

the first thing i have to do to communicate with the machine, after having started the server with the New command is to tell the device where it can find the configuration file.

There is a function for this which asks as argument the server object handle, which I obtain from the New command and the path which is a char * field.

As usually I define somethingh like

char * filename="D:\\filename.ext".. is this correct when dialing with activex?

the compiler returns no error but I wonder if it just do not understand this field..

It is getting on my nerves..

Luigi

0 Kudos
Message 3 of 4
(2,976 Views)
Hi Luigi!

To your questions
"do you know if there is any difference if you link the .obj file generated by CVI or the .c wrapper code?"

"char * filename="D:\\filename.ext".. is this correct when dialing with activex?"
Yes, i think its correct!

I suggest you to refer the CVI Example located in the "CVI directory"\samples\activex\cvi or excel or word to control one of these applications by using activex, to understand how it work to control an application with cvi.

greets Tobias

0 Kudos
Message 4 of 4
(2,958 Views)