
Call TP program from KAREL
-
Limburger -
May 20, 2021 at 4:30 PM -
Thread is Unresolved
-
-
Have you tried it without the %nolockgroup directive?
-
ERROR: Program must contain %nolockgroup directive
-
I was able to build and run the program that you posted after removing the %nolockgroup.
Where did you get the ERROR: Program must contain %nolockgroup directive? Was it during build or when you ran it?
-
When I call it from browser: “http://<robot_adress>/KAREL/caller”.
-
The Internet Options manual says that a Karel program that is run from the browser must include NOLOCKGROUP. It would not be safe to run a motion program remotely.
-
-
You don't need Karel to do that. Instead you could set a register value remotely, then have a BG Logic program monitor the register and turn on a Flag assigned to a Macro.
-
-
Yes, that is what I just said in the previous post.
Here is an example:
BG program:
F[1] = (R[12]=1)
Macro assignment:
F[1] TP program
TP program:
Uframe_num = 1
Utool_num = 1
PR[10] 100mm/sec FINE
-
Yes, that is what I just said in the previous post.
Here is an example:
BG program:
F[1] = (R[12]=1)
Macro assignment:
F[1] TP program
TP program:
Uframe_num = 1
Utool_num = 1
PR[10] 100mm/sec FINE
Hi HawkME,
Once again Thaks a lot, i am facing this same problem but your post helped again, as usual, now i can move the robot from positional data that is sent by another device or external pc.
I have some confusion and doubts which need some clarifications but I will post them tomorrow as the latest because now it's too late for me and i was working since afternoon on Sunday and need some rest.
again thanks a lot for helpful posts
-
Hi HawkME,
I going to ask some questions similar to the discussion in this post, just to enhance my knowledge.
In Summary,
I am working on a task, detail can be found here (PC and FANUC robot TCP/IP Communication), in which a python application running on PC will send recent workspace pictures to an App that runs AI/ML algorithms for detection and localization of objects and send position data to the robot to pick detected object through python middleware application.Yesterday I was struggling to run a TP program from a KAREL program and I had no luck with it. I am running KAREL from a web browser and using the following GET-URL from POSTman for testing purposes. URL: http://192.168.1.1/KAREL/Mov_HTTP?id=100&XX=214.384&YY=-282.970&ZZ=170.502&WW=179.937&PP=.712&RR=89.751
So KAREL program convert xyzprw values from string to REAL and stores them in a PR then calls a TP program that contains the following instruction:
J PR[100] 100mm/sec FINE
First I got "Cannot lock the motion grp". I searched the KAREL manual and found LOCK/UNLOCK group built-ins and used them in code as depicted in the code section I also increase time in $HTTP_CTRL.TIMEOUT from 10 to 100 but this did not help.It seems KAREL is not calling the TP program. Also, i did not get any error on the TP screen but the TP program did not run.
Why KAREL program if run from the browser can not run a TP program that contains a motion group?
There is an example in the KAREL manual, section B.5 in which KAREL calls two TP programs that contains motion instructions also it modifies positional data for one program before calling it.
Code
Display MorePROGRAM Mov_HTTP %NOLOCKGROUP %ENVIRONMENT REGOPE %TPMOTION %ENVIRONMENT MOTN %ENVIRONMENT MULTI %ENVIRONMENT STRNG %COMMENT = 'GET POS_HTPP' %NOABORT=ERROR+COMMAND %NOPAUSE=ERROR+COMMAND+TPENABLE %ALPHABETIZE %INCLUDE KLEVKEYS %INCLUDE KLEVKMSK %INCLUDE KLEVCCDF %INCLUDE KLIOUOP %INCLUDE KLIOTYPS VAR id,XX,YY,ZZ,WW,PP,RR: STRING[10] con: CONFIG reg_ID,x,y,z,w,p,r: REAL temp_pos: XYZWPR fFileHandle : FILE chOutFile: STRING[20] ret_code,status,prog_index: INTEGER ---------------------------------------------------- -- BEGIN MyProgram ---------------------------------------------------- BEGIN -- clear the TPERROR screen --FORCE_SPMENU(TP_PANEL,SPI_TPUSER,1) WRITE(CHR(137),CHR(128)) WRITE TPERROR(CHR(128)) WRITE('Waiting for HTTP Req...',CR) IF UNINIT(chOutFile) THEN chOutFile='TD:RESPONSE.HTM' WRITE('[X] INSIDE',CR) ENDIF WRITE(id,XX,YY,ZZ,WW,PP,RR,CR) CNV_STR_REAL(id,reg_ID) CNV_STR_REAL(XX,x) CNV_STR_REAL(YY,y) CNV_STR_REAL(ZZ,z) CNV_STR_REAL(WW,w) CNV_STR_REAL(PP,p) CNV_STR_REAL(RR,r) CNV_STR_CONF('nut',con,status) temp_pos = POS(x,y,z,w,p,r,con)--POS(XX,YY,ZZ,WW,PP,RR,con) WRITE('--->',CR) WRITE(temp_pos,CR) IF status =0 THEN --WRITE('Openign Foile...',CR) OPEN FILE fFileHandle ('RW', chOutFile) WRITE fFileHandle ('OK',CR) WRITE('L----',CR) LOCK_GROUP(1,status) SET_POS_REG(TRUNC(reg_ID),temp_pos,status,1) WRITE('L----',status,CR) CALL_PROG('HTTP_TEST', prog_index) --wait for DOUT[101] WRITE('Closing File...',CR) UNLOCK_GROUP(1,status) CLOSE FILE fFileHandle ENDIF END Mov_HTTP
-
I'm afraid I won't be much help with Karel. I never had a use for it.
Maybe someone else can help you with that. Otherwise, if you want to go the TP only route I'd be happy to help.
-
I'm afraid I won't be much help with Karel. I never had a use for it.
Maybe someone else can help you with that. Otherwise, if you want to go the TP only route I'd be happy to help.
Thank you HawkME and no problem.
-
I ran a test. I built the Karel example from Section B.5 that you mentioned. I ran it from the Teach Pendant and everything worked fine.
Then I tried to run it through the browser and I got the "Cannot lock motion group" on the Teach Pendant display.
There must be a restriction on running motion programs from a browser.
-
I ran a test. I built the Karel example from Section B.5 that you mentioned. I ran it from the Teach Pendant and everything worked fine.
Then I tried to run it through the browser and I got the "Cannot lock motion group" on the Teach Pendant display.
There must be a restriction on running motion programs from a browser.
Thank you HawkME
I thins BG logic will suffice as you mentioned