The macro at the end of this post runs as a Customized Data Analysis Macro (see the Runtime Checklist dialog box). I use this for flow injection analysis, with no column between the autosampler and the diode array detector. In effect, the HPLC becomes an automated UV spectrophotometer. Note that the time point numbers in the first column of the output CSV file and wavelength numbers in the first row are estimates based on the programmer's knowledge of the method, not derived from the raw data source. The variables runtime, Lmin, and Lrange are programmed to fit the method. The example below is for a 1.5 minute runtime, and a range from 200 to 600 nm. The macro was developed under Chemstation A.10.02. The DAD was an 1100 series.

If you know of a Chemstation SIG or user forum, I would be delighted to hear from you. Agilent provides very little support for the macro language and for data export, and I would like to share information with other users.


Name flowinj
runtime = 1.5
Lmin = 200
Lrange = 400
specPath$ = ObjHdrText$(_Config[1],DADataPath)
specFile$ = ObjHdrText$(_Config[1],DADataFile)
open specPath$ + specFile$ + "\spec3d.csv" for output as #7
loadspectra ,,,spec3d
Tnum = datarows(spec3d[1])
Lnum = datacols(spec3d[1])
line$=","
for index = 1 to Lnum
line$ = line$ + val$(Lmin + (index*Lrange/Lnum)) + "," !load wavelengths into first row of file spec3d.csv for 200 to 600 nm bandwidth
next index
print #7, line$
!loads data into subsequent rows of file spec3d.csv
for Tindex = 1 to tnum
print "Exporting 3D UV data, timepoint ", Tindex, " of ", Tnum, " to ", specPath$ + specFile$ + "\spec3d.csv"
line$ = val$(runtime*Tindex/Tnum) + "," !sets first column to time in minutes for 1.5 minute runtime
for Lindex = 1 to lnum
line$ = line$+val$(data(spec3d[1], Tindex, Lindex)) + ","
next lindex
print #7, line$
next tindex
print "Finished exporting 3D UV data to ", specPath$ + specFile$ + "\spec3d.csv"
close #7
delreg spec3d
remove flowinj
endmacro

flowinj