Benjamin Soriano III Posted July 22, 2014 Report Posted July 22, 2014 Good morning people! May I ask if there are some sensei in ladder programming that can help me interpret this code to a ladder program. Initialize CHECKSUM as FFFF(Hex) (There is a FOR NEXT Instruction) FOR each Byte CHECKSUM = CHECKSUM XOR (current byte) FOR I = 0-7 If ((CHECKSUM AND 1) = 0) CHECKSUM = Right_Bit_Shift CHECKSUM 1 bit Else CHECKSUM = (Right_Bit_Shift CHECKSUM 1 bit) XOR A001(Hex) NEXT I NEXT Byte I hope you can give me some ideas on this guys. I need some CRC function on the machine I am programming and I find it hard interpreting it in a ladder program. Thanks guys. Quote
Inntele Posted July 22, 2014 Report Posted July 22, 2014 What PLC type? What programming software? Quote
kaare_t Posted July 22, 2014 Report Posted July 22, 2014 And which language? If you can use FB's I might have an existing library for the CRC in hand... Quote
Benjamin Soriano III Posted July 23, 2014 Author Report Posted July 23, 2014 The PLC is Q12PHCPU and I use GXWorks2. Thank you sir. Quote
Benjamin Soriano III Posted July 23, 2014 Author Report Posted July 23, 2014 I use ladder programming, in GX Works2 sir. Quote
kaare_t Posted July 29, 2014 Report Posted July 29, 2014 OK, so you cannot use FBs. Did you solve it? It's a little bit of work to make the CRC check, so I don't think anyone will make it for free... Did you solve it? Do you interface with an existing CRC application, or do you need it for your personal need in some way? Quote
Benjamin Soriano III Posted August 4, 2014 Author Report Posted August 4, 2014 Good day sir. I am trying to figure this out. Somehow I did some progress, but this is far from complete. I came to use FOR NEXT statements and I saw in the programming manual that there are existing logical ops that might help me. I am now trying to figure out the stuff that must be programmed inside the ladder to complete the process as it has a time prerequisite (It was a MARKEM printer on a high speed horizontal wrapping machine. I will update you regarding the stuff. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.