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
    
    
  • 相关阅读:
    [转]读取并修改App.config文件
    [转]线程和进程的概念
    实习日志(3)
    实习日志2
    实习小感,回学校啦~~~~
    请教LUA高手一段代码,希望帮忙谢谢!
    实习的日子
    vs显示 error LNK2019: 无法解析的外部符号 _main解决办法
    创建一个新窗口进程并返回进程ID号和进程的主线程ID号
    显示基本图形界面第一天
  • 原文地址:https://www.cnblogs.com/lion-zheng/p/10583086.html
Copyright © 2011-2022 走看看