Did you create a robot config?
PC and FANUC robot TCP/IP Communication
-
mahboobelahi93 -
September 24, 2021 at 4:02 PM -
Thread is Unresolved
-
-
Did you create a robot config?
Hi Nation,
Thanks for your response.
No. and I do not know why "robot.ini" file is missing.
I want to know about the following:
Does the FANUC socket server support more than one socket client?
I am sending positional data to the robot as a string from the socket client in the following format:
PR_id, X, Y, Z, W, P, R
(20,137.8,70.4,79.8,50.3,-15.0,-180.5,0.0)
how to convert this string to XYZWPR. The converted value goes to PR[20] and the robot will move to that position.
Is there an easier way to do this?
-
I'm no expert in this area, but as I understand it, for the command-line tools to work, you need to have built a virtual controller in RoboGuide that had the same software version, and all of the options, as the robot you're trying to compile code to.
I encountered the same kind of issue, when I had only built a basic virtual controller with the right core version, but without adding the Fanuc options that the real robot had. The command-line tools would compile and decompile "generic" code, but would fail on any line that was tied to a specific Fanuc option.
Hi SkyFire,
Thanks for your reply,
Actually my roboguide trial license has expired, this could be the reason for not having successful compilation. I do have a work cell with v8.30 in roboguide but the license has expired.
-
I am sending positional data to the robot as a string from the socket client in the following format:
PR_id, X, Y, Z, W, P, R
(20,137.8,70.4,79.8,50.3,-15.0,-180.5,0.0)
Hi all,
I have written a simple KAREL prog to convert xyzwpr data received through HTTP request like:
http://192.168.1.1/KAREL/Mov_HTTP?id=100&x=214.384&y=-282.970&z=170.502&w=179.937&p=.712&r=89.751
after compilation of the source file, I am getting the following error
And when I run p-code file I get TP warning can not lock motion group, how to resolve this error/issue
Here is the KAREL code:
Code
Display MorePROGRAM Mov_HTTP %ENVIRONMENT REGOPE %ENVIRONMENT STRNG %COMMENT = 'GET POS_HTPP' %NOLOCKGROUP %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 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) WRITE(reg_ID,x,y,z,w,p,r,CR) temp_pos.x = x--CNV_STR_REAL(x,XX) temp_pos.y = y--CNV_STR_REAL(y,YY) temp_pos.z = z--CNV_STR_REAL(z,ZZ) temp_pos.w = w--CNV_STR_REAL(w,WW) temp_pos.p = p--CNV_STR_REAL(p,PP) temp_pos.r = r--CNV_STR_REAL(r,RR) --CNV_STR_CONF('n',con,status) --temp_pos = POS(XX,YY,ZZ,WW,PP,RR,con) WRITE('--->',temp_pos,CR) SET_POS_REG(TRUNC(reg_ID),temp_pos,status,1) CALL_PROG('HTTP_test', prog_index) WRITE('Openign Foile...',CR) OPEN FILE fFileHandle ('RW', chOutFile) WRITE fFileHandle ('OK',CR) wait for DOUT[101] CLOSE FILE fFileHandle END Mov_HTTP
-
Actually my roboguide trial license has expired, this could be the reason for not having successful compilation. I do have a work cell with v8.30 in roboguide but the license has expired.
Even if you have a virtual controller built with the correct core software version, if that virtual controller lacks the options (say, iRVision) that the real robot has, this problem is liable to occur.
-
Hi all,
I have written a simple KAREL prog to convert xyzwpr data received through HTTP request like:
http://192.168.1.1/KAREL/Mov_HTTP?id=100&x=214.384&y=-282.970&z=170.502&w=179.937&p=.712&r=89.751
after compilation of the source file, I am getting the following error
And when I run p-code file I get TP warning can not lock motion group, how to resolve this error/issue
Here is the KAREL code:
Code
Display MorePROGRAM Mov_HTTP %ENVIRONMENT REGOPE %ENVIRONMENT STRNG %COMMENT = 'GET POS_HTPP' %NOLOCKGROUP %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 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) WRITE(reg_ID,x,y,z,w,p,r,CR) temp_pos.x = x--CNV_STR_REAL(x,XX) temp_pos.y = y--CNV_STR_REAL(y,YY) temp_pos.z = z--CNV_STR_REAL(z,ZZ) temp_pos.w = w--CNV_STR_REAL(w,WW) temp_pos.p = p--CNV_STR_REAL(p,PP) temp_pos.r = r--CNV_STR_REAL(r,RR) --CNV_STR_CONF('n',con,status) --temp_pos = POS(XX,YY,ZZ,WW,PP,RR,con) WRITE('--->',temp_pos,CR) SET_POS_REG(TRUNC(reg_ID),temp_pos,status,1) CALL_PROG('HTTP_test', prog_index) WRITE('Openign Foile...',CR) OPEN FILE fFileHandle ('RW', chOutFile) WRITE fFileHandle ('OK',CR) wait for DOUT[101] CLOSE FILE fFileHandle END Mov_HTTP
You get this kind of error, if your KAREL program, which you are compiling, is still running or it is paused.
You can also try deleting Mov_HTTP.VR from MD.
-
Hi all,
i have established socket communication between the robot's SM server and python App(SM client) but i am having trouble in handling data chunks coming from the Socket server. sample chunk:
Code
Display MoreWRITE file_var('uframe_Data ') WRITE file_var(uframe ,'--' ) WRITE file_var('camframe_Data ') WRITE file_var(camframe ,'--') WRITE file_var('utool_Data ') WRITE file_var(utool ,'--') WRITE file_var('Home_POS ') WRITE file_var(lpos ,'--' ,CR) WRITE file_var( 'Current-POS', curr_X::9::2, ',', curr_Y::9::2, ',', curr_Z::9::2, ',', curr_W::9::2, ',', curr_P::9::2, ',', curr_R::9::2,'--' ) DELAY 1000
'--' will use as a delimiter that is used by the python app to split incoming data.I got the following list in the python application. The remaining data is missing.
['uframe_Data 411.096 215.795 -272.131\n .713 .059 -89.751\nN U T, 0, 0, 0', 'camframe_Data 332.167 77.494 -273.281\n .681 -.038 -89.856\nN U T, 0, 0, 0', 'utool_Data 0.000 0.000 115.000\n 0.000 0.000 0.000\nN']
What is the correct way to receive all data from KAREL program that is responsible for handling Socket communication?
i also tried following write commands
CodeDELAY 500 WRITE file_var('uframe_Data ') WRITE file_var(uframe ,CR) WRITE file_var('utool_Data ') WRITE file_var(utool ,CR) WRITE file_var('Home_POS ') WRITE file_var(lpos ,CR) DELAY 500
Whit these write commands received data include a little portion of previous as well next data segment.
I have the following two questions regarding the robot Socket server:
1- how many clients can a robot server handle?
2- how to check client dis-connections correctly? Can MSG_DISC() will work for it?, i have no success with handling client disconnections.
i want when client disconnects then server stops sending data and wait for a reconnects.
-
Here is the received data from the robot Socket server.
I have not set any file attribute.
writing data to file like :
Code
Display MoreWRITE file_var('camera_frame') WRITE file_var(camframe ,CR) WRITE file_var('uframe_Data') WRITE file_var(uframe ,CR) WRITE file_var('utool_Data') WRITE file_var(utool ,CR) WRITE file_var('Home_POS') WRITE file_var(lpos ,CR) WRITE file_var( 'Current-POS', curr_X::9::2, ',', curr_Y::9::2, ',', curr_Z::9::2, ',', curr_W::9::2, ',', curr_P::9::2, ',', curr_R::9::2, CR) DELAY 1000
Waiting for response.
Thanks a lot.
-
The first suggestion I have to is run WireShark on the computer running the python app, and examine the raw packets.
-
Even with a trial version of roboguide running out of date you can compile Karel and TPE. For Karel compilation you don't need a virtual robot created. This is only for TPE.
The robot.ini (Project folder) has to be set correctly and the win- system paths have to be OK.The first message was something about missing 'ev'. I'm not familiar with vision, but you should check if the file is present in your WinOlpc / Versions / support folder.
Here is a robot.ini of mine. Fit it to your needs (Robot, Suppport and Output only for TPE)...
[WinOLPC_Util]
Robot=\D\VirtualRobots\V930\Robot_1
Version=V9.30-1
Path=C:\Program Files (x86)\FANUC\WinOLPC\Versions\V930-1\bin
Support=D:\VirtualRobots\V930\Robot_1\support
Output=D:\VirtualRobots\V930\Robot_1\output
-
Even with a trial version of roboguide running out of date you can compile Karel and TPE. For Karel compilation you don't need a virtual robot created. This is only for TPE.
The robot.ini (Project folder) has to be set correctly and the win- system paths have to be OK.The first message was something about missing 'ev'. I'm not familiar with vision, but you should check if the file is present in your WinOlpc / Versions / support folder.
Here is a robot.ini of mine. Fit it to your needs (Robot, Suppport and Output only for TPE)...
[WinOLPC_Util]
Robot=\D\VirtualRobots\V930\Robot_1
Version=V9.30-1
Path=C:\Program Files (x86)\FANUC\WinOLPC\Versions\V930-1\bin
Support=D:\VirtualRobots\V930\Robot_1\support
Output=D:\VirtualRobots\V930\Robot_1\output
Thank you 1Cllif
-
The first suggestion I have to is run WireShark on the computer running the python app, and examine the raw packets.
Hi SkyFire,
I modified my python script like this:
JSON_DATA[data[0]] =dict([("XYZ",[float(i) for i in data[1:4]]),
("WPR",[float(i) for i in data[4:7]]),
("CONFIG","NUT000")])now my JSON data is ok but in the console, there is still data overlap. I have checked data packets in WireShark and packet bytes are random ranging between 70-90 bytes.
in KAREL i am accessing Frames data like:
GET_VAR(entry, '*SYSTEM*', '$MNUFRAME[1,9]', camframe, STATUS)
WRITE file_var('camera_frame') --12 bytes (not sure)
WRITE file_var(camframe ,CR) --56bytes
--- writing other frames data follows same process
As camfram is a POSITION data so only 56bytes +12bytes only be written and the remaining bytes of write buffer must be handled by Carriage return but for me somehow it is not working.
-
Hi, have you established communication using above method? please provide more details
Thanks
-