System INPUT signal
Nata_lia
✭
I am using system input signal " startmain" to start the main program from PLC. When we start main from PLC would it erase all my variables to their default value or their values will be retained?
0
Comments
-
Dear Natalia
By my experience, "StartAtMain" would not erase/reset the variables as long as we don't declare something which can reset them on the "main" procedure.
For example:
PROC main()
VAR num Stack:=0;
........
Stack:=0;
......
MoveL......
But be careful for using VAR type, because some variables can be erased to their default value after controller is shutdown.
BR
fear of GOD is the beginning of wisdom0 -
Hey, Thanks Dhyan. I am using it to start Home move from PLC, I will let you know how it works.
0 -
The part of my code is like this,
var num count =0; ! defined in user.sys
proc main()
LOOP:
....
....
myproc1;
Goto LOOP;
endproc
proc myproc1()
count=count+1;
endproc
When the program is stopped from the PLC and started again from main (StartMain) by the PLC, I still need the count variable to remember its value it has when the program was stopped.
0 -
Hi Natalia,You need to define count variable as persistent.PERS num count:=0;BR.Erdem Karaçeper0
-
Yea thank you very much , I did that and wanted to confirm it. Thank you very much
0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 801 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings