目录

命令格式


6\r\n
chunk1\r\n
8\r\n
somedata\r\n
E\r\n
 in\r\n\r\nchunks.\r\n
0\r\n
\r\n

多命令


可以使用多命令在单个事务中发送多个命令。

举例:

Command

{
   "dc":{
      "1":[
         {
            "command":"setVoltage",
            "voltage":3300
         },
         {
            "command":"getVoltage"
         }
      ],
      "2":[
         {
            "command":"setVoltage",
            "voltage":5000
         }
      ]
   }
}

Response

{
   "dc":{
      "1":[
         {
            "command":"setVoltage",
            "statusCode":0,
            "wait":500
         },
         {
            "command":"getVoltage",
            "statusCode":0,
            "wait":100,            
            "voltage":3300
         }
      ],
      "2":[
         {
            "command":"setVoltage",
            "statusCode":0,
            "wait":500
         }
      ]
   }
}



波形发生器部分

提供访问任意波形发生器的数据和功能的命令

获得当前状态


获得仪器通道的当前状态、

命令

响应

例子

命令

{
    "awg": {
        "1": [
            {
                "command": "getCurrentState"
            }
        ]
    }
}

响应

{
    "awg": {
        "1": [
            {
                "command": "getCurrentState",
                "statusCode": 0,                
                "wait": 0,
                "state": "running",
                "waveType": "sine",
                "actualSignalFreq": 1000000,
                "actualVpp": 3000,
                "actualVOffset": 0
            }
        ]
    }
}


设置通用波形


设置AWG的通道参数以输出正常的波形

命令

响应

举例(波形)


Command

{
   "awg":{
      "1":[
         {
            "command":"setRegularWaveform",
            "signalType":"sine",
            "signalFreq":1000000,
            "vpp":3000,
            "vOffset":0 
         }
      ]
   }
}

Response

{  
   "awg":{  
      "1":[  
         {  
            "command":"setRegularWaveform",
            "statusCode":0,            
            "wait":0,
            "actualSignalFreq": 1000000,
            "actualVpp": 3000,
            "actualVOffset":0
         }
      ]
   }
}



运行


运行AWG通道

命令

响应

举例:

Command

{
   "awg":{
      "1":[
         {
            "command":"run"
         }
      ]
   }
}

Response

{
   "awg":{
      "1":[
         {
            "command":"run",
            "statusCode":0,
            "wait":0
         }
      ]
   }
}



停止


停止AWG通道

命令

响应

举例:

Command

{
   "awg":{
      "1":[
         {
            "command":"stop"
         }
      ]
   }
}

Response

{
   "awg":{
      "1":[
         {
            "command":"stop",
            "statusCode":0,
            "wait":0
         }
      ]
   }
}



直流电压

提供访问直流电压数据和函数的命令

获取当前状态


Get the current state of the instrument's channel

命令

响应

命令

{
    "dc": {
        "1": [
            {
                "command":"getCurrentState"
            }
        ]
    }
}

响应

{
    "dc": {
        "1": [
            {
                "command": "getCurrentState",
                "statusCode": 0,
                "wait": 0,
                "state": "idle",
                "voltage": 3300                
            }
        ]
    }
}


获取电压值


Get the output voltage(s) of the specified DC power supply channel(s).

命令

响应

#### 举例

命令

{
   "dc":{
      "1":[
         {
            "command":"getVoltage"
         }
      ]
   }
}

Response

{
   "dc":{
      "1":[
         {
            "command":"getVoltage",
            "statusCode":0,
            "wait":100,
            "voltage":3300
         }
      ]      
   }
}



设置电压


Set the output voltage(s) of the specified DC power supply channel(s).

命令

响应

#### 举例:

Command

{
   "dc":{
      "1":[
         {
            "command":"setVoltage",
            "voltage":3300
         }
      ]
   }
}

Response

{
   "dc":{
      "1":[
         {
            "command":"setVoltage",
            "statusCode":0,
            "wait":500
         }
      ]
   }
}