查看共享变量的基本信息
- 更新时间2025-08-27
- 阅读时长2分钟
必需权限:VariableBrowse
可浏览相关的VariableObject,找到共享变量的名称、类型和URL。使用下列URI格式定位VariableObject:http://[host]:[port]/nivariable/VariableObjects('[dynamic api url]')
例如,GET http://my_server:3580/nivariable/VariableObjects('ni.var.psp://localhost')?$format=json
在URI后加上子项,可查看VariableObject的Children属性。
例如,GET http://my_server:3580/nivariable/VariableObjects('ni.var.psp://localhost')?$format=json
使用$expand,可直接获取Children属性,无需单独发出获取子项的请求。例如,GET http://my_server:3580/nivariable/VariableObjects('ni.var.psp://localhost')?$format=json&$expand=children
使用下列URI格式获取VariableObject的一个属性:
GET http://[host]:[port]/nivariable/VariableObjects('[dynamic api url]')/[specific property]
可用的属性包括Url、Type、Name。例如,如要获取ni.var.psp://localhost的type属性,使用下列URI:
GET http://my_server:3580/nivariable/VariableObjects('ni.var.psp://localhost')/type?$format=json