This is part of 2.1.0latest release.

MLxRobotSetCubicIZByTwoCorners

0.2.0

Setup a cubic interference zone by specifying two diagonal corners of a cuboid.

The ZoneAction parameter in IZData is used to define the action of the IZ. See MLxAppDataCubicIZ data type for more information.

Once set, an Interference Zone send its status in a DINT MLX.Robot.CubicIZStatus. The corresponding bit depends on the IZNumber parameter (e.g. if IZNumber=2 then status is the third least significant bit).

Values set by this function block can be checked on the Teach Pendant menu ROBOT » INTERFERENCE. Note that Interference Area number starts at 1 and correspond to IZNumber=0.

Version history

0.2.0

  deGroot

Changes

Removed:
  • unused internal variables
show full history

0.1.0

  deGroot

Changes

Changed:

Prerequisites

prerequisitestate
Key switchREMOTE
Robot motionstandstill

Overview

kindnametypedefaultcomment
inputEnableBOOLEnable this Function Block.
inputRobotNumberDINT0The robot commanded by this instruction instance. Valid values are 0 to MLX.NumberOfRobots-1.
inputIZNumberDINTIndex of the interference zone
inputCoordFrameDINT0 = Robot, 1= Base, 2 = User
outputSts_ENBOOLEnable bit. This bit will stay high as long as the instruction is enabled.
outputSts_DNBOOLDone bit. This bit will turn high when the instruction has finished.
outputSts_ERBOOLError bit. Indicates an error during instruction execution. Call MLxGetErrorDetail for more information.
in_outMLXMLxDataThe MLxData Controller Scope tag.
in_outIZDataMLxAppDataCubicIZMLxAppDataCubicIZ containing the interference zone data

Details

Enable

BOOL

For starting this function block. On a rising edge of this input the internal processing will start which is indicated by the Sts_EN status signal.

Internal processing steps typically involve:

  • checking if required conditions are met
  • sending command data to the robot controller (on the next possible occasion)
  • receiving answer data from the robot controller

Since the status bits will only be updated as long as the Enable is active, it is necessary to keep the input enabled until the FB has completed its entire lifecycle which is signalled by the Sts_DN (done) status signal.

Disabling the input too early can mess up the MotoLogix command interface and lead to a hangup situation.

RobotNumber

DINT
(default: 0)

Specifies the motion device targeted by this MotoLogix function.

The MotoLogix data packet supports a maximum of 4 motion devices on one robot contoller. Examples of motion devices are:

  • manipulators (e.g. GP7 robot)
  • base axes (e.g. gantry system)
  • station axes (e.g. servo gripper)

Each motion device gets its own RobotNumber (and slot in the data packet). Some examples:

two robots: R1 and R2

[0]     // R1
[1]     // R2
[2]     // not used
[3]     // not used

two robots on a linear track R1B1 and R2B2

[0]     // R1
[1]     // R2
[2]     // B1
[3]     // B2

robot with a servo gripper R1S1

[0]     // R1
[1]     // S1
[2]     // not used
[3]     // not used

The numbering is fixed in the configuration of the robot controller (cannot be changed by MotoLogix). MLxRobotGetProperties can be used to read this configuration. It will give you practical information for each motion device such as: type, axis names, speed- and motion range.

valueexplanation
0-3Robot number (use MLxRobotGetProperties to see the mapping).

IZNumber

DINT

Index of the Interference Zone (IZ).

Range value from 0 to 31.

CoordFrame

DINT

Frame in which the two corners are given.

ValueFrame
0Robot Frame
1Base Frame
2User Frame

Sts_EN

BOOL

Status Enabled signal which tells that the FB is currently enabled. It reflects the status of the Enable input.

A common use for Sts_EN is in combination with the Sts_DN (or Sts_PC) signal. This filters the old status which is important because in the PLC scan where the FB gets enabled the Sts_DN still has the status from its previous run (which is probably high) until the FB call is processed.

CASE state OF
...
10:
  // enabling the FB
  someMLxFB.Enable := TRUE;

  // condition to proceed after FB finished
  // --> Sts_DN still has its old status from previous run
  IF (someMLxFB.Sts_DN AND someMLxFB.Sts_EN) THEN
    state := state + 10;
  END_IF;

20:
  ...
END_CASE;

// FB call
someMLxFB(...);
// --> now Sts_DN has the new status

Sts_DN

BOOL

Status done signal which tells that the FB has finished. This means the Enable input can now safely be disabled as the FB has completed its lifecycle.

This status signal keeps its status until the next time this FB is enabled. See Sts_EN on how to filter any old status.

Sts_ER

BOOL

Status error signal which tells that the FB has failed. The Enable input can now be disabled as the FB has aborted its lifecycle.

Now it is important to find the cause of the error. In most cases the robot controller has generated an alarm which explains what the problem is.

Recommended next steps:

  • Read the alarm details using MLxGetErrorDetail
  • Fix the issue described in the alarm details (e.g. parameter out of range)
  • Reset the alarm using MLxReset (also clears the motion queue) or MLxResetAndHold (resets the alarm but leaves the motion queue in place).
  • Restart the application

If Sts_ER becomes active but the robot controller does not generate an alarm you should check the SystemState and the conditions/prerequisites for using the FB.

This status signal keeps its status until the next time this FB is enabled. See Sts_EN on how to filter any old status.

The MotoLogix variable which acts as the shared memory for a MotoLogix system.

As the PLC runs through its scan cycle each active MotoLogix FB will read from- and write to this MotoLogix variable.

It is also used for processing the data red from- and sent to the robot controller.

There are a few important rules:

  • MLxCommunicationRead must be called at the very beginning of the PLC scan cycle.
  • MLxCommunicationWrite must be called at the very end of the PLC scan cycle.
  • All other MotoLogix FB’s used in your application must be called inbetween.
  • All off this must be handled by the same PLC task, respecting above rules.

Failing to follow above rules can lead to inconsistent data being sent to the robot controller which could result in unexpected motion.

MLxAppDataCubicIZ containing the interference zone data.

ZoneAction parameter is used to define the IZ action :

VariableDefinition
0Status Only
1Stop Motion
2Clear IZ

Be sure to set CubicIZType parameter to 0.

Relevant parameters for MLxRobotSetCubicIZByTwoCorners are :

  • Corner1 defining the first corner position [X,Y,Z]
  • Corner2 defining the second corner position [X,Y,Z]
  • CoordFrame defining the frame in which corners position are given
    CoorFrameFrame
    0Robot
    1Base
    2User

Implementation

Snippet of the function call:
fbRobotSetCubicIZByTwoCorners : ARRAY[0..0] OF MLxRobotSetCubicIZByTwoCorners;

// fbRobotSetCubicIZByTwoCorners[0].Enable := ;
// fbRobotSetCubicIZByTwoCorners[0].RobotNumber := ;
// fbRobotSetCubicIZByTwoCorners[0].IZNumber := ;
// fbRobotSetCubicIZByTwoCorners[0].CoordFrame := ;
fbRobotSetCubicIZByTwoCorners[0]( MLX := dummy,  IZData := dummy );
//  := fbRobotSetCubicIZByTwoCorners[0].Sts_EN;
//  := fbRobotSetCubicIZByTwoCorners[0].Sts_DN;
//  := fbRobotSetCubicIZByTwoCorners[0].Sts_ER;

Pages built with Hugo - 23 Apr 2024 11:54 CEST