In Proficy, use an "SVC_REQ" block to call info from PLC.
SVC REQ (Service Request) 16 is number of seconds since power up in 32 bit (Store to DINT).
You can use a 1-shot to pull seconds and do again to pull and compare time elapsed.
You will have to have 2 storage registers (DINTs) to compare time between on and off.
Use SVC_REQ 16 to read the system's elapsed time clock. The elapsed time clock measures the time in seconds since the CPU was powered on. The parameter block has a length of three words used for output only.
Output
Address Seconds from power on (low order)
Address+1 Seconds from power on (high order)
Address+2 100 microsecond (μs) ticks
The first two words are the elapsed time in seconds. The last word is the number of 100 μs ticks in the current second.
The resolution of the CPU's elapsed time clock is 100 microseconds (μs). The overall accuracy of the elapsed time clock is ±0.01%. The accuracy of an individual sample of the elapsed time clock is approximately 105 μs.
Use a Service Request function to request one of the following control system services:
SVC_REQ 1: Change/Read Constant Sweep Timer
SVC_REQ 2: Read Window Modes and Time Values
SVC_REQ 3: Change Controller Communications Window Mode
SVC_REQ 4: Change Backplane Communications Window Mode and Timer Value
SVC_REQ 5: Change Background Task Window Mode and Timer Value
SVC_REQ 6: Change/Read Number of Words to Checksum
SVC_REQ 7: Read or Change the Time-of-Day Clock
SVC_REQ 8: Reset Watchdog Timer
SVC_REQ 9: Read Sweep Time from Beginning of Sweep
SVC_REQ 10: Read Target Name
SVC_REQ 11: Read Controller ID
SVC_REQ 12: Read Controller Run State
SVC_REQ 13: Shut Down (STOP) CPU
SVC_REQ 14: Clear Controller or I/O Fault Table
SVC_REQ 15: Read Last-Logged Fault Table Entry
SVC_REQ 16: Read Elapsed Time Clock
SVC_REQ 17: Mask/Unmask I/O Interrupt
SVC_REQ 18: Read I/O Forced Status
SVC_REQ 19: Set Run Enable/Disable
SVC_REQ 20: Read Fault Tables
SVC_REQ 21: User-Defined Fault Logging
SVC_REQ 22: Mask/Unmask Timed Interrupts
SVC_REQ 22: Mask/Unmask Timed Interrupts
SVC_REQ 23: Read Master Checksum
SVC_REQ 24: Reset Module
SVC_REQ 25: Disable/Enable EXE Block and Standalone C Program Checksums
SVC_REQ 29: Read Elapsed Power Down Time
SVC_REQ 32: Suspend/Resume I/O Interrupt
SVC_REQ 45: Skip Next I/O Scan
SVC_REQ 50: Read Elapsed Time Clock
SVC_REQ 51: Read Sweep Time from Beginning of Sweep
SVC_REQ 56: Logic Driven Read of Nonvolatile Storage
SVC_REQ 57: Logic Driven Write to Nonvolatile Storage
The following Service Requests are used in CPU HSB redundancy applications.
Refer to the PACSystems Hot Standby CPU Redundancy User’s Guide, GFK-2308. For non-HSB applications, refer to PACSystems RX7i & RX3i TCP/IP Ethernet Communications User Manual, GFK-2224.
SVC_REQ 26 Role switch (redundancy)
SVC_REQ 27 Write to reverse transfer area (Hot Standby Redundancy)
SVC_REQ 28 Read from reverse transfer area (Hot Standby Redundancy)
SVC_REQ 43 Disable data transfer copy in backup unit (Hot Standby Redundancy)
SVC_REQ 55 Set application redundancy mode (non-Hot Standby Redundancy)