本逻辑用于将高速ADC采集到的数据进行缓存,并根据上位机的需要,从缓存的数据中选出用于显示的部分进行传输,传输的方式可以是:
FPGA的作用负责解析控制器发来的控制字,并根据控制字的内容从缓存中选取需要的数据
未来在FPGA里面可以扩展的数据处理功能:
FPGA内部的框图如下:
数据采集FPGA逻辑功能
主要分为两部分:
根据FPGA的内部Block RAM或外扩的RAM的实际情况设定双口RAM的大小,一般我们使用的Lattice XO2系列的FPGA内带的Block RAM为96kbits,如果采用双通道8位的高速ADC,则每个通道可以使用的RAM空间为48Kbits ~ 6KByte,考虑到高速ADC可以采用更高分辨率,比如12bit,96Kbits ~ 12bits * 2 * 4K,每个通道为4KB的存储深度。
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 } ] } }
提供访问任意波形发生器的数据和功能的命令
获得仪器通道的当前状态、
* ** wait ** - (Integer) - The number of ms to wait before the device is ready to process another command. * ** state ** - (String) - The instrument channel state: "idle" or "running". * ** waveType ** - (String) - The waveform type: "sine", "square", "triangle", "dc", "sawtooth", "arbitrary", or "none". * ** actualSignalFreq ** - (Integer) - The actual waveform frequency in mHz. * ** actualVpp ** - (Integer) - The actual peak-to-peak voltage in mV. * ** actualVOffset ** - (Integer) - The actual voltage offset in mV.
命令
{ "awg": { "1": [ { "command": "getCurrentState" } ] } }
响应
{ "awg": { "1": [ { "command": "getCurrentState", "statusCode": 0, "wait": 0, "state": "running", "waveType": "sine", "actualSignalFreq": 1000000, "actualVpp": 3000, "actualVOffset": 0 } ] } }
设置AWG的通道参数以输出正常的波形
* **actualSignalFreq** - (Integer) - The actual waveform frequency in mHz. * **actualVpp** - (Integer) - The actual peak-to-peak voltage in mV. * **actualVOffset** - (Integer) - The actual voltage offset in mV.
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
* **state** - (String) - The current state of the channel: "idle" or "running". * **voltage** - (Integer) - The current measured value of the channel in mV.
#### 举例
命令
{ "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).
* **voltage** - (Integer) - The current measured value of the channel in mV.
#### 举例
命令
{ "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 } ] } }