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. It would be nice if the PST could supports device dependent SCPI registers. They can be used to notify a LabVIEW flow from the device. I'd be happy if we can notify LabVIEW when a GPIO input changed logic level. |
part 1: PST.. Experimental event / trigger support for Pico SCPI labTool - 1: investigate
part 2: PST.. Experimental event / trigger support for Pico SCPI labTool - 2: design the registers
part 3: PST.. Experimental event / trigger support for Pico SCPI labTool - 3: Instrument Specific Registers Test
part 4: PST.. Experimental event / trigger support for Pico SCPI labTool - 4: let TinyUSB USBTMC code use SCPI-LIB's Status Byte register
part 5: PST.. Experimental event / trigger support for Pico SCPI labTool - 5: Propagation to IEEE488.2 SCPI Registers Test
part 6: PST.. Experimental event / trigger support for Pico SCPI labTool - 6: Service Request from Instrument to LabVIEW flow
part 7: PST.. Experimental event / trigger support for Pico SCPI labTool - 7: Test Service Request from Instrument to LabVIEW flow
Test Setup
I continue from post 3 PST.. Experimental event / trigger support for Pico SCPI labTool - 3: Instrument Specific Registers Test.
We managed to fan a negative transition on Digital In PIN 2 (a button connected to GPI27), to the standard Operation Status register. Let's now test the upstream up to STB and SRE
Tests will systematically test
- can I propagate an event from the Operation Status register to the Status Byte register?
- did I land in the SCPI-LIB and USBTMC Service Request invocation code?
Test IEEE488.2 Standard Registers
Let's first bring the device in the condition that button presses fan out to OPERATION STATUS EVENT register.
STATus:OPERation:DIGItal:INPut:NTRansition 4\n
STATus:OPERation:DIGItal:INPut:ENABle 4\n
*CLS\n
Do this before each of the test cases. This will take care that the next button push will propagate to that bit.
test 1: OPERATION STATUS ENABLE and STB registers
condition:
- When OPERATION STATUS EVENT register Bit 0 is set (see part 3 on how to do that), STB OPS bit (Bit 7) should not be set (we have not enabled it)
- Set OPERATION STATUS ENABLE register bit 0 to 1. Query it back.
- STB OPS bit (Bit 7) should still be 0, because we did not generate an OPERATION STATUS event
- Push the button to make OPERATION STATUS EVENT Bit 0 go to 1. STB Pin 7 should now be 1
result;
1:Query STB by pressing the VI VISA tool's Read Status Byte button (this does not clear bits)
0
2: Enable the fan-out, and check back
STATus:OPERation:ENABle 1
STATus:OPERation:ENABle?
1
3: Query STB by pressing the VI VISA tool's Read Status Byte button (this does not clear bits)
0
4: Push the button. Push the button STB Bit 7 should be 1
128
pass
test 2: SERVICE REQUEST ENABLE register (and do we land in the Service Request code?)
condition:
- Start the firmware in a debugger. Set a breakpoint in first line of SCPI lib source file ieee488.c, function writeControl(). Run the test case initialisation commands.
Enable the Operation Status propagation too.
Debugger should not break yet. - Set SERVICE REQUEST ENABLE register OPER Bit 7 to 1. Query it back.
Push the button to make OPERATION STATUS EVENT Bit 0 go to 1. The debugger should break
result;
1: I use VSCode. Started the firmware in debug mode with the breakpoint set. Executed the 3 initialisation SCPI commands
STATus:OPERation:DIGItal:INPut:NTRansition 4
STATus:OPERation:DIGItal:INPut:ENABle 4
*CLS
STATus:OPERation:ENABle 1
debugger doesn't break
2: Enable propagation by setting SRE Bit 7 (OPER Bit) to 1, and control if it is set
*SRE 128
*SRE?
128
#pushcode breaks :)
pass
Top Comments