Advertisement

Code for Universal Shutdown Macro (Chemstation)......

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

6 posts Page 1 of 1
I wrote this awhile back for a friend of mine and I thought I would share the code here. It allows you to easily set shutdown method conditions based on the last method within your sequence, you don't have to remember to check the post sequence cmd/macro button in the Seq Parameters menu, and it can handle all of your shutdown conditions for any instrument in your lab regardless of type (GC, LC, MS....etc)

The following two files should go in the Chem32/Core folder

Name the following code shutdown.mac

Name Shutdown
Local MethPath$, RunMeth$, ShutDwnMeth$

MethPath$ = "C:\Chem32\1\METHODS\"
RunMeth$ = "HTSDBFFAPMACH_V3_PROPISTD.M"
ShutDwnMeth$ = "SHUTDOWN.M"

!Check For Online Status: Only call shutdown from Online Chemstation
If _OFFLINE=1
DelHook "PostSeq", "Shutdown"
Stop
Else
!Check System Variables to get current loaded method and sequence
If _MethFile$ = "COLUMNBURNOFF.M" and _SeqFile$ = "BURNOFF.S"
!Load Method to Run Samples after Burnoff cycle
LoadMethod MethPath$,RunMeth$
ExecHook "LoadMethod"
Else
!Load Shutdown Method after running any other method
LoadMethod MethPath$,ShutDwnMeth$
ExecHook "LoadMethod"
EndIf
EndIf

EndMacro

The following lines should go in the USER.MAC file (in the same directory as above)

!Loads Macros when Chenstation is initialized
Macro SHUTDOWN.MAC
!Runs Macro when Sequence and all post processing/reporting is complete
SetHook "PostSeq", "Shutdown"

By declaring a set of variables for each shutdown condition and chaining together more if statements you can easily manage all your shutdown conditions for your lab within one macro. Of course we can make this more complicated my adding timed events, running specific sequences, etc... but this should provide everyone with a nice alternative to the other available strategies.

Let me know if anyone has any questions or needs any modifications to this or any other macros. My email is josh.brewer76@yahoo.com

would this work for a manual inject-only instrument that runs methods and not sequences?

It could be modified to work for manual injection systems, but the current code as it's written won't accomplish that task.

I'm actually very curious why you'd want an auto shutdown macro in a manual injection setting?

mainly because I have people using a manual system who simply refuse to shut it down when they are done. They run their checks and then walk away from it and leave the pump running and lamps on for hours. If they can't click the OFF button themselves then I want the system to do it for them before something gets busted or needs to be replaced (again).

I figured as much... thats about the only case i could think of where a auto shutdown would be appropriate for a manual inject system.

Email me at josh.brewer76 at yahoo.com or at gmail.com with what you're looking to do and I'd be happy to throw something together for you...

Josh Brewer
Thanks a lot, LCGCBrew for sharing!

Looks quite what i was looking for.
I will try to get it running on a OpenLab CDS Rev. C..

Cheers
6 posts Page 1 of 1

Who is online

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