
adccommunitymod (AutomationDirect) asked a question.
Created Date: February 13,2011
Created By: bgirouard
**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****
Hi all, I had a thread a while back asking some questions about this, but it was more about RS-485 comm. with a Miyachi laser welding system. I do have communications happening with the laser using a Click. For details see that thread here . What I have found out is that my program was not generating the proper BCC checksum the laser needed. Buried within a C#.NET program example in the laser's manual (pp. 194-195 of the pdf) it says to XOR all the characters in the data string between and ascii characters that tell the laser when the data string starts and ends. However, when I perform this calculation both with my Click and manually, I get different values than what their command utility program generates. Here are three examples with their BCC and my manually calculated BCC (- is a space in the text string): TEXT STRING THEIR BCC MY BCC 10WS--2---------- 34h 35h 10WS--0---------- 36h 37h 10W841103:0375 61h 62h I know there is a trend here, but I do not want to assume this is all the time. Does this seem familiar to anyone else out there? I have this question posted to the laser manufacturer, but I know people on this forum have been an immense help in the past to me, so I figured trying both these avenues in parallel. Thanks in advance!
Created Date: February 14,2011
Created by: bcarlton
As I read the example it is appending the ETX then calling the BCC generation routine which includes all the characters, including the ETX. But a difference in including or excluding the ETX would have caused a bit difference in the last two bit positions which doesn't match your findings.
Edit - on looking at your numbers again I guess the last two positions are flipped from their example.
I don't see in the PDF your definition of all characters "between and ascii characters " which I assume, in your mind, excludes the STX and ETX.
Their example is excluding the STX but including the ETX.
Created Date: February 14,2011
Created by: bgirouard
Their example is excluding the STX but including the ETX.
THAT's IT!!
Bcarlton, I think you 've answered my last MAJOR hurdle in figuring out this project!! I thought for sure that I had tried that combination, but I must 've mistyped one of the ascii codes when manually calculating the BCC. I just tried all three examples with including the ETX and they all match. THANK YOU!!!
Now I can start building my Click logic with more confidence knowing that this calculation works. I was hoping it was something along the lines of not being able to see the forest through the trees!
Created Date: February 13,2011
Created by: bgirouard
Hi all,
I had a thread a while back asking some questions about this, but it was more about RS-485 comm. with a Miyachi laser welding system. I do have communications happening with the laser using a Click. For details see that thread here .
What I have found out is that my program was not generating the proper BCC checksum the laser needed. Buried within a C#.NET program example in the laser's manual (pp. 194-195 of the pdf) it says to XOR all the characters in the data string between and ascii characters that tell the laser when the data string starts and ends. However, when I perform this calculation both with my Click and manually, I get different values than what their command utility program generates. Here are three examples with their BCC and my manually calculated BCC (- is a space in the text string):
TEXT STRING THEIR BCC MY BCC
10WS--2---------- 34h 35h
10WS--0---------- 36h 37h
10W841103:0375 61h 62h
I know there is a trend here, but I do not want to assume this is all the time. Does this seem familiar to anyone else out there? I have this question posted to the laser manufacturer, but I know people on this forum have been an immense help in the past to me, so I figured trying both these avenues in parallel.
Thanks in advance!