联系人:麦女士
手机:+86 15270269218
电话:
Q Q:3136378118
邮箱:stodcdcs@gmail.com
地址:江西省九江市瑞昌市东益路23号赛湖农商城401号
wReadRawBytes IODevice RawData[\时间]
碘器件
数据类型:iodevBytesVAR num float:=0.2;
VAR字符串答案;
ClearR数据类型:num
读取操作(超时)的长时间(秒)(分辨率0001s)。如果这个
如果未指定使用错误代码ERR\u DEV\u MAXTIME调用。如果没有错参数,则大时间设置为60秒。要永远等待,请使用
预定义常数WAIT_MAX。awBytes raw\u data\u out;
PackDNHeader“10”,“20 1D 24用于从用Open\Bin打开的设备中读取rawbytes类型的数据。
基本示例
指令ReadRawBytes的基本示例如下所示。
示例1
无功iodev io_装置;
VAR rawbytes raw\u data\u out;
VAR rawbytes raw_data_in;
01 30 64”,raw\u data\u out;
PackRawBytes float,raw\u data\u out,(RawBytesLen(raw\u data\u out)+1)
\浮动4;
打开“/FC1:/dsqc328\u 1”,io\u设备\ Bin;
WriteRawBytes io_device,raw_data_out;
ReadRawBytes io_设备,raw_data_in时间:=1;
关闭io_设备;
Uncrawbytes raw\u data\u in,1,answer\ASCII:=10;
在本例中,清除raw_data_out,然后用DeviceNet标头和浮点值打包
值为0.2。
打开设备“/FC1:/dsqc328\u 1”,原始数据输出中的当前有效数据为
写入设备。然后程序多等待1秒从设备读取,
存储在中的raw_data_中。
关闭设备“/FC1:/dsqc328\u 1”后,读取的数据被解包为字符串
字符,并存储在应答中。
论据
IODevice是应从中读取数据的设备的标识符。
矩阵空间
数据类型:rawbytes
RawData是存储从索引1开始从IODevice读取的数据的数据容器。
下一页继续
1说明
1.125. ReadRawBytes-读取rawbytes数据
机器人软件-操作系统
3HAC 16581-1版本:J 353
©版权所有2004-2010 ABB。保留所有权利。
[\时间]
如果此时间在读取操作完成之前用完,则错误处理程序将
误处理程序,则执行
将停止。
超时功能也在程序停止期间使用,RAPID会注意到
程序开始时的程序。
程序执行
在程序执行期间,从IODevice指示的设备读取数据。
如果对现场总线命令(如DeviceNet)使用WriteRawBytes,则现场总线
总是发送答案。答案必须用ReadRawBytes快速处理
指示
RawData变量中有效字节的当前长度设置为读取的字节数。
数据从RawData中的索引1开始。
错误处理
如果在读取过程中发生错误,则系统变量ERRNO设置为ERR_FILEACC。
如果在读取操作完成之前超时,则变量RawData中的任何内容都不会
系统变量ERRNO设置为ERR\u DEV\u MAXTIME。
然后,这些错误可以由错误处理程序处理
dRawBytes is used to read data of type rawbytes from a device opened with Open\Bin.
Basic examples
Basic examples of the instruction ReadRawBytes are illustrated below.
Example 1
VAR iodev io_device;
VAR rawbytes raw_data_out;
VAR rawbytes raw_data_in;
VAR num float := 0.2;
VAR string answer;
ClearRawBytes raw_data_out;
PackDNHeader "10", "20 1D 24 01 30 64", raw_data_out;
PackRawBytes float, raw_data_out, (RawBytesLen(raw_data_out)+1)
\Float4;
Open "/FC1:/dsqc328_1", io_device \Bin;
WriteRawBytes io_device, raw_data_out;
ReadRawBytes io_device, raw_data_in \Time:=1;
Close io_device;
UnpackRawBytes raw_data_in, 1, answer \ASCII:=10;
In this example raw_data_out is cleared and then packed with DeviceNet header and a float
with value 0.2.
A device, "/FC1:/dsqc328_1", is opened and the current valid data in raw_data_out is
written to the device. Then the program waits for at most 1 second to read from the device,
which is stored in the raw_data_in.
After having closed the device "/FC1:/dsqc328_1", the read data is unpacked as a string
of characters and stored in answer.
Arguments
ReadRawBytes IODevice RawData [\Time]
IODevice
Data type: iodev
IODevice is the identifier of the device from which data shall be read.
RawData
Data type: rawbytes
RawData is the data container that stores read data from IODevice starting at index 1.
Continues on next page
1 Instructions
1.125. ReadRawBytes - Read rawbytes data
RobotWare - OS
3HAC 16581-1 Revision: J 353
© Copyright 2004-2010 ABB. All rights reserved.
[\Time]
Data type: num
The max. time for the reading operation (timeout) in seconds (resolution 0,001s). If this
argument is not specified then the max. time is set to 60 seconds. To wait forever, use the
predefined constant WAIT_MAX.
If this time runs out before the reading operation is finished then the error handler will be
called with the error code ERR_DEV_MAXTIME. If there is no error handler then the execution
will be stopped.
The timeout function is also in use during program stop and will be noticed by the RAPID
program at program start.
Program execution
During program execution the data is read from the device indicated by IODevice.
If using WriteRawBytes for field bus commands such as DeviceNet then the field bus
always sends an answer. The answer must be handled in RAPID with the ReadRawBytes
instruction.
The current length of valid bytes in the RawData variable is set to the read number of bytes.
The data starts at index 1 in RawData.
Error handling
If an error occurs during reading then the system variable ERRNO is set to ERR_FILEACC.
If time out before the read operation is finished then nothing in the variable RawData is
affected, and the system variable ERRNO is set to ERR_DEV_MAXTIME.
These errors can then be dealt with by the error handler
dRa
瑞昌明盛自动化设备有限公司.....本公司主DCS控制系统备件,PLC系统备件及机器人系统备件,,本特利,ABB,霍尼韦尔,FOXBORO福克斯波罗,黑马Hima,英维思,施耐德,AB,横河yokogawa,GE,ICS,EPRO,艾默生,伍德沃德,Motorola...... 进口模块 卡件 CPU控制器 我们公司的产品自己的渠道和仓库,无中间商赚差价
产品广泛应用于:电力、石油、矿井提升、港口、供热、燃气、供水、污水处理、冶金、造纸、纺织、化工、水利等现代化工业领域!
ABB---AC 800M控制器、贝利、PM866控制器、IGCT可控硅5SHY 3BHB01 3BHEO0 3HNA00 DSOC系列
GE---模块、空气开关、I/O模块、显示器、CPU模块,电源模块、转换器、CPU板、以太网模块、综合保护装置、电源模块、燃机卡
本特利(BENTLY)---3500系统/前置器,前后卡,传感器,电源模块、探头、电缆
艾默生(EMERSON)---modbus卡、电源板、控制器、电源、底座、电源模块、交换机
福克斯波罗FOXBORO---热电阻输入输出模块、电源模块、通讯模块、电缆、控制器、交换机
黑马(HIMA)---DI模块、处理器模块、AI卡件、脉冲编码器
霍尼韦尔(HONEYWELL)---安全型数字输出卡、程序模块、模拟输入卡、CPU模块、FIM卡
NI---信息采集卡、PXI模块、卡件、机箱多通道控制卡
伍德沃德(WOODWARD)---调节器、模块、控制器、调速器
横河(YOKOGAWA)---伺服模块、控制柜节点单元
详情电话咨询:陈经理1 5 5 7 9 2 0 9 6 5 6
详情扫描咨询: