How can I give signed position of robot to PLC because from group output I can only give integers how to give floating values with signed onr
How to share signed position of robot to PLC
-
Thejesh -
February 25, 2020 at 6:37 AM -
Thread is Unresolved
-
-
Thejesh
February 25, 2020 at 7:02 AM Changed the title of the thread from “How to signed position of robot to PLC” to “How to share signed position of robot to PLC”. -
Hi
Can you explain what "signed position" means ?
Is it that you you want to pass to the PLC the values of a particular position ?
Is it that you want just say "robot is here" turning an output on /
What is it ?
-
I am giving robot position to PLC and saving in PLC array for future use so I need to give signed position value to PLC from group output
-
Any solution please
-
depends on your communication fieldbus you have on your PLC.
If you are using PLC just to do this, I rather you use a computer and send your information via socket messaging. Which maybe easier as through plc you need to convert here and there. From float to integer then send across and converts the integer to float. To the Pros out there, do correct me if I’m wrong... or if there’s any simpler method. Cheers
-
I am using profinet can u able to guide how to share by socket message please
-
err... I don’t have the program, manual on hand nor the computer.
but the idea is to grab robots current location and send via socket messaging as a string....
if you have the socket messaging manual I may be able to point out to you. -
Sorry I don't have if you have please share
-
The simplest way to do what you are asking is to turn on a separate, discreet output to indicate that the sign is negative, and the PLC can multiply the value received by -1. Three total, one for X, one for Y and one for Z, if you are only interested in sending pos and not interested in orient.
-
For me it seems easy,
just create a Background Program, look for six(Example 2-8) Group Outputs and fill the BG Program like this:
Check if the Registers or GO's are in use in other Programs before start the BG Program.
Code
Display More1: ; 2: R[20:X POS OUT]=($SCR_GRP[1].$MCH_POS_X) ; 3: R[21:Y POS OUT]=($SCR_GRP[1].$MCH_POS_Y) ; 4: R[22:Z POS OUT]=($SCR_GRP[1].$MCH_POS_Z) ; 5: R[23:W POS OUT]=($SCR_GRP[1].$MCH_POS_W) ; 6: R[24:P POS OUT]=($SCR_GRP[1].$MCH_POS_P) ; 7: R[25:R POS OUT]=($SCR_GRP[1].$MCH_POS_R) ; 8: ; 9: R[20:X POS OUT]=R[20:X POS OUT]*10 ; 10: R[21:Y POS OUT]=R[21:Y POS OUT]*10 ; 11: R[22:Z POS OUT]=R[22:Z POS OUT]*10 ; 12: R[23:W POS OUT]=R[23:W POS OUT] ; 13: R[24:P POS OUT]=R[24:P POS OUT] ; 14: R[25:R POS OUT]=R[25:R POS OUT] ; 15: ; 16: ; 17: GO[3]=R[20:X POS OUT] ; 18: GO[4]=R[21:Y POS OUT] ; 19: GO[5]=R[22:Z POS OUT] ; 20: GO[6]=R[23:W POS OUT] ; 21: GO[7]=R[24:P POS OUT] ; 22: GO[8]=R[25:R POS OUT] ;
-
Why multiplication with 10 is needed with position values
-
Because he is sending 0.1mm accuracy on the robot position.
You can do it multiple ways. One way as JMPLBL_NoGO showed, another way:
Code1: ; 2: R[20:X POS OUT]=($SCR_GRP[1].$MCH_POS_X) ; 3: ; 4: R[30:X POS after coma]=R[20:X POS OUT] MOD 1 ; 5: R[20:X POS OUT]=R[20:X POS OUT] - R[30:X POS after coma] ; 6: ; 7: GO[3]=R[20:X POS OUT] ; 8: GO[4]=R[30:X POS after coma] ;
Not sure that it's working, I wrote it in notepad. I hope I understand the idea.
-
I didn't getting command $SCR in the pendent is any variables I have to make it high to get this command
-
I didn't getting command $SCR in the pendent is any variables I have to make it high to get this command
You'll have to type it in manually. If you can edit offline and download to the robot, it is much easier with system variables.
-
The simplest way to do what you are asking is to turn on a separate, discreet output to indicate that the sign is negative, and the PLC can multiply the value received by -1. Three total, one for X, one for Y and one for Z, if you are only interested in sending pos and not interested in orient.
Technically, you do not need to send a sign bit if both sides are speaking the same language.
Group I/O is a 16-bit signed integer in two's-compliment. Sorry, I cannot remember the endianess of it (I *think* it is Big Endian, I may be wrong). I'm lazy; I usually just see if it is correct, if not , it will need to be flipped, which is usually easier to do on the non-Fanuc side.
But to your quote Lemster68, yes, sending a sign bit and being limited to 32766 values is the simplest way. At least it is for sure the simplest way five years down the road when you don't remember...