12.07.2015 Views

RAPID reference manual - Technology

RAPID reference manual - Technology

RAPID reference manual - Technology

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

InstructionClkStartRobotWare-OSClkStart - Starts a clock used for timingClkStart is used to start a clock that functions as a stop-watch used for timing.ExampleClkStart clock1;The clock clock1 is started.ArgumentsClkStartClockClockData type: clockThe name of the clock to start.Program executionWhen a clock is started, it will run and continue counting seconds until it is stopped.A clock continues to run when the program that started it is stopped. However, theevent that you intended to time may no longer be valid. For example, if the programwas measuring the waiting time for an input, the input may have been received whilethe program was stopped. In this case, the program will not be able to “see” the eventthat occurred while the program was stopped.A clock continues to run when the robot is powered down as long as the battery backupretains the program that contains the clock variable.If a clock is running it can be read, stopped or reset.ExampleVAR clock clock2;ClkReset clock2;ClkStart clock2;WaitUntil DInput(di1) = 1;ClkStop clock2;time:=ClkRead(clock2);The waiting time for di1 to become 1 is measured.<strong>RAPID</strong> <strong>reference</strong> <strong>manual</strong> - part 1a, Instructions A-R 41

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!