SafeRemote
Warning
SafeRemote is not supported in Automation Studio 6.
SafeRemote Library
The SafeRemote library provides an interface to commission / update safety systems. In this page, SC refers to the safety controller.
NOTE: SafeRemote only supports Safety Release 1.10 or later.
NOTE: If SafeRemote is connected to a Safety Controller (SC), use of SAFE DESIGNER’s Remote Control is not allowed.
Initialization
In order to use SafeRemote a variable of type SRWrap_typ must be declared.
safeRemote.IN.CFG.SafeLogicID:= 4; // The SafeLogic ID
safeRemote.IN.CFG.FileDevice:= 'safe'; // Enter File Device where safety program is located
IN.CFG.UDID_Low and IN.CFG.UDID_High will need to be mapped to the SC UDID_Low and UDID_High inputs respectively. If SC does not have the inputs available they can be accessed using AsIOAcc’s AsIOAccRead FUB.
deviceName:= 'IF6.ST1';
channelNameLow:= 'UDID_low';
channelNameHigh:= 'UDID_high';
IOReadLow.pChannelName:= ADR(channelNameLow);
IOReadLow.pDeviceName:= ADR(deviceName);
IOReadLow.enable:= TRUE;
IOReadHigh.pChannelName:= ADR(channelNameHigh);
IOReadHigh.pDeviceName:= ADR(deviceName);
IOReadHigh.enable:= TRUE;
IF NOT (IOReadLow.value = 0) THEN
safeRemote.IN.CFG.UDID_Low:= IOReadLow.value;
IOReadLow.enable:= FALSE;
END_IF
IF NOT (IOReadHigh.value = 0) THEN
safeRemote.IN.CFG.UDID_High:= UDINT_TO_UINT(IOReadHigh.value);
IOReadHigh.enable:= FALSE;
END_IF
IOReadLow();
IOReadHigh();
Cyclic Operation
SafeRemoteFn_Cyclic( safeRemote );
SafeRemote Structure
Inputs
Commands
Commands are reset internally after each function call.
- LogIn - Attempt to log into SC using Password specified in parameters
- LogOut - Log out of SC and stop communication.
- SetPassword - Sets SC password to NewPassword in parameters. If a password is already set Password is required.
- Transfer - Starts a project transfer to SC.
- Unlock - Unlock SC to continue transfer.
- FormatSafeKey - Performs a format on SC.
- Scan - Starts a system scan of SC.
- ReadStatus - Read status of SC.
- AcknowledgeKey - Attempt ACK of Safe Key change.
- Acknowledge1Module - Attempt ACK of 1 Module change.
- Acknowledge2Module - Attempt ACK of 2 Module changes.
- Acknowledge3Module - Attempt ACK of 3 Module changes.
- AcknowledgeNModule - Attempt ACK of N Modules changes.
- AcknowledgeFirmware - Attempt ACK of Firmware change.
- AcknowledgeError - Acknowledges FUB error.
Parameters
- Password - SC password. Required when doing a LogIn or SetPassword.
- NewPassword - SC password to be set. Required when doing a SetPassword.
- TransferMode - Specifies whether to transfer application from File or AppID.
- AppID - App ID # when performing a transfer in SRWrap_Data_Object_Mode.
- File - File name when performing a transfer in SRWrap_File_Mode.
Configuration
- SafeLogicID - SafeLOGIC ID of safety controller.
- UDID_Low - SC UDID_low (Set via IO mapping or AsIOAcc library).
- UDID_High - SC UDID_high (Set via IO mapping or AsIOAcc library).
- FileDevice - File device for File.
Outputs
- ControlStatus - SC status. Only valid when logged into SC. Refer to RemoteControlStatusTypeV2 in BR help.
- StatusString - FUB status string.
- AckKeyNeeded - Acknowledge of Safety Key is required.
- AckModuleNeeded - Acknowledge of Modules required.
- AckNModuleNeeded - Acknowledge of N number of Modules required.
- NumAckModulesNeeded - Number of Modules that have changed.
- AckFirmwareNeeded - Acknowledge of Safety Firmware is required.
- PasswordSet - SC password is set.
- ConnectionStatus - Connection Status. Refer to SRWrap_Connection_Status_enum.
- UnlockRequired - Unlock required to continue.
- Error - FUB error occurred.
- ErrorID - Current error ID.
- ErrorString - Current error text information.
Error ID Numbers
- 0 - ERR_OK - No error
- 20605 - doERR_ILLOBJECT - Object not found
- 20609 - doERR_MODULNOTFOUND - Data object not found
- 20700 - fiERR_INVALID_PATH - The specified path is invalid
- 20798 - fiERR_DEVICE_MANAGER - Error in device manager
- 36100 - safeERR_VERSION - Incorrect version of command structure
- 36101 - safeERR_PW_LENGTH - Incorrect password length
- 36102 - safeERR_UDID - No UDID specified for safety controller
- 36103 - safeERR_ALLOC_MEM - Error allocating internal memory
- 36104 - safeERR_INTERNAL_ERROR - Internal error
- 36105 - safeERR_TIMEOUT - Communication timeout
- 36106 - safeERR_RC_CMD - No command specified
- 36107 - safeERR_RC_ENTER_DATA - Invalid command specified for Enter command
- 36108 - safeERR_RC_ENTER_PW - No password specified for Enter command
- 36109 - safeERR_RC_ENTER_SK_PW - No new password specified for change
- 36110 - safeERR_RC_STATUS_DATA - Invalid command for reading back status
- 36111 - safeERR_RC_DATA_LENGTH - Incorrect data length for status information returned by system
- 36112 - safeERR_DL_NO_PASSWORD - No password specified for download
- 36113 - safeERR_DL_PROTOCOL - Incorrect protocol version or header error
- 36114 - safeERR_DL_FILE_OPEN - File already open
- 36115 - safeERR_DL_FILE_INVALID - File invalid
- 36116 - safeERR_DL_FILE_TOO_BIG - File too large
- 36117 - safeERR_DL_WRITE - Write error
- 36118 - safeERR_DL_STREAM - Error at end of stream
- 36119 - safeERR_DL_CHECKSUM - Incorrect checksum
- 36120 - safeERR_DL_UDID - Mismatch of specified UDID with UDID of safety controller
- 36121 - safeERR_DL_WRONG_FILE_SIZE - Incorrect file size
- 36122 - safeERR_DL_NO_RIGHTS_TO_WRITE - No authorization to write, incorrect password
- 36123 - safeERR_DL_UNLOCK_FILE_FILE - Error retrieving file information
- 36124 - safeERR_DL_UNLOCK_READ - Read error
- 36125 - safeERR_DL_UNLOCK_WRITE - Write error
- 36126 - safeERR_DL_STATIC_UNLOCK - Constant signal TRUE on parameter in command structure
- 36127 - safeERR_DL_COMPARE_FAILED - Comparison failed for read back data
- 36128 - safeERR_DLDATA_TYP_ERR - Unknown or invalid download type
- 36129 - safeERR_DLDATA_ERR_DATA - Incorrect data specified for download
- 36130 - safeERR_COT_TYPE_ERR - Unknown or invalid upload type
- 36131 - safeERR_COT_READING_FILE - Error reading from file
- 36132 - safeERR_BUFFER_NULL - Required input buffer is NULL
- 36133 - safeERR_BUFFER_TOO_SMALL - Required input buffer too small
- 36134 - safeERR_FILE_EMPTY - File empty or not found on safety controller
- 36135 - safeERR_FI_TYPE_ERR - Error retrieving file information
- 36136 - safeERR_SLINFO_TYPE_ERR - Unknown or invalid SafeLOGIC information
- 36137 - safeERR_SLINFO_RET_ERR - Remote control command returning error
- 36138 - safeERR_COT_PWD_ERR - Invalid password
- 36180 - safeERR_TC_INV_TABTYPE - Table type not supported
- 36181 - safeERR_TC_INV_INST - Invalid table instance
- 36182 - Invalid pointer - Null pointer specified
- 36183 - safeERR_TC_INV_TAB_LEN - Number of table entries is 0 or unable to determine table length (e.g. table type not supported)
- 36184 - safeERR_TC_INV_USER - Username longer than 47 bytes plus string terminator
- 36185 - safeERR_TC_TYPE_CPY_FCT - Table type dependent copy function returning error
- 36186 - safeERR_TC_CHECK_FAILED - Type-dependent table check failed
- 36187 - safeERR_TC_EXTRACT_FAILED - Unable to export HMI application data from the generated raw table data
- 36188 - safeERR_TC_LOCK_FAILED - Tables CRC protection returned error
- 36189 - safeERR_TC_ACK_SET - Input “AckData” was set although this is not permitted
- 36190 - safeERR_TC_INVALID_STEP - The step switching mechanism of the function block is in an invalid step
- 36191 - safeWRN_TC_WAIT_FOR_ACK - The function block is waiting for HMI application data to be acknowledged
- 65535 - ERR_FUB_BUSY - Function block still working