Gets information about a Citect SCADA variable. This function returns internal statistics and other information about the Citect SCADAruntime system.
Note: This function is a non-blocking function and can only access data contained within the calling process; consequently it cannot return data contained in a different server process. This function is not redirected automatically by Citect SCADA runtime. If you want to make a call from one process to return data in another, use MsgRPC() to make a remote procedure call on the other process. Alternatively, include the server process that has the information that CitectInfo requires in the calling process.
Syntax
CitectInfo(sGroup, sName, sType)
sGroup:
The name of the group to which the variable belongs. Valid group names are: "General", "Port", "IODevice", "Network", "Stats", "Memory", or "Disk".
sName:
The name of the variable. This name depends on sGroup:
"Alarm Proc" - Alarm Processing (includes Digital, Analog, Advanced and High Resolution alarms).
"Citect n" - The Citect SCADA window where n is the window number (returned from the WinNumber() function)
"Code n" - The user Cicode task (thread) where n is the task handle (returned from the TaskHnd() function)
"Reset" - Reset the Citect SCADA statistics.
"ElapsedTimeMS" - The elapsed time since statistics have been reset. Returns -1 if more than 20 days has elapsed.
0 = bytes
KB = kilobytes
MB = megabytes
GB = gigabytes
0 = The current drive
1 = A:
2 = B:
3 = C: and so on.
snType:
The type of information to get, depending on sGroup:
"General" - General statistics:
0 - CPU usage
1 - Citect SCADA Kernel cycles per second
2 - Citect SCADA Kernel tasks per second
3 - Citect SCADA Kernel boot time
4 - Citect SCADA Kernel running time (in seconds)
5 - Citect SCADA startup time
6 - Citect SCADA running time in seconds
7 - Not supported in v7.10 or later
8 - Total read requests
9 - Total read requests per second
10 - Total write requests
11 - Total write requests per second
12 - Total Physical read requests
13 - Total Physical read requests per second
14 - Total Physical write requests
15 - Total Physical write requests per second
16 - Total Blocked read requests
17 - Total Blocked write requests
18 - Total Digital read requests
19 - Total Register read requests
20 - Total Digital read requests per second
21 - Total Register read requests per second
22 - Total Cache reads count
23 - Total Cache reads %
24 - Overall Average response time (ms)
25 - Overall Minimum response time (ms)
26 - Overall Maximum response time (ms)
27 - Request sample for response times
28 - Static point count is no longer supported. Calling the function with parameter 28 returns a value of 0 and a hardware alarm is raised.
29 - Dynamic point count currently in use
30 - Number of pending read requests from the device
31 - Number of pending write requests to the device
32 - Determines if Citect SCADA Kernel window is open
33 - Percentage of the CPU used by the current Citect SCADA process
34 - Total CPU time spent by the current Citect SCADA process in milliseconds
35 - Total number of handles opened by the current Citect SCADA process
36 - Total number of threads owned by the current Citect SCADA process
"Port" - Port information for the I/O Server:
0 - Read requests
1 - Write requests
2 - Physical read requests
3 - Physical write requests
4 - Cached read requests
5 - Cached write requests
6 - Blocked read requests
7 - Blocked write requests
8 - Read requests per second
9 - Write requests per second
10 - Error count
11 - Read bytes counter
12 - Channel usage %
13 - Read bytes per second
14 - Statistics, minimum read time
15 - Statistics, maximum read time
16 - Statistics, average read time
17 - Statistics, time of samples
18 - Statistics, number of sample
100 - 119 - Driver specific counter values. Citect SCADA drivers can maintain up to 20 unique counters that can be accessed via this function. They are zero based, indexed from 100 to 119. If a value is not defined or maintained by the driver, 0 is returned for the value of the counter.
"IODevice" - I/O device information for the I/O device:
0 - Client side status:
1 - I/O Server status:
2 - If this I/O device is a standby device
3 - Last generic error
4 - Last driver error
5 - Error count
6 - Initialization count
7 - Statistics, minimum read time
8 - Statistics, maximum read time
9 - Statistics, average read time
10 - Statistics, number of samples
"Network" - Network statistical information:
0 - Read Network Control Blocks (NCBs)
1 - Maximum pending read NCBs
2 - Minimum pending read NCBs
3 - Current pending read NCBs
4 - Number of short read NCBs
5 - Write NCBs
6 - Maximum pending write NCBs
7 - Minimum pending write NCBs
8 - Current pending write NCBs
9 - Number of short write NCBs
10 - Total NCBs
11 - Maximum pending total NCBs
12 - Minimum pending total NCBs
13 - Current pending total NCBs
14 - Number of short total NCBs
15 - Minimum send response time in milliseconds
16 - Maximum send response time in milliseconds
17 - Average send response time in milliseconds
18 - Send packet count
"Stats" - Statistical information:
0 - Minimum time between code executions (cycles)
1 - Maximum time between code executions (cycles)
2 - Average time between code executions (cycles)
3 - Total cycle time in milliseconds
4 - Minimum time to execute the code in milliseconds
5 - Maximum time to execute the code in milliseconds
6 - Average time to execute the code in milliseconds
7 - Total execute time in milliseconds
"Memory" - Memory information:
0 - Free virtual memory
1 - Free windows system resources as %
2 - Free Physical Memory
3 - Memory Paging File Size
4 - Total Physical Memory
5 - Total % of Physical Memory Used (Win 2000 or later) and % of the last 1000 pages in memory that are in use (Win NT or earlier).
6 - Total working set size counter for current Citect SCADA process
7 - Private bytes counter of current Citect SCADA process
"Disk" - Disk information:
0 - Free disk space in bytes
1 - Total disk space in bytes
2 - Free disk space in kilobytes
3 - Total disk space in kilobytes
Return Value
The type of information (as an integer).
Related Functions
IODeviceInfo, WinNumber, TaskHnd
Example
! Get free memory
FreeMemory = CitectInfo("Memory", "", 0);
! Get free disk space on C:
FreeDisk = CitectInfo("Disk", 3, 0);
! Get max cycle time for digital alarms
MaxCycleTime = CitectInfo("Stats","Digital Alm","1");
See Also
Published June 2018