RobotStudio event

atomicity of a digital input/output signal/shared variable in RAPID

BEGINTASK<Task1, Null>
	MODULE Module1
	CONST robtarget Target_10 :=[[326.494, 425, 634.740], [0.104, 0, 0.983, 0], [-1, 0, -1, 0], [9E+09, 9E+09, 9E+09, 9E+09, 9E+09, 9E+09]];
	CONST robtarget Target_20 :=[[-474.642, 265, 298.999], [0.087, 0, 0.996, 0], [-1, 0, 0, 0], [9E+09, 9E+09, 9E+09, 9E+09, 9E+09, 9E+09]];
	CONST robtarget Initial_point :=[[0.446, 0, 764.740], [0.809, 0, 0.587, 0], [0, -1, 0, 4], [9E+09, 9E+09, 9E+09, 9E+09, 9E+09, 9E+09]];
	PROC MAIN()
		IF Target_10.trans.x>0 and Target_20.trans.x<0
		    Path_Q1_Q2;
		SETDO do1 ,0;
	ENDPROC
	PROC Path_Q1_Q2()
		MoveJ Target_10,v1000,z100,MyTool\WObj:=wobj0;
		MoveJ Target_20,v1000,z100,MyTool\WObj:=wobj0;
		MoveJ Initial_point,v1000,z100,MyTool\WObj:=wobj0;
	ENDPROC
 	ENDMODULE
ENDTASK		

BEGINTASK<Task2, Null>
	MODULE Module1
	PERS robtarget Target_10 ;
	PERS robtarget Target_20 ;
	PROC MAIN()
		WaitDO do1 ,0;
	    	Target_10.trans.x:=0;
	    	Target_20.trans.x:=0;
	ENDPROC
	ENDMODULE
ENDTASK		
Hai,
Consider we have two tasks task1 which resets a digital output d01 to 0 and corresponding to that task 2 which is waiting for the d01 value to become 0. Meantime is there any other situation where the d01 value changed by some other inbuilt functions or commands other than task 1 and task 2?

Comments

  • A cross connection would be about the only thing that would change the value, if no other rapid instructions are acting upon that signal.
    Lee Justice
  • Why wouldn't you want to use a syncident instead?

    Then you would never need to worry about something else possibly changing a DO at the wrong time either though a programming mistake or cross connection, and you could still use DO1 in the future if you needed it. 

    -Brian