RobotStudio event

Problem

Bellen
Bellen
edited November 2013 in Robot Controller

How to transfer system signels to the PLC via RS232,such as Motor on, Auto on, etc.

Rob side             PLC side
Motor On   ---->    MR100
Auto On    ---->     MR101

Thanks

Post edited by Jonathan Karlsson on

Comments


  • Or is associated with a variable.

    PERS num RM100;
    PERS num RM101;

    Motor On   ---->    RM100
    Auto On    ---->    RM101

    Thanks

  • Bellen,
    You will need to define a virtual Output for both signals then you can read the state of the Outputs and set your RM100 and RM101 based on the state of the output.  Example:

    Define a Virtual board VIO1 under units in configurations
    Define a Virtual Output voMotorsOn and connect it to VIO1 board
    Define a Virtual Output voAutoOn and connect it to VIO1 board
    Define a System Output and connect voMotorsOn to MotorOn system output (this means even if your program is not running the virtual output voMotorsOn will always be updating with the state of MotorOn
    Define a System Output and connect voAutoOn to AutoOn

    now in your rapid code you would need to read the state of the outputs and update your variables

    IF Output(voMotorsOn)=TRUE THEN
      RM100:=1;
    ELSE
      RM100:=0;
    ENDIF

    IF Output(voAutoOn)=TRUE THEN
      RM101:=1;
    ELSE
      RM101:=0;
    ENDIF


  • Thanks for your help to answer my questions. I will try it next week. If I have further problem, I may need your assistance again. Wish you have nice weekend!

    Bellen

  • I have another question, how to control System Input via RM200,for example,

    PERS num RM200;
    PERS num RM201;
    PERS num RM202;


      RM200 ---->    MotorOn
      RM201 ---->    Start 
      RM202 ---->    Stop


    What's the difference between Start and StartAtMain signal?

    Can I put these codes in the Daemon (background program or multitasking), and then set routine to semistatic?

    Thanks
  • I have define a virtual board, then define a virtual output signals both voMotorsOn and voAutoOn, then connect them to system output MotorOn and AutoOn, and checked them at Input and output\View\I/O units\VI01\Signals\voMotorOn and voAutoOn, the states is OK.

    then write code in the rapid

    IF Output(voMotorsOn)=TRUE THEN
      RM100:=1;
    ELSE
      RM100:=0;
    ENDIF

    but there is an error message appear, Event Message---Output not function reference, how to solve this problem.

    Thanks