Hello, everyone
how can i use xmove function with more than 1 signal with OR operator?
example:
XMOVE p1 TILL 1001 OR 1002
should I used background logic?
Hello, everyone
how can i use xmove function with more than 1 signal with OR operator?
example:
XMOVE p1 TILL 1001 OR 1002
should I used background logic?
Hello,
You can use a WHILE loop having that connditions or create a background program.
For the WHILE loop, the robot will go to the final point and the motion it will be intrerupted by the conditions from the while.
cond = 0
LMOVE p1
WHILE cond==0 DO
IF SIG(1001) AND cond ==0 THEN
BRAKE
cond = 1
END
IF SIG(1002) AND cond==0 THEN
BRAKE
cond = 2
END
IF DISTANCE(HERE,DEST)<=5 AND cond==0 THEN
cond = 3
END
END
CASE cond OF
VALUE 1:
TYPE "Robot stopped by 1001 signal"
VALUE 2:
TYPE "Robot stopped by 1002 signal"
VALUE 3:
TYPE "Robot reached the final position"
ANY :
TYPE "State unkown"
HALT
END
And for the backgroup program:
.PROGRAM autostart.pc ()
loop:
IF SIG(1001) OR SIG(1002) THEN
SIGNAL 2001
ELSE
SIGNAL -2001
END
TWAIT 0.1
GOTO loop
Use XMOVE TILL 2001
I know that the XMOVE function had some bugs with the old AS version, make sure to have the lastest version from AS and SV. And also make sure to have a watchdog for the background program, If it is in stopped mode, the robot might collide or do other silly thing.
Welcome to the forum...………
I have never tried using multiple signals, so cannot be sure if it will accept the syntax or not.
However, I am pretty sure you can only detect on single signal as there are positive/trailing edge detection modes and also /ERR and /LVL options associated with the command. and these would not be possible across more than one signal.
In which case, a background task to provide the detection signal would be an alternative.
- but the background task must be running prior to the XMOVE instruction
Display MoreHello,
And for the backgroup program:
.PROGRAM autostart.pc ()
loop:
IF SIG(1001) OR SIG(1002) THEN
SIGNAL 2001
ELSE
SIGNAL -2001
END
TWAIT 0.1
GOTO loop
Use XMOVE TILL 2001
I know that the XMOVE function had some bugs with the old AS version, make sure to have the lastest version from AS and SV. And also make sure to have a watchdog for the background program, If it is in stopped mode, the robot might collide or do other silly thing.
Hello, thank you for reply
I made like that yesterday.
Today, I tested and everything working good with background logic. I put on the beginning program PCEXECUTE command with this logic and everything is OK.
Before the XMOVE function you can check if the autostart is still running:
IF TASK(1003)<>1 THEN
PCABORT 3:
PCEXECUTE 3:
END
This code will check if the autostart3 is not running, it will execute again. If you have a different program name, you can put the name into after the pcexecute 3: program_name.
Hello,
According to the changelog from the AS updates, a bug from XMOVE function has been fixed in ASE_010300X54 version.
Also in the latest version, a bug from ABS.SPEED has been fixed.
I attached the history file with the changelog from the AS updates E-Controller.
Some interesting fixes in there...…..Many thanks for sharing...………