IODeviceInfo
Gets information about a specified I/O device.
Apart from when Type is set to 3 or 17, this function can only be used if the I/O Server is on the current machine, otherwise the function will not succeed and will return empty string. When the I/O Server is not in the calling process, this function will become blocking and cannot be called from a foreground task. In this case, the return value will be undefined and a Cicode hardware alarm will be raised.
If both the primary and standby I/O devices are on the same server and they have the same I/O device name, you can get information about them individually by specifying the following:
IODeviceInfo("PLC1,P",1); // for the Primary
IODeviceInfo("PLC1,S",1); // for the Standby
where P represents the primary I/O device and S the standby I/O device.
If you have more than one standby device on the same server, there is currently no way of using this function for other than the first standby device.
Note: When the I/O server is not in the calling process, this function could become a blocking function if the information required by this function is on an I/O server (except types 3 and 17, which are normally non-blocking). If this is the case, this function cannot be called from a foreground task (such as a graphics page) or an expression. Otherwise the return value will be undefined and a Cicode hardware alarm raised.
Syntax
IODeviceInfo(IODevice, Type [, ClusterName] [, ServerName])
IODevice:
The I/O device number, or the I/O device name enclosed in double quotes.
Type:
The type of information:
0 - Name of I/O device
1 - Protocol of I/O device
2 - Protocol address
3 - Client I/O device state
4 - Current generic error number (decimal)
5 - Current driver error number (decimal)
6 - Disabled flag
7 - Statistics, minimum read time
8 - Statistics, maximum read time
9 - Statistics, average read time
10 - I/O server I/O device state
11 - Unit number
12 - Configured I/O server name
13 - Configured Port name
14 - Configured startup mode
15 - Configured comment
16 - The primary I/O server name the client uses to communicate to this device
17 - The I/O Server the client is using to communicate to this device. Will be Standby if the Primary is down.
18 - State of the remote unit:
This mode causes redirection to the I/O server if running in separate processes.
19 - Number of successful attempts to communicate with the scheduled I/O device.
20 - Number of unsuccessful attempts to communicate with the scheduled I/O device.
21 - Write mode: Write On Request, and normal (as per schedule defined in the Express Communications Wizard).
22 - Number of queued read requests for the scheduled I/O device. (This mode causes redirection to the I/O server if running in separate processes.)
23 - Number of queued write requests for the scheduled I/O device. (This mode causes redirection to the I/O server if running in separate processes.)
24 - The cache timeout (in milliseconds).
26 - The name of the line device (for example, modem) you are using to connect to the I/O device. (This mode causes redirection to the I/O server if running in separate processes.)
27 - The call_status of a currently connected remote I/O device.
DIALCALLSTATE_UNAVAIL |
0 |
DIALCALLSTATE_IDLE |
1 |
DIALCALLSTATE_OFFERING |
2 |
DIALCALLSTATE_ACCEPTED |
3 |
DIALCALLSTATE_DIALTONE |
4 |
DIALCALLSTATE_DIALING |
5 |
DIALCALLSTATE_RINGBACK |
6 |
DIALCALLSTATE_BUSY |
7 |
DIALCALLSTATE_SPECIALINFO |
8 |
DIALCALLSTATE_CONNECTED |
9 |
DIALCALLSTATE_PROCEEDING |
10 |
DIALCALLSTATE_ONHOLD |
11 |
DIALCALLSTATE_CONFERENCED |
12 |
DIALCALLSTATE_ONHOLDPENDCONF |
13 |
DIALCALLSTATE_ONHOLDPENDTRANSFER |
14 |
DIALCALLSTATE_DISCONNECTED_NORMAL |
16 |
DIALCALLSTATE_DISCONNECTED_LINELOST |
17 |
DIALCALLSTATE_DISCONNECTED_UNKNOWN |
18 |
DIALCALLSTATE_DISCONNECTED_REJECT |
19 |
DIALCALLSTATE_DISCONNECTED_PICKUP |
20 |
DIALCALLSTATE_DISCONNECTED_FORWARDED |
21 |
DIALCALLSTATE_DISCONNECTED_BUSY |
22 |
DIALCALLSTATE_DISCONNECTED_NOANSWER |
23 |
DIALCALLSTATE_DISCONNECTED_BADADDRESS |
24 |
DIALCALLSTATE_DISCONNECTED_UNREACHABLE |
25 |
DIALCALLSTATE_DISCONNECTED_CONGESTION |
26 |
DIALCALLSTATE_DISCONNECTED_INCOMPATIBLE |
27 |
DIALCALLSTATE_DISCONNECTED_UNAVAIL |
28 |
DIALCALLSTATE_DISCONNECTED_NODIALTONE |
29 |
DIALCALLSTATE_DISCONNECTED_NUMBERCHANGED |
30 |
DIALCALLSTATE_DISCONNECTED_OUTOFORDER |
31 |
DIALCALLSTATE_DISCONNECTED_TEMPFAILURE |
32 |
DIALCALLSTATE_DISCONNECTED_QOSUNAVAIL |
33 |
DIALCALLSTATE_DISCONNECTED_BLOCKED |
34 |
DIALCALLSTATE_DISCONNECTED_DONOTDISTURB |
35 |
DIALCALLSTATE_DISCONNECTED_CANCELLED |
36 |
DIALCALLSTATE_UNKNOWN |
48 |
(This mode causes redirection to the I/O server if running in separate processes.)
28 - The call rate (in bits per second) which may be the DTE or DCE connection speed depending on the server modem settings. (This mode causes redirection to the I/O server if running in separate processes.)
30 - The last time an I/O device from the remote I/O device redundant group was connected (primary or any standbys).
31 -The state of the remote I/O device redundant group:
32 - The next time the specified I/O device is scheduled to connect (unless a higher priority I/O device comes online).
ClusterName:
Specifies the name of the cluster in which the I/O Server resides. This is optional if you have one cluster or are resolving the I/O server via the current cluster context. The argument is enclosed in quotation marks "".
ServerName:
Specifies the name of the I/O Server. This parameter is only required if you are running more than one I/O server process from the same cluster on the same computer and need to instruct the system which process to redirect to. The argument is enclosed in quotation marks "".
Return Value
The type of information (as a string).
Related Functions
IODeviceControl, IODeviceStats, TagReadEx, TagWrite
Example
//Using the IODevice Number
sName = IODeviceInfo(20, 0); ! Get the name of I/O device 20
sName = IODeviceInfo(2, 1); ! Get the protocol of I/O device 2
//Using the IODevice Name
sName = IODeviceInfo("IODev",10); ! Get the I/O Server State
sName = IODeviceInfo("IODev1",3); ! Get the State of IODev1
See Also