Hi all. I need help with my custom M code I've started to write. I ran into a problem right at the beginning with an "if" statement. My M code should be M105 P100 and it seems the "P" value isn't transfered into the M code.
Code:
#!/bin/bash
operand="$1"
if [[ "$operand" == 100 ]]; then
halcmd setp lcec.0.EL2008.dout-0 true
echo "ok"
else
halcmd setp lcec.0.EL2008.dout-1 true
exit 1
fi
exit 0
The M code always outputs "else" condition so "operand" isn't 100 as expected.
I also wrote a similar M code with "case" and there the P value is recognised by bash.
What did I do wrong here?