Posts by panic mode

    you need to declare variable before you can use it. there are different places where variables can be declared and this will determine scope - local or global. if you want convenience of monitoring variable and being able to access it from other programs, you will want it to be global.

    simplest way to make variable global is to declare it in $config.dat, preferably under USER section.
    the other easy way is to make own data list:
    - login as expert
    - create a new program such as myGlobals, note: make sure to select Expert module (creates SRC and DAT files)
    - delete SRC file as it is no longer needed (this way you can open it later on when not Expert)
    - declare your variables (unlike declaring them in $config.dat, here you need to use keyword GLOBAL)


    DECL GLOBAL BOOL myFlag = false
    DECL GLOBAL BOOL cylExtended = false
    DECL GLOBAL INT myCounter = 0
    DECL GLOBAL REAL offeset = 50.0 ; mm

    you may also omit initialization ( "= value" part) if you like. this way value will not be retained when you reboot. if initialized here, then value will be stored and you can check it out later on. you can still choose if you want to clear or initialize them on program start (normally in the INI section of a program).

    actually I made mistake, I replied without reading the question (sorry, it was late...)
    what I described was using analog input to control robot speed.
    what you ask is how to use robot to control speed of a VFD.
    this means you would want Wago analog output so instead of ANIN, it will be ANOUT
    and you have to send value to ANOUT1 for example.

    if you want to use analog signal to control the robot speed, you need Wago analog input card.

    your images (although blurry) show that switches 1,3 and 8 are on Wago bus coupler.
    this means the coupler is configured as device node 5 communicating at 500kbps.

    therefore in C:\KRC\ROBOTER\INIT\DEVNET.INI you need


    and in C:\KRC\ROBOTER\INIT\IOSYS.INI you need to enable MFC DeviceNet driver by removing semicolon in front of DEVNET=2,dnInit,dn2drv.o

    then scroll down and under

    enter something like this (assuming it is a 4ch. analog input card):


    then in SPS.SUB inside LOOP/ENDLOOP map scaled analog input to $OV_PRO, something like

    of course, first thing is to get Wago wired up correctly and powered up.

    for short cycle times (spot welding, handling etc.) you could just use:

    but this will not be suitable for applications as the "quick" stop may be just too long. also perhaps you may not want to move robot away in the middle of the cycle. in such cases interrupt is a better idea.

    this means inserting interrupt declaration in your main program:

    interrupt global decl 5 when $in[122] do quick_brake()
    interrupt on 5

    then create a small program (no DAT file needed):

    DEF quick_brake()
    brake ; this line initiates stop of the robot
    wait for not $in[122] ; here we stay until $in[122] goes off
    halt ; still wait, until new start is issued

    but this is just to give you an idea. it goes without saying that you are on your own and any idea need to be tested thoroughly before being considered as a possible solution.

    sorry I don't have details for that article number. also using full text search for entire Siemens part number will be a dead end - one must get the motor catalog and decode the part number character by character. I used to work with Siemens that was years ago and catalogs are recycled. Siemens offers them for download but the files are large.


    "The motors also have internal gearing, declared in $RAT_MOT_ENC. If you've swapped motors around, that would be an additional factor. KUKA motors generally have a RAT_MOT_ENC of 1/3 or 1/4"

    there is no internal gearing (inside motor). this is motor/encoder position ratio which is number of poles of the motor (because for Kuka, motor and resolver must have same number of poles). in other words, on a 4 pole motor, 90deg motor shaft rotation produces full period sin/cos (2*pi) on resolver. kuka motors are actually built by Siemens. name plate of the motor contains both Siemens (1FK...) and Kuka part numbers (article number xx-xxx-xxx). you can download datasheet from Siemens website and confirm number of poles if you like.

    one motor pole (one period of sin/cos on resolver) is 4096 counts (12-bit) on a KRC2. for comparison, on a KRC4 it is 16-bit (65536 counts).
    so if we have a 3-pole motor, then one full motor revolution is 3x4096=12288 counts.
    and if we have a 4-pole motor, then one full motor revolution is 4x4096=16384 counts.