RobotStudio event

World Zone Tutorial

Hello All,

I am fairly new to RobotStudio and RAPID programming. I am trying to set up a cube World Zone, and I am getting several syntax errors. I have read the Technical Reference Manual and looked at the functions, etc. They weren't really of much help. So my question is, is there any sort of World Zone tutorial out there or is there some place I can get lots of examples for World Zone code?

Thanks in advance for any help!
SM

Best Answer

Answers

  • soup
    soup ✭✭✭
    Maybe a little more info in the attached manual.
  • SteveMob
    SteveMob
    edited March 2016
    Soup,

    Thank you for your post. Although it was helpful, it still didn't really answer my question. Perhaps the attached screenshot will help clarify my question a little more:


    Both syntax errors are saying "Wrong number of arguments." Any ideas on how to correct my syntax? Am I placing that snippet of code in the wrong place or something?

    Essentially I am trying to create a "box" defined at corner1:=[28.50, -14.25, 0.00] and corner2:=[17.00, 28.50, 58.80]. I want the robot to stop everything when it comes into contact with that "box."

    Also attached is the text file for my code snippet.

    Any examples or help is greatly appreciated!
    SM


  • soup
    soup ✭✭✭
    Looks good. The only thing I see is that "object" is defined as temporary and then "\Stat" is used in the limit supervision instruction. Probably both need to be one or the other -- but not sure if that's what is causing your error.
  • SteveMob
    SteveMob
    edited March 2016
    I changed them both to the same for "temp" and "stat" and that still did not fix the problem. I did find out that line 15 ("WZBoxDef....") is the line that is causing the error.

     Any other suggestions or examples of World Zone code?

    Thanks,
    SM
  • soup
    soup ✭✭✭
    It looks good -- not seeing anything.

    Things to try:

    1. Press the "Format" button in the Rapid editor and see if any garbage characters are hiding somewhere.
    2. Save the module out, attach it here, and I'll try to run it.
  • Ok attached is the text file. The module method isn't really working, but the text file should be sufficient?
    Thanks,
    SM
  • soup
    soup ✭✭✭
    Has a "-" after ENDMODULE -- looks good otherwise.
  • SteveMob
    SteveMob
    edited March 2016
    That was an accidental on my part when I was pasting it to notepad. The program in RS doesn't have that "-".

    Were you getting "Wrong number of arguments" errors in the "WZBoxDef" or "WZLimSup" lines?

    Could my PC not hooked up to the real controller have anything to do with it? Like my RS doesn't actually have WZ on it, but the real controller does. Is that unusual? Or is there an addin for RS that has WZ?

    Also, what version of RS are you using? I am using 6.01.01.
    Thanks,
    Stephen
  • soup
    soup ✭✭✭
    Nothing -- applied and got "No errors."

    If the controller doesn't have the World Zone option it should error saying it doesn't have that option -- virtual or real controller.

    I'm using a virtual controller with RW 5.15.8.

    All this is very odd -- I'd Apply changes, close and restart RobotStudio. If still have an issue -- restart the PC. If still have an issue -- throw the computer out the window.
  • So I am looking at the output window, and it says "The instruction WZBoxDef requires option World." I think this may be the problem. Is there somewhere that I can download WZ to the virtual controller? Or is this something that has to be purchased when purchasing RS?

    Thanks,
    Stephen
  • soup
    soup ✭✭✭
    No purchase necessary -- the virtual controller keystring has World Zones as an available option -- the World Zone box must be checked. Sounds like it was not checked when your virtual controller was created. After the fact, I don't think you can easily add the option to your virtual controller without remaking the system.
  • Ok. Thanks for all the help. I just hooked my PC up to the real controller (which has WZ on it) and I no longer received syntax errors.

    However, I want the robot to stop everything when it enters the WZ "cube" defined above. Is my program not written for that case? I am still trying to understand what all the commands are for... What would I need to change in my program above to have the robot stop when it enters the WZ "cube?"

    Thanks for all the help,
    SM
  • soup
    soup ✭✭✭
    The procedure is good but now you need to call it at a POWER_ON event. Look-up "Event Routine" in the manual to learn about it, add the POWER_ON event in the controller under Configuration > Controller > Event Routine in RobotStudio, cycle the power on the controller, and it should work. And every edit to the zone requires that you cycle power for it to take.

  • So I created a POWER_ON Event, but I am not really sure how to implement it in my code in order to get the WZ to work?
    Thanks
    SM
  • soup
    soup ✭✭✭
    You choose the procedure you'd like to call in the POWER_ON event parameters and as the controller is powering on that procedure is called in the background -- in this case the procedure is defining the World Zones. If you think the event is not running the procedure, try pulsing an output (something you can see -- light, alarm, solenoid, etc.) in that procedure to confirm to yourself the event is working before digging into possible issues with the World Zone definitions.
  • Can you show me an example of this? I am having trouble creating inputs/outputs as I am new to this sort of thing.
    Thanks,
    SM