# Encoder type record(waveform, "$(P)$(M):Encoder_Type") { field(DTYP, "asynOctetRead") field(INP, "@asyn($(CONTROLLER),$(AXIS),1) ENCODER_TYPE") field(FTVL, "CHAR") field(NELM, "80") field(SCAN, "I/O Intr") } # reread encoder record(longout, "$(P)$(M):Reread_Encoder") { field(DTYP, "asynInt32") field(OUT, "@asyn($(CONTROLLER),$(AXIS),1) REREAD_ENCODER_POSITION") field(PINI, "NO") } # reread encoder record(longout, "$(P)$(M):Read_Config") { field(DTYP, "asynInt32") field(OUT, "@asyn($(CONTROLLER),$(AXIS),1) READ_CONFIG") field(PINI, "NO") } # =================================================================== # The following records read acceleration and velocity from the driver and # copy those values into the corresponding fields of the main motor record. # This strategy is described here: https://epics.anl.gov/tech-talk/2022/msg00464.php # Helper record for the high limit which is filled in by the driver record(ai, "$(P)$(M):MOTOR_VELOCITY-RBV") { field(DTYP, "asynFloat64") field(INP, "@asyn($(CONTROLLER),$(AXIS)) MOTOR_VELOCITY_FROM_DRIVER") field(SCAN, "I/O Intr") field(FLNK, "$(P)$(M):PUSH_VELO_TO_FIELD") } # Push the value into the field of the main motor record record(ao, "$(P)$(M):PUSH_VELO_TO_FIELD") { field(DOL, "$(P)$(M):MOTOR_VELOCITY-RBV CP") field(OUT, "$(P)$(M).VELO") field(OMSL, "closed_loop") # This configuration keeps the PV and the field in sync } # Helper record for the low limit which is filled in by the driver record(ai, "$(P)$(M):MOTOR_ACCL-RBV") { field(DTYP, "asynFloat64") field(INP, "@asyn($(CONTROLLER),$(AXIS)) MOTOR_ACCEL_FROM_DRIVER") field(SCAN, "I/O Intr") field(FLNK, "$(P)$(M):PUSH_ACCL_TO_FIELD") } # Push the value into the field of the main motor record record(ao, "$(P)$(M):PUSH_ACCL_TO_FIELD") { field(DOL, "$(P)$(M):MOTOR_ACCL-RBV CP") field(OUT, "$(P)$(M).ACCL") field(OMSL, "closed_loop") # This configuration keeps the PV and the field in sync }