1. Home
    1. Dashboard
    2. Search
  2. Forum
    1. Unresolved Threads
    2. Members
      1. Recent Activities
      2. Users Online
      3. Team Members
      4. Search Members
      5. Trophys
  3. Articles
  4. Blog
  5. Videos
  6. Jobs
  7. Shop
    1. Orders
  • Login or register
  • Search
Everywhere
  • Everywhere
  • Articles
  • Pages
  • Forum
  • Blog Articles
  • Products
  • More Options
  1. Robotforum - Support and discussion community for industrial robots and cobots
  2. Members
  3. Seekdawg33

Posts by Seekdawg33

  • Read Position Points from CSV File into Roboguide

    • Seekdawg33
    • February 22, 2022 at 6:49 PM

    This is amazing and did exactly what I was looking for. Thanks so much, incredible.

    Quote from Nation

    While you can do this in Karel, unless you need to do this on the fly on a real controller, I wouldn't recommend it. I just went through this, and it is not trivial.

    You can use Targets in roboguide to import points from a CSV file, and then generate a path from them, I find them pretty cumbersome to work with.

    EnergyAddict's route is the I typically take. My customers will usually provide me with a series of points they want to measure as an excel file, and I use Excel's vba engine to generate a .ls file I can then import into the robot.


    Here is a bit of VBA code to get you started:

    VBA
    Rem Option Explicit
    Sub Fanuc_ls_Output()
    progName = InputBox("Input the name of the program. Omit the .ls extenstion.")
    If progName = "" Then Exit Sub
    
    
    myFile = ActiveWorkbook.Path & "\" & progName & ".ls"
    Open myFile For Output As #1
    
    
    Header = _
    "/PROG " & UCase(progName) & vbCrLf & _
    "/ATTR" & vbCrLf & _
    "OWNER = MNEDITOR;" & vbCrLf & _
    "COMMENT = ""Insert Comment"";" & vbCrLf & _
    "PROG_SIZE = 7326;" & vbCrLf & _
    "CREATE = DATE 17-11-17 TIME 07:43:46;" & vbCrLf & _
    "MODIFIED = DATE 17-11-17 TIME 07:43:46;" & vbCrLf & _
    "FILE_NAME = ;" & vbCrLf & _
    "VERSION = 0;" & vbCrLf & _
    "LINE_COUNT = 267;" & vbCrLf & _
    "MEMORY_SIZE = 8102;" & vbCrLf & _
    "PROTECT = READ_WRITE;" & vbCrLf & _
    "TCD: STACK_SIZE = 0," & vbCrLf & _
    " TASK_PRIORITY = 50," & vbCrLf & _
    " TIME_SLICE = 0," & vbCrLf
    Header = Header & _
    " BUSY_LAMP_OFF = 0," & vbCrLf & _
    " ABORT_REQUEST = 0," & vbCrLf & _
    " PAUSE_REQUEST = 0;" & vbCrLf & _
    "DEFAULT_GROUP = 1,*,*,*,*;" & vbCrLf & _
    "CONTROL_CODE = 00000000 00000000;" & vbCrLf & _
    "/APPL" & vbCrLf & _
    "/MN" & vbCrLf
    Header = Header & _
    " : ! ****************************** ;" & vbCrLf & _
    " : ! Robot: XX ;" & vbCrLf & _
    " : ! ****************************** ;" & vbCrLf & _
    " : ;" & vbCrLf
    Header = Header & _
    " : UTOOL_NUM=1 ;" & vbCrLf & _
    " : UFRAME_NUM=2 ;" & vbCrLf & _
    " : ;"
    Print #1, Header
    
    
    Rem Next definitions should all be the same row length.
    Set pointName = Range("A8:A300")
    Set pointXYZ = Range("B8:D300")
    
    
    codeTP = ""
    codePos = ""
    For i = 1 To pointName.Rows.Count
    
    
    Rem Ignore the line if it is hidden by the smart filter.
    rowHidden = cellIsOnHiddenRow(pointName.Cells(i, 1))
    If Not rowHidden Then
    
    
    Rem Exit early if we reach the end.
    If pointName.Cells(i, 1).Value = "" Then Exit For
    
    
    codeTP = codeTP & _
    " :J P[" & i & "] 100% FINE ;" & vbCrLf & _
    " : ;" & vbCrLf
    
    
    codePos = codePos & _
    "P[" & i & ":""" & pointName.Cells(i, 1).Value & """]{" & vbCrLf & _
    " GP1:" & vbCrLf & _
    vbTab & "UF : 2, UT : 1, CONFIG : 'N U T, 0, 0, 0'," & vbCrLf & _
    vbTab & "X = " & Format(((pointXYZ.Cells(i, 1).Value)), "###0.000") & " mm, Y = " & Format((pointXYZ.Cells(i, 2).Value), "###0.000") & " mm, Z = " & Format((pointXYZ.Cells(i, 3).Value), "###0.000") & " mm," & vbCrLf & _
    vbTab & "W = -90.000 deg, P = 90.000 deg, R = 0.000 deg" & vbCrLf & _
    "};" & vbCrLf
    End If
    Next
    
    
    Print #1, codeTP
    Print #1, "/POS"
    Print #1, codePos
    Print #1, "/END"
    Close #1
    
    
    MsgBox ("File Created at:" & vbCrLf & myFile)
    End Sub
    
    
    ' Is the row which referenceCell is on hidden by a filter?
    Public Function cellIsOnHiddenRow(referenceCell As Range) As Boolean
    
    
    Dim referenceSheet As Worksheet
    Dim rowNumber As Long
    
    
    Set referenceSheet = referenceCell.Parent
    rowNumber = referenceCell.Row
    
    
    cellIsOnHiddenRow = referenceSheet.Rows(rowNumber).EntireRow.Hidden
    
    
    End Function
    Display More
  • Read Position Points from CSV File into Roboguide

    • Seekdawg33
    • February 22, 2022 at 5:18 PM

    Thanks! But with 100 teach points, this method is EXTREMELY manual. I wish there was an easy way to just have those x,y,z coordinates from my excel file be put into roboguide touch points.

    Quote from EnergyAddict

    Without Karel, I think you may have to do a bit of manual work behind getting things set up.

    Try the following to get an understanding of ASCII loading in Roboguide, and see if you could use something like this for your end goal:

    • In roboguide, create a simple program with a couple of points in it.
    • On the left hand side of your screen in the tree, under your robot programs; Right click the program you just created, and select "Save" -> "Text (.LS)"
    • Save the file to some location, such as your desktop
    • open the file in notepad (or some other text editor)
    • At the bottom of the program, you will see how point data is stored, try editing one of the points and save the file.
    • Back in Roboguide, in the top tool bar, select "Teach"-> "Load Program" -> and select the '.LS' file that you just edited.
    • Take a look at your TP program and note the changes.

    Perhaps some variation of this process could help you?

  • Read Position Points from CSV File into Roboguide

    • Seekdawg33
    • February 21, 2022 at 8:44 PM

    I am a relatively new programmer and have little exposure and experience with Fanuc, robots, and roboguide as a whole. I am learning as much as a can about programming in roboguide but am struggling figuring out how to convert a CSV file in a .ls file for position points in a program. Basically, I want to take a CSV file wiht x,y,z coordiantes (tool point locations), convert that csv file into a roboguide useable .ls file, then import that .ls into roboguide and into a program so that my robot will have those position points for, lets say welding or dispensing around a part in those coordinate paths. If someone could please help me with this that would be awesome, or even just simply helping me convert the csv into a .ls would be a huge help.

    NOTE: I have never used, heard of, or programmed in KAREL. I would prefer a way to convert without using this method as I am completely unfamilar with it. If KAREL is the ONLY way to do this, then please provide an explanation for "getting started" with KAREL, i.e what and where to download it, setup, and exporting results into a .ls file.

    Thank you so much.

Advertising from our partners

IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Advertise in Robotics
Advertise in Robotics
  1. Privacy Policy
  2. Legal Notice
Powered by WoltLab Suite™
As a registered Member:
* You will see no Google advertising
* You can translate posts into your local language
* You can ask questions or help the community with your knowledge
* You can thank the authors for their help
* You can receive notifications of replies or new topics on request
* We do not sell your data - we promise

JOIN OUR GREAT ROBOTICS COMMUNITY.
Don’t have an account yet? Register yourself now and be a part of our community!
Register Yourself Lost Password
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on Google Play
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on the App Store
Download