Posts by ashwinmudigonda

    I have an MH12 robot on a FS100 controller. I am trying to use a gripper to pick parts and would like to use the shock setting as a sensor to help me stop an IMOV motion.


    I have configured the shock sensitivity settings and call it with the SHCKSET command in the job. This is working as expected. My question is how do I capture the


    ALARM 4315
    COLLISION DETECT


    alarm and set a bit so that I can use it with an IMOV.

    I figured that much through the manuals, but what do I add to the ladder?


    Find the relay that matches teh input and connect it straight to the relay that matches the output?


    I tried to map input 17 to output 17.


    I added a rung and set the relay on the left to be 00030 and the one on the right to be 10030, but the ladder won't compile.


    I also tried to set the relay on the right to be an OUT.


    How would the program look like?


    STR #00030
    OUT #10030


    I tried doing the above in the mnemonic editing window, and could not get it to compile

    I have a vision system that is communicating to the teach pendant the pose to go to via sockets. I pushed the (x,y,z,w,p,r) into PR[1] and am trying to use the J command to move the robot to it, but it throws an error on that line saying


    INTP-311 Uninitialized data is used.


    I recorded a position to set PR[1] to some value. That didn't help.
    I also tried to assign PR[1] to another PR variable that is a constant. That also didn't help.


    How do I initialize this variable?


    The details of the variable are


    PR[1] UF: F UT: F CONF:FUT 127-1-
    X 120.9 mm W 179.8
    Y -1133.9 P 31.4
    Z 352.9 R -176


    Reading another post, I made this modification to my KAREL program:


    SET_POS_REG(1, poseToGo, status)
    $UFRAME = $MOR_GRP[1].$NILPOS --For world.
    $UTOOL = $MNUTOOL[1,1] -- where utool would be the tool the point used.


    I am still seeing the same error and the PR variable looks the same.


    EDIT 1:
    Further digging:


    The values of a PR variable that I have recorded and then am able to jog to look like this:


    PR[3] UF:F UT:F CONF:NUT 000


    When I set this to PR[1] and then run my code it is getting overwritten to FUT 127-1-


    This could be the problem. How do I set it to NUT 000?


    EDIT 2:
    I figured it out:


    -- Write this value in PR[1]
    poseToGo.config_data.CFG_TURN_NO1 = 0
    poseToGo.config_data.CFG_TURN_NO2 = 0
    poseToGo.config_data.CFG_TURN_NO3 = 0

    poseToGo.config_data.CFG_FLIP = FALSE
    poseToGo.config_data.CFG_UP = TRUE
    poseToGo.config_data.CFG_FRONT = TRUE


    This set the configuration correctly.

    That didn't quite work. Here is the code snippet



    I tried commenting out the first file attribute too. That didn't work either.

    I am working on writing a socket client on the FANUC side to talk to a Python server. I got the example code to work, but I am having issues with getting a random length string to be passed to and from.


    Code
    tmp_str = 'Connect'
    WRITE file_var(tmp_str::126)
    WRITE('Wrote: ',tmp_str,CR)
    
    
    WRITE('Waiting to read from server...')
    READ file_var(tmp_str::126)
    status = IO_STATUS(file_var)
    WRITE('Read status: ',status,CR)


    works if my Python server echoes the data back


    But if I want the response from my server to be "Connect, 1"


    Then the Karel client is stuck on "waiting to read from server..." because it is expecting more bytes. I tried to use BYTES_AHEAD to sniff how many bytes to read, but that function returned 0. However, if I change my READ to


    Code
    READ file_var(tmp_str::9)


    it works fine. From the manual I thought the first format specifier was the number of bytes to read. This appears to be the length of the string. How do I know a prori the length of the input string buffer?

    I am trying to create a single file for all the constants I'll need and refer to them in all the other files.


    I created a GlobalVars.kl file that looks like


    Code
    PROGRAM GlobalVars
    
    	VAR
    		maxSize	 : INTEGER
    
    	BEGIN
    		maxSize = 125
    END GlobalVars


    I created a QuickTest.kl that looks like:


    Code
    PROGRAM QuickTest
    
    	VAR
                    maxSize FROM GlobalVars : INTEGER
    
    	BEGIN
    		WRITE('maxSize: ',maxSize,CR)		
    END QuickTest


    Both files compile fine, but when I run quicktest.pc, I get:


    Intp-311 (Quick_Test, 7) uninitialized data is used.....abort all


    How do I accomplish this?

    New issue: I am able to send a message, but not read.



    The python side has sent the 'RunJob' string back, but on the KAREL side, I see it stuck at


    'Waiting to read from server...'

Advertising from our partners