ChemStation How to create a macro to Extracting Specific Absorbance Signal from 3D IsoPlot

I have existing data from runs looking at a spectrum of wavelengths and am looking to streamline the 'saving to .csv' part of the process.
Currently I am opening each sample as an isoabsorbance plot and saving individual wavelengths as signals (eg 300-600 in increments of 10), then extracting those as .csv files.

For a more detailed explanation, I am following this method: 

  1.  Extracting Specific Absorbance Signal from 3D IsoPlot with OpenLab ChemStation: https://community.agilent.com/knowledge/chromatography-software-portal/kmp/chromatography-software-articles/kp764.extracting-specific-absorbance-signal-from-3d-isoplot-with-openlab-chemstation  
  2. then this:  How to Export XY Data from Chemstation or OpenLab ChemStation to a CSV File 
  3. Then combining the saves into one file with Time and Absorbance values for each wavelength.
      1. e.g
    Time 400 410 420
    0.00145 1.173496 1.142502 1.424313
    0.008117 1.178265 1.146317

    1.426697

I found this which is similar however is for the online/current runs only and not for already saved runs, and also for pre-set wavelengths and not spectrum:  RE: Post-run Macro to export Signal Raw Data to ASCII 

I have been having troubles trying to adapt this macro to be used in my case.
Any help will be appreciated.

  • Hi there,

    You can extract a specific signal from the DAD data by using the LoadChrom command;

    LoadChrom [Detector], [TimeRange], [WLRange], [RefWLRAnge], ToReg

    So for example LoadChrom, 0:0, 215:225, , ChromReg would load 220 nm with a bandwidth of 10 and no reference and would add this signal to the ChromReg register.  Note that this will not actually display the signal graphically; the DrawSignals macro can be used for displaying it although it's not necessary if you just want to extract the data to a .csv file.

    DrawSignals [DrawAnew], [DrawSig], [ChromNormalized], [ChromOverlaid], [ShowFileInfo], [FreezeLayout], [DrawCmd$], [ZoomSeparate]

    ex.; DrawSignals 1, 3,,,,1

    So you could have a macro that loads all the desired extracted signals to the ChromReg register and you can then go through the data (starting at the original RegSize + 1) by accessing that register using the signal numbers and looping through all of the data points as DataCols(ChromReg[signalIndex]) much like the example that you linked; Data(ChromReg[signalIndex], 0, a) would be the time and Data(ChromReg[signalIndex], 1, a) - you could then print that out to a text file and format it as you wish.  You could also go through the timepoints first and loop through the signals for each timepoint if you wanted an output file formatted as you had above.

    If this is part of a sequence, you could also set up your macro to run on all the files in the sequence and output the data file name and data to your .csv file.  You could also do that with single files in a folder, but you might need to access that list with an external script (ChemStation can run scripts through the ExecWait/ExecNoWait commands).

    Hope this helps.

Was this helpful?