I'm using a cannon vison system on this particular Fanuc robot (V8.3), the vision information is stored in registers. I need a way to get the value out of them and store it as a txt file or something similar so that I can review failures and make adjustments accordingly. I have task ID and grasp ID that I need exported, there are 14 tasks each task has up to 3 grasp ids. That post into R64 Task id and R68 Grasp id. Looking for a simpler way than expanding my registers and making a counter for each task and grasp combo. Suggestions are appreciated! Edit I need something that i can execute conditionally.
Looking for a way to export the value of registers as a txt file
-
C_hiney -
November 19, 2021 at 11:57 AM -
Thread is Unresolved
-
- Go to Best Answer
-
I need a way to get the value out of them and store it as a txt file or something similar so that I can review failures and make adjustments accordingly.
You could pull the "numreg.va" file off of the robot using FTP.
For info on FTP, check out this link OneRobotics-FTP.
-
Is there a way to write that into bg logic so that conditionally when a pick fails to initiate a transfer to say my desktop thats on the same network? I probably should have stated that i want to execute it conditionally when a failure occurs.
-
You can write a Karel program that writes the registers into a text file. This Karel program you can call in case of an error.
-
Do you have Karel on the robot? You can set it up to write files to a FTP server on your network. I've done something similar.
-
Karel is available on this robot. I Haven't written a karel program I have made minor directive modifications to source code. Could someone provide a base script?
-
- Best Answer
PROGRAM writeReg
%COMMENT ='WriteRegCheck BY NC'
%STACKSIZE = 400
%NOLOCKGROUP
%ALPHABETIZE
%NOPAUSE=ERROR+COMMAND+TPENABLE
%INCLUDE KLIOTYPS
VAR
aux : INTEGER
file_var : FILE
STATUS_C1:INTEGER --communication status
ComFile_C:FILE -- FOR CLIENT COMMUNICATION
STATUS:INTEGER --communication status
R_FLG:BOOLEAN
register_7:INTEGER
register_2:INTEGER
R_VAL:REAL
BEGIN
OPEN FILE ComFile_C ('RW','UD1:\register.dt')
STATUS_C1 = IO_STATUS(ComFile_C)
IF STATUS_C1 = 0 THEN
-- reads the value or register 7
GET_REG(7, r_flg, register_7, r_val, status)
-- reads the value or register 2
GET_REG(2, r_flg, register_2, r_val, status)
--write the value of register 7
WRITE ComFile_C(register_7)
--write "enter"
WRITE ComFile_C(CR)
--write the value of register 2
WRITE ComFile_C(register_2)
CLOSE FILE ComFile_C
ELSE
WRITE('ERROR Opening FILE',CR)
ENDIF
END writeReg
-
Nice example.
You can setup client tags to an external FTP server, and then replace the UD1: to C1:. That will write the file to the FTP server setup in the client tag.
-
PROGRAM writeReg
%COMMENT ='WriteRegCheck BY NC'
%STACKSIZE = 400
%NOLOCKGROUP
%ALPHABETIZE
%NOPAUSE=ERROR+COMMAND+TPENABLE
%INCLUDE KLIOTYPS
VAR
aux : INTEGER
file_var : FILE
STATUS_C1:INTEGER --communication status
ComFile_C:FILE -- FOR CLIENT COMMUNICATION
STATUS:INTEGER --communication status
R_FLG:BOOLEAN
register_7:INTEGER
register_2:INTEGER
R_VAL:REAL
BEGIN
OPEN FILE ComFile_C ('RW','UD1:\register.dt')
STATUS_C1 = IO_STATUS(ComFile_C)
IF STATUS_C1 = 0 THEN
-- reads the value or register 7
GET_REG(7, r_flg, register_7, r_val, status)
-- reads the value or register 2
GET_REG(2, r_flg, register_2, r_val, status)
--write the value of register 7
WRITE ComFile_C(register_7)
--write "enter"
WRITE ComFile_C(CR)
--write the value of register 2
WRITE ComFile_C(register_2)
CLOSE FILE ComFile_C
ELSE
WRITE('ERROR Opening FILE',CR)
ENDIF
END writeReg
hello
I have a question. Can I open any file in this format ? For example I want to open a .pcd file and change something
Thanks for your reply’s
-
hello
I have a question. Can I open any file in this format ? For example I want to open a .pcd file and change something
Thanks for your reply’sYes. You can open any file with that command.
-
Hello
Actually I m new on the karel. But i m using Fanuc robots for 3 years.
I have a problem on the Fanuc vision system.
I want to reach camera raw data (I m using 3DV1600 camera) and manipulate on karel or TP program. I have .PCD files but i can not reach raw data on Karel. Because it is binary format and I can not change ascii format.
Another question: Can i read and manipulate image register on Karel ?
Thanks a lot…