Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

IODeviceInfo

  • Last UpdatedFeb 02, 2024
  • 6 minute read

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

  • 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 [, sClusterName] [, ServerName])

IODevice:

The I/O device number, or the I/O device name enclosed in double quotes.

nType:

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

• 1 = Running - Client is either talking to an online I/O device or talking to a scheduled device that is not currently connected but has a valid cache

• 2 = Standby - Client is talking to an online standby I/O device

• 4 = Starting - Client is talking to an I/O device that is attempting to come online

• 8 = Stopping - Client is talking to an I/O device that is in the process of stopping

• 16 = Offline - Client is pointing to an I/O device that is currently offline

• 32 = Disabled - Client is pointing to a device that is disabled

• 66 = Standby write - client is talking to an I/O device configured as a standby write device

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

• 1 = Running - I/O device for this I/O server is online or a scheduled device that is not currently connected but has a valid cache

• 2 = Standby - I/O device for this I/O server is online and a standby unit

• 4 = Starting - I/O device for this I/O server is attempting to come online. Starting may be combined with either Offline or Remote such as: 20 = Starting(4) + Offline(16) or 132 = Starting(4) + Remote(128).

• 8 = Stopping - I/O device for this I/O server is currently in the process of stopping

• 16 = Offline (only valid on an I/O server) - I/O device for this I/O server is currently offline

• 32 = Disabled - I/O device for this I/O server is disabled

• 66 = Standby write - I/O device for this I/O server is configured as a standby write device

• 128 = Remote (returned in combination with another value specified above - see Starting) - I/O device for this I/O server is a scheduled device but not currently connected

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:

• 0 = Remote unit is disconnected and OK

• 1 = Remote unit is connected and online

• 2 = Remote unit is in the dial queue

If you are trying to determine the state of a remote device that is configured for scheduled communications, you should use this type in conjunction with type 10. Firstly, use type 10 to determine if the device is in running state. If it is, use type 18 to determine its connection state.

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 — 1

• DIALCALLSTATE_IDLE — 2

• DIALCALLSTATE_OFFERING — 3

• DIALCALLSTATE_ACCEPTED — 4

• DIALCALLSTATE_DIALTONE — 5

• DIALCALLSTATE_DIALING — 6

• DIALCALLSTATE_RINGBACK — 7

• DIALCALLSTATE_BUSY — 8

• DIALCALLSTATE_SPECIALINFO — 9

• DIALCALLSTATE_CONNECTED — 10

• DIALCALLSTATE_PROCEEDING — 11

• DIALCALLSTATE_ONHOLD — 12

• DIALCALLSTATE_CONFERENCED — 13

• DIALCALLSTATE_ONHOLDPENDCONF — 14

• DIALCALLSTATE_ONHOLDPENDTRANSFER — 15

• DIALCALLSTATE_DISCONNECTED_NORMAL — 16

• DIALCALLSTATE_DISCONNECTED_LINELOST — 17

• DIALCALLSTATE_DISCONNECTED_UNKNOWN — 18

• DIALCALLSTATE_DISCONNECTED_REJECT — 19

• DIALCALLSTATE_DISCONNECTED_PICKUP — 20

• DIALCALLSTATE_DISCONNECTED_FORWARDED — 21

• DIALCALLST•ATE_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:

• 0 = not connected (none of the redundant I/O devices connected)

• 1 =connected (one of the redundant I/O devices is connected)

32 - The next time the specified I/O device is scheduled to connect (unless a higher priority I/O device comes online).

sClusterName:

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).

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

I/O Device Functions

In This Topic
TitleResults for “How to create a CRG?”Also Available in