move my robot whit a .nc file
korum
✭
in RobotStudio
hi i need to use my robot whit a .nc file to paint a piece of iron.
i can open my .nc file but i dont know of to get the x and the y coordinates
ty
i can open my .nc file but i dont know of to get the x and the y coordinates
ty
0
Comments
-
Hello Korum,Basically what you need is to search for the strings you want in the file.It's more a computer programming job than a robot programming job.Here is an example of how it can be done with a CNC file named Dragon.nc webwiz/530/Dragon.zipMODULE MainModule
PERS tooldata Crayon:=[TRUE,[[146.384,1.05238,33.398],[0.0155533,0.708021,0.00727686,0.705982]],[1.6,[12.5,0,-50.5],[1,0,0,0],0,0,0.118]];CONST robtarget Origine_Dragon:=[[235,380,-0.7],[0.000532811,0.999984,0.00545403,-0.000924032],[0,0,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
VAR iodev VariableIodev;
VAR string StringLue := "";
VAR bool ConversionOK := FALSE;
VAR num X := 0;
VAR num Y := 0;
PROC main()
Open "HOME"File:="Dragon.nc", VariableIodevRead;
! Open "/bd0/" File:="Dragon.nc", VariableIodev Read; !IF ON ROBOT'S USB FILE
! Open "C:" File:="Dragon.nc", VariableIodevRead; !IF ON DISC C: OF VC
!Search and discard until F200. Found
WHILE StringLue <> "F200." DO
StringLue := ReadStr(VariableIodevdelim:=" 9"RemoveCRDiscardHeaders);
ENDWHILE
!Search and process until G0 found
WHILE StringLue <> "G0" DO
!Lookup for first X thus eliminating Nxxx
StringLue := ReadStr(VariableIodevdelim:="X"RemoveCRDiscardHeaders);
!Lookup for Y, getting the numbers between X and YStringLue := ReadStr(VariableIodevdelim:="Y"RemoveCRDiscardHeaders);
ConversionOk:=StrToVal(StringLue,X);!Lookup for LineFeed, getting the numbers between Y and the EOL.
StringLue := ReadStr(VariableIodevRemoveCR);
ConversionOk:=StrToVal(StringLue,Y);!Make it's move with the X and Y Offset + a 25.4 Scalling
MoveJ Offs(Origine_Dragon,25.4*X,25.4*Y,0), v50, Z1, Crayon;ENDWHILE
Close VariableIodev;
ENDPROC
ENDMODULEHope it helps,JetJetman2009-05-12 19:49:15Jet,
Janin Delorme, Ing. (P.Eng)0 -
Fine Exambel Jetman but remember G02 G03 G12 and G13. (Full and Half circles)The exambel only handels lineary movement not CirclesAnother tink i saw is that the movement is A'made during the read of file.I have tried with a program i made with reading from file during movement and is courses stop like fine points. I changed the program to read all target beforre movement.In painting it will be bad with fien pointsBR KlausBest Regards
Klaus Soenderhegn
www.cadalysator.dk0 -
Hello Klaus,The thing is I know nothing about CNC codes!I just opened a CNC file and saw the X and Y coordinates and started from there.My program was reading the file during movment it was not stopping though, it went real smooth. Were you going at speed higher than V50 or doing large movments?. I was using V50 and Z0.JetJet,
Janin Delorme, Ing. (P.Eng)0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 786 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings