zoukankan      html  css  js  c++  java
  • 使用 Sinamics S120 驱动脚本配置扩展报文

    为了传输故障代码、电流、温度等信息。通常需要使用扩展报文的方式来发送这些信息。在驱动数量较少的情况下,可以进行手动配置。
    如果驱动数量很多,可以使用脚本script的方式来配置扩展报文。

    驱动编号

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

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

    使用以下脚本时,需要

    • 将设备名称替换为你项目中的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
    
    
  • 相关阅读:
    Django创建模型。
    Kubernetes APIService资源
    应用系统管理风险
    [Golang] go list命令查看依赖的版本
    [Golang] 升级gin框架和jwtgo
    [Git] 解决git错误 OpenSSL SSL_read: Connection was reset, errno 10054
    [Github] 配置ssh免密码登录解决 You've successfully authenticated, but GitHub does not provide shell access.
    go循环遍历小坑
    Go 字符串拼接6种,最快的方式 strings.builder
    uniapp安卓真机调试提示检测不到手机【解决办法】
  • 原文地址:https://www.cnblogs.com/lion-zheng/p/10583086.html
Copyright © 2011-2022 走看看