Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Checksum error in GPIB

Solved!
Go to solution

Hi, could somebody help me understanding this? I´m pretty new at GPIB and I had never heard about checksum.String.PNG

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" GPIB.PNG

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

0 Kudos
Message 1 of 6
(3,627 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 6
(3,598 Views)

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:

CHEKSUM.PNG

PD: I had to use 101 instead of 100 in order to get the result from the example.

Thanks for all.

0 Kudos
Message 3 of 6
(3,583 Views)
Solution
Accepted by JEmmanuelH

@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 6
(3,573 Views)

any idea how to use Append STX(Start of text)(02H) and ETX(End Of text)(03H) to the commands?

0 Kudos
Message 5 of 6
(1,714 Views)

Do you really need this?

Use the concatenate string function, and first use byte to array and array to string to convert ch to string.

This is all compile time except for the concatenate.

2021-09-11 19_48_38-.jpg

greetings from the Netherlands
0 Kudos
Message 6 of 6
(1,696 Views)