Hi guys!
Anybody know if is possible to translate a .PC function in a .KL function? I would like to know if I can to do the reverse of ktrans.
Thanks
Hi guys!
Anybody know if is possible to translate a .PC function in a .KL function? I would like to know if I can to do the reverse of ktrans.
Thanks
Thanks.
Very usefull.
This is what you've been told, but is actually not true. Similar to decompilers for other programming languages, there are decompilers for karel.
Not something Fanuc wants you to know, but they exist.
I'm in curiosity too. AFAIK there are two possible options.
1) .PC code runs directly on CPU of the controller
2) .PC code is some kind of bytecode which runs on virtual machine which runs directly on CPU of the controller
In first point there will be necessary to know every possible CPU architectures which had been on every controller over time to be able to talk about KAREL decompiler better to say universal KAREL decompiler.
In second point we can talk about KAREL decompiler or universal KAREL decompiler because KAREL will be the same on every possible CPU architecture because hardware layer is separated there from bytecode by virtual machine.
I think that second point is less likely than first one. You may have to take into mind that KAREL has different versions over time.
So I can imagine that there is decompiler for KAREL version 3.05 on RJ controller or 2.22 on RH controller. But universal? I think it is a dream excl. point 2 above or under condition that every CPUs on FANUC controller had same architecture in relation to point 1.
So it would be better to talk about which CPU architecture come with each type of controller. Because I have RH controller here I'm obviously curios which architecture comes with it. If it's standard x86 by Intel it will not be so hard to decompile the .PC code I would say.
Cejka
Try to run a karel function and bring on an error. For example, try to move the robot to a invalid position or try to use a array with a index value is invalid (if you use "0", is a invalid index). The execution stops and you can see on TP the line in your .kl program that the fault was occurred.
For this, I think that maybe is a possible to convert.
I will learn more about your suggestions and I hope to learn for share here.
Cheers!
This is what you've been told, but is actually not true. Similar to decompilers for other programming languages, there are decompilers for karel.Not something Fanuc wants you to know, but they exist.
Hi blatter_string,
if you think there are decompilers for Karel then name only one of them...
For me this sounds like speculation.
I have some friends at FANUC Europe and even they have no possibility to decompile Karel.
Maybe the OS/Karel developers at FANUC have some tools but if so ....they will never ever leave their lab.
rob76 I don't think there are decompilers, I know there are.
I don't need to provide you with any proof, and you don't need to believe me.
The decompiler I wrote about is not (yet) commercially available, so I cannot refer you to it.
I wrote my post to let you know that what has been claimed to be impossible for many years is in fact not impossible.
Try to run a karel function and bring on an error. For example, try to move the robot to a invalid position or try to use a array with a index value is invalid (if you use "0", is a invalid index). The execution stops and you can see on TP the line in your .kl program that the fault was occurred.
emanuel_eng you were right. Recently I digged deeply into this topic and for now I'm definitelly sure that it is possible to do reverse translation from *.PC to *.KL. The p-code itself does not run directly on CPU arch, it is some kind of bytecode that KAREL controller operating system interprets on the fly. BUT things will not be so easy just because of every particular KAREL system OS have own KAREL translator version and *.PC file format as the FANUC add more and more features over time. I'm still working on it but for now I'm able to reverse translate some basic KAREL statemets related to R-H controller. If there will be enough interest I'll start some online service around lately.