26#include "SampleAppsHelper.h"
27#include "SampleApps.h"
32int UserLimitDigialInputAction::Run()
39 const int AXIS_COUNT = 1;
40 const int AXIS_NUMBER = 0;
42 const double USER_UNITS = 1048576;
44 const int IO_NODE_NUMBER = 0;
45 const int USER_LIMIT = 0;
46 const int CONDITION = 0;
47 const int INPUT_BIT_NUMBER = 0;
65 std::cout <<
"This sample app cannot be run without hardware." << std::endl;
78 io = controller->
IOGet(IO_NODE_NUMBER);
84 auto mask1 = digitalInput->
MaskGet();
85 auto mask2 = digitalInput->
MaskGet();
98 printf(
"Waiting for the input bit to go high...\n");
99 printf(
"\nPress Any Key To Exit.\n");
113 printf(
"Text: %s\n", rsiError.text);
The IO object provides an interface to the inputs and outputs of a network node.
uint64_t AddressGet()
Get the Host Address for the I/O point.
static IOPoint * CreateDigitalInput(Axis *axis, RSIMotorDedicatedIn motorDedicatedInNumber)
Create a Digital Input from an Axis' Dedicated Input bits.
int32_t MaskGet()
Get the bit mask for the I/O point.
Represents one specific point: Digital Output, Digital Input, Analog Output, or Analog Input....
void UserLimitDisable(int32_t number)
Disable the processing of 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.
void UserLimitConfigSet(int32_t number, RSIUserLimitTriggerType triggerType, RSIAction action, int32_t actionAxis, double duration, bool singleShot)
Configure a User Limit.
static MotionController * CreateFromSoftware()
Initialize and start the RMP EtherCAT controller.
void Delete(void)
Delete the MotionController and all its objects.
IO * IOGet(int32_t nodeNumber)
IOGet returns a pointer to an IO object using its node number and initializes its internals.
bool UserLimitStateGet(int32_t number)
Get the state of a User Limit.
void UserLimitCountSet(int32_t userLimitCount)
Set the number of processed UserLimits in the MotionController.
Represents the RMP soft motion controller. This class provides an interface to general controller con...
RapidCodeOS * OS
Provides access to operating system (Windows) features.
void Sleep(int32_t milliseconds)
Put the current thread to sleep.
int32_t KeyGet(int32_t milliseconds)
Wait for a key to be pressed and return its value.
Represents the error details thrown as an exception by all RapidCode classes. This class contains an ...
@ RSIUserLimitLogicEQ
Equal to.
@ RSIActionE_STOP_ABORT
E-Stop then Abort.
@ RSIWaitPOLL
return immediately, use polling
@ RSIUserLimitTriggerTypeSINGLE_CONDITION
Only one condition is evaluated.
static void SetupControllerForHardware(MotionController *controller)
Sets up the controller for hardware use by resetting it and starting the network.
static void CheckErrors(RapidCodeObject *rsiObject)
Checks for errors in the given RapidCodeObject and throws an exception if any non-warning errors are ...