overflow errors
Hi @Vrekrer, i have been searching for a very long time for an error that was due to an overflow. Can you perhaps issue a message when an overflow occurs? That would be extremely useful.
It would at least be extremely helpful to have a function that can be used to check whether one of the following variables is true.
struct internal_errors {
//Command storage overflow error
bool command_overflow = false;
//Token storage overflow error
bool token_overflow = false;
//Branch (SCPI_Commands) storage overflow error
bool branch_overflow = false;
//Special command storage overflow error
bool special_command_overflow = false;
} setup_errors;
Hi Steffen
Have you tried the error handling example?
You can access that variables using my_instrument.last_error this property will return a SCPI_Parser::ErrorCode enum with the last error.
You can also set a special function my_instrument.SetErrorHandler(&myErrorHandler) that will be called every time a communication error is detected.
I think your project is great. No, I somehow overlooked it. Many thanks for the quick reply. That helps me.
Hi, the example is great. Unfortunately, it didn't help in my case. My problem was that I had loaded more commands into the class than there was room for. This resulted in a bad run, which is also handled internally. Unfortunately, I wondered for a long time why some commands didn't work.
Apart from that, I think your code is really great!
Hi.
You can increase the number of commands. Look at the Configuration options example.
The default number of commands is for low-RAM processors, such as Arduino.
Hi,
I did that but only after I had found the problem. That's why I would have liked it if I could have simply called up the overflow in a function. According to the motto there is an error or not.
That is a good idea. I will add an status to the library class and try to report class errors there.
Something along the lines of buffer_ok() which then outputs true if there is no overflow, you could very well check this once after initialization, then you won't be surprised if there are errors.