Due to the size of data types across platforms, the C++ version of the library required type aliasing of some primitives. These aliases are not needed and therefore not present in the C# version of the library.
Selection of control groups. Encompasses robots, bases, and stations.
public enum ControlGroupId
{
R1 = 1, R2 = 2, R3 = 3, R4 = 4, R5 = 5, R6 = 6, R7 = 7, R8 = 8,
B1 = 11, B2 = 12, B3 = 13, B4 = 14, B5 = 15, B6 = 16, B7 = 17, B8 = 18,
S1 = 21, S2 = 22, S3 = 23, S4 = 24, S5 = 25, S6 = 26, S7 = 27, S8 = 28,
S9 = 29, S10 = 30, S11 = 31, S12 = 32, S13 = 33, S14 = 34, S15 = 35, S16 = 36,
S17 = 37, S18 = 38, S19 = 39, S20 = 40, S21 = 41, S22 = 42, S23 = 43, S24 = 44
};
The type of information to be requested from the controller by the GetSystemInfo function.
This includes robots, stations and application number.
public enum SystemInfoId
{
R1 = 11, R2 = 12, R3 = 13, R4 = 14, R5 = 15, R6 = 16, R7 = 17, R8 = 18, // Robot number
S1 = 21, S2 = 22, S3 = 23, S4 = 24, S5 = 25, S6 = 26, S7 = 27, S8 = 28, // Station number
S9 = 29, S10 = 30, S11 = 31, S12 = 32, S13 = 33, S14 = 34, S15 = 35, S16 = 36,
S17 = 37, S18 = 38, S19 = 39, S20 = 40, S21 = 41, S22 = 42, S23 = 43, S24 = 44,
A1 = 101, A2 = 102, A3 = 103, A4 = 104, A5 = 105, A6 = 106, A7 = 107, A8 = 108 //Application number.
};
Type of alarm to retrieve. Used by the GetActiveAlarms and GetAlarmHistory functions
public enum AlarmCategory { Major = 0, Minor = 1000, UserSystem = 2000, User = 3000, Offline = 4000 };
public enum CoordinateType { Pulse = 0, BaseCoordinate = 16, RobotCoordinate = 17, ToolCoordinate = 18, UserCoordinate = 19, MasterTool = 20, Undefined = 55, Angle = 56 };
Specifies whether the controller is set to Teach, Play, or Remote mode.
public enum ControlMode { Teach, Play, Remote };
The location of the B axis rotation when viewed from the right side of the robot.
Front: center of the B-axis is to the right of the S-axis rotation center.
Back: center of the B-axis is to the left of the S-axis rotation center.
public enum FrontOrBack { Front, Back };
The angle of the elbow (L and U axis) when viewed by the right side. Upper is less than 180 degrees, lower is greater than 180 degrees.
public enum UpperOrLower { Upper, Lower };
Flip: B axis is in positive direction (Theta B > = 0 degrees).
NoFlip = B axis is in negative direction (Theta B < 0 degrees).
public enum FlipOrNoFlip { Flip, NoFlip };
Specify if an angle is less than or greater than 180 degrees.
public enum AxisAngle { LessThan180, GreaterThanOrEqual180 };
public enum CycleMode { Step = 0, Cycle, Automatic };
Type of time to request when calling GetOperatingTime
.
public enum TimeType
{
ControllerOnTime = 1,
ServoPowerOnTimeTotal = 10,
ServoPowerOnTimeRobot = 11,
ServoPowerOnTimeStation = 20,
PlayBackTimeTotal = 110,
PlayBackTimeRobot = 111,
PlayBackTimeStation = 120,
MovingTimeTotal = 210,
MovingTimeRobot = 211,
MovingTimeStation = 221,
ApplicationOperationTime = 300
};
Application ex. Arc Welding, Spot Welding, Painting, General Purpose.
On standard pendant, assignments can be found from the main menu under
[System Information]>[Controller Information] under the APPLICATION section.
public enum ApplicationNumber
{
ApplicationOne = 1,
ApplicationTwo,
ApplicationThree,
ApplicationFour,
ApplicationFive,
ApplicationSix,
ApplicationSeven,
ApplicationEight
};
Used to specify the type of system parameter to be retrieved by the GetSystemParameter function.
public enum SystemParameterType
{
S1CG = 0, /* S1CxG requires group number.*/
S2C = 1, /* S2C */
S3C = 2, /* S3C */
S4C = 3, /* S4C */
RS = 4, /* RS */
AP = 5, /* AxP requires group number*/
SE = 6, /* SxE requires group number*/
};
Specifies the task to reference when getting the executing job information and job stack.
public enum InformTaskNumber
{
Master, Subtask1, Subtask2, Subtask3, Subtask4, Subtask5, Subtask6,
Subtask7, Subtask8, Subtask9, Subtask10, Subtask11, Subtask12, Subtask13, Subtask14, Subtask15
};
Specifies file types for file interface operations.
public enum FileType { Job_JBI, Data_DAT, Condition_CND, Parameter_PRM, System_SYS, Ladder_LST, Log_LOG };
Category of I/O signal. All signal categories are readable. Writing is limited to NetworkInput.
Additionally, GeneralOutput can be written on YRC1000 or newer controllers.
public enum IOType
{
GeneralInput, GeneralOutput, ExternalInput, NetworkInput, ExternalOutput, NetworkOutput,
SpecificInput, SpecificOutput, InterfacePanelInput, AuxiliaryRelay, RobotControlStatus, PsuedoInput
};
public enum MoveInterpolationType { NoneSelected, MoveJoint, MoveLinear, MoveCircular };
Activate or deactivate Hold, Servo.
public enum SignalStatus { ON = 1, OFF = 2 };
When converting between coordinate types using the KinematicsInterface, specifies the conversion to use.
public enum KinematicConversions
{
JointAngleToCartesianPos, // Convert Joint Angles(in degrees) To Cartesian Position.
PulseToJointAngle, // Convert Pulse position To Joint Angles(in degrees).
JointAngleToPulse, // Convert Joint Angles(in degrees) To Pulse.
PulseToCartesianPos, // Convert Pulse position To Cartesian Position.
CartesianPosToJointAngle,
CartesianPosToPulse
};
Specifies how to solve inverse kinematics when converting from cartesian position. Used when calling ConvertPosition in the Kinematics interface.
public enum KinematicType
{
Default,// Calculate using parameter S2C430 value. 2:Delta, 1:Figure
Delta,// Calculate by prevAngle. If this type is selected, prevAngle must be provided.
Figure //Calculate by the figure set in the position to convert.
};
The index of each axis in the CoordinateArray
.
namespace AxisIndex
{
public enum PulseAxis { S = 0, L, U, R, B, T, E, W };
public enum CartesianAxis { X = 0, Y, Z, Rx, Ry, Rz, Re, Rw };
};
Name | Description |
---|---|
FrontOrBack | The location of the B axis rotation when viewed from the right side of the robot. See FrontOrBack. |
UpperOrLower | The angle of the elbow (L and U axis) when viewed from the right side. See UpperOrLower. |
FlipOrNoFlip | Indicates whether the B axis is in positive (Flip) or negative (NoFlip) direction. See FlipOrNoFlip. |
AxisAngles | Array specifying if each axis angle is less than or greater than 180 degrees. See AxisAngle. |
public struct Figure
{
public FrontOrBack FrontOrBack{ get; set;}
public UpperOrLower UpperOrLower{ get; set;}
public FlipOrNoFlip FlipOrNoFlip{ get; set;}
public AxisAngle[] AxisAngles { get; set; }
public Figure()
{
AxisAngles = new AxisAngle[8];
}
public Figure(FrontOrBack frontOrBack, UpperOrLower upperOrLower, FlipOrNoFlip flipOrNoFlip, AxisAngle[] axisAngles)
{
this.FrontOrBack = frontOrBack;
this.UpperOrLower = upperOrLower;
this.FlipOrNoFlip = flipOrNoFlip;
this.AxisAngles = axisAngles;
}
public override string ToString()
{
StringBuilder sb = new();
sb.Append($"FrontOrBack: {FrontOrBack}\nUpperOrLower: {UpperOrLower}\nFlipOrNoFlip: {FlipOrNoFlip}\nAxisAngles: \n");
for (int i = 0; i < 7; i++)
{
sb.Append((PulseAxis)i + ": ");
sb.Append($"{AxisAngles[i]}\n");
}
sb.Append(PulseAxis.W + ": ");
sb.Append($"{AxisAngles[7]}");
return sb.ToString();
}
}
Name | Description |
---|---|
CoordinateType | The type of coordinate system in which the axis data is represented. See CoordinateType. |
Figure | Used to represent a robot configuration when the coordinate system is cartesian. See Figure. NOTE: When adding points to the trajectory, the figure information will only be explicitly considered when S2C430 = 1. This is not recommended for most applications. |
ToolNumber | The Tool File contains the TCP data for cartesian coordinates. It also contains mass properties for path and PFL calculations. |
UserCoordinateNumber | 0 if the coordinate type is anything other than UserCoordinate. |
AxisData | Pulse counts for coordinate type pulse, millimeters and joint angles otherwise. |
public struct PositionData
{
public CoordinateType CoordinateType { get; set; }
public Figure Figure { get; set; }//Used to represent a robot configuration when the coordinate system is cartesian.
public UInt32 ToolNumber { get; set; } //|0 if the coordinate type is anything other than ToolCoordinate.
public UInt32 UserCoordinateNumber { get; set; } //Only used when coordinateType is UserCoordinate. Otherwise it is 0. Only used with robot position variables.
public CoordinateArray AxisData { get; set; }//Pulse counts for coordinate type pulse, millimeters and joint angles otherwise.
public PositionData()
{
Figure = new Figure();
AxisData = new double[8];
}
public PositionData(CoordinateType coordinateType, Figure figure, UInt32 toolNumber, UInt32 userCoordinateNumber, CoordinateArray axisData)
{
this.CoordinateType = coordinateType;
this.Figure = figure;
this.ToolNumber = toolNumber;
this.UserCoordinateNumber = userCoordinateNumber;
this.AxisData = axisData;
}
public override string ToString()
{
StringBuilder sb = new();
if (CoordinateType == CoordinateType.Pulse)
{
sb.Append($"CoordinateType: {CoordinateType}\nToolNumber: {ToolNumber}\nAxisData:\n");
for(int i = 0; i < 8; i++)
{
sb.Append((PulseAxis)i + ": ");
sb.Append($"{AxisData[i]} pulse\n");
}
}
else
{
sb.Append($"CoordinateType: {CoordinateType}\nFigure:\n{Figure}\nToolNumber: {ToolNumber}\nUserCoordinateNumber: {UserCoordinateNumber}\nAxisData:\n");
//first 3 axes are measured in mm, the rest are joint angles.
for (int i = 0; i < 3; i++)
{
sb.Append((CartesianAxis)i + ": ");
sb.Append($"{AxisData[i]} mm\n");
}
for (int i = 3; i < 8; i++)
{
sb.Append((CartesianAxis)i + ": ");
sb.Append($"{AxisData[i]} deg\n");
}
}
return sb.ToString();
}
}
Name | Description |
---|---|
AxisConfiguration | Array representing axis configuration characters. |
public struct AxisConfigurationData
{
public char[] AxisConfiguration { get; set; } = new char[8];
public AxisConfigurationData()
{
}
public override string ToString()
{
StringBuilder sb = new();
sb.Append("AxisConfiguration:\n");
foreach (var axis in AxisConfiguration)
{
sb.Append($"{axis}\n");
}
return sb.ToString();
}
}
Name | Description |
---|---|
Code | Alarms main code. |
Subcode | Alarm subcode. |
Time | Time when the alarm occurred. |
Name | Name or description of the alarm. |
public struct AlarmData(int code, int subcode, string? time, string? name)
{
public Int32 Code { get; set; } = code;
public Int32 Subcode { get; set; } = subcode;
public string? Time { get; set; } = time;
public string? Name { get; set; } = name;
public override readonly string ToString()
{
return $"Code: {Code}\nSubcode: {Subcode}\nTime: {Time}\nName: {Name}";
}
};
A structure containing all of the active alarms on the controller. There can be four alarms at a time.
Name | Description |
---|---|
Count | Number of active alarms. |
Alarms | Array of active alarm data. See AlarmData. |
public struct ActiveAlarms
{
public const Int32 MaxActiveAlarms = 4;
public ActiveAlarms(int count, AlarmData[] alarms)
{
Count = count;
Alarms = new AlarmData[MaxActiveAlarms];
for (int i = 0; i < MaxActiveAlarms; i++)
{
Alarms[i] = alarms[i];
}
}
public ActiveAlarms()
{
Count = 0;
Alarms = new AlarmData[MaxActiveAlarms];
}
public Int32 Count { get; set; }
public AlarmData[] Alarms { get; set; }
public override string ToString()
{
StringBuilder sb = new();
sb.Append($"Count: {Count}\nAlarms:\n");
foreach (var alarm in Alarms)
{
sb.Append($"{alarm}\n");
}
return sb.ToString();
}
};
The previous n alarms of the controller. n = numberOfAlarmsFetched. Also includes any active alarms.
Name | Description |
---|---|
NumberOfAlarmsFetched | Number of alarms in the array. |
Alarms | Array of alarms. See AlarmData. |
public struct AlarmHistory
{
public const Int32 AlarmHistorySize = 100;
public AlarmHistory(int count, AlarmData[] alarms)
{
NumberOfAlarmsFetched = count;
Alarms = new AlarmData[AlarmHistorySize];
for (int i = 0; i < AlarmHistorySize; i++)
{
Alarms[i] = alarms[i];
}
}
public AlarmHistory()
{
NumberOfAlarmsFetched = 0;
Alarms = new AlarmData[AlarmHistorySize];
}
public Int32 NumberOfAlarmsFetched { get; set; }
public AlarmData[] Alarms { get; set; }
public override string ToString()
{
StringBuilder sb = new();
sb.Append($"NumberOfAlarmsFetched: {NumberOfAlarmsFetched}\nAlarms: ");
for (int i = 0; i < NumberOfAlarmsFetched; i++)
{
sb.Append($"{Alarms[i]}\n");
}
return sb.ToString();
}
};
Name | Description |
---|---|
AxisData | Array of position error values for each axis. |
public struct PositionErrorData
{
public Int32[] AxisData { get; set; } = new Int32[8];
public PositionErrorData()
{
}
public PositionErrorData(Int32[] axisData)
{
this.AxisData = axisData;
}
public override string ToString()
{
StringBuilder sb = new();
sb.Append("AxisData:\n");
for(int i = 0; i < 8; i++)
{
sb.Append("Axis " + i + ": ");
sb.Append($"{AxisData[i]}\n");
}
return sb.ToString();
}
}
Torque data of a control group. Includes the control group ID and the axis torques. Expressed as a percentage.
Name | Description |
---|---|
ControlGroupId | Control group ID of the requested data. See ControlGroupId. |
AxisData | Torque values for each axis. |
public struct TorqueData
{
public ControlGroupId ControlGroupId { get; set; }
public Int32[] AxisData { get; set; } = new Int32[8];
public TorqueData()
{
}
public override string ToString()
{
StringBuilder sb = new();
for (int i = 0; i < 8; i++)
{
sb.Append("Axis " + i + ": ");
sb.Append($"{AxisData[i]}\n");
}
return sb.ToString();
}
}
All of the information about the controller's state. Includes the running mode, control mode, and hold status.
Name | Description |
---|---|
CycleMode | Current cycle mode of the controller. See CycleMode. |
IsRunning | True if the controllers equipment is in motion. |
ControlMode | Current control mode of the controller. See ControlMode |
IsInHold | True if controller is in a hold status. |
IsAlarming | True if controller has an active alarm. |
IsErroring | True if an error is happening. |
IsServoOn | True if the servo is on. |
public struct ControllerStateData
{
public CycleMode CycleMode { get; set; }
public bool IsRunning { get; set; }
public ControlMode ControlMode { get; set; }
public bool IsInHold { get; set; }
public bool IsAlarming { get; set; }
public bool IsErroring{ get; set; }
public bool IsServoOn{ get; set; }
public ControllerStateData(CycleMode cycleMode, bool isRunning, ControlMode controlMode, bool isInHold, bool isAlarming, bool isErroring, bool isServoOn)
{
this.CycleMode = cycleMode;
this.IsRunning = isRunning;
this.ControlMode = controlMode;
this.IsInHold = isInHold;
this.IsAlarming = isAlarming;
this.IsErroring = isErroring;
this.IsServoOn = isServoOn;
}
public ControllerStateData()
{
CycleMode = CycleMode.Step;
IsRunning = false;
ControlMode = ControlMode.Teach;
IsInHold = false;
IsAlarming = false;
IsErroring = false;
IsServoOn = false;
}
public override readonly string ToString()
{
return $"CycleMode: {CycleMode}\n" +
$"IsRunning: {IsRunning}\n" +
$"ControlMode: {ControlMode}\n" +
$"IsInHold: {IsInHold}\n" +
$"IsAlarming: {IsAlarming}\n" +
$"IsErroring: {IsErroring}\n" +
$"IsServoOn: {IsServoOn}";
}
}
Type of position vector.
Name | Description |
---|---|
X | X-coordinate value. |
Y | Y-coordinate value. |
Z | Z-coordinate value. |
public struct XyzVector
{
public double X { get; set; } = 0.0;
public double Y { get; set; } = 0.0;
public double Z { get; set; } = 0.0;
public XyzVector() { }
public XyzVector(double x, double y, double z)
{
X = x;
Y = y;
Z = z;
}
public override readonly string ToString()
{
return $"X: {X}\nY: {Y}\nZ: {Z}";
}
};
Representation of the pose in 3D space. Includes the position and orientation. Orientation is represented as ZYX-intrinsic (roll, pitch, yaw).
https://en.wikipedia.org/wiki/Rotation_matrix
Name | Description |
---|---|
Nx, Ny, Nz | Components of the N (normal) vector. |
Ox, Oy, Oz | Components of the O (orientation) vector. |
Ax, Ay, Az | Components of the A (approach) vector. |
Px, Py, Pz | Position coordinates. |
public struct EulerMatrix
{
public double Nx { get; set; } = 0.0;
public double Ny { get; set; } = 0.0;
public double Nz { get; set; } = 0.0;
public double Ox { get; set; } = 0.0;
public double Oy { get; set; } = 0.0;
public double Oz { get; set; } = 0.0;
public double Ax { get; set; } = 0.0;
public double Ay { get; set; } = 0.0;
public double Az { get; set; } = 0.0;
public double Px { get; set; } = 0.0;
public double Py { get; set; } = 0.0;
public double Pz { get; set; } = 0.0;
public EulerMatrix()
{
}
public EulerMatrix(double nx, double ny, double nz, double ox, double oy, double oz, double ax, double ay, double az, double px, double py, double pz)
{
this.Nx = nx;
this.Ny = ny;
this.Nz = nz;
this.Ox = ox;
this.Oy = oy;
this.Oz = oz;
this.Ax = ax;
this.Ay = ay;
this.Az = az;
this.Px = px;
this.Py = py;
this.Pz = pz;
}
public override readonly string ToString()
{
return $"Nx: {Nx}\nNy: {Ny}\nNz: {Nz}\nOx: {Ox}\nOy: {Oy}\nOz: {Oz}\nAx: {Ax}\nAy: {Ay}\nAz: {Az}\nPx: {Px}\nPy: {Py}\nPz: {Pz}";
}
}
The value and index of a byte(B) variable.
Name | Description |
---|---|
Value | Byte value of the variable. |
VariableIndex | Index of the byte variable. |
public struct ByteVariableData
{
public Byte Value { get; set; }
public UInt16 VariableIndex { get; set; }
public ByteVariableData(Byte variableData, UInt16 variableIndex)
{
Value = variableData;
VariableIndex = variableIndex;
}
public ByteVariableData()
{
Value = 0;
VariableIndex = 0;
}
public override readonly string ToString()
{
return $"B{VariableIndex.ToString().PadLeft(3,'0')}={Value}";
}
}
The value and index of an integer(I) variable.
Name | Description |
---|---|
Value | Integer value of the variable. |
VariableIndex | Index of the integer variable. |
public struct IntegerVariableData
{
public Int16 Value { get; set; }
public UInt16 VariableIndex { get; set; }
public IntegerVariableData(Int16 variableData, UInt16 variableIndex)
{
Value = variableData;
VariableIndex = variableIndex;
}
public IntegerVariableData()
{
Value = 0;
VariableIndex = 0;
}
public override readonly string ToString()
{
return $"I{VariableIndex.ToString().PadLeft(3, '0')}={Value}";
}
}
The value and index of an double(D) variable.
Name | Description |
---|---|
Value | Double integer value of the variable. |
VariableIndex | Index of the double integer variable. |
public struct DoubleIntVariableData
{
public Int32 Value { get; set; }
public UInt16 VariableIndex { get; set; }
public DoubleIntVariableData(Int32 variableData, UInt16 variableIndex)
{
Value = variableData;
VariableIndex = variableIndex;
}
public DoubleIntVariableData()
{
Value = 0;
VariableIndex = 0;
}
public override readonly string ToString()
{
return $"D{VariableIndex.ToString().PadLeft(3, '0')}={Value}";
}
}
The value and index of a real(R) variable.
Name | Description |
---|---|
Value | Real (floating-point) value of the variable. |
VariableIndex | Index of the real variable. |
public struct RealVariableData
{
public float Value { get; set; }
public UInt16 VariableIndex { get; set; }
public RealVariableData(float variableData, UInt16 variableIndex)
{
Value = variableData;
VariableIndex = variableIndex;
}
public RealVariableData()
{
Value = 0;
VariableIndex = 0;
}
public override readonly string ToString()
{
return $"R{VariableIndex.ToString().PadLeft(3,'0')}={Value}";
}
}
The value and index of a string(S) variable. Max length is 32 characters.
Name | Description |
---|---|
Value | String value of the variable. |
VariableIndex | Index of the string variable. |
public struct StringVariableData
{
public string Value { get; set; }
public UInt16 VariableIndex { get; set; }
public StringVariableData(string variableData, UInt16 variableIndex)
{
Value = variableData;
VariableIndex = variableIndex;
}
public StringVariableData()
{
Value = "";
VariableIndex = 0;
}
public override readonly string ToString()
{
return $"S{VariableIndex.ToString().PadLeft(3,'0')}={Value}";
}
}
The value and index of a robot position(P) variable.
Name | Description |
---|---|
PositionData | Position data for the robot. |
VariableIndex | Index of the robot position variable. |
public struct RobotPositionVariableData
{
public PositionData PositionData { get; set; }
public UInt16 VariableIndex { get; set; }
public RobotPositionVariableData()
{
PositionData = new PositionData();
VariableIndex = 0;
}
public RobotPositionVariableData(PositionData positionData, UInt16 variableIndex)
{
PositionData = positionData;
VariableIndex = variableIndex;
}
public override readonly string ToString()
{
return $"P{VariableIndex.ToString().PadLeft(3,'0')}:\n{PositionData}";
}
}
The values and index of a base axis position variable. If the coordinate type is pulse, the pulse counts will be in X.
Name | Description |
---|---|
PositionData | Position data for the base axis. |
VariableIndex | Index of the base axis position variable. |
public struct BaseAxisPositionVariableData
{
public PositionData PositionData { get; set; }
public UInt16 VariableIndex { get; set; }
public BaseAxisPositionVariableData()
{
PositionData = new PositionData();
VariableIndex = 0;
}
public BaseAxisPositionVariableData(PositionData positionData, UInt16 variableIndex)
{
PositionData = positionData;
VariableIndex = variableIndex;
}
public override readonly string ToString()
{
return $"BP{VariableIndex.ToString().PadLeft(3,'0')}:\n{PositionData}";
}
}
The value and index of a station position variable.
Name | Description |
---|---|
PositionData | Position data for the station. |
VariableIndex | Index of the station position variable. |
public struct StationPositionVariableData
{
public PositionData PositionData { get; set; }
public UInt16 VariableIndex { get; set; }
public StationPositionVariableData()
{
PositionData = new PositionData();
VariableIndex = 0;
}
public StationPositionVariableData(PositionData positionData, UInt16 variableIndex)
{
PositionData = positionData;
VariableIndex = variableIndex;
}
public override readonly string ToString()
{
return $"BP{VariableIndex.ToString().PadLeft(3,'0')}:\n{PositionData}";
}
}
The software version running on the controller. Also includes the model of the system
or application name requested by ReadSystemInformation.
Name | Description |
---|---|
SoftwareVersion | Version of the controller software. |
ModelName | Model name of the system or application name if requested. |
public struct SystemInfoData
{
public string SoftwareVersion { get; set; }
public string ModelName { get; set; }
public override readonly string ToString()
{
return $"SoftwareVersion: {SoftwareVersion}\nModelName: {ModelName}";
}
}
Name | Description |
---|---|
Hours | Number of hours. |
Minutes | Number of minutes. |
Seconds | Number of seconds. |
public struct ElapsedTime(UInt32 hours, UInt32 minutes, UInt32 seconds)
{
public UInt32 Seconds => seconds;
public UInt32 Minutes => minutes;
public UInt32 Hours => hours;
public ElapsedTime() : this(0, 0, 0) { }
public override string ToString()
{
return $"Hours: {Hours}\nMinutes: {Minutes}\nSeconds: {Seconds}";
}
}
Includes the start time and elapsed. Since this structure is used in GetOperatingTime, the elapsed time cooresponds to the TimeType Selected.
Name | Description |
---|---|
StartTime | Start time for the requested data. |
ElapsedTime | Total elapsed time period for the requested data. |
public struct TimeData
{
public DateTime StartTime { get; set; }
public ElapsedTime ElapsedTime { get; set; }
public TimeData(DateTime startTime, ElapsedTime elapsedTime)
{
this.StartTime = startTime;
this.ElapsedTime = elapsedTime;
}
public TimeData()
{
StartTime = new DateTime();
ElapsedTime = new ElapsedTime();
}
public override readonly string ToString()
{
return $"StartTime: {StartTime}\nElapsedTime: {ElapsedTime}";
}
}
The name, line, step number, and speed override of a job. Line cooresponds to the line number of the job. Step number cooresponds to the motion step in the job.
SpeedOverride is expressed as a percentage. 100% is programmed speed. Ranges from 10% to 150%.
Name | Description |
---|---|
Name | Current active job. |
Line | Active line in active job. |
StepNumber | Current motion step in the active job. |
SpeedOverride | Speed override for the active job. |
public struct JobData
{
public string Name { get; set; }
public UInt32 Line { get; set; }
public UInt32 StepNumber { get; set; }
public Double SpeedOverride { get; set; }
public JobData(string name, UInt32 line, UInt32 stepNumber, Double speedOverride)
{
this.Name = name;
this.Line = line;
this.StepNumber = stepNumber;
this.SpeedOverride = speedOverride;
}
public JobData()
{
Name = "";
Line = 0;
StepNumber = 0;
SpeedOverride = 0;
}
public override readonly string ToString()
{
return $"Name: {Name}\nLine: {Line}\nStepNumber: {StepNumber}\nSpeedOverride: {SpeedOverride}";
}
};
The IOData class present in the C# version is designed to act with the same conveniences as the std::bitset used for the type of the same name in the C++ version.
Name | Description |
---|---|
Data | BitArray representing I/O data. |
public abstract class IOData(int size)
{
protected BitArray Data = new BitArray(size);
public bool this[int index]
{
get { return Data[index]; }
set { Data[index] = value; }
}
public override string ToString()
{
StringBuilder sb = new StringBuilder();
//print the bits in reverse order
for (int i = Data.Length - 1; i >= 0; i++)
{
sb.Append(Data[i] ? "1" : "0");
}
return sb.ToString();
}
public IOData SetAll(bool value)
{
Data.SetAll(value);
return this;
}
public bool HasAllSet()
{
return Data.HasAllSet();
}
public bool HasAnySet()
{
return Data.HasAnySet();
}
public IOData And(IOData other)
{
Data = Data.And(other.Data);
return this;
}
public IOData Or(IOData other)
{
Data = Data.Or(other.Data);
return this;
}
public IOData Xor(IOData other)
{
Data = Data.Xor(other.Data);
return this;
}
public IOData Not()
{
Data = Data.Not();
return this;
}
public IOData RightShift(int count)
{
Data = Data.RightShift(count);
return this;
}
public IOData LeftShift(int count)
{
Data = Data.LeftShift(count);
return this;
}
public bool Get(int index)
{
return Data.Get(index);
}
public void Set(int index, bool value)
{
Data.Set(index, value);
}
public Byte ToByte()
{
byte[] bytes = new byte[1];
Data.CopyTo(bytes, 0);
return bytes[0];
}
public UInt16 ToWord()
{
byte[] bytes = new byte[2];
Data.CopyTo(bytes, 0);
return BitConverter.ToUInt16(bytes, 0);
}
}
IOData as a byte.
Name | Description |
---|---|
(Inherits members from IOData) | Represents I/O data as a byte. |
public class IOByteData : IOData
{
public IOByteData() : base(8)
{
}
public IOByteData(byte data) : base(8)
{
Data = new BitArray(new byte[] { data });
}
public void Set(byte data)
{
Data = new BitArray(new byte[] { data });
}
}
IOData as a word.
Name | Description |
---|---|
(Inherits members from IOData) | Represents I/O data as a word (UInt16). |
public class IOWordData : IOData
{
public IOWordData() : base(16)
{
}
public IOWordData(UInt16 data) : base(16)
{
Data = new BitArray(new byte[] { (byte)(data & 0xFF), (byte)(data >> 8) });
}
//function to set the data from a UInt16
public void Set(UInt16 data)
{
Data = new BitArray(new byte[] { (byte)(data & 0xFF), (byte)(data >> 8) });
}
}
Represents register data.
Name | Description |
---|---|
(Inherits members from IOData) | Represents register data. |
public class RegisterData : IOData
{
public RegisterData() : base(16)
{
}
public RegisterData(UInt16 data) : base(16)
{
Data = new BitArray(new byte[] { (byte)(data & 0xFF), (byte)(data >> 8) });
}
public void Set(UInt16 data)
{
Data = new BitArray(new byte[] { (byte)(data & 0xFF), (byte)(data >> 8) });
}
}
Contains the acceleration and deceleration ratios for a motion. These ratios reduce the amount of acceleration and/or deceleration that occurs during a motion. For example, if the acceleration ratio is set to 50%, the robot will accelerate at half of the programmed acceleration rate. If the deceleration ratio is set to 50%, the robot will decelerate at half of the programmed deceleration rate.
Name | Description |
---|---|
AccelRatio | Acceleration ratio. Valid range is 20.00%-100.00%. |
DecelRatio | Deceleration ratio. Valid range is 20.0%-100.00% |
public struct MotionAccelDecel
{
//Will change the acceleration ratio of subsequent motions until changed again. Valid range is 20.00%-100.00%.
double AccelRatio { get; set; }
//Will change the deceleration ratio of subsequent motions until changed again. Valid range is 20.0%-100.00%
double DecelRatio { get; set; }
public MotionAccelDecel(double accelRatio, double decelRatio)
{
this.AccelRatio = accelRatio;
this.DecelRatio = decelRatio;
}
public MotionAccelDecel()
{
AccelRatio = double.MaxValue;
DecelRatio = double.MaxValue;
}
public override readonly string ToString()
{
return $"AccelRatio: {AccelRatio}, DecelRatio: {DecelRatio}";
}
};
Name | Description |
---|---|
groupId | Group to move. See ControlGroupId. |
speed | Speed of the motion. |
attributes | Acceleration and deceleration rate. See MotionAccelDecel |
interpolationType | Motion interpolation. Note that changing this instead of using the proper derived class can cause undefined behavior. |
accuracy | Optional accuracy for the motion target. Measured in mm. When -1 is specified, the motion planner will plot a smooth trajectory and attempt to maintain velocity by potentially rounding corners. If this rounding must be minimized due to application requirements, you can specify the maximum distance from the target point at which the robot is allowed to deviate. A value of 0 will cause the robot to follow the path exactly.![]() Please note that this is only applicable to LinearMotion . When using CircularMotion or JointMotion , the accuracy value will be ignored. |
position | Target position of the motion. Note that tool frame coordinate type is not supported at this time. See PositionData. |
Note that changing interpolationType instead of using the proper derived class can cause undefined behavior.
public class Motion
{
public ControlGroupId GroupId { get; set; } //The control group to move.
public double Speed { get; set; } //Speed of the motion. This value is a percentage (0.00 - 100.00) for JointMotion. For LinearMotion and CircularMotion, the value is in mm/sec (0.0 - 1500.0)
public MotionAccelDecel Attributes { get; set; } //The acceleration and deceleration ratios for the motion.
public MoveInterpolationType InterpolationType { get; set; } //The interpolation type of the motion.
public PositionData Position { get; set; } //The position data of the motion.
public override string ToString()
{
return $"GroupId: {GroupId}, Speed: {Speed}, Attributes: {Attributes}, InterpolationType: {InterpolationType}, Position: {Position}";
}
};
Name | Description |
---|---|
(Inherits members from Motion) | Represents linear motion commands. |
public class LinearMotion : Motion
{
public LinearMotion()
{
InterpolationType = MoveInterpolationType.MoveLinear;
Attributes = new MotionAccelDecel();
Position = new PositionData();
}
/// <summary>
/// Constructor for a linear motion target.
/// </summary>
/// <param name="groupId">ControlGroupId for the motion.</param>
/// <param name="destinationCoords">Data for the target position.</param>
/// <param name="speed">Speed for this motion target.</param>
/// <param name="attributes">Optional Motion attributes.</param>
public LinearMotion(ControlGroupId groupId, PositionData destinationCoords, double speed, MotionAccelDecel attributes)
{
GroupId = groupId;
Speed = speed;
Attributes = attributes;
InterpolationType = MoveInterpolationType.MoveLinear;
Position = destinationCoords;
}
public LinearMotion(ControlGroupId groupId, PositionData destinationCoords, double speed)
{
GroupId = groupId;
Speed = speed;
Attributes = new MotionAccelDecel();
InterpolationType = MoveInterpolationType.MoveLinear;
Position = destinationCoords;
}
};
Use this struct to create a joint motion target. See Motion.
Name | Description |
---|---|
(Inherits members from Motion) | Represents joint motion commands. |
public class JointMotion : Motion
{
public JointMotion()
{
InterpolationType = MoveInterpolationType.MoveJoint;
Attributes = new MotionAccelDecel();
Position = new PositionData();
}
/// <summary>
/// Constructor for a joint motion target.
/// </summary>
/// <param name="groupId">ControlGroupId for the motion.</param>
/// <param name="destinationCoords">Data for the target position</param>
/// <param name="speed">Speed for this motion target.</param>
/// <param name="attributes">Optional Motion attributes.</param>
public JointMotion(ControlGroupId groupId, PositionData destinationCoords, double speed, MotionAccelDecel attributes)
{
GroupId = groupId;
Speed = speed;
Attributes = attributes;
InterpolationType = MoveInterpolationType.MoveJoint;
Position = destinationCoords;
}
public JointMotion(ControlGroupId groupId, PositionData destinationCoords, double speed)
{
GroupId = groupId;
Speed = speed;
Attributes = new MotionAccelDecel();
InterpolationType = MoveInterpolationType.MoveJoint;
Position = destinationCoords;
}
};
Use this struct to create a Circular motion target. This motion target requires an auxillary set of coordinates. This is the passing point used to calculate the arc. See Motion.
Name | Description |
---|---|
AuxCoords | Auxiliary coordinates (passing point) for circular motion. |
public class CircularMotion : Motion
{
public CoordinateArray AuxCoords { get; set; } //The passing point for the motion.
public CircularMotion()
{
InterpolationType = MoveInterpolationType.MoveCircular;
Attributes = new MotionAccelDecel();
AuxCoords = new double[8];
Position = new PositionData();
}
/// <summary>
/// Constructor for a circular motion target.
/// </summary>
/// <param name="groupId">ControlGroupId for the motion.</param>
/// <param name="destinationCoords">Data for the target position.</param>
/// <param name="auxCoords">Pass in pulse counts for coordinate type pulse, millimeters and joint angles otherwise. Used as a passing point.
/// e.g if you want to move from point A to point C, but you want to pass through point B, then point B would be the auxCoords.
/// </param>
public CircularMotion(ControlGroupId groupId, PositionData destinationCoords, CoordinateArray auxCoords, double speed, MotionAccelDecel attributes)
{
GroupId = groupId;
Speed = speed;
Attributes = attributes;
InterpolationType = MoveInterpolationType.MoveCircular;
Position = destinationCoords;
AuxCoords = auxCoords;
}
public CircularMotion(ControlGroupId groupId, PositionData destinationCoords, CoordinateArray auxCoords, double speed)
{
GroupId = groupId;
Speed = speed;
Attributes = new MotionAccelDecel();
InterpolationType = MoveInterpolationType.MoveCircular;
Position = destinationCoords;
AuxCoords = auxCoords;
}
};
Name | Description |
---|---|
StatusCode | Error code returned from function calls. |
Message | Error message associated with the status code. |
public class StatusInfo
{
public int StatusCode { get; set; }// The error code returned from the function call. 0 indicates no error.
public string? Message { get; set; }// The error message associated with the error code.
/// <summary>
/// A convenience function to return the StatusCode and Message as a string.
/// </summary>
/// <returns>StatusInfo represented as a string.</returns>
public override string ToString()
{
return $"Code ({StatusCode}): {Message}";
}
}