System Console and Toolkit Tcl Command Reference Manual

ID 683101
Date 7/08/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

1.1.135. monitor_set_interval

Description

Specifies the frequency of the polling action by specifying the interval between two memory reads. The actual polling frequency varies depending on the system activity. The monitor service will try it keep it as close to this specification as possible.

Usage

monitor_set_interval <service-path> <interval>

ReturnType

Nothing

Returns

no return value

Arguments

service-path
interval
Specifies the polling interval in milliseconds

Example

#
# Get monitor service
#
set service_path [get_service_paths monitor]

#
# Claim a monitor service
#
set monitor_path [claim_service monitor $service_path "my_lib" ""]

# Assume there is one device and one master
set master_path [lindex [get_service_paths master] 0]

#
# Define monitor service properties
#
monitor_set_interval $monitor_path 1000

monitor_set_callback $monitor_path [list example_callback_proc $monitor_path $master_path]

monitor_add_range $monitor_path $master_path 0x00 4
monitor_add_range $monitor_path $master_path 0x10 4

#TCL callback procedure for the monitor service
proc example_callback_proc {monitor_path master_path} {
	set w1 [monitor_read_data $monitor_path $master_path 0x00 4]
	set w2 [monitor_read_data $monitor_path $master_path 0x10 4]
	set i1 [monitor_get_read_interval $monitor_path $master_path 0x00 4]
	set i2 [monitor_get_read_interval $monitor_path $master_path 0x10 4]

	puts "0x00-0x03: $w1 ($i1 ms)"
	puts "0x10-0x13: $w2 ($i2 ms)"
}

#
# Activate the monitor service
#

monitor_set_enabled $monitor_path 1