Beginner questions

  • Hi all,


    Been programming robots, PLC and CNC since 1998, but somehow I managed to never making a complete project with FANUC since then.

    I've only finished a program for a customer whose roboticist left the company and all the setup was done.


    I've seen/know how to define TCPs and User frames.

    I've seen how to call routines stored in different files.


    But I have a few questions:

    1. Let's say I create the PROG_1 TP program, how can I define that this is the MAIN routine (the program entry point for that robot)? (like Main is in ABB robots).
    2. Is it possible to call a function passing parameters to it? and can a function return a value? (could you tell me where could I get information about it?) (or pasting a small example).
    3. Of course I will need inputs and outputs. I know there are the DI[x] and DO[x]... and how to use them, but... How do I tell the system how many of them exist? I mean, seen the maintenance manual, but not seen how to define the signals available... Are they simply present when IO cards are connected? and what happens when you connect IOs from a fieldbus?
    4. When I had to finish that cell in the past, they did not explained anything to me and I ended up using a USB stick to send the programs to the robot controller... Is there any way I can connect my laptop to it using an ethernet cable? Is there any manual that explains where should I connect (port), the IP addresses needed, if it must be an FTP connection... ?


    Thank you very much in advance!

  • Place your Ad here!
  • Let's say I create the PROG_1 TP program, how can I define that this is the MAIN routine (the program entry point for that robot)? (like Main is in ABB robots).

    It depends on the mode (local or remote) and the program selection method you are using. Check this post for a very nice explanation about the methods and how they work.

    Is it possible to call a function passing parameters to it? and can a function return a value? (could you tell me where could I get information about it?) (or pasting a small example).

    It is possible with KAREL but not with TP. In TP you can pass arguments to a program. But in TP there is nothing like a function with a return value available.

    Of course I will need inputs and outputs. I know there are the DI[x] and DO[x]... and how to use them, but... How do I tell the system how many of them exist? I mean, seen the maintenance manual, but not seen how to define the signals available... Are they simply present when IO cards are connected? and what happens when you connect IOs from a fieldbus?

    You can change the maximum number of inputs and outputs in a controlled start under MENU > -- NEXT -- > PROGRAM SETUP. After that, you can map the signals to the correct Rack, Slot and Start depending on your fieldbus protocol, local IOs or whatever your system is using.

    When I had to finish that cell in the past, they did not explained anything to me and I ended up using a USB stick to send the programs to the robot controller... Is there any way I can connect my laptop to it using an ethernet cable? Is there any manual that explains where should I connect (port), the IP addresses needed, if it must be an FTP connection... ?

    FTP is one of the easiest ways to connect to the robot controller. Check this thread for the details on how to configure the ethernet port as well as the FTP client.

  • 1. How to make a program your "Main" program: this is done by the Program Select setup. Menu>Setup>Prog Select. Easiest way to set set the Program Select method to "other" then press detail and select the name of your main program.


    2. Passing parameters: Yes, you can pass parameters, they come through as Argument Registers. There are no return values though. To pass an argument you do the following:

    : CALL PROGRAM_XYZ(1, 2.0, 'hello world', R[4]);


    Then in PROGRAM_XYZ you can reference those 4 example arguments as AR[1] - AR[4]. (Fanuc starts counting at 1, not 0). Since there is no return values you have to use global scope, like a regular Register.


    3. How to configure IO: There is an auto-configure setting by default that may work, but to actually configure IO you go to the DI or DO menu, then press "Config". You then set the correct Rack/Slot/Start points. Reference the manual if needed.


    4. How to send programs: You either need to send the already compiled *.tp version of the file or have purchased and installed the "Ascii upload option" which allows you to send the *.ls text files, and it will automatically convert them to .tp for you. You can send files via FTP. Typically no setup is required beyond setting the IP address in Menu>Setup>Host Comm>TCP/IP. There are usually 2 ethernet ports on newer robots. The top one is Port 1 and the bottom one is Port 2. Unless you have a reason do otherwise to I would just use port 1. You can plug your laptop in or use a switch and then use any FTP client to send/receive files.

    • Helpful

    Ok lets see.

    1) Press MENU > SETUP and choose prog select option. From here you can customize several things concerning how the robot will start and what to check during production (AUTO) mode. The first option is your program select mode, press F4 CHOICE choose OTHER option, enter, press F3 DETAIL and manually modify variable $shell_wrk.$cust_name by pressing CHOICE and choosing PROG_1 TP from the list. You can also configure several safety checks before a program starts such us if the robot is @ home pos before start.

    2) Yes you can. Create your desired function by using Argument Registers for your parameters. Here is a sample function that initializes a PR for me (notice the indirect addressing I use to assign the parameter):

    PR_INIT.TP:

    R[80]=AR[1]

    PR[R[80]]=LPOS

    PR[R[80],1]=0

    PR[R[80],2]=0

    PR[R[80],3]=0

    PR[R[80],4]=0

    PR[R[80],5]=0

    PR[R[80],6]=0


    CALL PR_INIT(55)


    3) This is called standard I/O assignment and it is performed automatically. Depending on the communication protocol you have selected for your project (Profibus, ethernetIP, modbusTCP etc) and provided you have set up the connection properly, you configure the DI/DO based on the rack and slot number of the logical signal with the physical signal (the signal from the connected device). You map the logical signals (DI/DO) to the physical ones. If for example you have the EthernetIP option and you have already configured the connection, you can go to MENU > I/O > Digital press F2 > CONFIG and map the logical signals to their physical locations. Here The rack indicates the kind of I/O module installed on your system and slot indicates numbers of I/O module which compose the rack. For ethernetIP rack is always 89, for ModbusTCP for example rack number is 96, and the slot is 1 because i do not use adittional I/O modules. So DI[1-80] is located on rack 89(EthernetIP) slot 1 starting from physical address 1. DI[81-272] again on rack 89 slot 1 starting from 81 etc etc.

    4) For all the above options you need to have EthernetIP optional function on the robot. EthernetIP includes FTP, Advanced Internet Connectivity and Customization, and Socket Messaging. If you do have it, you need to configure host comm properties through MENU > SETUP > host comm. There you configure the robot's TCP/IP params (be carefull as to configure the port you actually use), IP, subnet, router, pretty easy stuff, After that, you can load your TP programs to your robot (provided it is on the same LAN network your PC or LAPTOP is connected to) using Roboguide or the robot's FTP. You could even use external FTPs to save or backup your robot programs daily, or access and download files and programs from other robots' FTPs provided they are connected to the same network of course.

    EDIT: you also need to Ascii Upload option too as HawkMe says, I didnt mention it as Ascii upload comes as standard in Europe. But then again you also need roboguide too, who writes .TP programs in notepad nowdays ? :grinning_squinting_face:

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now

Advertising from our partners