I'm testing the monitor service from system console.
Below the example code (from help in system console) with modified registers. 0x00004014 is a register with is changing at 2 hz and 0x00004024 at 1 hz. With some C code I verified that the registers are indeed changing.
Code:
#
# 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 100
monitor_set_callback $monitor_path
[list example_callback_proc $monitor_path $master_path]
#0x00004010 | 0x00004020 | 0x00004030 | 0x00004040
monitor_add_range $monitor_path $master_path 0x00004014 1
monitor_add_range $monitor_path $master_path 0x00004024 1
#TCL callback procedure for the monitor service
proc example_callback_proc {monitor_path master_path} {
set w1 [monitor_read_data $monitor_path $master_path 0x00004014 1]
set w2 [monitor_read_data $monitor_path $master_path 0x00004024 1]
set i1 [monitor_get_read_interval $monitor_path $master_path 0x00004014 1]
set i2 [monitor_get_read_interval $monitor_path $master_path 0x00004024 1]
puts "0x00004014: $w1 ($i1 ms) 0x00004024: $w2 ($i2 ms)"
}
#
# Activate the monitor service
#
monitor_set_enabled $monitor_path 1
I expect something like:
0x00004014: 0x00 (100 ms) 0x00004024: 0x00 (100 ms)
0x00004014: 0x00 (100 ms) 0x00004024: 0x00 (100 ms)
0x00004014: 0x00 (100 ms) 0x00004024: 0x00 (100 ms)
0x00004014: 0x00 (100 ms) 0x00004024: 0x00 (100 ms)
0x00004014: 0x00 (100 ms) 0x00004024: 0x00 (100 ms)
0x00004014: 0x0
1 (100 ms) 0x00004024: 0x00 (100 ms)
0x00004014: 0x0
1 (100 ms) 0x00004024: 0x00 (100 ms)
0x00004014: 0x0
1 (100 ms) 0x00004024: 0x00 (100 ms)
0x00004014: 0x0
1 (100 ms) 0x00004024: 0x00 (100 ms)
0x00004014: 0x0
1 (100 ms) 0x00004024: 0x00 (100 ms)
0x00004014: 0x00 (100 ms) 0x00004024: 0x0
1 (100 ms)
0x00004014: 0x00 (100 ms) 0x00004024: 0x0
1 (100 ms)
0x00004014: 0x00 (100 ms) 0x00004024: 0x0
1 (100 ms)
0x00004014: 0x00 (100 ms) 0x00004024: 0x0
1 (100 ms)
0x00004014: 0x00 (100 ms) 0x00004024: 0x0
1 (100 ms)
0x00004014: 0x0
1 (100 ms) 0x00004024: 0x0
1 (100 ms)
0x00004014: 0x0
1 (100 ms) 0x00004024: 0x0
1 (100 ms)
0x00004014: 0x0
1 (100 ms) 0x00004024: 0x0
1 (100 ms)
0x00004014: 0x0
1 (100 ms) 0x00004024: 0x0
1 (100 ms)
0x00004014: 0x0
1 (100 ms) 0x00004024: 0x0
1 (100 ms)
0x00004014: 0x00 (100 ms) 0x00004024: 0x00 (100 ms)
0x00004014: 0x00 (100 ms) 0x00004024: 0x00 (100 ms)
0x00004014: 0x00 (100 ms) 0x00004024: 0x00 (100 ms)
0x00004014: 0x00 (100 ms) 0x00004024: 0x00 (100 ms)
0x00004014: 0x00 (100 ms) 0x00004024: 0x00 (100 ms)
But I get:
0x00004014: 0x00 (100 ms) 0x00004024: 0x00 (100 ms)
0x00004014: 0x00 (100 ms) 0x00004024: 0x00 (100 ms)
0x00004014: 0x00 (100 ms) 0x00004024: 0x00 (100 ms)
0x00004014: 0x00 (100 ms) 0x00004024: 0x00 (100 ms)
0x00004014: 0x00 (100 ms) 0x00004024: 0x00 (100 ms)
0x00004014: 0x0
1 (100 ms) 0x00004024: 0x0
1 (100 ms)
0x00004014: 0x0
1 (100 ms) 0x00004024: 0x0
1 (100 ms)
0x00004014: 0x0
1 (100 ms) 0x00004024: 0x0
1 (100 ms)
0x00004014: 0x0
1 (100 ms) 0x00004024: 0x0
1 (100 ms)
0x00004014: 0x0
1 (100 ms) 0x00004024: 0x0
1 (100 ms)
0x00004014: 0x00 (100 ms) 0x00004024: 0x00 (100 ms)
0x00004014: 0x00 (100 ms) 0x00004024: 0x00 (100 ms)
0x00004014: 0x00 (100 ms) 0x00004024: 0x00 (100 ms)
0x00004014: 0x00 (100 ms) 0x00004024: 0x00 (100 ms)
0x00004014: 0x00 (100 ms) 0x00004024: 0x00 (100 ms)
0x00004014: 0x0
1 (100 ms) 0x00004024: 0x0
1 (100 ms)
0x00004014: 0x0
1 (100 ms) 0x00004024: 0x0
1 (100 ms)
0x00004014: 0x0
1 (100 ms) 0x00004024: 0x0
1 (100 ms)
0x00004014: 0x0
1 (100 ms) 0x00004024: 0x0
1 (100 ms)
0x00004014: 0x0
1 (100 ms) 0x00004024: 0x0
1 (100 ms)
0x00004014: 0x00 (100 ms) 0x00004024: 0x00 (100 ms)
0x00004014: 0x00 (100 ms) 0x00004024: 0x00 (100 ms)
0x00004014: 0x00 (100 ms) 0x00004024: 0x00 (100 ms)
0x00004014: 0x00 (100 ms) 0x00004024: 0x00 (100 ms)
0x00004014: 0x00 (100 ms) 0x00004024: 0x00 (100 ms)
As you can see, the 0x00004024 is a copy of 0x00004014. I now for sure the values of the register are correct and changing.
I tested this two way's, one with an C application and two with system console with 20 bytes read on the callback function.
Output of C:
0x00004014: 0x00 0x00004024: 0x00
0x00004014: 0x00 0x00004024: 0x00
0x00004014: 0x00 0x00004024: 0x00
0x00004014: 0x00 0x00004024: 0x00
0x00004014: 0x00 0x00004024: 0x00
0x00004014: 0x0
1 0x00004024: 0x00
0x00004014: 0x0
1 0x00004024: 0x00
0x00004014: 0x0
1 0x00004024: 0x00
0x00004014: 0x0
1 0x00004024: 0x00
0x00004014: 0x0
1 0x00004024: 0x00
0x00004014: 0x00 0x00004024: 0x0
1
0x00004014: 0x00 0x00004024: 0x0
1
0x00004014: 0x00 0x00004024: 0x0
1
0x00004014: 0x00 0x00004024: 0x0
1
0x00004014: 0x00 0x00004024: 0x0
1
0x00004014: 0x0
1 0x00004024: 0x0
1
0x00004014: 0x0
1 0x00004024: 0x0
1
0x00004014: 0x0
1 0x00004024: 0x0
1
0x00004014: 0x0
1 0x00004024: 0x0
1
0x00004014: 0x0
1 0x00004024: 0x0
1
0x00004014: 0x00 0x00004024: 0x00
0x00004014: 0x00 0x00004024: 0x00
0x00004014: 0x00 0x00004024: 0x00
0x00004014: 0x00 0x00004024: 0x00
0x00004014: 0x00 0x00004024: 0x00
Code:
monitor_add_range $monitor_path $master_path 0x00004014 20
#TCL callback procedure for the monitor service
proc example_callback_proc {monitor_path master_path} {
set w1 [monitor_read_data $monitor_path $master_path 0x00004014 20]
set i1 [monitor_get_read_interval $monitor_path $master_path 0x00004014 20]
puts "0x00004014: $w1 ($i1 ms)"
}
Output of system console with change of size in read action:
0x00004014: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 (100 ms)
0x00004014: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 (100 ms)
0x00004014: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 (100 ms)
0x00004014: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 (100 ms)
0x00004014: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 (100 ms)
0x00004014: 0x0
1 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 (100 ms)
0x00004014: 0x0
1 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 (100 ms)
0x00004014: 0x0
1 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 (100 ms)
0x00004014: 0x0
1 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 (100 ms)
0x00004014: 0x0
1 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 (100 ms)
0x00004014: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0
1 0x00 0x00 0x00 (100 ms)
0x00004014: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0
1 0x00 0x00 0x00 (100 ms)
0x00004014: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0
1 0x00 0x00 0x00 (100 ms)
0x00004014: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0
1 0x00 0x00 0x00 (100 ms)
0x00004014: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0
1 0x00 0x00 0x00 (100 ms)
0x00004014: 0x0
1 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0
1 0x00 0x00 0x00 (100 ms)
0x00004014: 0x0
1 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0
1 0x00 0x00 0x00 (100 ms)
0x00004014: 0x0
1 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0
1 0x00 0x00 0x00 (100 ms)
0x00004014: 0x0
1 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0
1 0x00 0x00 0x00 (100 ms)
0x00004014: 0x0
1 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0
1 0x00 0x00 0x00 (100 ms)
0x00004014: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 (100 ms)
0x00004014: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 (100 ms)
0x00004014: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 (100 ms)
0x00004014: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 (100 ms)
0x00004014: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 (100 ms)
From the documantion: "More ranges can be added. with monitor_add_range". This is also shown in the example. So I don't understand why this is not working.
Do some of you have an idea?