Menu

Topic-icon Better Documentation: Timers stop on Emergency Stop

More
5 years 6 months ago #29529157 by jetonski
I'd like to suggest a more detailed description in the controller manual of what effects using the emergency stop command has. It would have been helpful to know that the timers do not run when that condition is set.

Since script execution continues, I assumed timers did as well, and spent a while looking for possible memory corruption, etc. Hand tracing the code with lots of debug output finally led me to understand that emergency stop is halting the timers. Worth documenting.

Respectfully submitted,
Jacob

Please Log in or Create an account to join the conversation.

  • roboteq
  • roboteq's Avatar
5 years 6 months ago #29529158 by roboteq
Checking the source code, Timers are not supposed to be suspended during emergency stop. We'll take a closer look again.

Please Log in or Create an account to join the conversation.

More
5 years 6 months ago - 5 years 6 months ago #29529166 by jetonski
I just noticed that my code was doing the following:
SetCommand(_EX, 0)
When in principle it should be
SetCommand(_EX)

It was an oversight since the command had previously been
SetCommand(_MS, 0)

Don't know if the misplaced parameter could be related to the unexpected timer behavior?

edit

Nevermind.
SetCommand() requires a second parameter.

Please Log in or Create an account to join the conversation.

More
5 years 6 months ago #29529167 by jetonski
Here's some code to reproduce it:
Option Explicit
Dim mainLoopCounter as Integer

'----------------------------- INIT ------------------------------------------------------
Init:
	
	mainLoopCounter = 0
	SetTimerCount(1, 500000) '500 seconds
	SetTimerState(1, 0)
	
Goto Main


'----------------------------- MAIN LOOP ------------------------------------------------------
Main:
	
	'increment counter as a marker of script execution
	mainLoopCounter++
		
	'"extern" the variables using user variables, to be accessed via serial commands
	SetCommand(_VAR, 1, mainLoopCounter)
	SetCommand(_VAR, 2, GetTimerCount(1))
	
	'Catch your breath. You're working too hard.
	wait(9)
	
goto Main

After that's loaded, I'm doing the following in a console to watch the timer value change:
!R 2
?var
# 10

Sending an emergency stop command halts the timer countdown. Releasing the emergency stop resumes countdown.

Tested on VBL2350 with firmware ID: Roboteq v1.3 RCB200 03/11/2014

Please Log in or Create an account to join the conversation.

Moderators: tonysantoni
Time to create page: 0.086 seconds
Go to top