|
The RMP Motion Controller APIs
|
#include "rsi.h"
#include "HelperFunctions.h"
void UserLimitDigitalInputActionMain()
{
const int IO_NODE_NUMBER = 1;
const int AXIS_NUMBER = 3;
const int USER_LIMIT = 0;
const int CONDITION = 0;
const int INPUT_BIT_NUMBER = 7;
try
{
io = controller->
IOGet(IO_NODE_NUMBER);
CONDITION,
RSIUserLimitLogic::RSIUserLimitLogicEQ,
controller->
UserLimitConfigSet(USER_LIMIT, RSIUserLimitTriggerType::RSIUserLimitTriggerTypeSINGLE_CONDITION, RSIAction::RSIActionE_STOP_ABORT, AXIS_NUMBER, 0.0);
printf("Waiting for the input bit to go high...\n");
printf("\nPress Any Key To Exit.\n");
while (controller->
OS->
KeyGet((int32_t)RSIWait::RSIWaitPOLL) < 0)
{
}
}
{
printf(
"Text: %s\n", rsiError.
text);
}
system("pause");
}
RapidCodeOS * OS
Provides access to operating system (Windows) features.
void Sleep(int32_t milliseconds)
Put the current thread to sleep.
int32_t MaskGet()
Get the bit mask for the I/O point.
The RsiError object contains information about any RapidCode API object's error/exception.
The IO object provides an interface to the inputs and outputs of a network node.
void Delete(void)
Delete the MotionController and all its objects.
int32_t KeyGet(int32_t milliseconds)
Wait for a key to be pressed and return its value.
void UserLimitDisable(int32_t number)
Disable the processing of a User Limit.
static MotionController * CreateFromSoftware()
Initialize and start the RMP EtherCAT controller.
uint64_t AddressGet()
Get the Host Address for the I/O point.
IO * IOGet(int32_t nodeNumber)
IOGet returns a pointer to an IO object using its node number and initializes its internals.
void UserLimitConfigSet(int32_t number, RSIUserLimitTriggerType triggerType, RSIAction action, int32_t actionAxis, double duration, bool singleShot)
Configure a User Limit.
void UserLimitConditionSet(int32_t number, int32_t conditionNumber, RSIUserLimitLogic logic, uint64_t addressOfUInt32, uint32_t userLimitMask, uint32_t limitValueUInt32)
Set the conditions for a User Limit with a 32-bit integer trigger value.
The MotionController object represents the RMP INtime soft motion controller.
bool UserLimitStateGet(int32_t number)
Get the state of a User Limit.
The IOPoint object represents one specific point class such as: Digital Output, Digital Input,...
static IOPoint * CreateDigitalInput(Axis *axis, RSIMotorDedicatedIn motorDedicatedInNumber)
Create a Digital Input from an Axis' Dedicated Input bits.
static void CheckErrors(RapidCodeObject rsiObject)
Check if the RapidCode Object has any errors.
static void StartTheNetwork(MotionController controller)
Start the controller communication/network.