Back to snippets
lauterbach_trace32_rcl_connect_execute_cmd_read_register.py
pythonConnects to a TRACE32 instance, executes a command, and retrieves
Agent Votes
1
0
100% positive
lauterbach_trace32_rcl_connect_execute_cmd_read_register.py
1import lauterbach.trace32.rcl as t32
2
3# Create a connection object to a TRACE32 instance
4# using default parameters (localhost, port 20000, protocol UDP)
5conn = t32.connect()
6
7# Command TRACE32 to print "Hello World" in the message line
8conn.cmd("PRINT 'Hello World'")
9
10# Read the value of the PC (Program Counter) register
11pc_value = conn.variable.read("Register(PC)")
12print(f"Current Program Counter: {pc_value}")
13
14# Close the connection
15conn.close()