Hi everyone, I'm doing my thesis work which consists on programming on WorkVisual. However, I don't have a copy of Officelite, so I can't try my code out. Basically I want to create a spline block and, while executing it, I want to execute a subprogram which involves ASYPTP. Here's the idea:
Code
GLOBAL DEF Function()
TRIGGER WHEN PATH = 20 DELAY = 0.0 DO AsynFunc() PRIO = -1
SPLINE
SLIN MoveUpZ
TRIGGER WHEN DISTANCE = 0 DELAY = 0.0 DO BAS(#VEL_CP, NewVel) PRIO = -1
SCIRC Rotate_1, Rotate_2
TRIGGER WHEN DISTANCE = 0 DELAY = 0.0 DO BAS(#VEL_CP, OldVel) PRIO = -1
SLIN MoveDownZ
ENDSPLINE
WAIT FOR Done
;proceeds with another movement
END
GLOBAL DEF AsynFunc()
output_open_clamp = TRUE
WAIT FOR input_clamp_open
output_open_clamp = FALSE
ASYPTP XMoveClamp
output_close_clamp = TRUE
WAIT FOR input_clamp_open
output_close_clamp = FALSE
Done = TRUE
END
Display More
Variables input_ and output_ are exchanged via Ethercat with a PLC and the exchange is done within sps.sub.
Will this work or it's better to create a .sub code? Is "AsynFunc()" completely independent by the "main" code in "Function()"? Is the movement going to be fluid or not?
And finally, do you have any suggestion on how I should write my code in case this doesn't work?
Thanks in advance to whoever takes the time to answer!