28#define BIT_MASK RSIControlIOMaskUSER0_OUT
31using namespace RSI::RapidCode::SynqNet;
34void sequencerDigitalOutputMain()
39 MotionController *controller ;
41 long controllerDigitalOutputAddr;
42 long axisActualPositionAddr;
45 controller = MotionController::CreateFromBoard(0);
52 controllerDigitalOutputAddr = controller->
AddressFromStringGet(
"SystemData.IO.HostOutput[0]",
"c:\\mei\\xmp\\bin\\winnt\\stdmei.map");
55 axisActualPositionAddr = axis->AddressGet(RSIAxisAddressTypeACTUAL_POSITION);
58 controller->SequencerEnableSet(SEQUENCER,
true);
61 for(
int i = 0; i < TRIGGERS; i++)
64 controller->CommandWaitLong(SEQUENCER,
65 RSICommandOperatorGREATER_OR_EQUAL,
66 axisActualPositionAddr,
69 controller->CommandComputeLong(SEQUENCER,
71 controllerDigitalOutputAddr,
72 controllerDigitalOutputAddr,
75 controller->CommandDelay(SEQUENCER, 0.50);
78 controller->CommandComputeLong(SEQUENCER,
79 RSICommandOperatorAND,
80 controllerDigitalOutputAddr,
81 controllerDigitalOutputAddr,
86 controller->SequencerStart(0);
88 printf(
"press a key to stop and delete sequencer \n");
91 while(controller->
OS->
KeyGet(RSIWaitPOLL) < 0)
96 controller->SequencerStop(0);
97 controller->SequencerEnableSet(0,
false);
100 catch (RsiError *err)
102 printf(
"%s\n", err->text);
Axis * AxisGet(int32_t axisNumber)
AxisGet returns a pointer to an Axis object and initializes its internals.
uint64_t AddressFromStringGet(const char *const addressName)
Get a controller memory address from string.
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.