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 ##查看数据库指定配置 ...
随机推荐
- VIJOS-P1421 更换轮胎
JDOJ 1506: VIJOS-P1421 更换轮胎 https://neooj.com/oldoj/problem.php?id=1506 Description 经过数周的期待,比赛终于正式开始 ...
- 微信小程序警告:Now you can provide attr "wx:key" for a "wx:for" to improve performance.
那是因为在<block wx:for-items="{{imgUrls}}">中不存在wx:key="imgUrls"所以才导致报了个警告. 写成& ...
- ios、安卓的兼容性
日期转换成时间戳: 安卓下可以使用 Date.parse(new Date('2019-11-18 12:00:00')) 直接转换,结果为 1574049600000 ios下 Date.parse ...
- 树的遍历 | 1079 理解题意+DFS
这题如果读懂了题意,就很好做,一波操作就结束了.不过题目有点难读,考验耐心和读题的细致. AC代码: #include <stdio.h> #include <memory.h> ...
- 【Comet OJ - Contest #0 A】解方程(数学水题)
点此看题面 大致题意: 给定自然数\(n\),让你求出方程\(\sqrt{x-\sqrt n}+\sqrt y-\sqrt z=0\)的自然数解\(x,y,z\)的数量以及所有解\(xyz\)之和. ...
- ES5.1下的作用域链
作用域链(ES5.1规格视角) javascript作用域类型 javascript采用的是词法作用域(静态作用域) 与之相对的是动态作用域,以下的例子可以很好地说明 let a = 3 functi ...
- 递归函数详解——VS调试教你理解透彻递归
#include <stdio.h> #include <stdlib.h> int recursion(int); ; int main(void) { recursion( ...
- Optical Flow Estimation 发展历程 (1)
Optical flow estimation Traditional Method Variational approach TVL-1 Deep Method Supervised FlowNet ...
- 利用ANSYS进行橡胶坝的静力分析和模态计算
这个是我一个同学的毕业论文,我也帮了一点小忙,所以征得同学同意,把相关的经验共享一下(当时候做得也很艰难,网上查到的可参考的资料太少了,而且没有具体步骤). 先占一个位子,以前的模型还有命令流文件都找 ...
- 利用SQL生成模型实体类
DECLARE @TableName sysname = 'TableName'; DECLARE @Result VARCHAR(MAX) = 'public class ' + @TableNam ...