使用 Sinamics S120 驱动脚本配置扩展报文

为了传输故障代码、电流、温度等信息。一般须要使用扩展报文的方式来发送这些信息。在驱动数量较少的状况下,能够进行手动配置。
若是驱动数量不少,能够使用脚本script的方式来配置扩展报文。code

驱动编号

注意下图中的Drive Number,表示驱动在 CU(control unit)中的编号, 脚本中须要使用这个编号blog

如下脚本,给报文增长以下内容
receive word 10, r80 电机扭矩
receive word 11, r2131 驱动故障代码
receive word 12, r2132 电机扭矩
receive word 13, r80 电机扭矩
receive word 14, r68 电机电流
receive word 15, r35 电机温度ip

使用如下脚本时,须要it

  • 将设备名称替换为你项目中的CU名称
  • 将驱动名称替换为你项目中的驱动
  • 检查Drive Number是否正确
' Script_1

'r80 torque actual value
PROJ.Devices("S120xCU320x2xPN4").TOs("DRV_IC_4").Parameters(2051,10)     =  "80 : 0 : 2"  ' receive word 10
PROJ.Devices("S120xCU320x2xPN4").TOs("DRV_PC_4").Parameters(2051,10)        =  "80 : 0 : 3"  ' receive word 10
PROJ.Devices("S120xCU320x2xPN4").TOs("DRV_Infeed_IN").Parameters(2051,10)    =  "80 : 0 : 4"  ' receive word 10
PROJ.Devices("S120xCU320x2xPN4").TOs("DRV_UNWinder").Parameters(2051,10)      =  "80 : 0 : 5"  ' receive word 10

'r2131 fault number
PROJ.Devices("S120xCU320x2xPN4").TOs("DRV_IC_4").Parameters(2051,11)     =  "2131 : 0 : 2"  ' receive word 11
PROJ.Devices("S120xCU320x2xPN4").TOs("DRV_PC_4").Parameters(2051,11)        =  "2131 : 0 : 3"  ' receive word 11
PROJ.Devices("S120xCU320x2xPN4").TOs("DRV_Infeed_IN").Parameters(2051,11)    =  "2131 : 0 : 4"  ' receive word 11
PROJ.Devices("S120xCU320x2xPN4").TOs("DRV_UNWinder").Parameters(2051,11)      =  "2131 : 0 : 5"  ' receive word 11


'r2132 alarm number
PROJ.Devices("S120xCU320x2xPN4").TOs("DRV_IC_4").Parameters(2051,12)     =  "2132 : 0 : 2"  ' receive word 12
PROJ.Devices("S120xCU320x2xPN4").TOs("DRV_PC_4").Parameters(2051,12)        =  "2132 : 0 : 3"  ' receive word 12
PROJ.Devices("S120xCU320x2xPN4").TOs("DRV_Infeed_IN").Parameters(2051,12)    =  "2132 : 0 : 4"  ' receive word 12
PROJ.Devices("S120xCU320x2xPN4").TOs("DRV_UNWinder").Parameters(2051,12)      =  "2132 : 0 : 5"  ' receive word 12


'r80 torque actual value
PROJ.Devices("S120xCU320x2xPN4").TOs("DRV_IC_4").Parameters(2051,13)     =  "80 : 0 : 2"  ' receive word 13
PROJ.Devices("S120xCU320x2xPN4").TOs("DRV_PC_4").Parameters(2051,13)        =  "80 : 0 : 3"  ' receive word 13
PROJ.Devices("S120xCU320x2xPN4").TOs("DRV_Infeed_IN").Parameters(2051,13)    =  "80 : 0 : 4"  ' receive word 13
PROJ.Devices("S120xCU320x2xPN4").TOs("DRV_UNWinder").Parameters(2051,13)      =  "80 : 0 : 5"  ' receive word 13

'r68 current
PROJ.Devices("S120xCU320x2xPN4").TOs("DRV_IC_4").Parameters(2051,14)     =  "68 : 0 : 2"  ' receive word 14
PROJ.Devices("S120xCU320x2xPN4").TOs("DRV_PC_4").Parameters(2051,14)        =  "68 : 0 : 3"  ' receive word 14
PROJ.Devices("S120xCU320x2xPN4").TOs("DRV_Infeed_IN").Parameters(2051,14)    =  "68 : 0 : 4"  ' receive word 14
PROJ.Devices("S120xCU320x2xPN4").TOs("DRV_UNWinder").Parameters(2051,14)      =  "68 : 0 : 5"  ' receive word 14

'r35 motor temperature
PROJ.Devices("S120xCU320x2xPN4").TOs("DRV_IC_4").Parameters(2051,15)     =  "35 : 0 : 2"  ' receive word 15
PROJ.Devices("S120xCU320x2xPN4").TOs("DRV_PC_4").Parameters(2051,15)        =  "35 : 0 : 3"  ' receive word 15
PROJ.Devices("S120xCU320x2xPN4").TOs("DRV_Infeed_IN").Parameters(2051,15)    =  "35 : 0 : 4"  ' receive word 15
PROJ.Devices("S120xCU320x2xPN4").TOs("DRV_UNWinder").Parameters(2051,15)      =  "35 : 0 : 5"  ' receive word 15
相关文章
相关标签/搜索