Home
PEAXACT Application Server - User Manual
Contents
1. 7 You can add more components from other models to the same channel or you can add components to other channels by repeating steps 4 to 6 8 After closing all setup windows with OK you may start measuring The prediction of fea ture values takes place after each measurement Results will be displayed in the main win dow of HoloPro Solutions for Process Analytics Control Technology 5 TROUBLE SHOOTING 46 5 TROUBLE SHOOTING Problems with the COM API Symptoms You cannot access the PEAXACT COM API from your third party application Resolution In case of any problems with the PEAXACT COM API you should try the following 1 Runthe diagnosis program After starting the program it performs several tests In case of errors a possible solution is suggested You have to fix all problems before you can use the interface correctly 2 Under some circumstances the diagnosis program crashes throwing a Windows error when the COM DLL is registered incorrectly If this happens you have to register the DLL manually by executing the file INSTALLDIR DLL COM register bat Note that administrator privileges are required to execute the file Afterwards run the diagnosis again Problems with the HoloPro Custom Interface Symptoms You receive an error when trying to add PEAXACT as new Custom Method in HoloPro Resolution In case of problems with the HoloPro Custom Interface you should try the following 1 Runthe diagnosis pr
2. PEAXACT gt Activate PEAXACT Application Server e Wait until the License Activation Dialog is displayed e Take the Host ID from the dialog window then click Cancel Solutions for Process Analytics amp Control Technology 1 QUICK START e If you purchased a license for multiple computers get one Host ID for each computer Step 2 Request license file e Visit http www s pact de peaxact activation and use the web form to request a li cense file Step 3 Activate license Licenses can be activated either programmatically using the setLicense method or inter actively using the License Activation Dialog While setLicense activates a license tempo rarily the License Activation Dialog activates a license permanently by storing the license filename in the Windows registry The following applies to the License Activation Dialog e Click the Windows start menu and select Programs gt PEAXACT gt Activate PEAXACT Application Server e Wait until the License Activation Dialog is displayed fi PEAXACT License Activation License Activation Please select a valid license file for PEAXACT Application Server 3 6 0 Activation required Please select a valid license file To get a license file write down the Host ID and visit http www s pact com peaxact activation to complete activation Host ID 58 94 6B 4D 5A F9 License Info License Activation Dialog 1 License selection 3 Additional license
3. Pixel Fill 0 ec gnal Leve Max Pixel Fill con 3 Tick Multivariate in the Data Analysis Settings Panel then click the Multivariate Predic tion Setup button 4 At the top of the In the next window select a channel then click the Add Components button Solutions for Process Analytics Control Technology 4 CUSTOM INTERFACES 4h I Enabled Model 3 e Nemedl CRE Method Type Model Filename OK Add Components Remove Components Copy To Channel Show Model Info 5 From the Method Type list select New Custom Method and enter peaxact or select PEAXACT if it has already been added before It may take a while until the PEAXACT is added to the list but from then on it will be available permanently Select a method type Method Type New Custom Method y Select an existing model or Browse to open a new model Model Filename mo y Tn Cstom Met Enter Method Name PEAXACT mes Show Model Info Solutions for Process Analytics amp Control Technology 4 CUSTOM INTERFACES 45 2 Add Multivariate Components oS 2 Select a method type Method Type PEAXACT gt CE Tee Model Filename Logging Level Log File Select a method type Method Type PEAXACT z Select an existing model or Browse to open a new model Model Filename EAmodels misturelHM pxm v Select desired components from this list
4. each page separately because this will preserve line breaks and also prevents from copying headers and footers At the beginning of the script after option Explicit add Added by S PACT 3 33 33 323333 2333S 252525 2LILALA LA LLL ALLL LAA AL ALAA ALAA ALAA AIA SEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEESEEEEEEEEEEEEESEEEEEEEEEEEES Dim pxToolbox Dim outputStruct Dim isInitializedPEAXACT isInitializedPEAXACT False 09999 1 9909090099909990999999999 Added by S PACT 333323333533335333353333333352333533335233353333523332333233353233353332 MsgBox Starting PEAXACT Dim isOK logLevel logFilename Set pxToolbox CreateObject PEAXACT Toolbox Set outputStruct CreateObject MWComUtil MWStruct7 14 pxToolbox setLogger 1 isOK exception Null pxToolbox initialize 1 isOK If NOT isOK Then MsgBox Failed to initialize PEAXACT Else pxToolbox getLogger 2 logLevel logFilename If logLevel OFF Then MsgBox PEAXACT initialized amp Chr 13 amp Logging is OFF Else MsgBox PEAXACT initialized Chr 13 amp Logging to amp logFilename End If pxToolbox addModel 1 isOK lt modelFilename gt If NOT isOK Then MsgBox Failed to add model Else isInitializedPEAXACT True Customize lt mode1ri1ename gt to load your models e Substitute mode ri lenanc gt with the full path and filename of a PEAXACT model For instance the line would then read pxToolbox addMod
5. varargout foo Xl X2 varargin CH single out public MWArray foo MWArray X1 MWArray X2 params MWArray varargin put interface CH standard public MWArray foo int numArgsOut MWArray X1 MWArray X2 params MWArray varargin interface When the varargin parameter is present in the MATLAB function you can specify optional inputs list the optional inputs or put them in an mwArray argument placing the array last in the argument list When the varargout parameter is present inthe MATLAB function you can use the standard calling interface to get all output arguments returned as an array of mwarrays including those collected by varargout Solutions for Process Analytics amp Control Technology 3 APPLICATION PROGRAMMING INTERFACE API 15 3 3 Data Conversion Rules This section describes the data conversion rules When a method isinvoked on the PEAXACT COM component or NET component the input parameters are converted to MATLAB inter nal array format and passed to the compiled MATLAB function When the function exits the output parameters are converted back In MATLAB a matrix is the basic building block for all of the common data types These in clude empty matrices matrices with at least one dimension equal to zero scalars 1 by 1 matrices vectors matrices with only one row or column and regular 2D matrices 3 3 1 COM Component The COM client passes all input
6. Not used 3 3 2 NET Component To support data conversion between managed types and MATLAB types the MATLAB Utility Library provides a set of data conversion classes derived from the abstract class mwarray When you invoke a method on a component the input and output parameters are derived types of mwarray Conversion from NET to MATLAB NET Type Class NET Type Native MATLAB Data Type MWLogicalArray System Boolean logical MWNumericArray System Double double MWCharArray System String char MWCellArray cell Others Not used Not used To pass parameters you can either instantiate one of the mwarray subclasses explicitly or for managed types system Double and System String rely on implicit data conversion Conversion from MATLAB to NET MATLAB Data Type NET Type Class NET Type Native logical MWLogicalArray System Boolean double MWNumericArray System Double char MWCharArray System String cell MWCellArray Solutions for Process Analytics amp Control Technology 3 APPLICATION PROGRAMMING INTERFACE API 17 MATLAB Data Type NET Type Class NET Type Native struct MWStructArray Others Not used Not used All variables returned from MATLAB are represented as instances of the appropriate mwArray subclass For example a MATLAB cell array is returned as an mwcellarray object e Use T
7. Run the PEAXACT Installer and follow the setup instructions Additional runtime packages are downloaded and installed automatically if detected missing Offline Installation e If you are planning to install PEAXACT on a computer without internet access you have to download additional runtime packages in advance from http www s pact de peaxact runtime Make sure to download runtime packages for the same architecture as the PEAXACT installer 32 bit or 64 bit e Save all installer files without renaming them to one folder on your hard drive flash drive e Run the PEAXACT Installer file from this folder and follow the setup instructions Runtime packages are installed automatically if detected missing Step 3 After Installation e After a new product installation continue with License Activation e After upgrading an existing installation check the upgrade notes at http www s pact de peaxact whatsnew for further upgrade steps 1 4 License Activation License activation involves loading a valid license file If you already have a license file go ahead to step 3 Step 1 Find out the computer s Host ID For purchased licenses activation associates the use of PEAXACT with designated computers by means of a Host ID The Host ID is a MAC address format xx xx xx xx Xx Xx or the serial number of volume c format xxxx xxxx of the computer on which PEAXACT is installed e Click the Windows start menu and select Programs gt
8. and output arguments in the compiled MATLAB functions as type varIaNT The COM vartanr type is a union of several simple data types A type VARIANT variable can store a variable of any of the simple types as well as arrays of any of these values Conversion from COM to MATLAB VIT EMPTY empty double VT_BOOL VARIANT BOOL Boolean logical VT_R8 Double Double double VT_BSTR BSTR String char VT_VARIANT VT ARRAY VARIANT Variant cell Others Not used 1 Denotes Windows specific type Not part of standard C C Conversion from MATLAB to COM logical VI EMPTY VT_BOOL VT_BOOL VT_ARRAY double VT_EMPTY VT_R8 VT_R8 VT_ARRAY char en VT_BSTR With length 1 vr sstrwithalength gt cell VI EMPTY VARIANT With a type con VARIANT of type forming to the conver vT_VARIANT VT_ARRAY with the sion rule for the type of each array member MATLAB data type of conforming to the conversion the cell contents rule forthe MATLAB data type ofthe corresponding cell Solutions for Process Analytics Control Technology 3 APPLICATION PROGRAMMING INTERFACE API 16 MATLAB VARIANT Type VARIANT Type VARIANT Type Data Type for Empty Data for Scalar Data for Array Data Struct SU A MATLAB struct array is converted to an mwstruct object see MATLAB Utility Library This object is passed as a VT_DISPATCH type Others Not used Not used
9. by double is a vector of integration range indices for which results are returned Indices correspond to names returned by getIntegrationRangeNanes isOK scalar logical IS false in case of errors outputStruct scalar struct is a result struct with fields nDataSets scalar double is the number of processed data sets dataSetURIs nDataSets by 1 cell of strings is a cell array of URIs of all processed data sets niIntegrationRanges scalar double is the number of integration ranges for which peak areas are returned e integrationRangeNames 1 by nIntegrationRanges cell of strings isa cell array of integration range names for which peak areas are returned integrationRangeIndices 1 by nIntegrationRanges double is a vector of in tegration range indices for which peak areas are returned e A nDataSets by nIntegrationRanges double is a matrix of calculated peak areas for all processed data sets and for all requested integration ranges analysisPrediction function isOK outputStruct analysisPrediction function isOK outputStruct analysisPrediction featureldentifier Perform Prediction of all added data sets using all added models which contain a calibration model Alternative 1 featureIdentifier missing or empty If featureldentifier is omitted from the function call or empty results are re turned for all calibrated features contained in all added master models Alternative 2 featureIdenti
10. csv 1 dataSetURIs 1 c data chromatogram csv 2 pxChrom analysisClassification 2 isOK outputStruct modelFile dataSetURIs display results Note Indexing into VARIANT arrays returned by the Application Server is 1 based nDataSets outputStruct Item 1 nDataSets 2 URIs outputStruct Item 1 dataSetURIs dataSetURIs code outputStruct Item 1 classificationCode text outputStruct Item 1 classificationText For i 1 To nDataSets Wscript Echo Classification of amp URIs i amp Code amp code i _ amp Description amp text i Next Solutions for Process Analytics Control Technology 4 CUSTOMINTERFACES 8 4 CUSTOM INTERFACES 4 1 OPUS Process 4 1 1 Prerequisites Software Requirements OPUS 6 5 or higher PEAXACT 3 6 0 or higher A 32 bit installation is required OPUS 7 Workaround The following workaround is necessary for OPUS version 7 to work with PEAXACT 1 Open the Windows Explorer and open the OPUS installation directory 2 Rename file calo d11 to Calo d11_ hidden or any other name such that the file won t be found be OPUS any more Please note that this workaround disables OPUS support for Unscrambler Additional Files These instructions refer to a special OPUS script file named peaxacTtcomponentAnalysis obs The file is used as a placeholder during set up of an OPUS PROCESS scenario and does noth ing so far The file is located at InsTALLDIR DLL
11. information 2 Status of activation 4 Apply and close Choose Import License from the list 1 to browse for a valid license file If the li cense is valid the license file is copied to the license directory Solutions for Process Analytics Control Technology 1 QUICK START 8 e Once a valid license is selected you can click on the License Info button 3 to learn more about the license or on the OK button 4 to accept the selection 1 5 Before You Start 1 5 1 COM Component Before you access the COM API for the first time you should test whether everything is in stalled correctly by running a diagnosis program Click the Windows start menu and select Programs gt PEAXACT gt Diagnosis Tool for PEAXACT Application Server The diagnosis program performs some tests and suggests possible solutions in case of prob lems You have to fix all problems before you can use the COM API Typical problems include e MATLAB Compiler Runtime MCR is not installed correctly e Required DLL files are not registered correctly e Platform dependent problems e g running 32 bit software instead of 64 bit You could run the diagnosis program at any time to check whether the interface still works correctly and to reveal possible errors 1 5 2 NET Component The NET component is a design time assembly you would compile and link against when building your own managed assemblies Before you can use it you need to reference the
12. least one session exists isOK scalar logical IS false in case of errors activeSessionID string is the unique identifier of the active session after re moval or empty if isok is false addDataSet function isOK addDataSet URI function isOK addDataSet URI varargin Add data set with optional additional features URI string is the full path filename and access ID of a sample in a data file You cannot add the same uri more than once Trying so will simply update the existing data set Alternative 1 varargin missing or empty If varargin is omitted from the function call or empty the data set is added with out any additional features xy values will be read from the data file Alternative 2 varargin xData yData Alternative 3 varargin keyl valuel key2 value2 Alternative 4 varargin clear xData and yData by 1 double are optional column vectors of x values and y values to be used instead of reading xy values from a data file In this case ur can be a dummy filename If provided xData and yData must be the first two ele ments of varargin key string andvalue scalar double are the name and value of an additional feature added to the data set You can optionally provide any number of key value pairs Solutions for Process Analytics amp Control Technology 3 APPLICATION PROGRAMMING INTERFACE API 25 clear string literal is an optional switch If provided
13. or x64 CPU with SSE2 support 2 GHz recommended e 1GBof disk space 2 GB recommended 1GBRAM 2 GB recommended 1 3 2 Licensing PEAXACT software is furnished under a license agreement The software may be used only under the terms of the license agreement The PEAXACT Application Server can be installed and operated on a given number of desig nated computers provided it is only operated locally i e not remotely The number of sim ultaneous users is not limited For the full and legally valid conditions please refer to the li cense agreement document 1 3 3 Installation Step 1 Before You Install Make sure your computer fulfills the system requirements When upgrading an existing installation visit http www s pact de pe axact whatsnew and read the upgrade notes and compatibility considerations Make sure you have administrator privileges to perform the installation e Make sure your license is valid for the major version you want to install If you do not have a license yet you can get a free trial license or purchase a license after installa tion Step 2 Install PEAXACT Download the latest PEAXACT Installer from http www s pact de downloads Solutions for Process Analytics Control Technology 1 QUICK START 6 Online Installation Web Installation e If you are going to install PEAXACT on a computer which is connected to the internet you do not need to download any additional files e
14. output Solutions for Process Analytics amp Control Technology 4 CUSTOM INTERFACES 42 Search and replace placeholder script e Press CTRL F3 to open the text search dialog e Search for PEAXACTComponentAnalysis obs ignore any matches found in the first line eo A matching line should start with vntResult Form OpusRequest VBScript e Replace the whole line by Modified by S PACT 33333S3SSSSSSSSSSEEEEEESEEEEEEEEEEEESESEEEEEEEEEEEESEEEEEES vntResult o 1 9999990 e Substitute lt typeofanalysis gt with one of the following types integration Calculation of peak area requires an integration model componentFitting Calculation of component weight requires a hard model prediction prediction of feature value requires a calibration model predictionOutlierPLs calculates the probability p value for a spectral outlier towards a PLS model requires a PLS calibration predictionOutlierIHM calculates the probability p value for a spectral outlier towards an IHM model requires an IHM calibration Substitute lt 10 gt with the desired file block e g ag Substitute lt componentName gt depending on your choice of lt typeofAnalysis gt integration substitute with the name of an integration range e componentFitting substitute with the name of a component model e prediction predictionOutlierPLS prediction0utliertHm substitute with the name of a calibrated feature Be
15. used It should be called before initialize However it can be called anytime to switch the license filename string is the fully qualified filename of a PEAXACT license isOK scalar logical IS false if the specified license is invalid function isOK setLicense filename OEM Key Activate OEM license OEM licenses are available for third party software developers only who integrate PEAXACT with their software and re sell it as part of their own products to end customers Solutions for Process Analytics amp Control Technology 3 APPLICATION PROGRAMMING INTERFACE API 22 filename string is the fully qualified filename of a PEAXACT OEM license OEM Key string is a key code which activates the OEM license isOK scalar logical IS false if the specified license is invalid setLogger function isOK setLogger Create default file logger if none exists If no file logger exists a new one is created with log level nro Otherwise this method does nothing isOK scalar logical IS false if no logger could be created which means that logging is disabled function isOK setLogger logLevel Create new file logger or change existing logger If no file logger exists a new one is created with log level 1ogtevel If a file logger does exist its log level is updated to 1ogLeve1 logLevel string can be one of the following strings ALL or DEBUG EXCEPTION INFO WARNING SEVERE OFF isOK scalar logical
16. 9 PACT L sungen auf Ihrer Wellenl nge PEAXACT Application Server User Manual Version 3 7 2 2015 06 23 SePACT GmbH phone 49 241 9569 9812 Burtscheider Str 1 fax 49 2414354 4308 52064 Aachen e mail support s pact de Germany Solutions for Process Analytics amp Control Technology O COPYRIGHT 2015 by S PACT GmbH The software described in this document is furnished under a license agreement The soft ware may be used only under the terms of the license agreement Software is based on MATLAB O 1984 2015 The MathWorks Inc Solutions for Process Analytics Control Technology CONTENTS 3 CONTENTS COMES A tal 3 1 QUICK Start ano 4 1 1 What is PEAXACT Application Server 4 1 2 Getting Hel o IP O else 4 1 3 Pac a e er ee 5 1 4 A ya 6 1 5 B fore You Starts se A E OO 8 2 WAU IG OPUS a Eee 9 2 1 A E ee 9 2 2 EOG lee 9 3 Application Programming Interface API ostia BER 10 3 1 Introduction ee E cameo eed oetalees 10 3 2 Calling CONVERSA een eu 10 3 3 Data Conversion RUIE Segane gun 15 3 4 MATLAB Utility LIE ann ae ea aa a E A intone 17 3 5 A aa A ee 19 3 6 Programming EXanples neuen 34 Bes A bes Renee 39 4 1 OPUS PROCESS 5620252 a Ki ae te e a ee Cl e 39 4 2 FIGIO PTO SEP let een 43 5 Trouble Shooting a 46 Solutions for Process Analytics Control Technology 1 QUICK START 4 1 QUICK START 1 1 What is PEAXACT Application Server The PEAXACT Application Server gives third party a
17. CT functions with optional input arguments and how to handle type MWStruct variables Function Predict ByVal dataSetURI As String As Double Requirelnitialization Dim isOK As Boolean Dim outputStruct As New MWComUtil MWStruct Predict add data set pxToolbox addDataSet 1 isOK dataSetURI DBNull Value Predict 1 If Not CBool isOK Then Exit Function predict features pxToolbox analysisPrediction 2 isOK outputStruct DBNull Value Predict 2 If Not CBool isOK Then Exit Function convert results Predict CType outputStruct x Value Double End Function End Region End Class 3 6 3 Using the COM API in VB Script 37 This example demonstrates how to call the PEAXACT Application Server from a Visual Basic Script VBS VBS only supports the COM API The script uses a model to classify two chro matograms and displays results This example relies on implicit initialization of the Applica tion Server because initialize is not called explicitly create instance of class PEAXACT Chrom Set pxChrom CreateObject PEAXACT Chrom create instance of utility class MWComUtil MWStruct Set outputStruct CreateObject MWComUtil MWStruct7 14 Solutions for Process Analytics Control Technology 3 APPLICATION PROGRAMMING INTERFACE API 38 classify chromatograms according to model specifications modelFile c model file pxm dataSetURIs 0 c data chromatogram
18. Data xData new Double nx yData new Double nx addDataSet expects xData and yData to be column vectors Because a native 1D Double array would implicitly be casted to a row vector you should use one of the many MWNumericArray constructors MWNumericArray xColumn new MWNumericArray nx 1 xData MWNumericArray yColumn new MWNumericArray nx 1 yData if MWLogicalArray pxToolbox addDataSet dataSetURI x y throwLastError private void predictFeatures This function demonstrates how to deal with multiple return values and how to work with the MWStructArray MWArray varargout pxToolbox analysisPrediction 2 2 outputs Boolean isOK MWLogicalArray varargout 0 if isOK throwLastError MWStructArray outputStruct MWStructArray varargout 1 convert some fields of the result struct to native types conversion of numerical scalars using the ToScalarXXX methods Int32 nDataSets MWNumericArray outputStruct GetField nDataSets ToScalarInteger Int32 nFeatures MWNumericArray outputStruct GetField nFeatures ToScalarInteger conversion of double matrices using the ToArray method Double values Double outputStruct GetField x ToArray you can also work with the MWArray type directly but keep in mind that indexing into MWArrays is 1 based MWCellArray mwDataSetURIs MWCellArray outputStruct G
19. Filename APPDATADIR peaxactAppServer log Solutions for Process Analytics Control Technology 3 APPLICATION PROGRAMMING INTERFACE API 10 3 APPLICATION PROGRAMMING INTERFACE API 3 1 Introduction The PEAXACT Application Server is developed in MATLAB and is compiled with the MATLAB compiler to either a COM DLL or a NET assembly DLL Despite the different software archi tecture both DLLs expose identical classes and methods All methods are fully documented in subsection Class Reference using MATLAB function signatures You will be able to trans late these function signatures to COM or NET function calls with the information from sub sections Calling Conventions and Data Conversion Rules You may also learn from Program ming Examples 3 2 Calling Conventions This Section describes how to translate MATLAB function signatures to COM and NET func tion signatures A detailed function documentation can be found in Section Class Reference 3 2 1 COM Component The following tables show the mapping of MATLAB function signatures to IDL code and ex emplarily to Microsoft Visual Basic 6 Functions with inputs only no output MATLAB function foo XL X2 IDL HRESULT foo in VARIANT X1 in VARIANT X2 VB 6 Sub foo X1 As Variant X2 As Variant _ VB 6 Example Dim com As Object Dim X1 As Variant assign values Set com CreateObject myComponent myClass X1 True p
20. K outputStruct analysisComponentFitting componentIdentifier Perform Component Fitting of all added data sets using all added models which contain a hard model Alternative 1 componentIdentifier missing or empty If component Identifier is omitted from the function call or empty results are re turned for all hard model components contained in all added master models Alternative 2 componentIdentifier componentNames componentNames 1 by cell of strings isa cell array of hard model component names for which results should be returned Use getcomponentNames to get a list of available names Caution If componentNames contains names that exist in more than one hard model results are only returned for the last matching component Use Alternative 3 in this case Alternative 3 componentIdentifier componentIndices componentIndices 1 by double is a vector of hard model component indices for which results are returned Indices correspond to names returned by getComponentNames isOK scalar logical IS false in case of errors outputStruct scalar struct is a result struct with fields nDataSets scalar double is the number of processed data sets dataSetURIs nDataSets by 1 cell of strings is a cell array of URIs of all processed data sets nComponents scalar double isthe number of components for which weights are returned componentNames 1 by nComponents cell of strings is a cell array of hard
21. OPUS 4 1 2 OPUS Configuration 1 Run the diagnosis program first to test whether the PEAXACT Application Server COM API is installed and registered correctly 2 Configure a new OPUS PROCESS scenario file obs with the OPUS scenario browser a Each measurement point requires a No Evaluation data channel for triggering the measurement must be the first data channel in each case b Add data channels with data evaluation by script PEAXACTComponentAnalysis obs 3 Modify the scenario script according to instructions in next Section 4 Runthe process script in OPUS 5 In case of errors PEAXACT runtime errors are logged to the peaxactAppServer log file which is located in directory apppatapir See note in Section 2 Solutions for Process Analytics Control Technology 4 CUSTOM INTERFACES 40 4 1 3 Modifying OPUS scenario file Important Notes e Set up the whole OPUS PROCESS scenario first using the OPUS scenario browser Run and test the scenario before making manual modifications to the scenario file e Once the scenario script is modified manually the scenario should not be changed with the OPUS scenario browser anymore because this would overwrite all manual modifications Again make sure to finish all steps in the scenario browser first e Usethe OPUS script editor Menu File gt Open gt obs to modify the scenario script as follows below If you copy and paste text from a PDF version of this document copy
22. PLICATION PROGRAMMING INTERFACE API 31 Any combination of names in featureNames can be passed as input to analysisPrediction However it is recommended to get indices of these names from the order of featureNames and then pass indices to analysisPrediction be cause this is unambiguous in case of identical names getComponentNames function componentNames getComponentNames Get names of non empty component models from all added hard models componentNames 1 by cell of strings is a cell array of available component model names ordered as they appear in hard models of added master models Note Component models without peaks are ignored The cell array is empty if no hard models can be found or in case of errors Any combination of names in componentNames can be passed as input to analysisComponentFitting However it is recommended to get indices of these names from the order of componentNames and then pass indices to analysisComponentFitting because this is unambiguous in case of identical names getIntegrationRangeNames function integrationRangeNames getIntegrationRangeNames Get names of integration ranges from all added integration models integrationRangeNames 1 by cell of strings Isa cell array of available com ponent model names ordered as they appear in integration models of added mas ter models The cell array is empty if no integration models can be found or in case of errors Any co
23. S false if no logger could be created or if 1ogLeve1 is inva lid function isOK setLogger logLevel logFilename Create new logger or change existing logger If no file logger exists a new one is created with log level 10gLeve1 and log file logFilenane If a file logger does exist its log level is updated and its file is moved tO logFilename logLevel see above logFilename string is the full path and filename of the log file isOK scalar logical iS false ifno logger could be created or if the log file could not be moved terminate function isOK terminate Uninitialize the Application Server Calling this method explicitly terminates the Application Server and returns whether termination was successful If this method is not called explicitly termi nation is done implicitly when required Termination covers e Removal of the file logger if any including closing of the log file e Deactivation of the license e Removal of all sessions and runtime data isOK scalar logical S true false if termination was not successful Solutions for Process Analytics amp Control Technology 3 APPLICATION PROGRAMMING INTERFACE API 23 testFunctionlO function isOK outputStruct varargout testFunctionIO xl x2 varargin 3 5 3 This function provides a testing platform for the calling conventions and data con version rules of MATLAB functions For any input argument you pass the function displa
24. a calibrated model to predict features from a measured sample using System using MathWorks MATLAB NET Arrays namespace PEAXACT class PredictionExample PEAXACT Toolbox pxToolbox static void Main string args PredictionExampl xample new PredictionExample example run Console WriteLine Press any key to continue Console ReadKey private PredictionExample initialize Application Server pxToolbox new PEAXACT Toolbox if MWLogicalArray pxToolbox setLogger DEBUG d peaxact log throwLastError if MWLogicalArray pxToolbox setLicense c peaxact license lic throwLastError if MWLogicalArray pxToolbox initialize throwLastError private void run loadModel c peaxact model pxm loadData c peaxact sample xyz predictFeatures Solutions for Process Analytics Control Technology 3 APPLICATION PROGRAMMING INTERFACE API 35 private void loadModel String modelFilename if MWLogicalArray pxToolbox addModel modelFilename throwLastError private void loadData String dataSetURI This function demonstrates how to add data sets with known xy data Alternatively you could pass a filename Int32 nx 800 number of data points Double xData vector of x data Double yData vector of y data populate xData and y
25. all previously added data sets except any which matches ur1 will be removed before adding the new data set Option clear must be the last element of varargin isOK scalar logical IS false in case of errors addModel function isOK addModel fullFilename Add master model from file fullFilename string is the full path and filename of e either a PEAXACT model file oraPEAXACT session file containing one or more models created and saved with PEAXACT Toolbox In case of a model file a single model is added In case of a session file all models contained in the session will be added Note that models taken from a session will get a new unique filename which is composed of the session filename and the model name This filename is just used as an identifier models do not have to be present as model files on the hard disk The unique identifier enables you to load models with identical names from mul tiple sessions and still be able to distinguish between them Use getModelFilenames to get a list of all added model filenames isOK scalar logical IS false in case of errors analysisPeakSearch function isOK outputStruct analysisPeakSearch function isOK outputStruct analysisPeakSearch minPeakHeight Perform Peak Search of all added data sets using data pretreatment settings of the first added master model if any Alternative 1 minPeakHeight missing or empty If minPeakHeight is omitted from the function
26. ar on the left side of the MATLAB function and are tagged as tin out meaning that they are passed by reference in both directions Functions with mutable inputs and outputs Signature Sample MATLAB function Y1 Y2 varargout foo Xl X2 varargin IDL HRESULT foo in long nArgOut in out VARIANT Y1 in out VARIANT Y2 in out VARIANT varargout in VARIANT X1 in VARIANT X2 in VARIANT varargin VB 6 Sub foo nArgOut As Long Y1 As Variant Y2 As Variant varargout As Variant X1 As Variant X2 As Variant varargin As Variant VB 6 Example Dim com As Object Dim X1 As Variant Dim varargin 1 To 2 As Variant Dim Y1 As Variant Y2 As Variant Y3 AS Variant Y4 As Variant Dim varargout As Variant assign values Set com CreateObject myComponent myClass X1 True varargin 1 1 5 varargin 2 option A provide all inputs and outputs Call com foo 4 YL Y2 varargout X1 test varargin Y3 varargout 0 Y4 varargout 1 omit some inputs and outputs Call com foo 1 Y1 Null Null XL Null Null ll Solutions for Process Analytics amp Control Technology 3 APPLICATION PROGRAMMING INTERFACE API 13 The optional varargin varargout parameters are used by functions with mutable input out put arguments When present the varargin varargout parameters are always listed as the last input parameters and the last output para
27. as sembly in you Visual Studio project In Visual Studio right click on a project for example and click Add References The assembly file is located at INSTALLDIR DLL NET peaxact dll You also need to reference the mwarray assembly located in the same directory which de fines the mwarray data type See Section 3 4 2 for further details Solutions for Process Analytics amp Control Technology 1 QUICK START 9 2 INPUTAND OUTPUT FILES 2 1 License File The license file contains information about a license e g the licensed release version The license can be set using the setLicense method If no valid license is set the Windows reg istry is searched for a license when required If still no valid license can be found the user is prompted to select a valid license file File Extension lic PEAXACT License file License Filenames in the Windows Registry HKEY LOCAL MACHINE S PACT PEAXACT Application Server licenseSourc takes precedence over HKEY CURRENT _USER S PACT PEAXACT Application Server licenseSource License Directory ProgrammData S PACT PEAXACT Application Server 2 2 Log File By default PEAXACT writes information messages warnings and errors to a log file The ver bosity of the log file can be changed using the setLogger method If you have multiple ap plications using the Application Server you should also use the setLogger to change the default filename Default Directory and
28. ataSetURI string is the URI of an added data set The URI must match any name returned by getDataSetURIs isOK scalar logical IS false in case of errors removeModel function isOK removeModel model Index function isOK removeModel modelFilename Remove model modelIndex scalar double is the index of a currently added master model to be removed The index must be in between 1 and nModel s modelFilename string is the full path and name of an added master model The filename must match any name returned by getModelFilenames isOK scalar logical iS false in case of errors 3 5 4 Chrom Class Methods analysisClassification function isOK outputStruct analysisClassification modelFile dataSetURIs Perform Classification of chromatograms modelFile string is the full path and filename of a PEAXACT model created and saved with PEAXACT Chrom Builder dataSetURIs string or cell of strings isthe full path and filename ofa data file It can also be a cell array of multiple filenames isOK scalar logical IS false in case of errors outputStruct scalar struct is a result struct with fields e nDataSets scalar double is the number of processed data sets dataSetURIs nDataSets by 1 cell of strings is a cell array of URIs of all processed data sets This could differ from the input argument dataseturIs if some data sets haven t been processed classificationCode nDataSets by 1 doub
29. call or empty the minimum peak detection height is estimated automatically and individually for each data set Alternative 2 minPeakHeight scalar double is the minimum height for peaks to get detected while peaks smaller than minpeakHeight are ignored isOK scalar logical iS false in case of errors outputStruct scalar struct is aresult struct with fields nDataSets scalar double is the number of processed data sets dataSetURIs nDataSets by 1 cell of strings is a cell array of URIs of all processed data sets minPeakHeight nDataSets by 1 double is the matrix of actually used peak detection heights Values are equal to input argument minPeakHeight if pro vided peakPositionIndices nDataSets by 1 cell of by 1 double isacell array where each element is a column vector of indices of xData at which peaks are found Solutions for Process Analytics amp Control Technology 3 APPLICATION PROGRAMMING INTERFACE API 26 peakPositions nDataSets by 1 cell of by 1 double is a cell array where each element is a column vector of x values at which peaks are found i e peakPositions xData peakPositionIndices peakIntensities nDataSets by 1 cell of by 1 double isacellarray where each element is a column vector of y values at the peak positions i e peakIntensities yData peakPositionIndices xData nDataSets by 1 cell of by 1 double is a cell array where each element is a column
30. careful not to accidentally use names of integra tion ranges or component models Calibrated feature names can be found in the model summary report CALIBRATION SUMMARY Calibration method IHM ratiometric Features 3 Featurenmss _____Cyclohexane Dioxane Toluene Linked component models Cyclohexane Dioxane Toluene Training samples 8 e For instance the line would now read vntResult PEAXACTAnalysis prediction AB Cyclohexane e Repeat this step until all occurrences of PeEaxacTcomponentAnalysis obs are replaced Solutions for Process Analytics Control Technology 4 CUSTOM INTERFACES 43 4 2 HoloPro 4 2 1 Prerequisites Software Requirements HoloPro 3 2 0 6 or higher expected to be installed in directory c Holopro e PEAXACT 3 5 or higher A 32 bit installation is required 4 2 2 Configuration 1 Run the diagnosis program first to test whether the PEAXACT Application Server COM API is installed and registered correctly 2 Start HoloPro and open the Channel Settings menu Settings gt Acquisition Setup El Acquisition Setup General Settings Saving Channel Settings Logging Channel Name Settings for channel Hs of 4 Channel 1 O Active at Startup r Data Analysis Settings MATLAB GRAMS Multivariate Prediction Setup r Data Collection Settings CO Dark Subtract CO Cosmic Ray Filter O Intensity Correct Accums r Signal Level PE le Min
31. d Class The uwriela class holds a single field reference in an wstruct object Property Name As String The name of the field read only Property Value As Variant Stores the field s value read write The value property is the default property of the mwriela class The value of a field can be any type that is coercible to a variant as well as object types Example Processing a MATLAB struct type in Visual Basic 6 Sub foo Dim x As MWStruct Dim y As Variant Dim FieldName As Variant On Error Goto Handle Error 1 Call a method that returns a scalar MWStruct in x 1 For Each FieldName In x FieldNames y x Item FieldName Value or simply y x FieldName Valu f Check whether y is nothing empty scalar or an array Do something with y Next Exit Sub Handle Error MsgBox Err Description End Sub 3 4 2 NET Component The mwarray assembly is a helper library providing data conversion classes You reference this assembly and specify the namespace MathWorks MATLAB NET Arrays in your managed application to convert native arrays to MATLAB arrays and vice versa The assembly is located at INSTALLDIR DLL NET MWArray dll Solutions for Process Analytics Control Technology 3 APPLICATION PROGRAMMING INTERFACE API 19 MWArray Class The data conversion classes are built as a class hierarchy that represents the major MATLAB array types The root of the hierarchy is the mwarray abstract c
32. e same process will share the same workspace The benefit of this design is an efficient memory usage Also it enables you to initialize the license and logger only once per process In order to perform multiple parallel analyses the Toolbox class provides session domains Each session is an isolated environment where analyses execute The Chrom class is a sim plistic class which doesn t need sessions Exception Handling The API is designed to not throw any exceptions Instead most methods return a Boolean variable isox which is false if an error occurred while executing the method In that case getlastErrorMessage can be called to get the corresponding error message The calling function should be responsible for recovering from this state 3 5 2 Common Methods The following methods are members of both the Toolbox class and Chrom class initialize function isOK initialize Initialize the Application Server Call this method in order to explicitly initialize the Application Server Otherwise this method is called implicitly when required However explicit initialization is recommended to determine whether it was successful Initialization covers e Creation of a default file logger if none exists Use setLoger before or after initialize to customize the logger e License validation as well as license activation In case no valid license is found the License Activation Dialog is shown for the user to load a l
33. ed features RMSResiduals nDataSets by nFeatures double is a matrix of root mean square RMS spectral residuals The matrix has identical columns for features predicted by the same IHM model The matrix contains NaN elements for fea tures predicted by Peak Integration models RMSResidualsOutlierPValue nDataSets by nFeatures double is a matrix of probability values p values for each spectral residuals being an outlier The matrix has identical columns for features predicted by the same IHM model The matrix contains NaN elements for features predicted by Peak Integration models mahalanobisDistance nDataSets by nFeatures double is a matrix of ma halanobis distances The matrix contains NaN elements for features not pre dicted by PLS models mahalanobisDistanceOutlierPValu nDataSets by nFeatures double is a matrix of probability values p values for each distance being an outlier The matrix contains NaN elements for features not predicted by PLS models getCalibratedFeatureNames function featureNames getCalibratedFeatureNames Get names of calibrated features from all added calibration models featureNames 1 by cell of strings is a cell array of available calibrated fea ture names ordered as they appear in calibration models of added master models The cell array is empty if no calibration models can be found or in case of errors Solutions for Process Analytics amp Control Technology 3 AP
34. ed names for each identified component e 5S by nComponents double Isa matrix of component spectra identified from the samples y data The matrix has as many rows aS xData e C nDataSets by nComponents double is a matrix of component concentra tions for each data set identified from the samples y data RMSResiduals nDataSets by 1 double is a vector of root mean square resid uals for each sample Residuals are calculated by yData sc R2 scalar double is the fraction of variance in yData explained by sc e xData by 1 double is column vector of x values at which s is calculated analysisHMFA function isOK outputStruct analysisHMFA nUnknownComponents function isOK outputStruct analysisHMFA nUnknownComponents varargin Perform Hard Modeling Factor Analysis of all added data sets using the first added master model which contains a hard model nUnknownComponents scalar double is the number of unknown components which should be identified from the samples y data Alternative 1 varargin missing or empty If varargin is omitted from the function call or empty HMFA is performed with default settings Alternative 2 varargin keyl valuel key2 value2 key string and value class and size differs are the name and value of optional settings for HMFA The following keys are recognized isClosureC 1 by 1 logical is an optional switch to enable or disable the closure constraint of compo
35. el 1 isOK C models cyclohexaneModel pxm e lf you want to add more models duplicate the pxToolbox addModel line Solutions for Process Analytics amp Control Technology 4 CUSTOM INTERFACES 41 6000000000000060000000000000000000000000000000000000000000090 9 Function PEAXACTAnalysis ByVal typeOfAnalysis ByVal block ByVal Id Added by S PACT 2 39 393393933939393939393939329339393939329393939393939393939393932 Dim vntResult iPoint nPoints firstX lastX isOK path file URI Dim xData yData yDataRow 0 varargin 2 fieldName result result 1 initialize result If isInitializedPEAXACT Then set some options and read data vntResult Form OpusRequest BINARY vntResult Form OpusRequest FLOAT MODE vntResult Form OpusRequest FLOATCONV MODE ON vntResult Form OpusRequest DATA POINTS vntResult Form OpusRequest READ FROM BLOCK block vntResult Form OpusRequest READ PARAMETER PAT path split vntResult chr 10 1 vntResult Form OpusRequest READ PARAMETER NAM file split vntResult chr 10 1 vntResult Form OpusRequest READ PARAMETER NPT nPoints split vntResult chr 10 1 vntResult Form OpusRequest READ PARAMETER FXV firstX split vntResult chr 10 1 vntResult Form OpusRequest READ PARAMETER LXV lastX split vntResult chr 10 1 crea
36. er 0 DBNull Value logLevel Dim isOK False pxToolbox initialize 1 isOK If Not isOK Then Throw New Exception Failed lename As String logFilename to initialize PEAXACT _ amp Chr 1 End If End Sub Private Sub RequirelInitialization Initialize End Sub AddModel demonstrates how to add a model file 3 amp lastErrorMessage RequireInitialization assures that PEAXACT is initialized Public Function AddModel ByVal modelFilename As String As Boolean RequireInitialization AddModel False pxToolbox addModel 1 AddModel modelFilename End Function Solutions for Process Analytics Co ntrol Technology 3 APPLICATION PROGRAMMING INTERFACE API GetCalibratedFeatureNames demonstrates how convert MATLAB cell array of strings into a native string array Public Function GetCalibratedFeatureNames As String RequireInitialization Dim featureNames As Object GetCalibratedFeatureNames pxToolbox getCalibratedFeatureNames 1 featureNames Dim featureNamesString UBound featureNames 1 1 _ UBound featureNames 2 1 As String For iRow As Integer 1 To UBound featureNames 1 For iCol As Integer 1 To UBound featureNames 2 featureNamesString iRow 1 iCol 1 _ CStr featureNanes iRow iCol Next Next GetCalibratedFeatureNames featureNamesString End Function Predict demonstrates how to call PEAXA
37. etField dataSetURIs conversion of cell arrays requires element wise conversion MWCellArray mwFeatureNames MWCellArray outputStruct GetField featureNames String names new String nFeatures for int i 0 i lt nFeatures i names i mwFeatureNames 1 i 1 ToString 1 based indexing display results for int i 0 i lt nDataSets i Solutions for Process Analytics amp Control Technology 3 APPLICATION PROGRAMMING INTERFACE API Console WriteLine mwDataSetURIs 1 i 1 for int j 0 j lt nFeatures j Console WriteLine 0 1 names private void throwLastError 36 1 1 based indexing j values i 31 throw new Exception pxToolbox getLastErrorMessage ToString 3 6 2 Using the COM API in VB N ET This example demonstrates how to use the COM API in Visual Basic NET by means of a Wrapper Class which simply wraps COM function calls into VB code Public Class Wrapper Region Properties Private pxToolbox As PEAXACT Toolbox Public ReadOnly Property lastErrorMessage As String Get lastErrorMessage pxToolbox getlastErrorMessage 1 lastErrorMessage End Get End Property End Region Region Methods Initialize demonstrates how to initialize PEAXACI Sub Initialize ByVal logLevel As String ByVal logFil If pxToolbox Is Nothing Then pxToolbox CreateObject PEAXACT Toolbox pxToolbox setLogg
38. fier featureNames featureNames 1 by cell of strings is a cell array of calibrated feature names for which results should be returned Use getcalibratedFeatureNames to get a Solutions for Process Analytics Control Technology 3 APPLICATION PROGRAMMING INTERFACE API 30 list of available names Caution If featurenames contains names that exist in more than one calibration model results are only returned for the last matching feature Use Alternative 3 in this case Alternative 3 featureldentifier featurelndices featureIndices 1 by double is a vector of feature indices for which results should be returned Indices correspond to names returned by getCalibratedFeatureNames isOK scalar logical iS false in case of errors outputStruct scalar struct is aresult struct with fields e nDataSets scalar double is the number of processed data sets dataSetURIs nDataSets by 1 cell of strings is a cell array of URIs of all processed data sets nFeatures scalar double isthe number of calibrated features for which pre dicted values are returned o featureNames 1 by nFeatures cell of strings is a cell array of feature names for which predicted values are returned o featureIndices 1 by nFeatures double is a vector of feature indices for which predicted values are returned e x nDataSets by nFeatures double is a matrix of predicted values for all pro cessed data sets and for all request
39. icense interac tively Use setLicense before initialize toseta license programmatically and prevent showing the license activation dialog e Creation of a new empty session Solutions for Process Analytics Control Technology 3 APPLICATION PROGRAMMING INTERFACE API 21 isOK scalar logical IS false in case of errors isInitialized function isOK isInitialized Query status of initialization isOK scalar logical iS true false if the Application Server is not initialized getLastErrorMessage function message getLastErrorMessage Get message of last caught exception message string isthe text of the last caught exception It typically changes when the isox return value of other methods is false getLogger function logLevel logFilename getLogger Get logging details logLevel string is the current state of the logging level logFilename string is the current log filename If no logger is set logLevel is orr and logFilename is an empty string setLicense function isOK setLicense Activate license If no license has been set so far by either initialize or any of the setLicense methods the Windows registry is searched for a permanently activated license isOK scalar logical S true if a valid license could be found and false if not function isOK setLicense filename Activate specific license This method gives you full control over the license to be
40. lass The mwarray class has the following subclasses representing the major MATLAB types MWNumericArray MWLogicalArray MWCharArray o MWCellArray and MWStructArray MWArray and its derived classes provide the following functionality e Constructors and destructors to instantiate and dispose of MATLAB arrays e Properties to get and set the array data e Indexers to support a subset of MATLAB array indexing e Implicit and explicit data conversion operators e General methods 3 5 Class Reference This Section describes all methods of the PEAXACT Application Server API Function signa tures are noted in MATLAB syntax function outl out2 functionName inl in2 These signatures can be translated to COM and NET function calls according to the Calling Conventions and Data Conversion Rules 3 5 1 Class Design The API exposes two classes e Class Toolbox provides analysis methods of PEAXACT Toolbox e Class Chrom provides analysis methods of PEAXACT Chrom Both classes have some methods in common e g for initialization Solutions for Process Analytics amp Control Technology 3 APPLICATION PROGRAMMING INTERFACE API 20 Singleton Class Instance The Application Server API implements a design pattern which enforces each applica tion process to use a single class instance only Although it is possible to create multiple in stances of the same class internally all instances created by th
41. le is acolumn vector with classifi cation codes for each processed data set classificationText nDataSets by 1 cell of strings isa cell array where each element contains a string describing the result of classification yDataBaselineCorrected nDataSets by 1 cell of by 1 double is a cell array where each element contains sample y values after baseline correction componentRetentionTimeShifts nDataSets by 1 cell of by 1 double isa cell array where each element contains retention time shifts for all model com ponents marked as significant Solutions for Process Analytics Control Technology 3 APPLICATION PROGRAMMING INTERFACE API 34 missingComponentNames nDataSets by 1 cell of by 1 cell of strings IS a cell array where each element again contains a cell array of model compo nent names which are missing in the reference sample missingComponentRetentionTimes nDataSets by 1 cell of by 1 double IS a cell array where each element contains retention times at which a model component is missing Elements in the vector of retention times correspond to elements in the cell array of missingComponentNames additionalComponentRetentionTimes nDataSets by 1 cell of by 1 double is a cell array where each element contains retention times at which an additional component is found 3 6 Programming Examples 3 6 1 Using the NET API in C This example demonstrates how to use the NET API in C The program uses
42. mbination of names in integrationRangeNames Can be passed as input to analysisIntegration However it is recommended to get indices of these names from the order Of integrationRangeNames and then pass indices to analysisIntegration because this is unambiguous in case of identical names getDataSetURIs function URIs getDataSetURIs Get ur1s of added data sets URIs by 1 cell of strings is a cell array of URIs of all added data sets see addDataSet The cell array is empty if no data sets are added or in case of errors getModelFilenames function fileNames getModelFilenames Get filenames of added master models Solutions for Process Analytics Control Technology 3 APPLICATION PROGRAMMING INTERFACE API 32 fileNames 1 by cell of strings isa cell array of filenames of all added master models see addModel The cell array is empty if no models are added or in case of errors getModellnfo function infoStruct getModelInfo modelIndex function infoStruct getModelInfo modelFilename Get information about added master model modelIndex scalar double is the index of a currently added master model The index must be in between 1 and nMode1s modelFilename string is the full path and name of an added master model The filename must match any name returned by getModelFilenames infoStruct scalar struct is a struct with fields nDataSets function N filename stri
43. meters Both parameters are varTanT arrays each element representing one additional input or output argument The nargout parameter also counts arguments which are collected by varargout All parameters other than nargout are passed as COM variant types Data Conversion lists the rules for conversion between MATLAB arrays and COM variants 3 2 2 NET Component All classes of the NET API are organized in the namespace unser For each MATLAB function the NET component has overloaded methods to implement the various forms of a generic MATLAB function call A single output signature that assumes that only a single output is required and re turns the result in a single mwarray A standard signature that specifies inputs of type mwarray and returns values as an array of MWArray A feval signature that includes both input and output arguments in the argument list rather than returning outputs as a return value Output arguments are specified first followed by the input arguments This interface is not documented here It is recom mended to use one of the other interfaces instead The following tables show the mapping of a generic MATLAB function signature to C Single output interface Typically you use the single output interface for MATLAB functions that return a single argu ment You can also use the single output interface when you only require the first output of a function or when you want to use the first output as the in
44. model component names for which weights are returned componentIndices 1 by nComponents double is a vector of hard model com ponent indices for which weights are returned o w nDataSets by nComponents double is a matrix of component weights for all processed data sets and for all requested hard model components Solutions for Process Analytics Control Technology 3 APPLICATION PROGRAMMING INTERFACE API 29 analysisIntegration function isOK outputStruct analysisIntegration function isOK outputStruct analysisIntegration integrationRangeldentifier Perform Integration of all added data sets using all added models which contain an integration model Alternative 1 integrationRangeldentifier missing or empty If integrationRangeIdentifier is omitted from the function call or empty results are returned for all integration ranges contained in all added master models Alternative 2 integrationRangeldentifier integrationRangeNames integrationRangeNames 1 by cell of strings iS a cell array of integration range names for which results should be returned Use getIntegrationRangeNames to get a list of available names Caution If integrationRangeNames contains names that exist in more than one integration model results are only returned for the last matching integration range Use Al ternative 3 in this case Alternative 3 integrationRangeldentifier integrationRangelndices integrationRangeIndices 1
45. nent concentrations default false isOK scalar logical IS false in case of errors outputStruct scalar struct is a result struct with fields e nDataSets scalar double is the number of processed data sets dataSetURIs nDataSets by 1 cell of strings is a cell array of URIs of all processed data sets nComponents scalar double is the sum of known components from the hard model and identified unknown components nunknownComponents from the data componentNames 1 by nComponents cell of strings is a cell array of compo nent names taken from the hard model if any as well as automatically gener ated names for each identified component if any Solutions for Process Analytics Control Technology 3 APPLICATION PROGRAMMING INTERFACE API 28 e 5S by nComponents double Isa matrix of component spectra identified from the samples y data The matrix has as many rows aS xData e C nDataSets by nComponents double is a matrix of component concentra tions for each data set identified from the samples y data RMSResiduals nDataSets by 1 double is a vector of root mean square resid uals for each sample Residuals are calculated by ypata sc R2 scalar double is the fraction of variance in yData explained by sc e xData by 1 double is column vector of x values at which s is calculated analysisComponentFitting function isOK outputStruct analysisComponentFitting function isO
46. ng is the filename of the added model description string is a free text provided by the creator of the model The text is intended to describe the model but it may contain any kind of infor mation The text may contain line breaks nIntegrationRanges scalar double is the number of integration ranges con tained in the model nComponents scalar double is the number of non empty hard model com ponents contained in the model nCalibratedFeatures scalar double is the number of calibrated features contained in the model integrationRangeNames 1 by cell of strings isa cell array as returned by getIntegrationRangeNames componentNames 1 by cell of strings is a cell array as returned by getComponentNanes featureNames 1 by cell of strings is a cell array as returned by getCalibratedFeatureNanes nDataSets Get number of added data sets N scalar double isthe number of currently added data sets nModels function M nModels Get number of added models M scalar double is the number of currently added master models removeDataSet function isOK removeDataSet dataSetIndex Solutions for Process Analytics Control Technology 3 APPLICATION PROGRAMMING INTERFACE API 33 function isOK removeDataSet dataSetURI Remove data set dataSetIndex scalar double is the index of a currently added data set to be re moved The index must be in between 1 and nDataSets d
47. oArray method in order to convert an MWLogicalArray MWNumericArray Or MWCharArray to a 2 dimensional native array e Use ToScalarInteger ToScalarDouble etc in order to convert an MwNumericArray to a native scalar e Use Tostring in order to convert an mwarray to a 1 dimensional native string Conversion of an mwcellarray requires element wise conversion e Conversion of an mwstructArray requires field wise conversion 3 4 MATLAB Utility Library 3 4 1 COM Component The MWComUtil type library includes helper classes for array processing and data conver sion In particular the library provides two classes mwstruct and mwrield for processing the MATLAB struct data type returned by some PEAXACT methods MWStruct Class The mwstruct class holds a MATLAB struct type The struct is a container using named fields for storing other data types Property Item fieldName As MWField The Item property is the default property of the mwstruct class This property is used to get set a particular field in the structure Property NumberOfFields As Long The read only NumberofFields property returns the number of fields in the struc ture Solutions for Process Analytics amp Control Technology 3 APPLICATION PROGRAMMING INTERFACE API 18 Property FieldNames As Variant The read only FieldNames property returns an array of length NumberofFields that contains the field names of the elements of the structure MWFiel
48. ogram After starting the program it performs several tests In case of errors a possible solution is suggested You have to fix all problems before you can use the interface correctly 2 Under some circumstances the diagnosis program crashes throwing a Windows error when the custom interface DLL is registered incorrectly If this happens you have to reg isterthe DLL manually by executing the file INSTALLDIR DLL HoloPro register bat Note that administrator privileges are required to execute the file Afterwards run the diagnosis again Solutions for Process Analytics Control Technology
49. on sessionID Make session active Methods of class Toolbox implicitly operate on the active session If you have mul tiple sessions you can use this method to switch between them sessionID string is the unique identifier of a session to be activated If missing or empty the active session is not changed isOK scalar logical IS false in case of errors activeSessionID string is the unique identifier of the active session after switching or empty if isox is false Solutions for Process Analytics amp Control Technology 3 APPLICATION PROGRAMMING INTERFACE API 24 newSession function isOK activeSessionID newSession Add a new session and make it the active one A session is a container for models and data sets By default the Toolbox instance already has one initial session Use this method to create parallel sessions isOK scalar logical IS false in case of errors activeSessionID string is the unique identifier of the new session or empty if isok IS false You should keep track of session IDs in order to switch between ses sions with activateSession or remove sessions with removesession removeSession function isOK activeSessionID removeSession sessionID Remove a session sessionID string is the unique identifier of a session to be removed If it is the active session the next session will be activated Ifthere are no further sessions a new session will be added such that always at
50. pplications access to PEAXACT analysis methods by means of an application programming interface API The API is available as e COM Component Object Model e NET assembly Any application supporting one of these standards will be able to programmatically integrate PEAXACT as a back end analyzer for spectroscopic or chromatographic data In addition the Application Server provides customized ready to use interfaces for e OPUS Process from Bruker HoloPro from Kaiser Optical Systems 1 2 Getting Help User Manual This user manual documents a certain version of the PEAXACT Application Server You can find the version number and publication date on the title page We are continuously working on improving the manual The latest document version is dis tributed as PDF file with each PEAXACT software update The file is located in subdirectory help of the PEAXACT installation directory Technical Support The Technical Support can be contacted in different ways e E mail to support s pact de e Web form at http www s pact de support Blog The PEAXACT Blog was launched as a free source of information complementary to the user manual It contains tutorials how tos and tips amp tricks See http www s pact de blog Solutions for Process Analytics amp Control Technology 1 QUICK START 5 1 3 Installation 1 3 1 System Requirements e Microsoft Windows XP SP2 or later 32 bit or 64 bit e Intel or AMD x86
51. put to another function The single output API for a MATLAB function returns a single mwarray value y1 Signature Sample MATLAB function Yl Y2 foo X1 X2 C public MWArray foo MWArray X1 MWArray X2 The input arguments x1 x2 are MWArray types or supported NET primitive types Solutions for Process Analytics amp Control Technology 3 APPLICATION PROGRAMMING INTERFACE API 14 Standard interface Typically you use the standard interface for MATLAB functions that return multiple output values The standard calling interface returns an array of mwarray objects rather than a single array object MATLAB function Yl Y2 foo Xl X2 CH public MWArray foo int numArgsOut MWArray X1 MWArray X2 The first argument numargsout is an integer It is the number of requested output arguments numArgsout must be smaller or equal to the total number of possible output arguments Out puts y1 v2 are returned as the elements of an array of mwarrays Mutable inputs and outputs Some MATLAB functions specify an optional varargin and or varargout parameter for muta ble input output arguments When present the varargin varargout parameters are always listed as the last input parameters and the last output parameters Both parameters are ar rays each element representing one additional input or output argument MATLAB function Yl Y2
52. rovide all inputs Solutions for Process Analytics Control Technology 3 APPLICATION PROGRAMMING INTERFACE API 11 Signature Call com foo Xl test omit some inputs Call com foo X1 Null The function inputs appear in the same order as they do on the right side of the MATLAB function All inputs are tagged as in parameters Functions with outputs Signature Sample MATLAB function Y1 Y2 foo XL X2 IDL HRESULT foo in long nArgOut in out VARIANT Y1 in out VARIANT Y2 in VARIANT X1 in VARIANT X2 dF VB6 Sub foo nArgOut As Long Y1 As Variant _ Y2 As Variant _ X1 As Variant _ X2 As Variant _ VB 6 Example Dim com As Object Dim X1 As Variant Dim Y1 As Variant Y2 As Variant assign values Set com CreateObject myComponent myClass X1 True provide all inputs and outputs Call com foo 2 Yl Y2 Xl test omit some outputs Call com foo 1 Yl Null XL test The first argument nargout is an in parameter of type long It is the number of requested output arguments nargout could be smaller than the total number of possible output argu ments in which case MATLAB returns Null for all arguments gt nargout Solutions for Process Analytics Control Technology 3 APPLICATION PROGRAMMING INTERFACE API 12 Following the nargout parameter the outputs are listed in the order they appe
53. te xData ReDim xData nPoints 1 0 column vector For iPoint 0 To nPoints 1 xData iPoint 0 CDbl firstX iPoint lastX firstX nPoints 1 Next read yData and convert to 2D array vntResult Form OpusRequestData READ DATA yDataRow ReDim Preserve yData nPoints 1 0 For iPoint 0 To nPoints 1 yData iPoint 0 CDbl yDataRow iPoint 1 yDataRow starts at index 1 Next add data set URI path amp chr 92 amp file amp block 1 varargin 0 xData varargin 1 yData varargin 2 clear pxToolbox addDataSet 1 isOK URI varargin analysis If isOK Then Select Case UCase typeOfAnalysis Case INTEGRATION pxToolbox analysisIntegration 2 isOK outputStruct Id fieldName A Case COMPONENTFITTING pxToolbox analysisComponentFitting 2 isOK outputStruct Id fieldName w Case PREDICTION pxToolbox analysisPrediction 2 isOK outputStruct Id fieldName x Case PREDICTIONOUTLIERPLS pxToolbox analysisPrediction 2 isOK outputStruct Id fieldName mahalanobisDistanceOutlierPValue Case PREDICTIONOUTLIERIHM pxToolbox analysisPrediction 2 isOK outputStruct Id fieldName RMSResidualsOutlierPValue Case Else MsgBox Invalid typeOfAnalysis amp typeOfAnalysis End Selec If isOK Then result outputStruct Item 1 fieldName End If End If PEAXACTAnalysis vbLf vbLf amp CStr result set
54. tional criterion for stopping MCR after a maximum number of iterations is reached default 100 nUnsuccessfulAttempts 1 by 1 double is an optional criterion for stopping MCR after a maximum number of unsuccessful iterations default 20 e isNonnegativeC 1 by 1 logical is an optional switch to enable or disable the non negativity constraint of concentrations default false isNonnegativeS 1 by 1 logical is an optional switch to enable or disable the non negativity constraint of component spectra default false isUnimodalc 1 by 1 logical is an optional switch to enable or disable the unimodality constraint of component concentrations default false e isClosureC 1 by 1 logical is an optional switch to enable or disable the closure constraint of component concentrations default false isOK scalar logical IS false in case of errors Solutions for Process Analytics amp Control Technology 3 APPLICATION PROGRAMMING INTERFACE API 27 outputStruct scalar struct is a result struct with fields e nDataSets scalar double is the number of processed data sets dataSetURIs nDataSets by 1 cell of strings is a cell array of URIs of all processed data sets nComponents scalar double is the number of components being identified from the data This simply is a copy of the input argument componentNames 1 by nComponents cell of strings is a cell array of auto matically generat
55. vector of a sample s x values e yData nDataSets by 1 cell of by 1 double is a cell array where each element is a column vector of a sample s y values analysisMCR function isOK outputStruct analysisMCR nComponents function isOK outputStruct analysisMCR nComponents varargin Perform Multivariate Curve Resolution of all added data sets using data pretreat ment settings of the first added master model if any nComponents scalar double is the number of unknown components which should be identified from the samples y data Alternative 1 varargin missing or empty If varargin is omitted from the function call or empty MCR is performed with de fault settings This also re uses previous results for initialization of concentrations co when called repeatedly Alternative 2 varargin keyl valuel key2 value2 key string and value class and size differs are the name and value of optional settings for MCR The following keys are recognized CO empty or nDataSets by nComponents double isan optional matrix of initial concentrations If co is empty null concentrations are initialized implicitly reset This is different from omitting the argument which would initialize co with previous results if available toleranceRMSE 1 by 1 double is an optional criterion for stopping MCR when progress of iterations drops below the tolerance default 1e 5 nIterations 1 by 1 double is an op
56. ys a message box with details about the argument s type size and value from the MATLAB point of view Output arguments have predefined values In particular outputstruct is a MATLAB struct with fields of all kinds of matrix di mensions and data types xl any size and type optional first input default value default x1 x2 any size and type Optional second input default value default x2 varargin any size cell optional further inputs collected in a cell array isOK scalar logical constant true outputStruct scalar struct is a struct with fields holding predefined values of all kinds of matrix dimensions and data types The name of each field also de scribes the data type of the field s value The following fields exist emptyLogical emptyDouble emptyChar emptyCell emptyStruct scalarLogical scalarDouble scalarChar scalarCellOfScalarLogical scalarCellOfScalarDouble scalarCellOfScalarChar vectorLogical vectorDouble vectorChar vectorCellOfScalarLogical vectorCellOfScalarDouble vectorCellOfScalarChar vectorCellOfVectorLogical vectorCellOfVectorDouble vectorCellOfVectorChar vectorCellOfVectorCellOfStrings matrixLogical matrixDouble matrixChar matrixCellOfScalarDouble varargout size of varargin cell is acopy of varargin Toolbox Class Methods activateSession function isOK activeSessionID activateSession function isOK activeSessionID activateSessi
Download Pdf Manuals
Related Search
Related Contents
Westinghouse 44-Inch Instruction Manual iTRAK System User Manual MAKE 5TM - Family Games America NOTICE DE MONTAGE DU DIAMOND Réf. GL02 - MRC Xerox WorkCentre C2424 Copier Descarga - soluciones en control Copyright © All rights reserved.
Failed to retrieve file