Yup that's right.
DECL gave me an error but after making it right, I came to know that when PLC sends me a signal in a word, the signals were not turning ON correctly and hence the value was zero. There was some mapping issue as well. But it is now sorted. Thank you guys !!
Posts by rush22
-
-
Hello,
I want to copy my group digital inputs to an integer. Can anyone please suggest me any code for the same?
I tried doing this in config.dat...
DECL SIGNAL WIDTH $IN[49] TO $IN[56]
Then I want to copy the data in WIDTH to an integer DIMENSION
DIMENSION = WIDTH (I have written this in sps) so in background itself the data will be transferred.
when i receive signals from PLC, the value of WIDTH and DIMENSION is still 0. Although the particular inputs are in ON state
Is there any other way to convert the group input signals to an integer?
-
Hello,
I have been working on kuka interrupts. I have two position P1 and P2, When the robot moves from P1 to P2, if $IN[1] == true THEN i want to stop the robot there, record the position and turn on the vaccum.
DEF INTERRUPT()
GLOBAL INTERRUPT DECL 20 WHEN $IN[1]==TRUE DO SUB()PTP APPROCH_POS
PTP P1
INTERRUPT ON 20
PTP P2
INTERRUPT OFF 20DEF SUB()
INTERRUPT OFF 20
XP1.Z = $POS_ACT.Z -100
LIN XP1
Vaccum_ON()
ENDI have this code but when the signal turns on while moving from P1 to P2, the position is saved, but the robot still move to P2 and then jumps to the sub program. Infact I dont want robot to reach the desired P2 position but I want robot to stop where the signal is triggered and immediately jump to the sub program and Offset the position by - 100 mm and move to the point P1 and turn on the vaccum.
Can anyone suggest any other way if you know. Kindly correct me if I am going wrong here.