Author Topic: SCPI parser library for Rust  (Read 2581 times)

0 Members and 1 Guest are viewing this topic.

Offline AtmelfanTopic starter

  • Newbie
  • Posts: 2
  • Country: se
  • We do what we must because we can
    • Github
SCPI parser library for Rust
« on: December 20, 2019, 09:13:06 pm »
https://github.com/Atmelfan/scpi-rs; https://docs.rs/scpi/
Thought it might be interesting to someone here, otherwise pretty niche with SCPI(https://en.wikipedia.org/wiki/Standard_Commands_for_Programmable_Instruments)+Rust  :-DD.

Still in a pretty early state but most of the basic parsing is done and it can be used for simple implementations. Some standard commands are stubs, haven't been very thorough with the errors it emits and some syntax is missing. I've an example running on a STM32F415, using 24 KiB flash (could probably be optimized a bit better and the example uses semihosting+core::fmt which adds a bit), it has no HW dependencies so it should be capable of running on any target supported by rust.

Example output from https://github.com/Atmelfan/scpi-rs/blob/master/example-cortexm/src/main.rs:
Code: [Select]
SCPI >> *IDN?; *ESR?
RESPONSE: Cyberdyne systems,T800-101,0,0;0

SCPI >> this:is:an:invalid:command?
ERROR: Undefined header

SCPI >> *ESR?
RESPONSE: 32

SCPI >> syst:err?
RESPONSE: -113,"Undefined header"

SCPI >> system:error?
RESPONSE: 0,"No error"

Sorry if this is too much of a plug (I'm the author if it wasn't clear), I think this is probably the only place with people who cares about SCPI :-DMM and possibly Rust.
 
The following users thanked this post: pigrew, sjm

Offline sjm

  • Contributor
  • Posts: 18
  • Country: fi
Re: SCPI parser library for Rust
« Reply #1 on: August 21, 2021, 11:14:36 am »
Sorry for a really stoopid question, but this is strictly meant to aid creation of an SCPI server on some kind of embedded hardware etc?
I am looking for a client-side SCPI crate to command my homelab devices...

BR, -sjm
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->