Advertisement

Help writing macro in Chemstation

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

10 posts Page 1 of 1
I could really use some help...after realising while writing a macro to extract information to excel reports that some information can't be extracted without reading the data from the reports, i have turned to seeking help to do this.
[...]
I have figured after reading the Chemstation Help, that the macro should solve this problem. Only thing is, i don't really know how to do it right now.
Problems/things i don't know:
1)Which file contains this information on the harddrive?!
2)how to extract the data according to modification times from the reports?
[...]
Select Help > About, and post the revision and build number of your ChemStation software.
The following relates to the GC ChemStation.

When you load a signal file into ChemStation, a register is built up which will contain the information you are looking for. If you have a signal loaded and you then type the following into the command line, Print ObjHdrVal(Chemres,"AcqMethModTime"), you will get a large number. This number is time of the change given as the number of seconds from midnight on January 1st 1970. The task then is converting this to a meaningful date and time..............

Gasman
Based on Gasman's reply, use:

A=ObjHdrVa(ChromRes,,"AcqMethModTime")
MethModTime$=Time$(1,A)

Then use MethModTime$ in your report.
nimbi63,

Thanks, you learn something new everyday.

Gasman
Select Help > About, and post the revision and build number of your ChemStation software.
Sorry first of all for the late post. i had some personal trouble (when they come, they come all together! :() and didn't have a pc for a few days.
The Chemstation Revision is: Rev.B.03.02[341]

Thanks a million for your kindness!
Regards,
Leni

PS. so i just write a simple macro with those few lines?
Help?!?! :(
nimbi63 , GasMan please send me an email to lenard21@gmail.com and help me a bit more, because i'm experiencing some difficulties, which i was not expecting. Thanks you. Your help is greatly appreciated.
Hello,

Sorry, was at the beach for several days. :D

Create a Report Layout (or just open estd.frp) and in the General section, place fixed text as:
Method Mod Time:
Then select the Text at the top and draw the area where you want the date/time. Select 'Computed Text (user defined macro)" Click the 'Select File' and choose ShortUtil.mac, for the name, after USR_ enter 'MethModTime$", then 'Edit Macro/Append new Macro Frame to file".

The macro will open, scroll to the bottom to find:
********************************
name USR_MethModTime$
********************************
At the top of this macro will be a line:
local Text$
change this line to:
local Text$, A

just after the comments (lines starting with an exclaimation mark '!') enter two lines as:

A = ObjHdrVal(ChromRes,"AcqMethModTime")
Text$ = Date$(2,A,"dd MMM yyyy ")+ Time$(1,A)

Following this will be the "Return Text$"

Save and close the macro, select File and save the template (or Save Template As..).
Select File > Add to Report Styles, and give your new report a name.

in Data Analysis, go to Report > Specify Report, and in 'Style", select your report.

Save the method, and print the report.
Hello,

Sorry, was at the beach for several days. :D
Thanks a million man, you're a lifesaver. Hope you enjoyed your time at the beach. I'm forever in your debth.
Respect and regards,
Leni
10 posts Page 1 of 1

Who is online

In total there are 10 users online :: 0 registered, 0 hidden and 10 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: No registered users and 10 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