Functions that assist with retrieving system information from the controller.
Name | Description |
---|---|
ReadState | Get the current state of the controller. |
ReadSystemInformation | Get System Information from the controller. This includes softwareVersion and modelName |
ReadOperatingTimes | Get times from the controller according to the specified time type. |
ReadSystemParam | Read a system parameter from the controller. |
Get the current state of the controller. This includes the cycle mode, if the controller is running, the control mode, if it is in hold, alarming or erroring, and the servo state.
StatusInfo ReadState(out ControllerStateData statusDataObject);
statusDataObject
[out] Contains the current state of the controller. See ControllerStateData.
A StatusInfo object indicating if the operation was successful.
//`c` is a MotomanController object that has been created with ` YMConnect.OpenConnection`
status = c.Status.ReadState(out ControllerStateData stateData);
Console.WriteLine(status);
Console.WriteLine(stateData);
//be sure to close `c` with `YMConnect.CloseConnection` when the application is done
Get System Information from the controller. This includes software version and model name. Corresponds to Version Information on the programming pendant.
StatusInfo ReadSystemInformation(SystemInfoId sysInfoId, out SystemInfoData systemInfo);
sysInfoId
[in] The type of system information to retrieve. See SystemInfoId.
systemInfo
[out] Contains the system information. The system software version is returned always. If sysInfoId is R1-R8
, the model name is returned. If S1-S24
is selected, modelName will be empty. Model name is limited to 16 characters.
Anything beyond that will be truncated. See SystemInfoData.
A StatusInfo object indicating if the operation was successful.
//`c` is a MotomanController object that has been created with ` YMConnect.OpenConnection`
status = c.Status.ReadSystemInformation(SystemInfoId.R1, out SystemInfoData systemInfoData);
Console.WriteLine(status);
Console.WriteLine(systemInfoData);
//be sure to close `c` with `YMConnect.CloseConnection` when the application is done
Get times from the controller according to the specified time type.
StatusInfo ReadOperatingTimes(ControlGroupId controlGroupId, TimeType timeType, out TimeData timeData, ApplicationNumber appNumber = ApplicationNumber.ApplicationOne);
controlGroupId
[in] The control group to retrieve the time from. Specify for TimeTypes that are not totals or applications, otherwise pass R1. See ControlGroupId.
timeType
[in] The category of time to retrieve. See TimeType.
timeData
[out] Contains the time data if return is successful. See TimeData.
appNumber
[in] If timeType is ApplicationOperationTime, this is the application selection. See ApplicationNumber.
A StatusInfo object indicating if the operation was successful.
Read out a system parameter from the controller. S1CxG
, AxP
and SxE
parameters require a group to be specified. Use the other overload for these.
StatusInfo ReadSystemParam(SystemParameterType parameterType, Int32 parameterNumber, out Int32 parameterValue);
parameterType
[in] The type of parameter to retrieve. See SystemParameterType.
parameterNumber
[in] Index of the parameter to retrieve.
parameterValue
[out] The retrieved parameter value from the controller.
A StatusInfo object indicating if the operation was successful.
//`c` is a MotomanController object that has been created with ` YMConnect.OpenConnection`
status = c.Status.ReadSystemParam(SystemParameterType.RS, 2, out int paramNumber);
Console.WriteLine(status);
Console.WriteLine(paramNumber);
//be sure to close `c` with `YMConnect.CloseConnection` when the application is done
Read out a system parameter from the controller with the ability to specify a group.
StatusInfo ReadSystemParam(SystemParameterType parameterType, Int32 parameterNumber, Int32 parameterGroup, out Int32 parameterValue);
parameterType
[in] The type of parameter to retrieve. See SystemParameterType.
parameterNumber
[in] Index of the parameter to retrieve.
groupNumber
[in] The group number of the parameter to retrieve.
parameterValue
[out] The retrieved parameter value from the controller.
A StatusInfo object indicating if the operation was successful.
//`c` is a MotomanController object that has been created with ` YMConnect.OpenConnection`
status = c.Status.ReadSystemParam(SystemParameterType.RS, 2, 1, out int parameterValue);
Console.WriteLine(status);
Console.WriteLine(parameterValue);
//be sure to close `c` with `YMConnect.CloseConnection` when the application is done