Mass Hunter SDK

Try to run the quant debug tools using following code, but keep having the error. I am using VS studio 2019 and ironPython 2.7, installed the SDK from Quant B09.00

 

import clr
import sys

import System

# append quant path
# modify path if necessary
sys.path.append(
"C:\\Program Files\\Agilent\\MassHunter\\Workstation\\Quant\\bin")

# add debug dll path
sys.path.append(System.IO.Path.GetDirectoryName(System.IO.Path.GetDirectoryName(__file__)))

# load debug tool
clr.AddReference("QuantDebugTools")

import Agilent

# run
Agilent.MassSpectrometry.DataAnalysis.Quantitative.DebugTools.RunPython.RunQuant('QuantDebugTools')

 

 

ERROR: TypeError: RunQuant() takes exactly 2 arguments (1 given)

 

Parents
  • Hello

    I apologize for the extremely delayed response. I was going through old posts and found that this one had never been replied to. 

     

    Here are a few things to do that should allow you to run the shipping Quant debugging script successfully.

     

    The most important is to use the supported and tested versions of Visual Studio and IronPython as listed in the Scripting Developer’s Guide. From my limited testing I have found that the IronPython version is critical. IronPython version 2.7.5 is a must, though it can be difficult to find. I found an archived version of the older builds available on the IronPython GitHub site in their archived Main repository. It is a read only archive and contains a Windows installer for version 2.7.5 among others. The main listing of available builds can be found at this link

     

    https://github.com/IronLanguages/main/releases

     

    Next, I would suggest using Visual Studio 2015. While I have been able to get the debugging script to run in Visual Studio 2019 I can’t say how successful you may be once you go beyond that basic script. Again, it is not easy to find the older versions, but they are still available. Go to the main Visual Studio page and log in with your Microsoft account.

     

    https://visualstudio.microsoft.com/

     

    Once you get to your Visual Studio Subscriptions page go to the Downloads section to access older versions.

     

    If you are using Visual Studio 2015 you don’t need to download the Python tools separately. When installing VS 2015 choose to perform a custom install, expand the section for Programming Languages and choose Python Tools for Visual Studio.

     

    Finally, for your specific example, the final line of code should read.

     

    Agilent.MassSpectrometry.DataAnalysis.Quantitative.DebugTools.RunPython.RunQuant(sys.argv[1:])

     

    The shipping solution DebugPythonQuantScripting-VS2013.sln should be correct and will open and work in VS 2015. When run, this will launch a debug version of Quant where you can call your scripts for testing and further debugging.  

     

    Currently there is no timeline for the implementation of the latest versions of Visual Studio and IronPython with the Quant SDK, so for now I would recommend sticking with the versions suggested in the manual.

  • Hello ,

    Where can I locate the Scripting Developer’s Guide?

    Regards,

    James

  • Hi ,

     

    Starting with Quant B.08.x There is a folder named SDK on the installation media that contains an installer. After the SDK has been installed there will be a Start menu item called Quantitative Analysis SDK that opens a folder that contains shortcuts to all of the documentation. 

     

Reply Children
No Data
Was this helpful?