System Console and Toolkit Tcl Command Reference Manual

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

1.1.132. monitor_read_data

Description

Returns a list of 8-bit values read from the most recent values read from device. The memory range specified must be within the monitored memory range as defined by monitor_add_range.

Usage

monitor_read_data <service-path> <target path> <address> <size>

ReturnType

ByteBuffer

Returns

Arguments

service-path
target path
address
Specifies the location on which the memory is read.
size
Specifies the number of bytes to be monitored starting from the address specified.

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