I'm writing my own protocol scripts (Decoder + Value to Text) and I would like to plot a string on the waveform. How can I do that?
My Value2Text function looks as follows:
functionValue2Text(flag, value){switch(flag){case0:return"X";// Don't care, unknown or invalidcase2:return"b"+ value.toString(2);// Binary valuecase10:return value;// Decimal valuecase16:return"0x"+ value.toString(16).toUpperCase();// Hex valuedefault:return??;// String}}
I'm missing how to manage the default case, where I would like to pass a string. An example in the decoder:
Question
scorbetta
Hello all,
I'm writing my own protocol scripts (Decoder + Value to Text) and I would like to plot a string on the waveform. How can I do that?
My Value2Text function looks as follows:
I'm missing how to manage the default case, where I would like to pass a string. An example in the decoder:
rgValue[sample] = "Read";
rgFlag[sample] = 5;
Thanks
S
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now