Please note that System Parameter RS7 may need to be set to 2 to allow writing of variables outside of remote mode.
Name | Type | Description |
---|---|---|
ByteVariable | ByteVariableInterface | Reads and writes byte(B) variables. |
IntegerVariable | IntegerVariableInterface | Reads and writes Integer(I) variables. |
DoubleIntVariable | DoubleIntVariableInterface | Reads and writes Double(D) variables. |
RealVariable | RealVariableInterface | Reads and writes Real(R) variables. |
StringVariable | StringVariableInterface | Reads and writes String(S) variables. |
RobotPositionVariable | RobotPositionVariableInterface | Reads and writes Robot Position(P) variables. |
BasePositionVariable | BaseAxisPositionVariableInterface | Reads and writes Base Position variables. |
StationPositionVariable | StationPositionVariableInterface | Reads and writes Station Position variables. |
Reads a byte (B) variable from the controller.
StatusInfo Read(UInt16 variableIndex, out ByteVariableData variableData);
variableIndex
[in] The index of the variable to read.
variableData
[out] The byte variable data object to store the read data. See ByteVariableData.
A StatusInfo object indicating if the operation was successful.
//`c` is a MotomanController object that has been created with ` YMConnect.OpenConnection`
status = c.Variables.ByteVariable.Read(1, out ByteVariableData variableData);
Console.WriteLine(status);
Console.WriteLine(variableData);
Output
Code (0): OK
B001=2
Writes a byte (B) variable to the controller.
StatusInfo Write(ByteVariableData variableData);
variableData
[in] The byte variable data object to write. See ByteVariableData.
A StatusInfo object indicating if the operation was successful.
//`c` is a MotomanController object that has been created with ` YMConnect.OpenConnection`
ByteVariableData byteVariable = new ByteVariableData(255, 1);
status = c.Variables.ByteVariable.Write(byteVariable);
Console.WriteLine(status);
Output
Code (0): OK
Reads an integer (I) variable from the controller.
StatusInfo Read(UInt16 variableIndex, out IntegerVariableData variableData);
variableIndex
[in] The index of the variable to read.
variableData
[out] The integer variable data object to store the read data. See IntegerVariableData.
A StatusInfo object indicating if the operation was successful.
//`c` is a MotomanController object that has been created with ` YMConnect.OpenConnection`
status = c.Variables.IntegerVariable.Read(1, out IntegerVariableData variableData);
Console.WriteLine(status);
Console.WriteLine(variableData);
Output
Code (0): OK
I001=2
Writes an integer (I) variable to the controller.
StatusInfo Write(IntegerVariableData variableData);
variableData
[in] The integer variable data object to write. See IntegerVariableData.
A StatusInfo object indicating if the operation was successful.
//`c` is a MotomanController object that has been created with ` YMConnect.OpenConnection`
IntegerVariableData data = new IntegerVariableData(50, 10);
status = c.Variables.IntegerVariable.Write(data);
Console.WriteLine(status);
Output
Code (0): OK
Reads a double integer (D) variable from the controller.
StatusInfo Read(UInt16 variableIndex, out DoubleIntVariableData variableData);
variableIndex
[in] The index of the variable to read.
variableData
[out] The double integer variable data object to store the read data. See DoubleIntVariableData.
A StatusInfo object indicating if the operation was successful.
//`c` is a MotomanController object that has been created with ` YMConnect.OpenConnection`
status = c.Variables.DoubleIntVariable.Read(1, out DoubleIntVariableData variableData);
Console.WriteLine(status);
Console.WriteLine(variableData);
Output
Code (0): OK
D001=2
Writes a double integer (D) variable to the controller.
StatusInfo Write(DoubleIntVariableData variableData);
variableData
[in] The double integer variable data object to write. See DoubleIntVariableData.
A StatusInfo object indicating if the operation was successful.
//`c` is a MotomanController object that has been created with ` YMConnect.OpenConnection`
DoubleIntVariableData data = new DoubleIntVariableData(50, 10);
status = c.Variables.DoubleIntVariable.Write(data);
Console.WriteLine(status);
Output
Code (0): OK
Reads a real (R) variable from the controller.
StatusInfo Read(UInt16 variableIndex, out RealVariableData variableData);
variableIndex
[in] The index of the variable to read.
variableData
[out] The real variable data object to store the read data. See RealVariableData.
A StatusInfo object indicating if the operation was successful.
//`c` is a MotomanController object that has been created with ` YMConnect.OpenConnection`
status = c.Variables.RealVariable.Read(1, out RealVariableData variableData);
Console.WriteLine(status);
Console.WriteLine(variableData);
Output
Code (0): OK
R001=2
Writes a real (R) variable to the controller.
StatusInfo Write(RealVariableData variableData);
variableData
[in] The real variable data object to write. See RealVariableData.
A StatusInfo object indicating if the operation was successful.
//`c` is a MotomanController object that has been created with ` YMConnect.OpenConnection`
RealVariableData data = new RealVariableData(50, 10);
status = c.Variables.RealVariable.Write(data);
Console.WriteLine(status);
Output
Code (0): OK
Reads a string (S) variable from the controller.
StatusInfo Read(UInt16 variableIndex, out StringVariableData variableData);
variableIndex
[in] The index of the variable to read.
variableData
[out] The string variable data object to store the read data. See StringVariableData.
A StatusInfo object indicating if the operation was successful.
//`c` is a MotomanController object that has been created with ` YMConnect.OpenConnection`
status = c.Variables.StringVariable.Read(0, out StringVariableData data);
Console.WriteLine(status);
Console.WriteLine(data);
Output
Code (0): OK
S001=A STRING VARIABLE
Writes a string (S) variable to the controller. Max length is 32 characters.
StatusInfo Write(StringVariableData variableData);
variableData
[in] The string variable data object to write. See StringVariableData.
A StatusInfo object indicating if the operation was successful.
//`c` is a MotomanController object that has been created with ` YMConnect.OpenConnection`
StringVariableData data = new StringVariableData("TESTSTRING", 10);
status = c.Variables.StringVariable.Write(data);
Console.WriteLine(status);
Output
Code (0): OK
Reads a robot position (P) variable from the controller.
StatusInfo Read(UInt16 variableIndex, out RobotPositionVariableData variableData);
variableIndex
[in] The index of the variable to read.
variableData
[out] The robot position variable data object to store the read data. See RobotPositionVariableData.
A StatusInfo object indicating if the operation was successful.
//`c` is a MotomanController object that has been created with ` YMConnect.OpenConnection`
status = c.Variables.RobotPositionVariable.Read(1, out RobotPositionVariableData pos);
Console.WriteLine(status);
Console.WriteLine(pos);
Output
Code (0): OK
P001:
Coordinate Type: ToolCoordinate
Figure:
Front, Upper, Flip, S<180, L<180, U<180, R<180, B<180, T<180, E<180, W<180
Tool Number: 1
User Coordinate Number: 0
Axes:
Axis X : 0.1 millimeters.
Axis Y : 0 millimeters.
Axis Z : 0 millimeters.
Axis Rx : 0 degrees.
Axis Ry : 0 degrees.
Axis Rz : 0 degrees.
Axis Re : 0 degrees.
Axis Rw : 0 degrees.
Writes a robot position (P) variable to the controller.
StatusInfo Write(RobotPositionVariableData variableData);
variableData
[in] The robot position variable data object to write. See RobotPositionVariableData.
A StatusInfo object indicating if the operation was successful.
//`c` is a MotomanController object that has been created with ` YMConnect.OpenConnection`
status = c.Variables.RobotPositionVariable.Read(1, out RobotPositionVariableData pos);
pos.VariableIndex = 2;
status = c.Variables.RobotPositionVariable.Write(pos);
Console.WriteLine(status);
Output
Code (0): OK
Reads a base axis position (BP) variable from the controller.
StatusInfo Read(UInt16 variableIndex, out BaseAxisPositionVariableData variableData);
variableIndex
[in] The index of the variable to read.
variableData
[out] The base axis position variable data object to store the read data. See BaseAxisPositionVariableData.
A StatusInfo object indicating if the operation was successful.
//`c` is a MotomanController object that has been created with ` YMConnect.OpenConnection`
status = c.Variables.BaseAxisPositionVariable.Read(1, out BaseAxisPositionVariableData pos);
Console.WriteLine(status);
Console.WriteLine(pos);
Output
Code (0): OK
Variable Index: 0
Coordinate Type: Base
X: 100
Y: 0
Z: 0
Writes a base axis position (BP) variable to the controller.
StatusInfo Write(BaseAxisPositionVariableData variableData);
variableData
[in] Data to set. See BaseAxisPositionVariableData.
A StatusInfo object indicating if the operation was successful.
//`c` is a MotomanController object that has been created with ` YMConnect.OpenConnection`
status = c.Variables.BaseAxisPositionVariable.Read(1, out BaseAxisPositionVariableData pos);
pos.VariableIndex = 2;
status = c.Variables.BaseAxisPositionVariable.Write(pos);
Get variable data at the specified variable index.
StatusInfo Read(UInt16 variableIndex, out StationPositionVariableData variableData);
variableIndex
[in] The index of the variable to read.
variableData
[out] The base axis position variable data object to store the read data. See StationPositionVariableData.
A StatusInfo object indicating if the operation was successful.
//`c` is a MotomanController object that has been created with ` YMConnect.OpenConnection`
status = c.Variables.StationPositionVariable.Read(1, out StationPositionVariableData pos);
Console.WriteLine(status);
Console.WriteLine(pos);
Output
Code (0): OK
VariableIndex: 0
Coordinates: 0, 100, 0, 0, 0, 0, 0, 0,
Set variable data at the specified variable index. System Parameter at RS7 may need to be set to 2 to allow writing outside of REMOTE mode.
StatusInfo Write(StationPositionVariableData variableData);
variableData
[in] Data to set. See StationPositionVariableData.
A StatusInfo object indicating if the operation was successful.
//`c` is a MotomanController object that has been created with ` YMConnect.OpenConnection`
status = c.Variables.StationPositionVariable.Read(1, out StationPositionVariableData pos);
pos.VariableIndex = 2;
status = c.Variables.StationPositionVariable.Write(pos);
Console.WriteLine(status);
Output
Code (0): OK