Hi I currently have a program that uses a production switch so the program will continue to loop until the production switch is turned off then the program will go back to a change menu at the end of its current cycle. When the robot is in the home position the user must push a button to continue the cycle ( WaitDI diStart,1;)
Currently the production switch just needs to be turned off before the robot gets into its home position to end the current cycle but I would like the option for when the robot is in home position waiting on diStart to be pressed that if the production switch is turned off the program will go to main which in turn would go to the change menu.
I thought I might need to use DIBreak but I am not to sure.
Production Switch
-
David.mms -
April 4, 2019 at 10:10 AM -
Thread is marked as Resolved.
-
-
It would be a lot easier to follow your flow/logic if you posed the code...
Generally speaking and in my own personal opinion, diBreak is the way to go if you're doing a TP based menu system / flow.
I can post an example tonight of what I used. -
Yes that would be very helpful.
-
Code
Display MoreLOCAL FUNC string Select() VAR num nSelect; stHeader1:=stCykel+SecToTime(nAWLogSTN,5); stHeader2:=stEmpty; stInfo{1}:=stBlank; stInfo{2}:=stOP1; stInfo{3}:=stOP2; stInfo{4}:=stBlank; stText:=stChMenu; stFuncKey:=[stMMFKTcs,stMMFKSettings,stMMFKService,stMMFKLog,stMMFKSwitch]; nSelect:=MenuTPReadFK(\Header:=stHeader1\Header2:=stHeader2\Info:=stInfo,stText,stFuncKey\Erase\BrkDI:=diOP1OK); WaitTime 0.5; TEST nSelect CASE 1: RETURN "rTscMenu"; CASE 2: RETURN "rSetup"; CASE 3: RETURN "rServiceMenu"; CASE 4: RETURN "rLogMenu"; CASE 5: RETURN "rSwitchMenu"; CASE 99: RETURN "rProduce"; ENDTEST ERROR IF ERRNO=ERR_TP_DIBREAK THEN RETURN "rProduce"; ELSE RETRY; ENDIF ENDFUNC