¿ªÔÆÌåÓý

SCPI Command Parser Firmware For Instrument


 

Anyone here developed a SCPI command parser for embedding in an instrument?? Or know of one well developed.?
?
I have googled and never found a parser that appears to be very compliant to the specification.
?
A simple use case might be to have an Arduino UNO analogread() result available through the USB COM port where the UNO appears to be a SCPI instrument.
?
Regards,
(Forrest) Lee Erickson


 

You might find this helpful:



MK


 

I have seen one but not investigated how compliant it is. I'm not sure I can find it again and be sure it's better than one you've rejected. What have you looked at ?


On Wed, Jul 12, 2023 at 2:56?PM Michael Kellett <mk@...> wrote:
You might find this helpful:



MK


 

Regarding, "What have you looked at ?"

I think it was this one:??
It works against a limited set of fixed strings defined a compile time.
IIRC I thought it was not adequate for managing instrument state per some of the SCPI99 documentation. HOWEVER It may be my imaginiation of how to use it that is a limitation.??I do see there has been recent commits against it and I know I have NOT evaluated what ever is the latest versoin.

New to me is this one:?
I see it works only on Teensy 4.1. So if it was around before I would have passed over it as I do want an UNO solution and so was asking here because this is an Instrument = Equipment group by my inference.


 

Yes, I think it was one of those that I'd seen.
Either sound as though they might get you most of the way there - I think you'll be very lucky to find one that's complete in every possible way and yet fits in the tiny memory of a UNO. Strtoull() wouldn't be hard to write and may not even be necessary unless you know you want 64 bit values. Just substitute strtoul().


 

¿ªÔÆÌåÓý

On 2023-07-12 09:31 AM, Forrest Erickson wrote:
Anyone here developed a SCPI command parser for embedding in an instrument?? Or know of one well developed.?

Contact me privately at SteveHx at HxEngineering period com.

Steve Hendrix


 

I found two projects that might help:


This is an open source multi-channel power supply project that includes control with SCPI commands,
so somewhere in the sources on github there should be the SCPI parser.

I also found this open source project:




I hope this is helpful,
Philip


 

FWIW

30 years ago I wrote a parser using lex and yacc that ran in production for 8-9 years without a single bug report. It would take some revierw work to do that now, but is there isn't a solution extant, I'd be pleased to write one subject to a very busy schedule. It would be fun to write some software again.

Have Fun!
Regt


 


30 years ago I wrote a parser using lex and yacc that ran in production for 8-9 years without a single bug report. It would take some revierw work to do that now, but is there isn't a solution extant, I'd be pleased to write one subject to a very busy schedule. It would be fun to write some software again.
SCPI syntax appears very simple, not need for lex and yacc. An ad-hoc lexical analyzer and parser would probably more simple and eficient.
But indeed, it's very surprising there's not an already open source SCPI parser library.