The Pico SCPI labTool (PST) allows you to connect your PC to equipment to control and monitor all sorts of things. It runs on a Raspberry Pico. |
Capabilities
Functions
control output pins | Set gpio outputs high or low (can drive a LED, relays, actuator, buzzer, ...) | |
get output pin status | query the current state of an output pin | |
get input pin status | query the state of an input pin (can be a digital signal, switch status, ...) | added in release 3 |
get analogue input | query the Pico ADC inputs, or the measurements from an attached ADS1115 | added in release 2 |
set analogue output | Control a Pico pin's output value with variable duty cycle | added in release 3 |
get analogue output value | query the current set duty cycle of a Pico pin | added in release 3 |
digital input in: registers | instrument specific registers for digital input pins | added in release 4 |
service request | IEEE488.2 compliant service requests (e.g.: react on digital input status change) | added in release 5 |
Programming interface
control language | SCPI |
connectivity | Universal Serial Bus Test and Measurement Class (USBTMC), VISA compatible |
client software |
LabVIEW Virtual Instrument driver (VI) |
Command reference
This section describes the supported (and not yet supported) commands. It lists
- the SCPI syntax,
- LabVIEW Virtual Instrument driver block
- the pins that are used,
- parameters, return values.
set digital output |
drive digital output pin of PICO high or low |
pins: 0: GP22 |
SCPI | DIGItal:OUTPut# <0|1> |
example: DIGI:OUTP0 1 #: pin |
VI |
Public/Action-Status/Digital Out Control |
inputs: |
get digital output | query the state of a digital output |
pins: 0: GP22 |
SCPI | DIGItal:OUTPut#? |
example: DIGI:OUTP0? #: pin |
VI |
Public/Data/Read Digital Out |
inputs: pin (int) outputs: state (bool 0|1) |
|
||
get digital input |
query the state of a digital input |
pins: 0: GP20 |
SCPI | DIGItal:INPut#? |
example: DIGI:INP0? #: pin |
VI |
Public/Data/Read Digital In |
inputs: pin (int) outputs: state (bool 0|1) |
get analogue input (standard) | query an ADC input of the Pico |
pins: 0: GP26 (ADC0) |
SCPI | ANAlog:INPut#:RAW? |
example: ANA:INP0:RAW? #: pin |
VI |
Public/Data/Read Analog |
inputs: pin (int) outputs: ADC value (integer 0-4095) |
get analog input (high resolution) | query an input of attached ADS1115 ADC |
pins: ADS1115 pin 0 - 3 |
SCPI | ANAlog:HIRES:INPut#:RAW? | #: pin return: ADC value(integer 0-32766) |
VI |
Public/Data/Read Analog HiRes |
inputs: pin (int) outputs: ADC value (integer 0-32766) |
set analog output | control pin of Pico with variable duty cicle |
pins: 0: GP16 |
SCPI | ANAlog:OUTPut#:RAW <0-4095> | inputs: pin (int) Duty cycle value (integer 0-4095) outputs: na |
VI |
Public/Action-Status/Analog Out Control |
inputs: pin (int) duty cycle (integer 0-4095) outputs: na |
get analog output | query the set duty cycle set on a pin of Pico |
pins: 0: GP16 |
SCPI | ANAlog:OUTPut#:RAW? | inputs: pin (int) outputs: Duty cycle value (integer 0-4095) |
VI |
Public/Data/Read Analog Out |
inputs: pin (int) outputs: duty cycle (integer 0-4095) |
init resource | initiate connection | VISA url: USB0::0xCAFE::0x4000::123456::INSTR |
SCPI | na, connect via VISA API | client dependent |
VI |
Public/Initialize |
inputs: VISA url outputs: na |
close resource | release connection | |
SCPI | na, disconnect via VISA API | client dependent |
VI |
Public/Close |
inputs: na outputs: na |
Command reference: instrument specific registers
This section describes the supported (and not yet supported) commands. It lists
- the SCPI syntax,
- registers and bits that are used,
digital input registers | query the registers of a digital input, set filter and fan-out to IEEE488.2 Operation Status register |
bits: 0: GP20 registers: fan-out to IEEE488.2: Operation Status[0] |
SCPI | STATus:OPERation:DIGItal:INPut:CONDition? STATus:OPERation:DIGItal:INPut:PTRansition STATus:OPERation:DIGItal:INPut:PTRansition? STATus:OPERation:DIGItal:INPut:NTRansition STATus:OPERation:DIGItal:INPut:NTRansition? STATus:OPERation:DIGItal:INPut:EVENt? STATus:OPERation:DIGItal:INPut:ENABle STATus:OPERation:DIGItal:INPut:ENABle? |
|
Example
To run your first LabVIEW flow on the instrument, go to the Downloads section below, and get the latest firmware and LabVIEW VI driver with examples.
VI read analogue pin
This is one of the examples that's included in the LabVIEW VI Driver download |
PyVISA control and query digital output pins
ANA:OUT test at 100, 75, 50, 25 and 0%
Extensions
Connect an ADS1115 ADC to Pico I2C0 (GP4[SDA], GP5[SCL]) to enable the get analog input (high resolution) function. |
Contributors
shabaz | analogue output, high resolution analogue support, code reviews |
ggabe | IEEE488.2 service request support |
If you want to contribute to this project, check PST.. Have you worked with the Pico SCPI labTool? and github instructions.
If you want to use this project start your own SCPI instrument, check these 2 posts:
- Do you want to create your own Pico SCPI device, based on PST.. Pico SCPI USBTMC labLib (and labTool)?
- PSA.. SCPI firmware for Pico Data Acquisition Board as a plug-in module
Downloads
The release has all you need to get started. The firmware contains the binary .uf2 that you can copy on your Pico. The LabVIEW VI Driver contains examples that you can run right away.
software | latest release (source and bin) | development branch (source) |
Pico Firmware | github release | github branch |
LabVIEW Virtual Instrument driver with examples | github release | github branch |
Top Comments