LIBRARY: unRecipeFunctions_activation.ctl | |
Creation Date: April 2011 version 1.4.0 Modification History: 20/10/2014: Ivan
External Functions: Internal Functions: | |
const int | RCP_HEADER_MAX_SIZE = 15 |
const int | RCP_HEADER_ID_LOW = 1 |
const int | RCP_HEADER_ID_HIGH = 2 |
const int | RCP_HEADER_NUM_MANREG = 3 |
const int | RCP_HEADER_NUM_DPAR = 4 |
const int | RCP_HEADER_DB_DPAR = 5 |
const int | RCP_HEADER_NUM_WPAR = 6 |
const int | RCP_HEADER_DB_WPAR = 7 |
const int | RCP_HEADER_NUM_APAR = 8 |
const int | RCP_HEADER_DB_APAR = 9 |
const int | RCP_HEADER_NUM_AALARM = 10 |
const int | RCP_HEADER_DB_AALARM = 11 |
const int | RCP_HEADER_NUM_CONTR = 12 |
const int | RCP_HEADER_DB_CONTR = 13 |
const int | RCP_HEADER_SENT_VALUE = 14 |
const int | RCP_HEADER_CRC = 15 |
const int | RCP_STATUS_MAX_SIZE = 16 |
const int | RCP_STATUS_MIRROR_DATA_SIZE = 13 |
const int | RCP_STATUS_ID_LOW = 1 |
const int | RCP_STATUS_ID_HIGH = 2 |
const int | RCP_STATUS_NUM_MANREG = 3 |
const int | RCP_STATUS_NUM_DPAR = 4 |
const int | RCP_STATUS_DB_DPAR = 5 |
const int | RCP_STATUS_NUM_WPAR = 6 |
const int | RCP_STATUS_DB_WPAR = 7 |
const int | RCP_STATUS_NUM_APAR = 8 |
const int | RCP_STATUS_DB_APAR = 9 |
const int | RCP_STATUS_NUM_AALARM = 10 |
const int | RCP_STATUS_DB_AALARM = 11 |
const int | RCP_STATUS_NUM_CONTR = 12 |
const int | RCP_STATUS_DB_CONTR = 13 |
const int | RCP_STATUS_STATUS = 14 |
const int | RCP_STATUS_CRC = 15 |
const int | RCP_STATUS_ERR = 16 |
const int | RCP_ACTIVATION_TRIGGERED = 0 |
const int | RCP_ACTIVATED = 1 |
const int | RCP_NO_PLC_CONNECTION = 2 |
const int | RCP_INACTIVE = 3 |
const int | RCP_BAD_TYPES = 4 |
const int | RCP_BAD_STRUCTURE = 5 |
const int | RCP_BAD_DPES = 6 |
const int | RCP_ACTIVATION_FAILED = 7 |
const int | RCP_ACT_STATUS_ERROR = -1 |
const int | RCP_ACT_STATUS_STANDBY = 0 |
const int | RCP_ACT_STATUS_NEW_ID_RECEIVED = 1 |
const int | RCP_ACT_STATUS_CRC_OK = 2 |
const int | RCP_ACT_STATUS_DONE = 3 |
const int | RCP_ACT_HEADER_CANCEL = -1 |
const int | RCP_ACT_HEADER_SENDING_DATA = 1 |
const int | RCP_ACT_HEADER_DATA_SENT = 2 |
const int | RCP_ACT_HEADER_ACTIVATE = 3 |
const int | RCP_ACT_HEADER_ACTIVATION_OK = 4 |
const int | RCP_ACT_RETVAL_ACTIVATION_OK = 0 |
const int | RCP_ACT_RETVAL_BAD_RECIPE_DATA = -1 |
const int | RCP_ACT_RETVAL_BAD_PLC_STATUS = -2 |
const int | RCP_ACT_RETVAL_BAD_PLC_TYPE = -3 |
const int | RCP_ACT_RETVAL_PLC_BUSY = -4 |
const int | RCP_ACT_RETVAL_ACTIVATION_TIMEOUT = -5 |
const int | RCP_ACT_RETVAL_PLC_CANCELLATION = -6 |
const int | RCP_ACT_RETVAL_ACTIVATION_ERROR = -7 |
const int | RCP_ACT_RETVAL_BAD_RECIPE_STATUS = -8 |
const int | RCP_ACT_RETVAL_WRONG_ONLINE_VALUES = -9 |
const int | WRONG_NUMBER_OF_DPE_AND_VALUE = -100 |
const int | RECIPE_BUFFERS_DONT_EXIST = -101 |
const int | BUFFER_OVERFLOW = -102 |
const int | INVALID_RECIPE_DPE = -103 |
const int | ERROR_LOADING_RECIPE = -104 |
const int | VALUE_OUT_OF_RANGE = -105 |
global mapping | gHeaderMap |
global mapping | gManRegAddrMap |
global mapping | gManRegValMap |
global mapping | gReqAddrMap |
global mapping | gReqValMap |
const int | DPAR_ARM_BIT = 2 |
const int | DPAR_MONR_BIT = 4 |
const int | DPAR_MOFFR_BIT = 5 |
const int | WPAR_ARM_BIT = 2 |
const int | WPAR_NEWMR_BIT = 6 |
const int | APAR_ARM_BIT = 2 |
const int | APAR_NEWMR_BIT = 6 |
const int | AALARM_ARM_BIT = 2 |
const int | PID_ARM_BIT = 4 |
global mapping | unRecipe_unRecipe_pidManRegBits |
global mapping | unRecipe_aalarmManRegBits |
global mapping | unRecipe_recipeActivationInfo |
const int | PLCS_REQUIRED_FOR_ACTIVATION_INDEX = 1 |
const int | PLCS_READY_TO_ACTIVATE_INDEX = 2 |
const int | PLCS_ACTIVATED_RECIPE_INDEX = 3 |
const int | LOCAL_MANAGER_INDEX = 4 |
void | _unRecipeFunctions_initializeManRegBits () |
dyn_int | _unRecipeFunctions_getHeaderBuffer (string sPlcName) |
dyn_int | _unRecipeFunctions_getManRegAddrBuffer (string sPlcName) |
dyn_int | _unRecipeFunctions_getManRegValBuffer (string sPlcName) |
dyn_int | _unRecipeFunctions_getReqAddrBuffer (string sPlcName) |
dyn_float | _unRecipeFunctions_getReqValBuffer (string sPlcName) |
void | _unRecipeFunctions_removeRecipeBuffers (string sPlcName) |
int | unRecipeFunctions_activateRecipe (string sRcpInstanceDp, dyn_string &exceptionInfo) |
void | _unRecipeFunctions_resetRecipeActivation (int iCode, string sRcpInstanceDp, string sRcpName, string sMessage, dyn_string exceptionInfo) |
void | _unRecipeFunctions_removeRecipeHeaderBuffers (dyn_anytype daPlcNames) |
bool | _unRecipeFunctions_unlockRecipeBuffers (dyn_anytype daPlcNames, dyn_string &exceptionInfo) |
int | _unRecipeFunctions_getElementsByPLC (dyn_string dsElements, dyn_anytype dsValues, mapping &plcDpes, dyn_string &exceptionInfo) |
bool | _unRecipeFunctions_getRecipeBuffersName (string plcName, string &dpName, dyn_string &exceptionInfo) |
synchronized int | _unRecipeFunctions_canActivateRecipeInPlcs (string sRcpInstanceDp, dyn_anytype dsPlcNames, dyn_string &dsBusyPlcs, dyn_string &exceptionInfo) |
void | unRecipeFunctions_getRecipeActivationTimeout (dyn_anytype plcNames, time &tExpirationTime, int &iTimeoutSec, dyn_string &exceptionInfo) |
int | _unRecipeFunctions_activateRecipeByPLC (mapping plcDpes, string sRcpInstanceDp, dyn_string &exceptionInfo) |
synchronized void | _unRecipeFunctions_createRecipeActivationInfo (dyn_anytype plcNames, string sRcpInstanceDp, dyn_string &exceptionInfo) |
synchronized bool | _unRecipeFunctions_incrementNumPlcsReadyToActivate (string sPlcName, string sRcpInstanceDp) |
synchronized bool | _unRecipeFunctions_incrementNumPlcsActivatedRecipe (string sPlcName, string sRcpInstanceDp) |
synchronized bool | _unRecipeFunctions_addPlcToRecipeActivationInfo (int index, string sPlcName, string sRcpInstanceDp) |
int | _unRecipeFunctions_waitUntilActivationIsCompleted (string sRcpInstanceDp, time tEnd, dyn_string &exceptionInfo) |
int | _unRecipeFunctions_checRecipeActivation (string sRcpInstanceDp) |
bool | _unRecipeFunctions_activateRecipe (string plcName, string plcType, string sRcpInstanceDp, dyn_string dpes, dyn_string values, time tEnd, dyn_string &exceptionInfo) |
void | _unRecipeFunctions_sendRecipeHeader (string sPlcName, dyn_string &exceptionInfo, bool bWaitForDpSet=TRUE) |
void | _unRecipeFunctions_checkRecipeStatusBufferCB (string sRecipeStatusDp, int recipeStatus, string sRecipeState, string sState) |
void | _unRecipeFunctions_recipeActivationStatusError (string sPlcName, string sRecipeStatusDp, string sRecipeStateDp) |
void | _unRecipeFunctions_recipeActivationStatusNewIdReceived (string sPlcName, string sBuffersDpName, string sRcpInstanceDp) |
void | _unRecipeFunctions_recipeActivationStatusCrcOk (string sPlcName, string sBuffersDpName, string sRcpInstanceDp) |
void | _unRecipeFunctions_recipeActivationStatusDone (string sPlcName, string sRecipeStatusDp, string sRecipeStateDp, string sRcpInstanceDp) |
void | _unRecipeFunctions_recipeActivationWrongOnlineValues (string sErrDpe) |
void | _unRecipeFunctions_recipeActivationUpdateMetaInfo (dyn_dyn_mixed recipeObject, string sRcpDp) |
bool | _unRecipeFunctions_checkRecipeStatusBufferData (string sBuffersDpName, dyn_string &exceptionInfo) |
void | _unRecipeFunctions_cancelRecipeActivation (string sPlcName, string sBuffersDpName, string sRecipeState, string sReason, bool bDisconnect=true, bool bTerminate=false) |
synchronized void | unRecipeFunctions_cancelRecipeActivation (string sRecipeDpName, dyn_string &exceptionInfo, string sReason="", bool bTerminate=FALSE) |
void | _unRecipeFunctions_createBuffersData (string sPlcName, dyn_string dpes, dyn_string values, dyn_string &exceptionInfo) |
void | _unRecipeFunctions_addDigitalParameterToBuffers (int &numDevices, string sDeviceName, string sValue, dyn_int &diManRegAddr, dyn_int &diManRegVal, dyn_string &exceptionInfo) |
void | _unRecipeFunctions_addXParameterToBuffers (int &numDevices, string sDeviceName, string sDeviceType, string sValue, int iArmBit, int iNewMrBit, dyn_int &diManRegAddr, dyn_int &diManRegVal, dyn_int &diReqAddr, dyn_float &dfReqVal, dyn_string &exceptionInfo) |
void | _unRecipeFunctions_addMultiDpeDeviceToBuffers (int &numDevices, string sDeviceName, string sDpeName, string sDeviceType, string sValue, mapping &deviceMap, mapping manRegBitsMap, int iArmBit, dyn_string &exceptionInfo) |
void | _unRecipeFunctions_fillRecipeHeaderBuffer (dyn_int &recipeHeaderBuffer, int iNumDPar, int iNumWPar, int iNumAPar, int iNumAAlarm, int iNumPid) |
void | _unRecipeFunctions_fillRecipeBuffer (dyn_anytype &buffer, dyn_anytype dparValues, dyn_anytype wparValues, dyn_anytype aparValues, dyn_anytype aalarmValues, dyn_anytype pidValues) |
void | _unRecipeFunctions_sendData (string plcName, dyn_string &exceptionInfo) |
void | _unRecipeFunctions_processMultiDpeDevices (mapping map, dyn_int &manRegAddresses, dyn_int &manRegValues, dyn_int &reqAddresses, dyn_float &reqValues) |
void | _unRecipeFunctions_createRecipeHeaderDBNumber (string sPlcName, dyn_string dsDpes, dyn_string &exceptionInfo) |
synchronized void | unRecipeFunctions_activateRecipes (dyn_string dsRcpDps) |
void | _unRecipeFunctions_recipeStateCB (dyn_string dsDpList, dyn_string dsValues) |
void | unRecipeFunctions_checkRecipeStatus (dyn_string dsRcpDps) |
UNICOS Copyright (C) CERN 2014 All rights reserved
void _unRecipeFunctions_initializeManRegBits | ( | ) |
Initialization of the ManReg bit positions used in the recipes by the different device types.
Referenced by unRecipeFunctions_activateRecipe().
dyn_int _unRecipeFunctions_getHeaderBuffer | ( | string | sPlcName | ) |
Get the recipe header buffer for the specified PLC.
sPlcName | - [IN] The PLC name which recipe header buffer is required. |
Referenced by _unRecipeFunctions_cancelRecipeActivation(), _unRecipeFunctions_createBuffersData(), _unRecipeFunctions_createRecipeHeaderDBNumber(), _unRecipeFunctions_recipeActivationStatusCrcOk(), _unRecipeFunctions_recipeActivationStatusNewIdReceived(), _unRecipeFunctions_sendRecipeHeader(), and unRecipeFunctions_activateRecipe().
dyn_int _unRecipeFunctions_getManRegAddrBuffer | ( | string | sPlcName | ) |
Get the recipe ManRegAddress buffer for the specified PLC.
sPlcName | - [IN] The PLC name which recipe ManRegAddress buffer is required. |
Referenced by _unRecipeFunctions_createBuffersData(), and _unRecipeFunctions_sendData().
dyn_int _unRecipeFunctions_getManRegValBuffer | ( | string | sPlcName | ) |
Get the recipe ManRegValues buffer for the specified PLC.
sPlcName | - [IN] The PLC name which recipe ManRegValues buffer is required. |
Referenced by _unRecipeFunctions_createBuffersData(), and _unRecipeFunctions_sendData().
dyn_int _unRecipeFunctions_getReqAddrBuffer | ( | string | sPlcName | ) |
Get the recipe ReqAddress buffer for the specified PLC.
sPlcName | - [IN] The PLC name which recipe ReqAddress buffer is required. |
Referenced by _unRecipeFunctions_createBuffersData(), and _unRecipeFunctions_sendData().
dyn_float _unRecipeFunctions_getReqValBuffer | ( | string | sPlcName | ) |
Get the recipe ReqValues buffer for the specified PLC.
sPlcName | - [IN] The PLC name which recipe ReqValues buffer is required. |
Referenced by _unRecipeFunctions_createBuffersData(), and _unRecipeFunctions_sendData().
void _unRecipeFunctions_removeRecipeBuffers | ( | string | sPlcName | ) |
Remove all the recipe buffers associated to the specified PLC.
sPlcName | - [IN] The PLC name which recipe buffers must be removed. |
Referenced by _unRecipeFunctions_cancelRecipeActivation(), and _unRecipeFunctions_recipeActivationStatusDone().
int unRecipeFunctions_activateRecipe | ( | string | sRcpInstanceDp, | |
dyn_string & | exceptionInfo | |||
) |
Activate a recipe.
sRcpInstanceDp | - [IN] Data point name of the recipe which activation is triggered. | |
exceptionInfo | - [OUT] Standard exception handling variable. |
References _unRecipeFunctions_activateRecipeByPLC(), _unRecipeFunctions_canActivateRecipeInPlcs(), _unRecipeFunctions_checkRecipeValues(), _unRecipeFunctions_formatValues(), _unRecipeFunctions_getElementsByPLC(), _unRecipeFunctions_getHeaderBuffer(), _unRecipeFunctions_initializeManRegBits(), _unRecipeFunctions_normalizeDp(), _unRecipeFunctions_removeRecipeHeaderBuffers(), _unRecipeFunctions_resetRecipeActivation(), _unRecipeFunctions_setRecipeInstancePanelComponentsEnabled(), _unRecipeFunctions_unlockRecipeBuffers(), _unRecipeFunctions_writeInRecipeLog(), unRecipeFunctions_getPlcStatus(), and unRecipeFunctions_setRecipeStatusInfo().
Referenced by unRecipeFunctions_activateRecipes().
void _unRecipeFunctions_resetRecipeActivation | ( | int | iCode, | |
string | sRcpInstanceDp, | |||
string | sRcpName, | |||
string | sMessage, | |||
dyn_string | exceptionInfo | |||
) |
Reset the recipe activation after an error or a successful activation.
iCode | - [IN] Error code during the recipe activation. | |
sRcpInstanceDp | - [IN] Datapoint name of the recipe instance being activated. | |
sRcpName | - [IN] Name of the recipe being activated. | |
sMessage | - [IN] Message to display in the log. | |
exceptionInfo | - [IN] Standard exception handling variable. |
References _unRecipeFunctions_setRecipeInstancePanelComponentsEnabled(), _unRecipeFunctions_writeInRecipeLog(), and unRecipeFunctions_setRecipeStatusInfo().
Referenced by unRecipeFunctions_activateRecipe().
void _unRecipeFunctions_removeRecipeHeaderBuffers | ( | dyn_anytype | daPlcNames | ) |
Remove the recipe header buffers associated to the specified PLC names.
daPlcNames | - [IN] The PLC names which recipe header buffers must be removed. |
Referenced by unRecipeFunctions_activateRecipe(), and unRecipeFunctions_cancelRecipeActivation().
bool _unRecipeFunctions_unlockRecipeBuffers | ( | dyn_anytype | daPlcNames, | |
dyn_string & | exceptionInfo | |||
) |
Unlock the recipe buffers used during the recipe activation.
daPlcNames | - [IN] The PLC names which recipe header buffers must be unlocked. | |
exceptionInfo | - [OUT] Standard exception handling variable. |
References _unRecipeFunctions_getRecipeBuffersName(), and _unRecipeFunctions_unlockDevices().
Referenced by unRecipeFunctions_activateRecipe(), and unRecipeFunctions_cancelRecipeActivation().
int _unRecipeFunctions_getElementsByPLC | ( | dyn_string | dsElements, | |
dyn_anytype | dsValues, | |||
mapping & | plcDpes, | |||
dyn_string & | exceptionInfo | |||
) |
Get the recipe elements according to the PLC where the elements are located.
dsElements | - [IN] Recipe data point elements. | |
dsValues | - [IN] Recipe values. | |
plcDpes | - [OUT] Map containing the recipe elements and values for each PLC. | |
exceptionInfo | - [OUT] Standard exception handling variable. |
References _unRecipeFunctions_getRecipeBuffersName().
Referenced by unRecipeFunctions_activateRecipe().
bool _unRecipeFunctions_getRecipeBuffersName | ( | string | plcName, | |
string & | dpName, | |||
dyn_string & | exceptionInfo | |||
) |
Get the recipe buffers DPE name for an specific PLC.
plcName | - [IN] PLC name. | |
dpName | - [OUT] Name of the DPE where the recipe buffers of the PLC are located. | |
exceptionInfo | - [OUT] Standard exception handling variable. |
Referenced by _unRecipeFunctions_activateRecipe(), _unRecipeFunctions_canActivateRecipeInPlcs(), _unRecipeFunctions_getElementsByPLC(), _unRecipeFunctions_sendData(), _unRecipeFunctions_sendRecipeHeader(), _unRecipeFunctions_unlockRecipeBuffers(), unRecipeFunctions_cancelRecipeActivation(), and unRecipeFunctions_getRecipeActivationTimeout().
synchronized int _unRecipeFunctions_canActivateRecipeInPlcs | ( | string | sRcpInstanceDp, | |
dyn_anytype | dsPlcNames, | |||
dyn_string & | dsBusyPlcs, | |||
dyn_string & | exceptionInfo | |||
) |
Check if a recipe can be activated in the specified PLCs. The recipe can't be activated in a PLC if there is other recipe being activated in that PLC (i.e. the recipe buffer is locked).
sRcpInstanceDp | - [IN] DPE name of the recipe instance. | |
dsPlcNames | - [IN] List of PLC names. | |
dsBusyPlcs | - [OUT] List of busy PLCs. | |
exceptionInfo | - [OUT] Standard exception handling variable. |
References _unRecipeFunctions_createRecipeActivationInfo(), _unRecipeFunctions_getRecipeBuffersName(), and _unRecipeFunctions_lockDevices().
Referenced by unRecipeFunctions_activateRecipe().
void unRecipeFunctions_getRecipeActivationTimeout | ( | dyn_anytype | plcNames, | |
time & | tExpirationTime, | |||
int & | iTimeoutSec, | |||
dyn_string & | exceptionInfo | |||
) |
Get the time when the recipe activation must be cancelled (if the activation wasn't completed).
plcNames | - [IN] The list of PLC names where the recipe will be activated. | |
tExpirationTime | - [OUT] The time when the recipe activation must be cancelled. | |
iTimeoutSec | - [OUT] Timeout value in seconds. | |
exceptionInfo | - [OUT] Standard exception handling variable. |
References _unRecipeFunctions_getRecipeBuffersName().
Referenced by _unRecipeFunctions_activateRecipeByPLC().
int _unRecipeFunctions_activateRecipeByPLC | ( | mapping | plcDpes, | |
string | sRcpInstanceDp, | |||
dyn_string & | exceptionInfo | |||
) |
Triggers the recipe activation in all the PLCs containing recipe elements.
plcDpes | - [IN] DPE name of the PLCs where the recipe must be activated. | |
sRcpInstanceDp | - [IN] DPE name of the recipe instance. | |
exceptionInfo | - [OUT] Standard exception handling variable. |
References _unRecipeFunctions_activateRecipe(), _unRecipeFunctions_waitUntilActivationIsCompleted(), unRecipeFunctions_cancelRecipeActivation(), and unRecipeFunctions_getRecipeActivationTimeout().
Referenced by unRecipeFunctions_activateRecipe().
synchronized void _unRecipeFunctions_createRecipeActivationInfo | ( | dyn_anytype | plcNames, | |
string | sRcpInstanceDp, | |||
dyn_string & | exceptionInfo | |||
) |
Creates a matrix containing the necessary information to activate a recipe and stores it in the map unRecipeActivationInfo. Row 1: List of PLCS containing recipe elements. Row 2: List containing the names of the PLCs that are ready to activate the recipe. Row 3: List of PLC names where the recipe has been activated.
Referenced by _unRecipeFunctions_canActivateRecipeInPlcs().
synchronized bool _unRecipeFunctions_incrementNumPlcsReadyToActivate | ( | string | sPlcName, | |
string | sRcpInstanceDp | |||
) |
Increment the number of PLCs ready to activate the recipe. When all the PLCs are ready the recipe activation is triggered in all of them.
sPlcName | - [IN] The name of the PLC ready to activate the recipe. | |
sRcpInstanceDp | - [IN] The data point of the recipe instance to be activated. |
References _unRecipeFunctions_addPlcToRecipeActivationInfo().
Referenced by _unRecipeFunctions_recipeActivationStatusCrcOk().
synchronized bool _unRecipeFunctions_incrementNumPlcsActivatedRecipe | ( | string | sPlcName, | |
string | sRcpInstanceDp | |||
) |
Increment the number of PLCs ready to activate the recipe. When all the PLCs are ready the recipe activation is triggered in all of them.
sPlcName | - [IN] The name of the PLC where the recipe has been activated. | |
sRcpInstanceDp | - [IN] The data point of the recipe instance activated in the PLC. |
References _unRecipeFunctions_addPlcToRecipeActivationInfo().
Referenced by _unRecipeFunctions_recipeActivationStatusDone().
synchronized bool _unRecipeFunctions_addPlcToRecipeActivationInfo | ( | int | index, | |
string | sPlcName, | |||
string | sRcpInstanceDp | |||
) |
Adds the PLC name to the unRecipe_recipeActivationInfo in the index specified as a parameter.
index | - [IN] Index where to add the PLC name in the recipe activation info matrix. | |
sPlcName | - [IN] The PLC name to add in the recipe activation info matrix. | |
sRcpInstanceDp | - [IN] DPE name of the recipe instance. |
Referenced by _unRecipeFunctions_incrementNumPlcsActivatedRecipe(), and _unRecipeFunctions_incrementNumPlcsReadyToActivate().
int _unRecipeFunctions_waitUntilActivationIsCompleted | ( | string | sRcpInstanceDp, | |
time | tEnd, | |||
dyn_string & | exceptionInfo | |||
) |
Wait until the recipe activation is completed or the timeout expires.
sRcpInstanceDp | - [IN] DPE name of the recipe instance. | |
tEnd | - [IN] Expiration time for the recipe activation. | |
exceptionInfo | - [OUT] Standard exception handling variable. |
Referenced by _unRecipeFunctions_activateRecipeByPLC().
bool _unRecipeFunctions_activateRecipe | ( | string | plcName, | |
string | plcType, | |||
string | sRcpInstanceDp, | |||
dyn_string | dpes, | |||
dyn_string | values, | |||
time | tEnd, | |||
dyn_string & | exceptionInfo | |||
) |
Activates a recipe in a PLC.
plcName | - [IN] PLC name. | |
plcType | - [IN] PLC type. | |
sRcpInstanceDp | - [IN] DPE name of the recipe instance. | |
dpes | - [IN] List of recipe DPEs for the PLC. | |
values | - [IN] List of values for the recipe DPEs. | |
tEnd | - [IN] Expiration time for the recipe activation. | |
exceptionInfo | - [OUT] Standard exception handling variable. |
References _unRecipeFunctions_createBuffersData(), _unRecipeFunctions_createRecipeHeaderDBNumber(), _unRecipeFunctions_getRecipeBuffersName(), _unRecipeFunctions_sendRecipeHeader(), _unRecipeFunctions_writeInRecipeLog(), and unRecipeFunctions_isRemoteSystemConnected().
Referenced by _unRecipeFunctions_activateRecipeByPLC().
void _unRecipeFunctions_sendRecipeHeader | ( | string | sPlcName, | |
dyn_string & | exceptionInfo, | |||
bool | bWaitForDpSet = TRUE | |||
) |
Send the recipe header buffer to the PLC.
sPlcName | - [IN] PLC Name. | |
exceptionInfo | - [OUT] Standard error handling variable. | |
bWaitForDpSet | - [IN] TRUE if the dp set operation on the recipe buffers must be synchronous, otherwise FALSE. |
References _unRecipeFunctions_getHeaderBuffer(), and _unRecipeFunctions_getRecipeBuffersName().
Referenced by _unRecipeFunctions_activateRecipe(), _unRecipeFunctions_cancelRecipeActivation(), _unRecipeFunctions_recipeActivationStatusCrcOk(), and _unRecipeFunctions_recipeActivationStatusNewIdReceived().
void _unRecipeFunctions_checkRecipeStatusBufferCB | ( | string | sRecipeStatusDp, | |
int | recipeStatus, | |||
string | sRecipeState, | |||
string | sState | |||
) |
Callback function executed during the recipe activation when the recipe status has changed.
sRecipeStatusDp | - [IN] DP Name of the recipe buffer status. | |
recipeStatus | - [IN] Value of the recipe buffer status. | |
sRecipeState | - [IN] DP Name of the recipe state. | |
sState | - [IN] Value of the recipe state. |
References _unRecipeFunctions_recipeActivationStatusCrcOk(), _unRecipeFunctions_recipeActivationStatusDone(), _unRecipeFunctions_recipeActivationStatusError(), _unRecipeFunctions_recipeActivationStatusNewIdReceived(), and _unRecipeFunctions_writeInRecipeLog().
void _unRecipeFunctions_recipeActivationStatusError | ( | string | sPlcName, | |
string | sRecipeStatusDp, | |||
string | sRecipeStateDp | |||
) |
Function executed during the recipe activation when the recipe status is in error.
sPlcName | - [IN] Name of the PLC where the recipe is being activated. | |
sRecipeStatusDp | - [IN] Dp name of the recipe status buffer. | |
sRecipeStateDp | - [IN] Dp name of the recipe state. |
References _unRecipeFunctions_writeInRecipeLog(), and unRecipeFunctions_setRecipeStatusInfo().
Referenced by _unRecipeFunctions_checkRecipeStatusBufferCB().
void _unRecipeFunctions_recipeActivationStatusNewIdReceived | ( | string | sPlcName, | |
string | sBuffersDpName, | |||
string | sRcpInstanceDp | |||
) |
Function executed during the recipe activation when the PLC confirms that a new recipe activation has been triggered.
sPlcName | - [IN] Name of the PLC where the recipe is being activated. | |
sBuffersDpName | - [IN] Dp name of the recipe buffers. | |
sRcpInstanceDp | - [IN] Dp name of the recipe instance. |
References _unRecipeFunctions_checkRecipeStatusBufferData(), _unRecipeFunctions_getHeaderBuffer(), _unRecipeFunctions_sendData(), _unRecipeFunctions_sendRecipeHeader(), _unRecipeFunctions_writeInRecipeLog(), and unRecipeFunctions_cancelRecipeActivation().
Referenced by _unRecipeFunctions_checkRecipeStatusBufferCB().
void _unRecipeFunctions_recipeActivationStatusCrcOk | ( | string | sPlcName, | |
string | sBuffersDpName, | |||
string | sRcpInstanceDp | |||
) |
Function executed during the recipe activation when the PLC confirms that the CRC value is Ok.
sPlcName | - [IN] Name of the PLC where the recipe is being activated. | |
sBuffersDpName | - [IN] Dp name of the recipe buffers. | |
sRcpInstanceDp | - [IN] Dp name of the recipe instance. |
References _unRecipeFunctions_checkRecipeStatusBufferData(), _unRecipeFunctions_getHeaderBuffer(), _unRecipeFunctions_incrementNumPlcsReadyToActivate(), _unRecipeFunctions_sendRecipeHeader(), _unRecipeFunctions_writeInRecipeLog(), and unRecipeFunctions_cancelRecipeActivation().
Referenced by _unRecipeFunctions_checkRecipeStatusBufferCB().
void _unRecipeFunctions_recipeActivationStatusDone | ( | string | sPlcName, | |
string | sRecipeStatusDp, | |||
string | sRecipeStateDp, | |||
string | sRcpInstanceDp | |||
) |
Function executed during the recipe activation when the PLC confirms that the recipe activation is completed.
sPlcName | - [IN] Name of the PLC where the recipe is being activated. | |
sRecipeStatusDp | - [IN] Dp name of the recipe status buffer. | |
sRecipeStateDp | - [IN] Dp name of the recipe state. | |
sRcpInstanceDp | - [IN] Dp name of the recipe instance. |
References _unRecipeFunctions_incrementNumPlcsActivatedRecipe(), _unRecipeFunctions_removeRecipeBuffers(), and _unRecipeFunctions_writeInRecipeLog().
Referenced by _unRecipeFunctions_checkRecipeStatusBufferCB().
void _unRecipeFunctions_recipeActivationWrongOnlineValues | ( | string | sErrDpe | ) |
Function executed after the recipe activation when the online values are different than the recipe values.
sErrDpe | - [IN] Dp name of the first recipe element which value doesn't match the PLC online value. |
References _unRecipeFunctions_writeInRecipeLog(), and unRecipeFunctions_setRecipeStatusInfo().
void _unRecipeFunctions_recipeActivationUpdateMetaInfo | ( | dyn_dyn_mixed | recipeObject, | |
string | sRcpDp | |||
) |
Function to update the recipe activation meta-info when the recipe activation was completed successfully.
recipeObject | - [IN] Recipe object. | |
sRcpDp | - [IN] Datapoint name of the recipe instance. |
References _unRecipeFunctions_loadHistoryTableInfo(), and _unRecipeFunctions_loadPropertiesTableInfo().
bool _unRecipeFunctions_checkRecipeStatusBufferData | ( | string | sBuffersDpName, | |
dyn_string & | exceptionInfo | |||
) |
Checks the data in the recipe status buffer to verify:
sBuffersDpName | - [IN] DpName of the recipe buffers. | |
exceptionInfo | - [OUT] Standard exception handling variable. |
Referenced by _unRecipeFunctions_recipeActivationStatusCrcOk(), and _unRecipeFunctions_recipeActivationStatusNewIdReceived().
void _unRecipeFunctions_cancelRecipeActivation | ( | string | sPlcName, | |
string | sBuffersDpName, | |||
string | sRecipeState, | |||
string | sReason, | |||
bool | bDisconnect = true , |
|||
bool | bTerminate = false | |||
) |
Cancel the activation of a recipe.
sPlcName | - [IN] Name of the PLC where the recipe is being activated. | |
sBuffersDpName | - [IN] DP Name of the recipe buffers for the specified PLC. | |
sRecipeState | - [IN] Recipe state. | |
sReason | - [IN] Reason for the cancellation. | |
bDisconnect | - [IN] Flag to specify if the dpDisconnect of the recipe status must be done. | |
bTerminate | - [IN] TRUE if the function has been called from a panel termination. |
References _unRecipeFunctions_getHeaderBuffer(), _unRecipeFunctions_removeRecipeBuffers(), _unRecipeFunctions_sendRecipeHeader(), _unRecipeFunctions_writeInRecipeLog(), and unRecipeFunctions_setRecipeStatusInfo().
Referenced by unRecipeFunctions_cancelRecipeActivation().
synchronized void unRecipeFunctions_cancelRecipeActivation | ( | string | sRecipeDpName, | |
dyn_string & | exceptionInfo, | |||
string | sReason = "" , |
|||
bool | bTerminate = FALSE | |||
) |
Cancel the activation of a recipe.
sRecipeDpName | - [IN] Datapoint name of the recipe which cancellation is requested. | |
exceptionInfo | - [OUT] Standard exception handling variable. | |
sReason | - [IN] String containing the reason of the cancellation. | |
bTerminate | - [IN] TRUE if the function has been called from a panel termination. |
References _unRecipeFunctions_cancelRecipeActivation(), _unRecipeFunctions_getRecipeBuffersName(), _unRecipeFunctions_removeRecipeHeaderBuffers(), and _unRecipeFunctions_unlockRecipeBuffers().
Referenced by _unRecipeFunctions_activateRecipeByPLC(), _unRecipeFunctions_recipeActivationStatusCrcOk(), and _unRecipeFunctions_recipeActivationStatusNewIdReceived().
void _unRecipeFunctions_createBuffersData | ( | string | sPlcName, | |
dyn_string | dpes, | |||
dyn_string | values, | |||
dyn_string & | exceptionInfo | |||
) |
Create the recipe buffer data for a recipe activation.
sPlcName | - [IN] Name of the PLC where the recipe is about to be activated. | |
dpes | - [IN] Datapoint names of the recipe elements. | |
values | - [IN] Values of the recipe elements. | |
exceptionInfo | - [OUT] Standard exception handling variable. |
References _unRecipeFunctions_addDigitalParameterToBuffers(), _unRecipeFunctions_addMultiDpeDeviceToBuffers(), _unRecipeFunctions_addXParameterToBuffers(), _unRecipeFunctions_fillRecipeBuffer(), _unRecipeFunctions_fillRecipeHeaderBuffer(), _unRecipeFunctions_getHeaderBuffer(), _unRecipeFunctions_getManRegAddrBuffer(), _unRecipeFunctions_getManRegValBuffer(), _unRecipeFunctions_getReqAddrBuffer(), and _unRecipeFunctions_getReqValBuffer().
Referenced by _unRecipeFunctions_activateRecipe().
void _unRecipeFunctions_addDigitalParameterToBuffers | ( | int & | numDevices, | |
string | sDeviceName, | |||
string | sValue, | |||
dyn_int & | diManRegAddr, | |||
dyn_int & | diManRegVal, | |||
dyn_string & | exceptionInfo | |||
) |
Add the address and value of a digital parameter device in the recipe buffers.
numDevices | - [IN/OUT] Number of digital parameter devices included in the recipe. | |
sDeviceName | - [IN] Device name. | |
sValue | - [IN] Value for the device in the recipe. | |
diManRegAddr | - [OUT] Temporary buffer for the manual register address. | |
diManRegVal | - [OUT] Temporary buffer for the manual register value. | |
exceptionInfo | - [OUT] Standard exception handling variable. |
References _unRecipeFunctions_getDpeAddress(), and _unRecipeFunctions_setBit().
Referenced by _unRecipeFunctions_createBuffersData().
void _unRecipeFunctions_addXParameterToBuffers | ( | int & | numDevices, | |
string | sDeviceName, | |||
string | sDeviceType, | |||
string | sValue, | |||
int | iArmBit, | |||
int | iNewMrBit, | |||
dyn_int & | diManRegAddr, | |||
dyn_int & | diManRegVal, | |||
dyn_int & | diReqAddr, | |||
dyn_float & | dfReqVal, | |||
dyn_string & | exceptionInfo | |||
) |
Add the addresses and values of a word parameter or analog parameter device in the recipe buffers.
numDevices | - [IN/OUT] Number of digital parameter devices included in the recipe. | |
sDeviceName | - [IN] Device name. | |
sDeviceType | - [IN] Device type. | |
sValue | - [IN] Value for the device in the recipe. | |
iArmBit | - [IN] Position of the 'Armed' bit of the device in the Manual Register. | |
iNewMrBit | - [IN] Position of the 'New Manual Request' bit of the device in the Manual Register. | |
diManRegAddr | - [OUT] Temporary buffer for the manual register address. | |
diManRegVal | - [OUT] Temporary buffer for the manual register value. | |
diReqAddr | - [OUT] Temporary buffer for the requested value address. | |
dfReqVal | - [OUT] Temporary buffer for the requested value. | |
exceptionInfo | - [OUT] Standard exception handling variable. |
References _unRecipeFunctions_getDpeAddress(), and _unRecipeFunctions_setBit().
Referenced by _unRecipeFunctions_createBuffersData().
void _unRecipeFunctions_addMultiDpeDeviceToBuffers | ( | int & | numDevices, | |
string | sDeviceName, | |||
string | sDpeName, | |||
string | sDeviceType, | |||
string | sValue, | |||
mapping & | deviceMap, | |||
mapping | manRegBitsMap, | |||
int | iArmBit, | |||
dyn_string & | exceptionInfo | |||
) |
Add the addresses and values of an analog alarm or controller device in the recipe buffers.
numDevices | - [IN/OUT] Number of digital parameter devices included in the recipe. | |
sDeviceName | - [IN] Device name. | |
sDpeName | - [IN] Datapoint element name. | |
sDeviceType | - [IN] Device type. | |
sValue | - [IN] Value for the device in the recipe. | |
deviceMap | - [IN/OUT] Map where key=device name, Value=Matrix: (1,1) -> ManReg Address (1,2) -> ManReg value (2,1) -> Requested address (2,2) -> Requested value | |
manRegBitsMap | - [IN] | |
iArmBit | - [IN] Position of the 'Armed' bit of the device in the Manual Register. | |
exceptionInfo | - [OUT] Standard exception handling variable. |
References _unRecipeFunctions_getDpeAddress(), and _unRecipeFunctions_setBit().
Referenced by _unRecipeFunctions_createBuffersData().
void _unRecipeFunctions_fillRecipeHeaderBuffer | ( | dyn_int & | recipeHeaderBuffer, | |
int | iNumDPar, | |||
int | iNumWPar, | |||
int | iNumAPar, | |||
int | iNumAAlarm, | |||
int | iNumPid | |||
) |
Fill the contents of the recipe header buffer.
recipeHeaderBuffer | - [OUT] Recipe header buffer. | |
iNumDPar | - [IN] Number of digital parameter devices included in the recipe. | |
iNumWPar | - [IN] Number of word parameter devices included in the recipe. | |
iNumAPar | - [IN] Number of analog parameter devices included in the recipe. | |
iNumAAlarm | - [IN] Number of analog alarm devices included in the recipe. | |
iNumPid | - [IN] Number of controller devices included in the recipe. |
Referenced by _unRecipeFunctions_createBuffersData().
void _unRecipeFunctions_fillRecipeBuffer | ( | dyn_anytype & | buffer, | |
dyn_anytype | dparValues, | |||
dyn_anytype | wparValues, | |||
dyn_anytype | aparValues, | |||
dyn_anytype | aalarmValues, | |||
dyn_anytype | pidValues | |||
) |
Fill the contents of a recipe buffer.
buffer | - [OUT] Buffer where to add the recipe values. | |
dparValues | - [IN] Values of the digital parameter device. | |
wparValues | - [IN] Values of the word parameter device. | |
aparValues | - [IN] Values of the analog parameter device. | |
aalarmValues | - [IN] Values of the analog alarm device. | |
pidValues | - [IN] Values of the controller device. |
Referenced by _unRecipeFunctions_createBuffersData().
void _unRecipeFunctions_sendData | ( | string | plcName, | |
dyn_string & | exceptionInfo | |||
) |
Send the contents of the recipe buffers to a PLC.
plcName | - [IN] The PLC name. | |
exceptionInfo | - [OUT] Standard exception handling variable. |
References _unRecipeFunctions_getManRegAddrBuffer(), _unRecipeFunctions_getManRegValBuffer(), _unRecipeFunctions_getRecipeBuffersName(), _unRecipeFunctions_getReqAddrBuffer(), _unRecipeFunctions_getReqValBuffer(), and _unRecipeFunctions_writeInRecipeLog().
Referenced by _unRecipeFunctions_recipeActivationStatusNewIdReceived().
void _unRecipeFunctions_createRecipeHeaderDBNumber | ( | string | sPlcName, | |
dyn_string | dsDpes, | |||
dyn_string & | exceptionInfo | |||
) |
Insert the DB number for each recipe device type in the recipe header buffer (Siemens only).
sPlcName | - [IN] PLC Name. | |
dsDpes | - [IN] List of DPEs of a recipe. | |
exceptionInfo | - [OUT] Standard exception handling variable. |
References _unRecipeFunctions_getHeaderBuffer(), and _unRecipeFunctions_getS7AddressDBNumber().
Referenced by _unRecipeFunctions_activateRecipe().
synchronized void unRecipeFunctions_activateRecipes | ( | dyn_string | dsRcpDps | ) |
Activate a list of recipes. This method must be called from a panel containing a 'RcpTable' with the list of recipes.
dsRcpDps | - [IN] List of datapoints of the recipes to activate. |
References _unRecipeFunctions_mappingInsertValue(), _unRecipeFunctions_setTableCellBGColor(), _unRecipeFunctions_writeInRecipeLog(), and unRecipeFunctions_activateRecipe().
void _unRecipeFunctions_recipeStateCB | ( | dyn_string | dsDpList, | |
dyn_string | dsValues | |||
) |
Callback function executed when the recipe state has been modified.
dsDpList | - [IN] List of recipe state datapoints. | |
dsValues | - [IN] List of recipe state values. |
void unRecipeFunctions_checkRecipeStatus | ( | dyn_string | dsRcpDps | ) |
Check the status of a list of recipes. This method must be called from a panel containing a 'RcpTable' with the list of recipes.
dsRcpDps | - [IN] List of datapoints of the recipes to verify its activation. |
References _unRecipeFunctions_checkRecipeOnlineValues(), _unRecipeFunctions_getRecipeObjectFromDp(), _unRecipeFunctions_setTableCellBGColor(), _unRecipeFunctions_writeInRecipeLog(), unRecipeFunctions_getPlcStatus(), and unRecipeFunctions_getRecipeClassObject().