DF1协议常用命令
PCCC:Programmable Controller Communication Commands.
AB PLC常用指令
根据http://www.iatips.com/pccc_tips.html,SLC5/MicroLogix常用指令如下:
The best commands for SLC5/MicroLogix controllers are:
- Protected Typed Logical Read with 3-Address Fields (Cmd=0x0F, SubFnc=0xA2)
- Protected Typed Logical Write with 3-Address Fields (Cmd=0x0F, SubFnc=0xAA)
- Protected Typed Logical Masked-Write with 3-Address Fields (Cmd=0x0F, SubFnc=0xAB)
- Protected Typed Logical Read with 2-Address Fields (Cmd=0x0F, SubFnc=0xA1)
- Protected Typed Logical Write with 2-Address Fields (Cmd=0x0F, SubFnc=0xA9)
Only the first two (0xA2/AA) are documented in the official DF1 protocol specification. The third (0xAB) is not documented but is commonly used by OPC servers; In fact a Rockwell engineer formally sent me details of it when I asked; it is not considered "secret".
The last two (0xA1/A9) are only of value if you're creating a slave driver since a few of Rockwell's software tools assume these are supported. While they are not documented in the DF1 specification, RSLogix5000 outlines support for them as part of its legacy support for PCCC messages. But there is no reason for an OPC server or master to use 0xA1/A9 since support by slaves is not universal. Using SubFnc 0xA1 instead of 0xA2 just drops one unrequired NULL byte from the command, so is of modest value. For example, to read N7:1 your Read command would include the 6 bytes "A2 02 07 89 01 00" for the 3-Address Fields form and only the 5 bytes "A1 02 07 89 01" for the 2-Address Fields form. Big deal, eh? Well, yes - a big deal if you try to use 0xA1 with a slave that doesn't understand 0xA1.
怎样单独写一位:
How do I write single bits on a SLC5/MicroLogix?
use the undocumented (but well supported) Cmd=0x0F SubFnc=0xAB Masked Write
The command looks much like the documented Protected Typed Logical Write with 3-Address Fields (Cmd=0x0F, SubFnc=0xAA) except you'll find an added 16-bit word of data. So here are examples of each:
0xAA 02 03 85 00 00 01 00
0xAB 02 03 85 00 00 01 00 01 00
0xAB 04 03 85 00 00 01 00 01 00 00 00
The first command (0xAA) in effect clears bits B3:0/1 to B3:0/15 and sets bit B3:0/0. So the entire first word of the B3 table is changed - often not the desired action. In contrast, the second command (0xAB) just sets B3:0/0 to 1 without affecting the other 15 bits of B3:0. Notice that the 16-bit "mask" is not included in the byte count of 2. The third command (0xAB) shows that more than one data word can be sent, but there is always just a single 16-bit mask. The third command would set B3:0/0 to "1" and clear B3:1/0 to "0". If you - for example - desire to set both bits B3:0/0 and B3:1/6 to "1", then you'd need to issue two separate commands since they don't share the same 16-bit mask.
AB PLC常用指令--具体
A2指令--protected typed logical read with three address fields
Reads data from a logical address in a SLC 500 module
读取N7:1一个字(2bytes)
request: 10 02 01 00 0F 00 36 0D A2 07 89 01 00 10 03 80 D8
reply: 10 06 10 02 00 01 4F 00 36 0D E8 03 10 03 75 65
读取N7:0五个字(10bytes)
request: 10 02 01 00 0F 00 08 52 A2 0A 07 89 00 00 10 03 8D 4D
reply: 10 06 10 02 00 01 4F 00 08 52 D0 07 E8 03 00 00 00 00 00 00 10 03 5F E2
AA指令--protected typed logical write with three address fields
Writes data to a logical address in a SLC processor
写B3:0
request: 10 02 01 00 0F 00 08 54 AA 04 03 85 00 00 03 00 01 00 10 03 DB B2
reply: 10 06 10 02 00 01 4F 00 08 54 10 03 AB 1C 10 05 10 05 10 05 10 05
示例
一组PLC数据定义:
DF1协议
DF1协议控制字符
DF1协议传输标志
DF1协议链路协议帧
Half-duplex
Full-duplex
DF1协议应用帧
DF1协议常用命令的更多相关文章
- web 架构 /http协议,状态码,django中常用命令
什么是web应用? web应用 架构 :B/S架构 | C/S架构 网站:BS架构其实就是应用程序: B是浏览器 S是sever(实现了wsgi协议,实现了socket的服务端) + applicat ...
- DF1协议简述
DF1协议 1. 概述 可编程控制器(PLC)因编程方便,抗干扰能力强,被广泛应用于各种领域.DF1协议是AB公司可编程控制器系统广泛支持的数据链路层通信协议,各系列可编程控制器及装有RSLin ...
- linux iptables常用命令之配置生产环境iptables及优化
在了解iptables的详细原理之前,我们先来看下如何使用iptables,以终为始,有可能会让你对iptables了解更深 所以接下来我们以配置一个生产环境下的iptables为例来讲讲它的常用命令 ...
- 版本控制-Git服务器搭建和常用命令使用
Git是目前世界上最先进的分布式版本控制系统(没有之一).使用Svn的请参考<版本控制-svn服务器搭建和常用命令(centos 6.3)>,下面介绍Git的常用命令 常用命令 简单版 升 ...
- UNIX常用命令
以下只说明各常用指令的基本用法, 若需详细说明, 请用 man 去读详细的 manual. 1.关於档案/目录处理的命令 ls--列目录 这是最基本的档案指令. ls 的意义为 "list& ...
- shell常用命令归类整理
shell 命令整理 bash shell 含有许多功能,因此有许多可用的命令:本文档仅罗列了一些常用命令及其使用频率较高的参数.#本文档仅罗列了一些常用命令及其使用频率较高的参数.#vers ...
- Git版本控制软件结合GitHub从入门到精通常用命令学习手册(转)
简要参考:http://www.tuicool.com/articles/mEvaq2 http://gitref.org/zh/index.html GIT 学习手册简介 本站为 Git 学习参考手 ...
- Linux常用命令学习1---(安装、文件系统、目录操作命令cd ls mv cp rm mkdir、链接命令ln……)
1.理解Linux的文件系统:分区和挂载点 挂载点和路径名无关 /根目录下的/boot完全可以时独立于 /的独立的挂载点,只要你设置就可以 linux安装时候,必须要有这两个分区 / 和 ...
- db2常用命令大全
#显示这个DB2错误的解释信息(SQLSTATE 5位数字)db2 ? 42704 #显示这个SQLCODE的解释信息(SQLCODE 四位数字) db2 ? SQL0204N ##查看数据库指定配置 ...
随机推荐
- web控制树莓派摄像头
首先测试摄像头保证能顺利拍照 raspistill -o a.jpg 安装flask sudo pip install flask 确认无误之后向下进行. 文件夹结构: CapPic ----stat ...
- MySQL中连接超时自动断开的解决方案
前言: MySQL数据库一般默认的连接超时时间为3600s(1小时),但是在进行大规模的线程事务操作时,一个连接会一直等待执行,这时候如果数据库的超时时间设置的过短,就可能会出现Mysql数据连接自动 ...
- python总结十一
1.python运行速度慢的原因: python不是强类型的语言,所以解释器运行时遇到变量以及数据类型转换,比较操作,引用变量时都需要检查其数据类型 python的编译器启动速度比java快,但几乎每 ...
- HDU 3686 Traffic Real Time Query System(点双连通)
题意 给定一张 \(n\) 个点 \(m\) 条边的无向图,\(q\) 次询问,每次询问两边之间的必经之点个数. 思路 求两点之间必经之边的个数用的是边双缩点,再求树上距离.而对比边双和点双之 ...
- 【前端知识体系-CSS相关】CSS基础知识强化
1.CSS样式(选择器)的优先级? 1.1 权重的计算规则 第一优先级:无条件优先的属性只需要在属性后面使用!important.它会覆盖页面内任何位置定义的元素样式.(ie6支持上有些bug). 第 ...
- Ubuntu16 安装 wireshark
添加源 sudo apt-add-repository ppa:wireshark-dev/stable 更新 sudo apt-get update 安装 sudo apt-get install ...
- Ext.Net GridPanel (属性|方法|配置|详细介绍)
1.Ext.NET ---- GridPanel 主要配置项: store:表格的数据集 columns:表格列模式的配置数组,可自动创建ColumnModel列模式 autoExpandColumn ...
- golang学习笔记 ---slice
Go 语言中的slice类型可以理解为是数组array类型的描述符,包含了三个因素: 指向底层数组的指针 slice目前使用到的底层数组的元素个数,即长度 底层数组的最大长度,即容量 因此当我们定义一 ...
- mysql时间戳转日期
-- 日期字符串转时间戳,10位,数据库存储的是13位 select UNIX_TIMESTAMP('2019-09-01 00:00:00'); -- 时间戳转日期 ,'%Y-%m-%d %H:%i ...
- Vector线程安全,ArrayList非线程安全
http://baijiahao.baidu.com/s?id=1638844080997170869&wfr=spider&for=pc Vector线程安全,ArrayList非线 ...