LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I control a CVI application from within another CVI application?

Is there another way than TCP/IP to control my CVI application? I see nice Excel demos, well, that's the kind of control I mean.

To be more specific: I've written a display and analyze program (see http://www.phys.tue.nl/people/etimmerman/specview ) that I want to use as the display within several measuring programs (and compiling it with the measuring program would make seperate updates a lot harder). The measure program should write a measure file, and then let the display program know it should open that file. I am not too thrilled about doing this with TCP, and was wondering if there's another way.

Second: I would like the measure file to be clickable in the Windows explorer, which means, if
there are several measure files selected and double-clicked on, the display program should open and read all these files. Is this all done with command line parameters?

I'm not very experienced with AciveX or other ways of controlling programs, so a pointer to a nice tutorial or required reading would be welcome. A demo program too, but without the reading it would be quite a puzzle 🙂
0 Kudos
Message 1 of 5
(3,163 Views)
The easy way to do it to poll for files in your displayprogram, assuming that they are logical named files, f.e. MEASXX002 , MEASXX003.

The second option is the TCP/IP connection ,this has several advantages, in this case you can have your display program on an other computer somewhere (directories with meas files have to be shared).
The TCP/IP connection is easy and you can work with
easy ascii commands, f.e. "MEASXX003 READY" etc.
With CVI comes a simple and nice sample program in the TCP/IP folder.
0 Kudos
Message 2 of 5
(3,163 Views)
Hello

For the first part, you might also use datasocket for interprocess communication. There are a couple of examples of this installed with CVI. This would be a little simpler than using TCP, but then you would need to have datasocket support on the client as well.

For the second ( if I understood you correctly),
you can create file associations from your measure files by editing the registry. This article talks about it but it uses VB. The main thing is to see the specific registry entries being referenced. Once this is added to the registry, you would need to enable your application to support command line arguments in order to load the files up.
CVI has a Programmers tool
box that includes functions for registry manipulation you could use.

Hope this helps

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 3 of 5
(3,163 Views)
Thank you both very much for your answers.

Looking through the libraries I found the datasocket option, and indeed the TCP option would also be a possibility. However, I also came across the DDE server/client.

My idea is to make the spectrum viewer program as portable as possible, so that it can also be used by other people who write measuring programs, not only in CVI but VC++ or what have you. The fact that it can read all kinds of weird files can be handy when comparing measuring data from other sites (I'm at a university here so there's lots of reference data used). Thus it can also be of use to other guys here who write measuring programs. However, having to save a fresh measure file and then seperately having to open it in the spectrum view
er is a lot of hassle, you want to see a plot coming up the moment a measurement is ready.

The spectrum viewer program would then act as the server, and the measuring programs would be the clients, sending their data as files to display. What protocol would be the most portable and easy to implement in other programs?

As I now understand it there are several options (datasocket, TCP, DDE, even activeX) but I don't understand the difference between them very well. Is there a comparison between these protocols somewhere?
0 Kudos
Message 4 of 5
(3,163 Views)
Mr. Timmerman,

There is not a document which compares the different protocols. Blow I have given soem links to tutorials which explain the different protocols. Take a look at them to see if it clears things out for you:

DataSocket

TCP/IP

ActiveX

DDE is basicaly replaced by ActiveX. You could do a search on it to find some documents about it.

Hope this helps.


Best regards,

RikP
Application Engineering
National Instruments
Rik Prins, CLA, CLED
Software Development Engineer
0 Kudos
Message 5 of 5
(3,163 Views)