1

是否可以使用其 PRACTICE II 脚本语言从 Trace32 调度外部(python)脚本?

4

2 回答 2

2

对于像我这样的未来谷歌用户,这里是如何使用 Lauterbach c-API 从 Python 执行 PRACTICE 命令。在运行脚本之前,必须打开 TRACE32 应用程序。您还必须在 config.t32 文件中添加 5 行(包括两个空行):

#You must have an empty line before

RCL=NETASSIST
PACKLEN=1024
PORT=20010

#and after these three parameters

至少 PORT 参数值是任意的,但它必须在您的配置和脚本中匹配。它定义了 API 可用的 UDP 端口。此代码演示了如何在 Python 中使用 API:

from ctypes import *

node = (c_char_p('NODE='),c_char_p('localhost'))
port = (c_char_p('PORT='),c_char_p('20010'))
plen = (c_char_p('PACKLEN='),c_char_p('1024'))

mydll = cdll.LoadLibrary(r'C:\T32\demo\api\capi\dll\T32api.dll')

error = mydll.T32_Config(*node)
error = mydll.T32_Config(*port)
error = mydll.T32_Config(*plen)
error = mydll.T32_Init()
error = mydll.T32_Attach(1)

#Try a PRACTICE command
cmd = c_char_p('DATA.DUMP 0xFF800000')
mydll.T32_Cmd(cmd)

Check that the T32api.dll is in the directory specified in the script. Lauterbach provides more documentation for this api. Take a look in the demo\api\capi folder and this document http://www2.lauterbach.com/pdf/api_remote.pdf

于 2014-09-23T07:45:08.297 回答
1

使用 OS.Screen 创建命令提示符会话。

于 2011-06-22T17:45:38.533 回答