31 Replies Latest reply on Apr 19, 2019 8:19 AM by hebgent

    2 Amounts for 1 compound

    ryanm4

      Hi am currently running version B 02.02 SR2(260) and im trying to get 2 amount results for 1 compound. I would to add a second calculated amount based on the original amount from the calibration Table. Is this possible ?

        • Re: 2 Amounts for 1 compound
          ryanm4

          To make is simpiler, can I get the report to give me amounts with and without the multiplier ?

          • Re: 2 Amounts for 1 compound
            hebgent

            Hi ryanm4,

            Yes you can achieve this with a maro.  There are 2 ways that I've used in the past to achieve things like this.

             

            1) (I prefer this way because it gives you more options and less coding)

                a) Make a 2nd method "Method2.m"

                b) In that method change "From Data File" to "From Sample Defaults Below" in the "Data Analysis Window" "Report/Specify Report" dialog window.

                    This will now allow for you to change all sorts of options within that method.  Different calibration, different report types or anything else you want.

                c) Make a macro to use that method.

                    NAME TWOMETHODS

                        LOCAL METHODNAME$           

                        METHODNAME$ = _methfile$        !save method name

                        LoadMethod _methpath$,"Method2.M"    !Load method

                        RUNDAMETHOD                            !generate report

                        LoadMethod _methpath$, METHODNAME$    !Load old method

                    ENDMACRO

                d) Add the macro to auto load on GC initilization.

                    Place macro in user.mac text file in "C:\Chem32\Core"

                e) Add macro to execute as a postrun macro in the original method.

                    This is done with the "Runtime checklist"

             

            2) This other way is to code this all by hand and that just seems like a lot more work then is necessary.   

             

            Tim

              • Re: 2 Amounts for 1 compound
                ryanm4

                Thanks I will have a go at this first thing and let you know im successful. I am assuming I change METHODNAME to my current method. iv never created a macro but in had an attempt in notepad and saved it as a txt file. can you clarify what you mean by user.mac file in the " "C:\Chem32\Core"

                 

                 

                again many thanks,

                  • Re: 2 Amounts for 1 compound
                    hebgent

                    ryanm4,

                    METHODNAME$ is a string variable used to store the current method name before we change methods so we can reload the original method after.  You could remove it and just hard code the method name in.  In that case it would look like.

                            NAME TWOMETHODS

                                LoadMethod _methpath$,"Method2.M"      !Load method

                                RUNDAMETHOD                                      !generate report

                                LoadMethod _methpath$, "Method1.M"    !Load old method

                            ENDMACRO

                     

                    Chemstation will automatically load macros into memory when the instrument is initialized if they are in the user.mac file.  That file need to be stored in the "C:\Chem32\Core\" directory.

                  • Re: 2 Amounts for 1 compound
                    ryanm4

                    can you please describe hot to add the macro to execute on the runtime checklist. what do I need to type in the runtime checklist?

                      • Re: 2 Amounts for 1 compound
                        ryanm4

                        in managed to get the macro in the run time table . thanks! Howver the "Method2.m" is not printing the report. is is set up in the method to do so. any ideas?

                          • Re: 2 Amounts for 1 compound
                            hebgent

                            Hi ryanm4,

                            "Method2.M" is the name of your method with the different parameters.

                            "Method1.M" is the name of your original method.

                             

                            Can you confirm that method2 is being loaded at the end of the run.  If you watch Chemstation you'll be able to see it load method2 after the run it done, run data analysis and then reload method1.

                             

                            This is what the Runtime Checklist should look like.

                              • Re: 2 Amounts for 1 compound
                                ryanm4

                                I can confirm it is not loading "Method2.M". in unsure why. I have took a picture of the macro code below. I have copied the post run command as shown to.SUGARSLSC2 is the name of the original method.





                                   
                                 
                                 
                                 
                                 
                                 
                                 
                                 
                                 
                                 
                                 
                                 






                                   
                                 
                                 
                                 
                                 
                                 
                                 
                                 
                                 
                                 
                                 
                                 






                                   
                                 
                                 
                                 
                                 
                                 
                                 
                                 
                                 
                                 
                                 
                                 





                                  • Re: 2 Amounts for 1 compound
                                    hebgent

                                    ryanm4

                                    There needs to be a space after LoadMethod.

                                    Tim

                                      • Re: 2 Amounts for 1 compound
                                        ryanm4

                                        thanks Tim, I have added a space but its still not ladoing the method. when I type it directly into the command line there is a parsing error.macro2.jpg

                                          • Re: 2 Amounts for 1 compound
                                            hebgent

                                            ryanm4,

                                            That's strange, this should work.  Lets try a few thing.

                                            In the command line type "SHOW".  Then select "Macros" on the left and scroll to "LoadMethod" and select.  It will show the parameters for the macro at the bottom of the "Show" window.  Confirm that parameters are the same as the picture below.

                                            Then select "System Variables" on the left and scroll to "_METHPATH$" and select.  It should show the path to where your methods are stored.

                                            Then confirm the method name "Method2.m" is correct.

                                            Lastly you can try loading the method from the command line.  For example I could load a method using the command below.

                                            LoadMethod "C:\CHEM32\GC4\METHODS\", "Method2.M"

                                              • Re: 2 Amounts for 1 compound
                                                ryanm4

                                                it looks like the paramaters are slightly differentmacro3.jpg

                                                  • Re: 2 Amounts for 1 compound
                                                    hebgent

                                                    ryanm4,

                                                    All that is needed by the macro are path$ and file$ so it should have worked correctly.

                                                    Have you tried the command line.

                                                    LoadMethod "C:\Chem32\1\Methods\", "Method2.M"

                                                     

                                                    I'm assuming "C:\Chem32\1\Methods\" is the location of that instruments methods and there is folder in that directory called "Method2.M".

                                                    Also check to make sure that "Method2.M" is not a damaged method by manually loading it within chemstation.

                                                    I currently don't have B02.02 installed any place but I'll see if I can find a copy in storage and test the macro to make sure it works.

                                                     

                                                    Tim

                                                      • Re: 2 Amounts for 1 compound
                                                        ryanm4

                                                        The command line does work . I am also able to load it with the chemstaion. Are you able to send the macro over as a notepad file so I can upload it . this should rule out any typos I may have made .

                                                         

                                                        regards,

                                                        Ryan

                                                          • Re: 2 Amounts for 1 compound
                                                            hebgent

                                                            Here you go.

                                                            • Re: 2 Amounts for 1 compound
                                                              hebgent

                                                              ryanm4,

                                                              I looked closer at your screen shot of your macro and noticed that the file name is "TWOMETHODS.MAC".  In order for the macro to be loaded when Chemstation initializes the file needs to be named user.mac and placed in the "Core" directory. "C:\Chem32\Core\"

                                                               

                                                              You can check to see if your macro has been loaded by using the "Show" command.  Your macro should be listed in the Macros section.

                                                                • Re: 2 Amounts for 1 compound
                                                                  ryanm4

                                                                  pic2.jpg

                                                                  Thanks , I have made the changes and the macro is showing below.I will let you know if this works. many thankspi3.jpg

                                                                    • Re: 2 Amounts for 1 compound
                                                                      ryanm4

                                                                      the macro is now attempting to run , when it does It say method 2 does not exist. I have checked the C:\Chem32\1\Methods\ and there is a folder there containing the method. I can load the method from the command line and on the chemstaion.

                                                                       

                                                                      Ryan

                                                                        • Re: 2 Amounts for 1 compound
                                                                          hebgent

                                                                          Hi Ryan,

                                                                          We are getting closer.  Lets check the parameter _methpath$.

                                                                          In the command line type "Print _methpath$"

                                                                          It should return "C:\Chem32\1\Methods\"

                                                                          Then double check the method name in the macro and make sure it matches the method folder name. I'm guessing both the macro and the folder names should be "Method2.M".  Try not to use any spaces.  Method names are not case sensitive, so "METHOD2.M" and "method2.m" are the same.

                                                                          Hope this helps.

                                                                          Tim

                                                                            • Re: 2 Amounts for 1 compound
                                                                              ryanm4

                                                                              when I type "Print _methpath$" in the command line it does return "C:\Chem32\1\Methods\". The method names are the same , both are called method2.M . in the macro, should it contain the speech marks for the "METHOD2.M"? and "SUGARSLC2.M" ?

                                                                                • Re: 2 Amounts for 1 compound
                                                                                  hebgent

                                                                                  OK, this should work.

                                                                                  Yes the method name needs to be placed in speech marks, otherwise the macro will interpret the method name as a variable to be evaluated.

                                                                                  So if you type (LoadMethod _methpath$, "Method2.M") in the command line it loads the method but the macro gives an error (does not exist)?  If so lets try to simplify the macro to figure out whats wrong.  Lets change it to whats below.

                                                                                   

                                                                                  NAME TWOMETHODS

                                                                                  LoadMethod _methpath$,"Method2.M"

                                                                                  ENDMACRO

                                                                                    • Re: 2 Amounts for 1 compound
                                                                                      ryanm4

                                                                                      the method name is in speech marks. When I type LoadMethod _methpath$, "Method2.M" in to the command line the method does loadbut whe the macro runs is says Method2.M does not exist.

                                                                                       

                                                                                      I upded the macro to  :

                                                                                      NAME TWOMETHODS

                                                                                      LoadMethod _methpath$,"Method2.M"

                                                                                      ENDMACRO

                                                                                       

                                                                                       

                                                                                      it also says method.2 does not exist in the command line.

                                                                                        • Re: 2 Amounts for 1 compound
                                                                                          hebgent

                                                                                          Wow, that is weird.  At this point I'm guessing there is something wrong with whatever module the macro parser uses.

                                                                                          Lets try something to test whether it's the LoadMethod macro or the parsing of all functions.  Change the macro to whats listed be. It should return an Alert box with the path and method.

                                                                                          Let me know if this works?

                                                                                          NAME TWOMETHODS

                                                                                          Button = Alert (_methpath$ + _methfile$)

                                                                                          ENDMACRO