Files
ecmc_plugin_safety/scripts/addSS1Group.cmd
2025-02-26 14:51:27 +01:00

41 lines
2.0 KiB
Batchfile

#==============================================================================
# addSS1Group.cmd
#-
#- !!!!!!!!!!!!! IMPORTANT !!!!!!!!!
#- This plugin has _NO_ safety rated functionalities.
#- The intended use of this plugin is only to handle interfacing with a safety PLC.
#-
#-------------- Information:
#- Description: Create a SS1 motion group
#-
#- by Anders Sandström, Paul Scherrer Institute, 2023
#- email: anders.sandstroem@psi.ch
#-
#-###############################################################################
#-
#- Arguments:
#- NAME : Name of safety group
#- EC_RAMP_DOWN_CMD : Ethercat entry for ramp down command, input to ecmc (command from safety PLC/system)
#- EC_AXES_REST_STAT : Ethercat entry for signaling that all axes in group are at rest, output from ecmc (feedback to safety PLC/system)
#- EC_AXES_LIM_VELO_CMD : Ethercat entry for reducing velocity, input to ecmc (command from safety PLC/system)
#- DELAY_MS : Time between rampdown command and STO
#-
#################################################################################
#-Use ecmcAddSS1SafetyGroup(<name>, <ec_rampdown_cmd>, <ec_standstill_status>,<time_delay_ms>)
#- <name> : Name of group
#- <ec_rampdown_cmd> : Ethercat entry input for rampdown cmd
#- <ec_standstill_status> : Ethercat entry output for group standstill status
#- <ec_red_velo_cmd> : Ethercat entry input for activation of maximum velo limitation (set to "empty" to disable)
#- <time_delay_ms> : Time delay of STO [ms]
ecmcAddSS1SafetyGroup("${NAME}","${EC_RAMP_DOWN_CMD}","${EC_AXES_AT_REST_STAT}","${EC_AXES_LIM_VELO_CMD=empty}",${DELAY_MS=0})
ecmcEpicsEnvSetCalc(ECMC_PLG_SAFETY_GRP_CNT, "${ECMC_PLG_SAFETY_GRP_CNT=0}+1", "%02d")
#- Load SS1 group records
dbLoadRecords("ecmcSS1Group.template","P=${ECMC_PREFIX},NAME=${NAME},ID=${ECMC_PLG_SAFETY_GRP_CNT},COUNT=${ECMC_PLG_SAFETY_GRP_CNT},DELAY=${DELAY_MS=0}")