å¿«éå ¥é¨æåR&S FSL - Rohde & Schwarz
å¿«éå ¥é¨æåR&S FSL - Rohde & Schwarz å¿«éå ¥é¨æåR&S FSL - Rohde & Schwarz
远 程 控 制 编 程 的 基 本 步 骤R&S FSLPublic Sub InstrRead(ByVal vi As Long, Response As String, ByVal count As Long,retCount As Long)Dim status As Long'Initialize response stringResponse = Space(count)'...and readstatus = viRead(vi, Response, count, retCount)'Check for errors – this will raise an error if status is not VI_SUCCESSCALL CheckError(vi, status)'adjust string lengthResponse = Left(Response, retCount)End Sub下 面 的 函 数 说 明 了 如 何 进 行 状 态 / 错 误 检 测 。 在 出 现 一 个 VISA 错 误 时 , 该 程 序 就 会 产 生 一 个异 常 :Public Sub CheckError(ByVal vi As Long, status As Long)Dim ErrorMessage As String * 1024'Initialize error message stringErrorMessage = ""If (status < 0) Then'Query the error message from VISAIf (viStatusDesc(vi, status, ErrorMessage) = VI_SUCCESS) ThenErr.Description = ErrorMessageEnd IfErr.Raise (status)End IfEnd Sub初 始 化 和 默 认 状 态在 每 个 程 序 的 开 始 部 分 , 必 须 创 建 所 有 子 程 序 使 用 的 全 局 变 量 。 接 着 , 远 程 控 制 和 仪 器 设 置将 被 更 改 为 定 义 的 默 认 状 态 。 为 此 , 使 用 了 两 个 子 例 程 “ InitController ” 和“InitDevice”。创 建 全 局 变 量在 Visual Basic 中 , 全 局 变 量 存 储 在 模 块 中 ( 文 件 扩 展 名 .BAS)。 这 样 , 至 少 应 该 创 建 一 个模 块 ( 如 GLOBALS.BAS), 该 模 块 包 含 所 有 子 程 序 使 用 的 变 量 , 比 如 远 程 控 制 驱 动 程 序 所使 用 的 仪 器 地 址 变 量 。在 下 面 给 出 的 所 有 例 子 中 , 文 件 都 必 须 包 含 下 面 的 指 令 :Global analyzer As LongGlobal defaultRM As Long11300.2519.69 6.4 ZH-4
R&S FSL远 程 控 制 编 程 的 基 本 步 骤初 始 化 远 程 控 制 会 话REM –––––––––––– 初 始 化 远 程 控 制 会 话 –––––––––––––––––-----------------------––Public SUB Initialize()Dim status As Long'CALL viOpenDefaultRM to get the resource manager handle'Store this handle in defaultRM. The function viStatusDesc'returns a text description of the status code returned by viOpenDefaultRMstatus = viOpenDefaultRM(defaultRM)status = viStatusDesc(defaultRM, status, Response)'Open the connection to the device and store the handle'Note: The timeout value in viOpen() applies only for opening the interface'For setting the communication timeout, set the VI_ATTR_TMO_VALUE attribute'timeout values are in milliseconds'This example assumes the instrument IP address 10.0.0.10'If the network provides a name resolution mechanism, the hostname of'the instrument can be used instead of the numeric IP address'the resource string for GPIB would be "GPIB::20::INSTR''status = viOpen(defaultRM, "TCPIP::10.0.0.10::INSTR'', 0, 1000, analyzer)'status = viOpen(defaultRM, "TCPIP::::INSTR'', 0, 1000, analyzer)'status = viOpen(defaultRM, "GPIB::20::INSTR'', 0, 1000, analyzer)'Set timeout value – here 5sstatus = viSetAttribute(vi, VI_ATTR_TMO_VALUE, 5000)END SUBREM ***********************************************************************初 始 化 仪 器设 定 远 程 控 制 状 态 寄 存 器 和 仪 器 设 置 为 默 认 状 态 。REM –––––––––––– 初 始 化 仪 器 ––––––––––––––––––––––––------------------–––––––Public SUB InitDevice()CALL InstrWrite(analyzer, "*CLS")CALL InstrWrite(analyzer, "*RST")'Reset status register'Reset instrumentEND SUBREM************************************************************************1300.2519.69 6.5 ZH-4
- Page 71 and 72: 固 件 更 新R&S FSL固 件 更
- Page 73 and 74: R&S FSL基 本 操 作4 基 本 操
- Page 75 and 76: R&S FSL图 表 区 中 的 信 息
- Page 77 and 78: R&S FSL图 表 区 中 的 信 息
- Page 79 and 80: R&S FSL设 置 参 数设 置 参
- Page 81 and 82: R&S FSL设 置 参 数箭 头 键
- Page 83 and 84: R&S FSL设 置 参 数标 题 栏
- Page 85 and 86: R&S FSL设 置 参 数浏 览 对
- Page 87 and 88: R&S FSL设 置 参 数- 按 下 旋
- Page 89 and 90: R&S FSL如 何 使 用 帮 助 系
- Page 91 and 92: 测 量 正 弦 信 号R&S FSL测
- Page 93 and 94: 测 量 正 弦 信 号R&S FSL设
- Page 95 and 96: 测 量 正 弦 信 号 的 谐 波
- Page 97 and 98: 测 量 正 弦 信 号 的 谐 波
- Page 99 and 100: 测 量 多 个 信 号 的 频 谱
- Page 101 and 102: 测 量 多 个 信 号 的 频 谱
- Page 103 and 104: 测 量 多 个 信 号 的 频 谱
- Page 105 and 106: 零 频 跨 下 的 测 量R&S FSL-
- Page 107 and 108: 零 频 跨 下 的 测 量R&S FSL
- Page 109 and 110: 零 频 跨 下 的 测 量R&S FSL
- Page 111 and 112: 零 频 跨 下 的 测 量R&S FSL
- Page 113 and 114: 零 频 跨 下 的 测 量R&S FSL
- Page 115 and 116: 存 储 和 载 入 仪 器 的 设
- Page 117 and 118: 存 储 和 载 入 仪 器 的 设
- Page 119 and 120: R&S FSL远 程 控 制 简 介6 远
- Page 121: R&S FSL远 程 控 制 编 程 的
- Page 125 and 126: R&S FSL远 程 控 制 编 程 的
- Page 127 and 128: R&S FSL远 程 控 制 编 程 的
- Page 129 and 130: R&S FSL详 细 的 编 程 实 例
- Page 131 and 132: R&S FSL详 细 的 编 程 实 例'
- Page 133 and 134: R&S FSL详 细 的 编 程 实 例
- Page 135 and 136: R&S FSL详 细 的 编 程 实 例'
- Page 137 and 138: R&S FSL详 细 的 编 程 实 例'
- Page 139 and 140: R&S FSL详 细 的 编 程 实 例
- Page 141 and 142: R&S FSL详 细 的 编 程 实 例C
- Page 143 and 144: 附 录 A: 打 印 机 接 口R&S F
- Page 145 and 146: 附 录 A: 打 印 机 接 口R&S F
- Page 147 and 148: 附 录 B:LAN 接 口R&S FSL更 改
- Page 149 and 150: 附 录 B:LAN 接 口R&S FSL1. 在
- Page 151 and 152: 附 录 B:LAN 接 口R&S FSL3. 单
- Page 153 and 154: 附 录 B:LAN 接 口R&S FSL映 射
- Page 155 and 156: 附 录 B:LAN 接 口R&S FSL4. 按
- Page 157 and 158: 附 录 B:LAN 接 口R&S FSL11. 在
- Page 159 and 160: 附 录 B:LAN 接 口R&S FSL利 用
- Page 161 and 162: 附 录 B:LAN 接 口R&S FSL配 置
- Page 163 and 164: 附 录 B:LAN 接 口R&S FSL7. 如
- Page 165 and 166: 附 录 B:LAN 接 口R&S FSL建 立
- Page 167 and 168: 附 录 B:LAN 接 口R&S FSL你 可
- Page 169 and 170: R&S FSL索 引775 Ω ( 扩 展 标
- Page 171: R&S FSL索 引存 储 和 载 入
R&S <strong>FSL</strong>远 程 控 制 编 程 的 基 本 步 骤初 始 化 远 程 控 制 会 话REM –––––––––––– 初 始 化 远 程 控 制 会 话 –––––––––––––––––-----------------------––Public SUB Initialize()Dim status As Long'CALL viOpenDefaultRM to get the resource manager handle'Store this handle in defaultRM. The function viStatusDesc'returns a text description of the status code returned by viOpenDefaultRMstatus = viOpenDefaultRM(defaultRM)status = viStatusDesc(defaultRM, status, Response)'Open the connection to the device and store the handle'Note: The timeout value in viOpen() applies only for opening the interface'For setting the communication timeout, set the VI_ATTR_TMO_VALUE attribute'timeout values are in milliseconds'This example assumes the instrument IP address 10.0.0.10'If the network provides a name resolution mechanism, the hostname of'the instrument can be used instead of the numeric IP address'the resource string for GPIB would be "GPIB::20::INSTR''status = viOpen(defaultRM, "TCPIP::10.0.0.10::INSTR'', 0, 1000, analyzer)'status = viOpen(defaultRM, "TCPIP::::INSTR'', 0, 1000, analyzer)'status = viOpen(defaultRM, "GPIB::20::INSTR'', 0, 1000, analyzer)'Set timeout value – here 5sstatus = viSetAttribute(vi, VI_ATTR_TMO_VALUE, 5000)END SUBREM ***********************************************************************初 始 化 仪 器设 定 远 程 控 制 状 态 寄 存 器 和 仪 器 设 置 为 默 认 状 态 。REM –––––––––––– 初 始 化 仪 器 ––––––––––––––––––––––––------------------–––––––Public SUB InitDevice()CALL InstrWrite(analyzer, "*CLS")CALL InstrWrite(analyzer, "*RST")'Reset status register'Reset instrumentEND SUBREM************************************************************************1300.2519.69 6.5 ZH-4