Peter, Jon and I are building a Programmable Electronic Load. In this series of blogs I'm building a LabVIEW library of reusable components
In this second article: Reading the the instrument's measurements |
LabVIEW has a set of blocks to build flows with serial communication devices. Those blocks work well with our instrument.
However, inspired by the example for (in this case) the BK Precision 91xx family, I'm going to create more abstract blocks.
Read Output Block
This blog reads the values sampled by the instrument. I've used the same options as the BK Precision lib:
0: VOLT
1: CURR
2: POW
3: DVM
4: RES
The bold ones are implemented by the firmware. The others are for future use (and to stay as true as possible to the lib that inspired this) will throw a SCPI error.
For the Initialize block, the input parameters are
- VISA resource name eload
- delay before read (ms)
- Measurement Function
- error in (no error)
The output parameters are
- VISA resource name out
- Measurement
- error out
After running this block, the following functionality is performed:
- The measurement option that's passed to it is performed
0: VOLT
1: CURR
2: POW
3: DVM
4: RES
- If an error is detected, the VISA resource is closed and error info is passed to the caller.
Else the block passes the measured value to the calling flow via the Measurement parameter.
Reading the Output
The block is simple to use. It expects that you've initialised the instrument with the Initialize block.
Depending on the value you pass (in this example 1: current), it will return the last value sampled by the instrument.
Top Comments