Advertisement

Agilent macro programing

Discussions about chromatography data systems, LIMS, controllers, computer issues and related topics.

7 posts Page 1 of 1
I'm writing a macro to automatically process data contained in the AEV files, so according to the manual I should do something like:

open aevfile$ for input as #10
open processed$ for input as #20
execwait "myprogram", #10, #20
close #10
close #20

when I do that, the compiler throws a 'parse' error on the execwait command.

If i do: execwait "test_program"
the test program run properly

So I tried to pass the aevfile$ as a parameter:

execwait "myprogram aevfile$"
but it does not interpret the aevfile$ as a variable. It consider it a string and passed to myprogram.

I'd appreciate any help on this problem.
thanks,
Sergio

Sergio,

Do you have the following information about the ExecWait command.

Executes the specified program.

Group

Application Control commands

Syntax

ExecNoWait Program_Specification, [Appearance], [InputFileNum] ,[OutputFileNum] ,[ErrorFileNum]
ExecNoWait( Program_Specification, [Appearance], [InputFileNum] ,[OutputFileNum] ,[ErrorFileNum] )
ExecWait Program_Specification, [Appearance], [InputFileNum] ,[OutputFileNum] ,[ErrorFileNum]
ExecWait( Program_Specification, [Appearance], [InputFileNum] ,[OutputFileNum] ,[ErrorFileNum] )

Parameters Type/Description

Program_Specification String expression identifying a program and its parameters.
Appearance Numerical expression evaluating into an integer
InputFileNum File number. Given file is used as input file of the program being executed.
OutputFileNum File number. Given file is used as output file of the program being executed.
ErrorFileNum File number. Given file is used as error file of the program being executed.

Discussion

ExecNoWait and ExecWait are available as commands and functions. They execute the specified program. When using ExecNoWait, the CP does not wait for the program to finish before executing its next command. ExecWait returns the program's return value, while ExecNoWait returns the task id of the application if it actually starts.
An application name without absolute path is specified from the applications current working directory.
Appearance controls the display behavior on the graphical user interface for the started program. The number has the following meaning:

1 = normal sized window
2 = icon
3 = maximum sized window
If number is omitted it defaults to 2.
By providing file descriptors for the program to read its input from InputFileNum, write its output to OutputFileNum and finally writes its errors to ErrorFileNum, the macro writer has more control over the program being executed by ExecWait/ExecNoWait.
The use of the file descriptor parameters InputFileNum, OutputFileNum and ErrorFileNum is only possible when staring DOS programs. It is not valid when starting MS-WINDOWS applications.

For backwards compatibility for previous versions the function Exec() is available, but usage of ExecNoWait() function is suggested.
ExecNoWait() is typically used before DDEInitiate to start a DDE conversation with an particular instance of an application.

Return Value

Number (if called as a function)

Copyright (c) 1990-2002 Agilent Technologies

It is normally used to call an executable program. Please not that to pass parameters, the program must be a DOS program, not a MS Windows program.

Gasman

hi Gasman,

you can pass a parameter as shown in the example 1, just after the info you copy here, although they pass a string not a variable (which my need is)
I wrote the programs that execwait call, as I said before they execute properly if I don't pass the file ID.

The problem seems to be the syntax of the call:
execwait "myprogram", #10, #20
the Agilent Macro Compiler doesn't like it, for some reason

Thanks,
Sergio

Sergio,

It is not clear to me what you are trying todo.

Is the program you are trying to execute a macro or a standalone program. Why can you not open the files in your program and then just call the program. As I use the ExecuteWait command, it is to start a program that is OUTSIDE of the Chemstation. When you open a file with a macro, it is for use within the Chemstation macros, not for an external program.

Gasman

the workflow is:

* chemist put a sample to run using EazyAccess
* sample run: during data processing the AEV report file is created;
* inside the AEVGEN.MAC (as last step, before closing) I put the call to myprogram (which needs the name and path to the AEV file just created)
* myprogram will: process the AEV file, upload some data into the company's data base, write a file into the data file folder
* EazyAccess email to the chemist the html report and the file created by myprogram

nice and simple, if just execwait worked as expected

regards,
Sergio

Sergio,

In what language is the program 'myprogram' written in. Will it support DDE. If so, it may be possible to get the information from the ChemStation into your program.

The only other way that I can see to do this is store the information that you are trying get to your program in an external file. You can then get the program 'myprogram' to read this file.

Gasman

I'm using Tcl, I don't know if it supports DDE.
You are right: I can write the path to a file and read it from there. I should have thought about it before.

thanks for the idea
Sergio
7 posts Page 1 of 1

Who is online

In total there are 567 users online :: 1 registered, 0 hidden and 566 guests (based on users active over the past 5 minutes)
Most users ever online was 4374 on Fri Oct 03, 2025 12:41 am

Users browsing this forum: Google [Bot] and 566 guests

Latest Blog Posts from Separation Science

Separation Science offers free learning from the experts covering methods, applications, webinars, eSeminars, videos, tutorials for users of liquid chromatography, gas chromatography, mass spectrometry, sample preparation and related analytical techniques.

Subscribe to our eNewsletter with daily, weekly or monthly updates: Food & Beverage, Environmental, (Bio)Pharmaceutical, Bioclinical, Liquid Chromatography, Gas Chromatography and Mass Spectrometry.

Liquid Chromatography

Gas Chromatography

Mass Spectrometry