RobotStudio event

Create a counter in Robotstudio?

How can I create a counter in robotstudio?

I use the robotstudio school edition 5.13, I don't know if all instructions are available.

 

Thanks
Pedro Silva

Comments

  • Hi,
     

    Create a variable and then increment it up or down.

    For example:

     

    VAR num counter1;

     

    counter1:=counter1 + 1;

    or

    Incr counter1;

     

    Hope this helps.

     

    Regards

    Graeme
  • Thanks
    My robot do the programmed tasks, after completed 5 I need to count them and after call a routine to execute. How can I count the cycles that the robot do?

     

    Thanks

     
    Pedro Silva
  • Hi,
     

    You can use a FOR loop in the main routine to control the number of times the tasks are run before calling the routine (see example below).

     

    FOR i FROM 1 TO 5 DO

        programmed tasks in here;

    ENDFOR

    Call to next routine here;

     

    Regards

    Graeme

     
  • Sorry about this newbie questions, but what's the meaning of the "i" in your code example.
    Pedro Silva
  • Thank you for your time.
    Pedro Silva
  • Hi,
     

    The i is the variable (data) that holds the value of the count, I have copied the details about the counter from the (RAPID Instructions, Functions, and Data Types) manual below:


    The name of the data that will contain the value of the current loop counter. The data is declared automatically.
    If the loop counter name is the same as any data that already exists in the actual scope, the existing data will be hidden in the
    FOR loop and not affected in any way.

    The loop counter (of data type
    num) can only be accessed from within the FOR loop and consequently hides other data and routines that have the same name. It can only be read (not updated) by the instructions in the FOR loop.
    Decimal values for start, end, or stop values, in combination with exact termination conditions for the
    FOR loop, cannot be used (undefined whether or not the last loop is running).

    Regards
    Graeme
    graemepaulin2011-07-14 22:52:39
  • Hi again,
    How can I import a cad file that makes a movement such as a hidraulic press?

    What kind of format should it be exported?

     

    I've some 3D drawings made in Autocad Mechanical.

    Would you please help me?
    Pedro Silva


  • Hi Pedro.
     
    First of all you should make a new tropic to this.
    But here is a answer that you maybe can use.
     
    Export your base part of your press as *.sat fil.
    Do the same with your moveable part and then create a mecanicel device.
     
    you can find tutoriels on this forum to learn to create it
     
     
     
     
    Best Regards

    Klaus Soenderhegn
    www.cadalysator.dk
  • Hi Pedro
     

    As Klaus says, you must export the separate CAD components into files that you then can import in RobotStudio.

     

    But instead of using an Mechanism to create the press I recommend you to try out the Smart Component feature under the Modelling tab. This is what is written about Smart Components in the Release Notes of RobotStudio 5.13:

     

    Smart Components offers a new way of creating simulations by adding behavior to the simulated objects. It brings life to the graphical component libraries by the addition of so-called Base Smart Components for basic motion, signal logic, arithmetic, parametric modeling, sensors etc, etc. Moreover, Smart Component authoring can be separated from its use in a simulation. The internal logic of the user-created, composite Smart Component is hidden to the component user that only needs to know how to connect it to other high-level Smart Components of the simulation. This allows Smart Components for common equipment to be re-used over and over again, thus saving valuable time.
    Teodor Olsson2011-08-03 09:01:43