ABB 机器人 压包指令PackRawBytes 解包指令UnpackRawBytes
2015-11-21 10:16
423 查看
ABB 压包指令PackRawBytes 解包指令UnpackRawBytes
PackRawBytes- 将数据导入 rawbytes 数据。
使用方法
PackRawBytes
用于将 num, dnum, byte,或者 string类型的数据,打包到 rawbytes 类型的变量中.
基本举例 :
VAR rawbytes raw_data;
VAR num integer := 8;
VAR dnum bigInt := 4294967295;
VAR num float := 13.4;
VAR byte data1 := 122;
VAR byte byte1;
VAR string string1:="abcdefg";
PackDNHeader "10", "20 1D 24 01 30 64", raw_data;
将 DeviceNet 头文件 打包到 raw_data.
然后通过 PackRawBytes 打包要求的现场总线数据到 raw_data 中 。下面的例子展示了不同的数据如何被添加。
Example 1
PackRawBytes integer, raw_data, (RawBytesLen(raw_data)+1) \IntX :=DINT;
在 raw_data 中,头文件之后的下四个字节将是 8.
Example 2
PackRawBytes bigInt, raw_data, (RawBytesLen(raw_data)+1) \IntX :=
UDINT;
The contents of the next 4 bytes after the header in raw_data will be 4294967295
decimal.
Example 3
PackRawBytes bigInt, raw_data, (RawBytesLen(raw_data)+1) \IntX :=
LINT;
The contents of the next 8 bytes after the header in raw_data will be 4294967295
decimal.
Example 4
PackRawBytes float, raw_data, RawBytesLen(raw_data)+1) \Float4;
The contents of the next 4 bytes in raw_data will be 13.4 decimal.
Example 5
PackRawBytes data1, raw_data, (RawBytesLen(raw_data)+1) \ASCII;
The contents of the next byte in raw_data will be 122, the ASCII code for "z".
Example 6
PackRawBytes string1, raw_data, (RawBytesLen(raw_data)+1) \ASCII;
The contents of next 7 bytes in raw_data will be "abcdefg", coded in ASCII.
Example 7
byte1 := StrToByte("1F" \Hex);
PackRawBytes- 将数据导入 rawbytes 数据。
使用方法
PackRawBytes
用于将 num, dnum, byte,或者 string类型的数据,打包到 rawbytes 类型的变量中.
基本举例 :
VAR rawbytes raw_data;
VAR num integer := 8;
VAR dnum bigInt := 4294967295;
VAR num float := 13.4;
VAR byte data1 := 122;
VAR byte byte1;
VAR string string1:="abcdefg";
PackDNHeader "10", "20 1D 24 01 30 64", raw_data;
将 DeviceNet 头文件 打包到 raw_data.
然后通过 PackRawBytes 打包要求的现场总线数据到 raw_data 中 。下面的例子展示了不同的数据如何被添加。
Example 1
PackRawBytes integer, raw_data, (RawBytesLen(raw_data)+1) \IntX :=DINT;
在 raw_data 中,头文件之后的下四个字节将是 8.
Example 2
PackRawBytes bigInt, raw_data, (RawBytesLen(raw_data)+1) \IntX :=
UDINT;
The contents of the next 4 bytes after the header in raw_data will be 4294967295
decimal.
Example 3
PackRawBytes bigInt, raw_data, (RawBytesLen(raw_data)+1) \IntX :=
LINT;
The contents of the next 8 bytes after the header in raw_data will be 4294967295
decimal.
Example 4
PackRawBytes float, raw_data, RawBytesLen(raw_data)+1) \Float4;
The contents of the next 4 bytes in raw_data will be 13.4 decimal.
Example 5
PackRawBytes data1, raw_data, (RawBytesLen(raw_data)+1) \ASCII;
The contents of the next byte in raw_data will be 122, the ASCII code for "z".
Example 6
PackRawBytes string1, raw_data, (RawBytesLen(raw_data)+1) \ASCII;
The contents of next 7 bytes in raw_data will be "abcdefg", coded in ASCII.
Example 7
byte1 := StrToByte("1F" \Hex);
相关文章推荐
- WebView相关
- linux 下 FTP 配置文件详解
- LeetCode -- LRU Cache
- 内存对齐
- php eval使用
- 响应式布局
- iOS 开发导航栏使用系统自定义属性基本4条
- matlab 图像处理
- DBUtil的使用
- 005.TCP--拼接TCP头部IP头部,实现TCP三次握手的第一步(Linux,原始套接字)
- Android Intent 用法全面总结
- LeetCode -- Linked List Cycle II
- JAVA去掉一个字符串的前后空格
- 大数加法模板
- JAVA将一个字符串反向颠倒
- 坚持总结
- 单片机 MSP430 IIC控制器编程(2)
- LeetCode -- Contains Duplicate II
- js几秒以后倒计时跳转示例
- Material Design(1)底部表单(Bottom sheets)