The new OLE command export_spectra_via_variants has been introduced in both SCOUT and CODE (object generation 5.14). The command takes 5 parameters:
- input: the index of the spectrum object in the list of spectra (counting 1, 2, 3, …)
- output: a variant array holding the spectral positions (e.g. wavelengths)
- output: a variant array with simulated spectral values
- output: a variant array with measured spectral values at the same spectral positions as the simulated values, obtained by linear interpolation between the closest available points
- output: a string with the spectral unit
In object generation 4.97 we have implemented a new mechanism to pass error messages from SCOUT and CODE to OLE automation clients.
While it runs the OLE server (i.e. SCOUT or CODE) collects error messages in a list. We have introduced a view object (type ‘Error messages view’) to display the current list of error messages in a view.
Any OLE client (LabView, Excel, …) can retrieve information about the number of error messages, their type and text content. There is also a classification to separate critical errors and warnings. Once the OLE client has finished error handling it can clear the list in the OLE server.
When I try to start the software I get the message: ‘This program can be used as OLE server only!’. What does that mean?
The program has been installed with a passport file which allows to run the program as OLE server only. It cannot be started as a normal desktop application.
Very likely you have downloaded the software from our website and installed it on your system. The download packages do not contain valid passport files, i.e. valid user licences. After the installation, you have to copy a valid passport file into the program directory.
In the case of SCOUT, the passport file is called scout_passport.wtp. If you installed CODE the name is code_passport.wtp.
In the case of a software purchase you should have received a passport file from us either by e-mail or with the setup CD. If you are evaluating the software you should have received a passport file with a demo licence by e-mail.
I try to use CODE in VisualBasic but I get the error message ‘ActiveX can’t create the object’?
First check if the name of the OLE automation server in the VisualBasic command is correct. The server name of CODE is ‘code.colors’.
If this does not solve the problem, the registration of the OLE automation server is probably incorrect for some reason. When you run the setup program, CODE is registered as OLE automation server automatically. If this action failed, a call of the server in VisualBasic does not work. In this case you can do the registration manually.
Start a Windows command line by clicking on the Windows key on your keyboard followed by the letter ‘r’ (for run). You must have administrator rights to do registrations. If you are logged-in as a normal user, you can right-click the command line in ‘Start/accessories’ and select the option ‘Run as administrator’. Once the command line is available, type in the command
“c:\program files\code.exe” /regserver
where you should make sure that you use the double quotes as shown. The path of the program file code.exe must be adapted to your system, of course, i.e. it should point to the location of your code program.
If you work with different CODE versions on one computer, you might want to use the command
in order to explicitly de-register a code program as OLE server.