multiposition-add

ivanmason/accelstepper/multiposition-add

Add positions to position array. Must match number of stepper in multistepper-addstepper
multiposition-add
@/multiposition-add
Add positions to position array. Must match number of stepper in multistepper-addstepper
MPOSI@/multiposition
mposinumber (variadic)
Number of steps
mdirboolean (variadic)
Direction of move clockwise = True anticlockwise = False
multiposition-add
OUT
MPOSI
mposi
mdir
OUT@/multiposition
To use the node in your project you should have the ivanmason/accelstepper library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

struct State {
};

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    auto _positions = getValue<input_MPOSI>(ctx);

    if (_positions.idx >= _positions.numstepper){
        return;
    }
    long position = getValue<input_mposi>(ctx);
    if(getValue<input_mdir>(ctx))
        _positions.position[_positions.idx] = position;
    else _positions.position[_positions.idx] = -position;
    _positions.idx++;
    
    emitValue<output_OUT>(ctx, _positions);

}