Skip to main content
Skip table of contents

How can I build my own program generator?

Very often, customers prefer to have their own program generator visualisation instead of the ready-made program generator visualisation. A process screen can be used for this purpose and the visualisation can be recreated for the program generator. This means that several program generators can be placed on a process screen.

In the JCmpVisu library, all program generators can be accessed via the global variables list.

State

Querying of the program generator status:

// Query for the status of generator 1
CASE JCmpVisu.global.astProgramGenerator[1].ePscMode OF
// Generator no defined Mode
JCmpPgVisu.JUMOPSA.JUMOPSC.ePscOperationModeType._psc_no_mode:
// Generator initialized and ready to start
JCmpPgVisu.JUMOPSA.JUMOPSC.ePscOperationModeType._psc_stop:
// Generator loading program and necessary data
JCmpPgVisu.JUMOPSA.JUMOPSC.ePscOperationModeType._psc_start:
// Generator running fast forward (waiting for start trigger)
JCmpPgVisu.JUMOPSA.JUMOPSC.ePscOperationModeType._psc_start_timer_active:
// Generator automatic mode programm is running
JCmpPgVisu.JUMOPSA.JUMOPSC.ePscOperationModeType._psc_auto_mode_run_program:
// Generator automatic mode start at actual value
JCmpPgVisu.JUMOPSA.JUMOPSC.ePscOperationModeType._psc_auto_mode_start_at_X:
// Generator automatic mode programm is stopped
JCmpPgVisu.JUMOPSA.JUMOPSC.ePscOperationModeType._psc_auto_mode_stopped:
// Generator automatic mode program is waiting
JCmpPgVisu.JUMOPSA.JUMOPSC.ePscOperationModeType._psc_auto_mode_wait:
// Generator is in manual mode
JCmpPgVisu.JUMOPSA.JUMOPSC.ePscOperationModeType._psc_manual_mode:
// Generator programm is finished
JCmpPgVisu.JUMOPSA.JUMOPSC.ePscOperationModeType._psc_program_finished:
END_CASE

Operation

Operation of the program generator:

// Operation of generator 1
// program start
JCmpVisu.global.astProgramGenerator[1].stPscCommandosCond.stPscCommand.xPscStart;
// program stop
JCmpVisu.global.astProgramGenerator[1].stPscCommandosCond.stPscCommand.xPscStop;
// program cancel
JCmpVisu.global.astProgramGenerator[1].stPscCommandosCond.stPscCommand.xPscCancel;
// next section
JCmpVisu.global.astProgramGenerator[1].stPscCommandosCond.stPscCommand.xPscNextSection;
// previous section
JCmpVisu.global.astProgramGenerator[1].stPscCommandosCond.stPscCommand.xPscPreviousSection;
// manual mode
JCmpVisu.global.astProgramGenerator[1].stPscCommandosCond.stPscCommand.xPscManual;
// program continue (if in wait-mode)
JCmpVisu.global.astProgramGenerator[1].stPscCommandosCond.stPscCommand.xPscContinue;

If you use the Pre-defined buttons from the library JCmpVisuBasic, you can use the following structure variables as transfer parameters:

// Controll generator 1 by buttons

// program start
JCmpVisu.global.astProgramGenerator[1].stPscCommandosCond.stButtonStart
//program stop
JCmpVisu.global.astProgramGenerator[1].stPscCommandosCond.stButtonPause
//program cancel
JCmpVisu.global.astProgramGenerator[1].stPscCommandosCond.stButtonStop
// next section
JCmpVisu.global.astProgramGenerator[1].stPscCommandosCond.stButtonSkipNext
// previous section
JCmpVisu.global.astProgramGenerator[1].stPscCommandosCond.stButtonSkipPrevious
// manual mode
JCmpVisu.global.astProgramGenerator[1].stPscCommandosCond.stButtonHand

Setpoints

Setpoints can be read from the program generators as follows:

// Read out setpoints of generator 1.

// Read out the setpoint (x = 0-29) from generator 1. Real-Value
JCmpVisu.global.astProgramGenerator[1].stPscSetpoints.arSetpointValues[x];
// Read out the setpoint (x = 0-29) from generator 1. String-Value with decimal places
JCmpVisu.global.astProgramGenerator[1].stPscSetpoints.asSetpointValues[x];
// Read out the setpoint name (x = 0-29) from generator 1.
JCmpVisu.global.astProgramGenerator[1].stPscSetpoints.awsSetpointNames[x];
// Read out the setpoint unit (x = 0-29) from generator 1.
JCmpVisu.global.astProgramGenerator[1].stPscSetpoints.awsSetpointUnits[x];

// Read out the setpoint (x = 0-29) from generator 1. Real-Value
JCmpVisu.global.astProgramGenerator[1].stPscSetpoints.arNextSetpointValues[x];
// Read out the setpoint (x = 0-29) from generator 1. String-Value with decimal places
JCmpVisu.global.astProgramGenerator[1].stPscSetpoints.asNextSetpointValues[x];

// Read out the contact (.0 - .31) from generator 1.
JCmpVisu.global.astProgramGenerator[1].stPscSetpoints.udiControlContacts.0;
// Read out the contact name (x = 0-29) from generator 1.
JCmpVisu.global.astProgramGenerator[1].stPscSetpoints.awsContactNames[x];

Actual values

The transfer of actual values to the program generator is described in detail here.

Program information

// Program information of generator 1

// Name of generator 1
JCmpVisu.global.astProgramGenerator[1].wsActualPscName;
// Actual program name
JCmpVisu.global.astProgramGenerator[1].wsActualProgramName;
// Actual section number
JCmpVisu.global.astProgramGenerator[1].iActualSectionNo;

// Complete runtime, contains "hidden" runtimes caused by jump commands, e.g. next/prev. section
JCmpVisu.global.astProgramGenerator[1].stPscStatusData.udiCompletePrgRunTime;
// Real program runtime
JCmpVisu.global.astProgramGenerator[1].stPscStatusData.udiPrgRunTimeReal;
// Maximum runtime for complete Program
JCmpVisu.global.astProgramGenerator[1].stPscStatusData.udiProgMaxRunTime;
// Maximum runtime at start section
JCmpVisu.global.astProgramGenerator[1].stPscStatusData.udiProgMaxRunTimeAtSection;
// Actual Program runtime
JCmpVisu.global.astProgramGenerator[1].stPscStatusData.udiProgRunTime;
// Remainig Program runtime
JCmpVisu.global.astProgramGenerator[1].stPscStatusData.udiProgRunTimeRmg;
// Remainig Time for program Start
JCmpVisu.global.astProgramGenerator[1].stPscStatusData.udiRemainigStartDelayTime;
// Program repeat counter
JCmpVisu.global.astProgramGenerator[1].stPscStatusData.udiRepeatCounter;
// Maximum section duration
JCmpVisu.global.astProgramGenerator[1].stPscStatusData.udiSectionMaxRunTime;
// Actual section duration
JCmpVisu.global.astProgramGenerator[1].stPscStatusData.udiSectionRunTime;
// Real actual section runtime
JCmpVisu.global.astProgramGenerator[1].stPscStatusData.udiSectionRunTimeReal;
// Remaining section time
JCmpVisu.global.astProgramGenerator[1].stPscStatusData.udiSectionRunTimeRmg;
// Warning Flags, if one of the actual values is out of the tolerance band limits
JCmpVisu.global.astProgramGenerator[1].stPscStatusData.xToleranceWarning;

Program selection

In addition to the structure variable, the program selection object is required for program selection.
The structure variable for program generator 1 would be as follows:

// Program selection for generator 1
JCmpVisu.global.astProgramGenerator[1].stSelectionBoxPrograms

The PscSelectionElement object is inserted into the custom visualisation in the JCmpPgVisu library. As a transfer parameter, the structure variable (see infobox) is entered.

image-20240515-090912.png

Start via parameters

The following structure variables are required for the start parameters:

// Start parameter for generator 1
JCmpVisu.global.astProgramGenerator[1].stDialogProgStartt

The OnMouseClick property is now edited for an object (e.g. button) in the process screen. OnMouseClick receives the function Open Dialog. The prepared dialogue window JCmpPgVisu.DialogProgramStart is selected as Dialog. For the transfer parameter stPscData, the structure variable (see infobox) is transferred.

image-20240515-123803.png

If you want to use the Ready-made buttons from the library JCmpVisuBasic, then the following supplements must be made in addition to the above description.

:No1: Declaration of a variable for the button type stVisuButtonType.

:No2: Assign the new variable to the button as a transfer parameter.

:No3: The following configurations are solely for animation of the button:

  • OnMouseDown: Execute ST-Code : stButtonDialog.xButtonFeedback := TRUE;

  • OnMouseLeave: Execute ST-Code : stButtonDialog.xButtonFeedback := FALSE;

  • OnMouseUp: Execute ST-Code : stButtonDialog.xButtonFeedback := FALSE;

image-20240515-132646.png

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.