SCPI on Mac


            

Some more days passed and some more finishing touches added to my MacSCPI app. It is entirely dependent on hooking the device via the USBTMC driver, but it works fine and is stable:

Some SCPI commands sent from an OS X terminal to my KeysightAgilent DSOX 2002A scope (see the *IDN? query result — serial wiped for security reasons); all values are returned in NR3 format, but seem to be reliable (crossed-checked with reading from the display).

I had some problems with buffer padding and the output it is still not 100% gibberish–free , but I assume I have to play with buffer size and with zero–filled calloc routines. We’ll see. I implemented a fgets–based terminal character read. So far so good, the apps sends proper DEV_DEP_MSG_OUT and reads DEV_DEP_MSG_IN usbtmc messages. Some more screens with control reference waveforms and marker tests:

Some tests with markers and control reference waveforms, performed on my Agilent DSOX 2002A oscilloscope. Note the result of :MARKer:XDELta? SCPI query (last line) and compare with ΔX value (44.200 ns) displayed on the scope screen (next image).

Some tests with markers and control reference waveforms, performed on my KeysightAgilent DSOX 2002A oscilloscope. Note the result of :MARKer:XDELta? SCPI query (last line) and compare with ΔX value (44.200 ns) displayed on the scope screen (next image).

Some tests with markers and control reference waveforms, performed on my Agilent DSOX 2002A oscilloscope. Note the ΔX value (44.200 ns) and compare with the result of :MARKer:XDELta? SCPI query in the previous image (last line).

Some tests with markers and control reference waveforms, performed on my KeysightAgilent DSOX 2002A oscilloscope. Note the ΔX value (44.200 ns) and compare with the result of :MARKer:XDELta? SCPI query in the previous image (last line).

There are many ways to continue. For now, I will go with limited objectives: developing just the console app and adding support for parameters and inline help. Then some code refinements will follow: the next big move is to start creating the actual SCPI libraries — probably a stdandalone framework for Mac — thus increasing the level of abstraction to a stage that will be much programming–friendly and allow reusability and more flexibility in bigger, more complex applications. More to come.

A quickie on USB Endpoints

Endpoints are essentially the USB addresses that USB data is sent to or from. Now, here is the trick. The transfer direction naming convention is a bit unintuitive. Contrary to — at least — what I imagined, an IN Endpoint will transfer USB data from the USB device to the host PC, while an OUT Endpoint […]

USBTMC driver for Mac

After some head banging, I finally managed to send SCPI commands from my Mac to my Agilent (Keysight) DSOX2002A. I’ve worked on this since december last year. Almost a year, but I did not spent a sustained amount of effort. I did it just during my free time. I still have a day job that […]

Leave a Reply

Your email address will not be published. Required fields are marked *