01-24-2018 08:35 PM
Hi, could somebody help me understanding this? I´m pretty new at GPIB and I had never heard about checksum.
I´m using the code shown below to communicate with my instrument but I often get a "RR,15;" error wich according to the manual means "Checksum error"
Note: The original command is "EC;" this is, according to the manual, the one for identification of my instrument.
I sometimes have an answer of identification but it is just after sending a sort of combination of that command, I mean e.g: EC; then EC;= then EC;=. or in any order if the last sent did not work.
I´d thank your comments.
Greetings
Solved! Go to Solution.
01-25-2018 03:28 AM
Use String To Byte Array on the real command. The use Add Array Elements. To do the subtract from 100x, just use the NOT. From here, I would use Build Array to add your checksum to the command and then Byte Array To String.
01-25-2018 08:18 PM
First of all thanks for answering
I made what you suggested and it works with the example from the manual, but, any idea of the next result:
PD: I had to use 101 instead of 100 in order to get the result from the example.
Thanks for all.
01-26-2018 05:18 AM - edited 01-26-2018 05:19 AM
@JEmmanuelH wrote:
I made what you suggested...
Not exactly. What I meant was for you to use the Byte Array and add the calculated checksum to the array using Build Array. You can also add the Line Feed character there. Then when you do the Byte Array To String, you will have your final command to send to your instrument.
And after playing around, I realized it was doing a 2's Compliment, which means you have to add 1 to the inverted value. Use Increment to do this so that we do not have to worry about mixing data types.
09-10-2021 01:00 AM
any idea how to use Append STX(Start of text)(02H) and ETX(End Of text)(03H) to the commands?
09-11-2021 12:52 PM