Post-run Macro to export Signal Raw Data to ASCII

Dear All,


I'm using a GC system 7890A and controlling it with Chem-Station software.


I was wondering if anyone can help me in finding a way to automatically export the signal raw data to an ASCII file, ideally also with the option of choosing the folder destination.


I have already tried to modify the report output, however I managed to produce only a .txt file containing the integrated peaks' area, but not the signal raw data (X and Y values).


I think the answer lies in writing a post-run command/macro to be inserted when I edit the method that I use, however I am really unfamiliar with macro running and would be grateful if you could help me in this, or any other solutions I am not aware of.


Thanks in advance for your time


Best Regards,



  • Hey,


    thanks a lot for getting in touch and helping me with tags.


    I've already contacted my local Agilent Support team, but wasn't really helpful, saying he would have contacted some collegues to try to solve it.


    Thanks again for your support, let's see if someone can help!

  • Hello,


    I added tags to this post to increase visibility.


    I am not aware of a macro that will automatically export the raw signal data to an ASCII format file. I recommend that you contact your local Agilent support (Contact Us | Agilent ) and they can check their resources. If need by, they can provide you with a quote to have the macro developed.

  • Hi Amedeo,

    You should be able to do this with a simple postrun macro.  The signal data is suppose to be stored in the ChromReg register.  The "Macro programming guide" covers the basics of this.  You just need to export it out of the register.  I believe Agilents website still has a downloadable version of this old but applicable manual.

    If you don't want to try programming this yourself,  I'll try and write something for you when I have some spare time.


  • Hi Amedeo,

    Here is a quick proof of concept for exporting the signal.

    Is this what your looking for?  How would you want to choose a folder destination?

    Do you know how to load macros at system initialization?



        Local TimeSignal        !Number of x axis data points

        Open "C:\Chem32\Report.txt" for output as #3

        TimeSignal = DataCols(ChromReg[1])

        for i = 1 to TimeSignal

            print #3, Data(ChromReg[1], 0, i), "," , Data(ChromReg[1],1,i)

        next i

        Close #3



    Attached is what the macro generated.

  • Hi Amedeo,

    Attached is a more complete macro for you.  It will export multiple signals and place the ASCII file in the samples data directory.

    Just put the user.mac file in the C:\Chem32\Core directory and add the "EXPORTSIGNALS" macro to the post run macro in the runtime checklist.


    Let me know if you have any problems.

  • Hi hebgent!


    I tried your macros but keep getting parser errors.

    user.mac and extractsignal.mac are both placed in the CORE directory.

    Extractsignal.mac is set as the postrun macro.

    I have also tried user.mac as the postrun macro and have tried them both from the command line.

    There is always a parser error.

    We are using the latest release of Chemstation.

    Currently, I have 3 signals; 2 from the DAD and one from the FID.


    Any thoughts?



  • 1) Chemstation C.01.08

    2) Sequence

    3) I copied user.mac into the CORE directory. There was another short macro that you posted named EXPORTSIGNAL, so I thought that was the one you referred to in the runtime checklist. 


    Should user.mac be renamed to "EXPORTSIGNALS.mac" and the entry EXPORTSIGNALS (no.mac) be put into the runtime checklist as the post run macro?


    Thanks for getting back to me so fast!

  • Hi davidmilunic,

    1) What version of Chemstation are you using?

    2) Single run or sequence?

    3) There was only 1 file (user.mac) to add to the CORE directory.  Did you move the macro to its own file?  Did you change the name to extractsignal?  The name change shouldn't make a difference, I just trying to make sure we're calling everything the same.  Reduce confusion.

    4) In the Runtime Checklist / postrun only use "EXPORTSIGNALS" not "EXPORTSIGNALS.mac".  If I use "EXPORTSIGNALS.MAC" it results in a parser error.


    I tested the attached user.mac file on OpenLab C.01.07 on a 7890A and a single injection with success.


  • Ignore the short macro I posted called EXPORTSIGNAL.  That was just a proof of concept and would only export 1 signal to a predetermined location. 

    The user.mac file I post should be left as is and placed in the CORE directory.  When you start Chemstation and it initializes it will automatically load any macro in the user.mac file.  Then just put EXPORTSIGNALS (no.mac) into the runtime checklist as the post run macro.  The macro name inside the user.mac file is EXPORTSIGNALS.



    FYI, from the commandline you can type SHOW and you will get a dialog box with a bunch of Chemstation parameters / Function and even user macros.

Was this helpful?