setMark command not working


I can’t get the setMark() command to work. It seems to not accept any argument. A google search showed there was a thread here on this topic before, but I can’t find it.


Hi Wfk,

There’s a method called def setMark(self, value): which you can use to set the absolute position in the range from -2^21 to +2^21-1. Once the mark has been set, you can then call method def goMark(self): which will produce a motion to the marked position.


Hi Rakesh,

I’ve seen both methods, but I found that ‘Motor.setMark(0)’ doesn’t work. I don’t have the exact error message handy, but it was something like ‘argument cannot be a tuple, it must be an integer or…’.

Thanks, Wfk


I understand the issue now. The correct coding for setMark() in should be,

def setMark(self, value):
    if value > 0x3fffff: value = 0x3fffff
    if value < -0x3fffff: value = -0x3fffff
    self.setParam(LReg.MARK, value)


Ok, thanks. How/where to implement this code (Linux/Python newbie here…)


Run the following command in the Terminal window, to find file,

$ sudo find . -name

The output should print something similar to this,


Use a Text Editor, search for method def setMark(self, value), and make the appropriate changes to the lines of code in ./slushengine/Slush/

Go to the directory of ./slushengine and run the following command to install the modified package:

$ sudo python3 install


Yes, that worked!
I think it’s useful to also put this line in:
if value == 0: value = self.getPosition()



There’s no harm in inserting that line too.

By the way, the error message relating to argument cannot be a tuple, it must be an integer or… - setMark() was trying to pass an array into self.xfer(), which only accepts an integer value.