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
    
    
  • 相关阅读:
    Vs 开发时无法断点问题
    VS启动调试速度异常的缓慢问题
    vs2017 调试时 浏览器关闭不想中断调试
    聚簇索引和非聚簇索引
    java实现阿里云短信服务发送验证码
    mysql定时器
    token,加密,签名
    Redis更新缓存同步数据库的理解
    Token
    解决哈希冲突的方法
  • 原文地址:https://www.cnblogs.com/lion-zheng/p/10583086.html
Copyright © 2011-2022 走看看