I want to 32 crc and 30 crc and 16 crc with my own polynomial

I want to 32 crc and 30 crc and 16 crc with my own polynomial
,how can I implement this using opto scripting? please reply

Hi Sanivada, welcome to the forums!

I’m taking a deeper look into this to find the best implementation of this that can serve 32, 30, 16, and other arbitrary values — in the meantime can you share your polynomials here so we know what you’re working with?

1 Like

For solving polynomials in general you can use a combination of the standard operators + - * / % along with PAC Control’s built-in mathematical functions. These are covered in the user’s guide (Form 1700), about half way through chapter 10.

The one you’ll want to focus on is the exponent function “Power”, for example TEN_SQUARED = Power(10, 2); which can accept literals or variables.

These should be all the tools you need to solve your own polynomials.

1 Like

hello sir may i get any example code with any crc i can modified as per my requirement
my polynomial for 30 crc x30+x29+x21+x20+x15+x13+x12+x11+x8+x7+x6+x2+x+1

That can easily be coded with the power function I posted above:

Power(x, 30) + Power(x, 29) + Power(x, 21) + ... + Power(x, 2) + x + 1

Hello sir i am very glad for your response but I need full example that start to end with dummy data
just a small example
please sir
reply to me

We don’t have your application and hardware duplicated here at Opto, so its very hard for us to write end to end code that can be copy/paste as you are requesting.

Are you able to share with the forums what you have tested and what the error code is?
Perhaps what can help both of us come to a working example quicker.

1 Like

thankyou for the response sir
here is my truncated polynomial : 0x2030B9C7
and my data is:0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,
can you help me how to find 30crc for this data
or can i copy c language code and implement in opto scripting
if possible please share me the information

Please copy / paste or screenshot the OptoScript error that you are seeing so that we can try and assist you better with your question.

sir i do not have any code i just want some reference code to generate 32crc
IN opto scripting there is only option of generate 16crc forward or generate 16crc reverse
i want some reference code for generation of 32crc and 30crc for data i received
if possible please give some example code
It will be grateful if you could provide example code

Ah, so you have not tried anything.
Ok. It will take us some time to try and find and then setup some equipment to test 32crc and 30crc.

thankyou very much for your response sir

I don’t normally use chatGPT, so am not sure of its accuracy, but this might help you?

1 Like

how may I add this in my opto scripting code?

i already had this code but i donot know how to implement this opto scrpting
can send me any example code if you have any or give the steps how to implement this

Sorry I misunderstood, you said you could convert it.

I also got confused here:

It sounded like you did not have any code and were looking for some ‘reference’ code.

Just a bit confused about what you have done and what you have access to.

We might be going in circles and duplicating effort it seems.

sir I just want opto scripting reference code( not c _language_code) for generation of 32crc and 30crc
or example for 32crc generation in opto scripting

sir please response sir if any 32crc opto scripting code give me any example

Please share with us what you have tired and what errors you got.


i didnt try any thing sir
i just want how to generate 32crc for data i have
please explain me how to generate 32crc using opto scripting or
send me any example code in opto scripting for generation of 32crc