Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to parse string arguments #9

Open
KevinNadaud opened this issue Sep 30, 2022 · 1 comment
Open

How to parse string arguments #9

KevinNadaud opened this issue Sep 30, 2022 · 1 comment

Comments

@KevinNadaud
Copy link

Hi,
Thanks for the code which useful to build custom remote control electronic.

I would like to know if it is possible to parse string parameter instead of numerical parameter ?
For example, the sent command would be ":MODE CURR" or ":MODE VOLT" and I want to parse the 'CURR' or 'VOLT' in order to make the test into the function.
I found an alternative way up to know by using '0' for 'CURR' and '1' for 'VOLT' and parse numerical value, but parse string would be useful.
Regards,

@LachlanGunn
Copy link
Owner

Since your example doesn't require preserving whitespace, then the best approach would be to look at the struct scpi_tokens directly. You can find the struct definition here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants