#include "rsi.h"
#include "SampleAppsHelper.h"
#include "SampleApps.h"
int UserLimitDigialInputAction::Run()
{
const int AXIS_COUNT = 1;
const int AXIS_NUMBER = 0;
const double USER_UNITS = 1048576;
const int IO_NODE_NUMBER = 0;
const int USER_LIMIT = 0;
const int CONDITION = 0;
const int INPUT_BIT_NUMBER = 0;
USE_HARDWARE = false;
if (USE_HARDWARE)
{
}
else
{
std::cout << "This sample app cannot be run without hardware." << std::endl;
return 0;
}
try
{
controller->UserLimitCountSet(1);
io = controller->IOGet(IO_NODE_NUMBER);
auto mask1 = digitalInput->
MaskGet();
auto mask2 = digitalInput->
MaskGet();
controller->UserLimitConditionSet(USER_LIMIT,
CONDITION,
printf("Waiting for the input bit to go high...\n");
printf("\nPress Any Key To Exit.\n");
{
printf("User Limit state is %d\r", controller->UserLimitStateGet(USER_LIMIT));
controller->OS->Sleep(1);
}
controller->UserLimitDisable(USER_LIMIT);
}
{
printf(
"Text: %s\n", rsiError.
text);
return -1;
}
controller->Delete();
return 0;
}
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....
static MotionController * CreateFromSoftware()
Initialize and start the RMP EtherCAT controller.
Represents the RMP soft motion controller. This class provides an interface to general controller con...
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 ...