Creating the Opercalc DLL for the Custom Operation Calculation Routine

The SyteLine setup program installs the standard version of the opercalc50.dll into your \winnt\system32 directory. This dll contains a dummy version of the ol_opercalc routine. You must create a customized opercalc50.dll containing your custom ol_opercalc routine that will be used instead of the standard opercalc50.dll.

To create this dll, follow these steps:

  1. Create a new empty Win32 Dynamic Link Library project in Visual C++.
  2. Move your Microsoft C source code file into the project directory.
  3. Add the source code file to the Source Files folder of the project. Make sure the return value is of type double. The return value must represent the total required operation duration (in hours), for the specified number of parts using the specified resources during the time interval available for the production.
  4. Move the definition file (shown below) into the project directory. If there is a Definition Files folder, add the definition file to that folder. You may have to create the Definition Files folder.
  5. Make adjustments to the project settings. For example, you must:
    • Name the resulting dll file opercalc50dll.
    • Identify where the header file ol_api.h can be found. This reference is required because the declaration of the structure being passed (opercalc_s) resides in this header file. It can be referred to as $(OLXDIR50)\include.

    You must compile the code with the following code generation options to match those expected by the system's executable call:

    • __stdcall calling convention
    • multithreaded
    • 8 byte struct member alignment
  6. Build the project in either the debug or release form (there are separate settings for each). Messages should appear in the Build tab if there are any problems. If there are problems, modify the source code or project settings to fix them.
  7. Move the new opercalc50.dll file to the folder for the associated Planner project on the Planning server. For example, if the project is named Alt000, place the dll in \Planner\Projects\Alt000.
    Note:  When you delete an APS Project, all of its folders and files are deleted, including the opercalc50.dll. Therefore, be careful never to put your Visual C++ source code (as mentioned in step 1) in the project folder.

Definition file example

             ;--------------------------------------------------
				         ; OPERCALC50.DEF DLL library module definition file
				         ;--------------------------------------------------          LIBRARY
				OPERCALC50 INITINSTANCE          DESCRIPTION 'SyteAPS V5.0 OperCalc', Copyright
				© 2010 Infor. All rights reserved. www.infor.com'          ;          EXPORTS
				         ol_opercalc = _ol_opercalc@4          _ol_opercalc = _ol_opercalc@4