Using close_stddrv() – Rockwell Automation 6001-F2E AB STANDARD DRIVER SFTW User Manual
Page 20
![background image](/manuals/580009/20/background.png)
Writing Your Own Application Program
Chapter 4
4-7
Table 4.F
Reading io_stat[0]
If the STS and EXT STS bytes of io_stat[0] look like this It is a
STS
EXT STS
0
0
Command message. No error. The values in the
STS
EXT STS
F 0
0B
Reply message with extended status information.
Match the code in the low byte (EXT STS) to
the code for the appropriate command in appendix D.
EXT STS byte can be any values.
STS
EXT STS
X
Y
Reply message. X = status field of the DH-485
packet (this field contains remote errors returned
by devices on the DH-485 network. See appendix
D for a list of error codes. Y = user interface local error
codes listed in appendix D.
The CloseStdDrv() function call releases all resources and services and
must be called before the application terminates. Use the following
format and parameters:
Format for Closing Communication
The Close_StdDrv() function call is shown below:
status = Close_StdDrv(device);
Parameters for Closing Communication
Assign the parameters in Table 4.G:
Table 4.G
Assigning Parameters to Close Communication
Parameter
Type
Description
device[ ] = “KR:0”;
char
The device parameter should coincide with the device used in the
Open_StdDrv() function
When the Close function is called, a status value is returned indicating
whether the operation was successful or unsuccessful. Normal
completion is 1. A value other than 1 indicates that an error occurred
(See appendix D for a list of error codes.)
Using Close_StdDrv()