Eevacademy #9 – Implementing Scpi In C++

That would be pointless we’re gonna process at once and it will continue to the next node and it will go to its child notes that that’s these nodes so voltage wasn’t found.

At five which is at the end of the word sense at the the : here we go so now we’re going to process from five onwards starting with the : so this time we’re going to step in.

So you can see kind of what it does so it says is the cold in there I mean it has to be because it’s not a root so is it at character five inside the block it is and now we’re ready to search for the.

Key word the key word is the current so if currents found then we’re going to continue we’re going to assign the new end index.

The parameter P index and then we return true then we know finally we have current and that’s how Skippy’s command that’s how skip is interpreted and just as some variations so if.

You didn’t if you admitted the semicolon at the front it should still work no problem and if you omit the optional characters it should still work and.

If you now end it with a query it works still but this time it’s detected that it is a query so this is the basic structure of a Skippy interpreter it’s quite lightweight with the exception of using the standard string and it’s something you.

Can put on your own devices your own test equipment which makes it much more usable for people who aren’t aren’t you so if you look at the micro suppliers skippy specification we basically have everything that we talked about here before we have an optional semicolon at the start optional things are put around square brackets and then we can have source the voltage.

And then we can assign it a value or we can ask for what it is now skip is typically done by serial so that’s what we’re going to do that’s what we’ve done so let’s try it out so.

If we input source : voltage those the the source node then voltage with a.2 volts it will set the source voltage to 1.2 it doesn’t return anything here but we can’t query whether it was correct and this is usually.

A good idea so there we go we it returned 1.2 when I queried the voltage how about source current source current and we’re going to assign zero point one two three because that’s awesome or something source current query should return the same thing and it does so this is basically a real-world example of a Skippy command interface so of course it’s not.

Case sensitive as where tests weren’t it does exactly the same thing so yeah it’s a really useful interface.

And if there’s there’s a few that here’s the required commands that we have implemented and this is why it says Skippy ish because Skippy requires all of them all of them but we there’s no practical use of implementing all of them so.

For the minimum viable product we are not doing that maybe we’ll do it later so.

Now the required commands start in a star that’s the only difference and they have to have that star I think so here we go ID in with a query and there you go returns this query string build so if you want to.