System Console and Toolkit Tcl Command Reference Manual

ID 683101
Date 7/08/2024
Public
Document Table of Contents

1.1.134. monitor_set_enabled

Description

Enable or disable monitoring. Memory read will be started after this is enabled, and TCL callback will be evaluated after data are read.

Usage

monitor_set_enabled <service-path> <activated>

ReturnType

Nothing

Returns

no return value

Arguments

service-path
activated

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