Rice Lake iRite IDE User Manual

Page 78

Advertising
background image

74

920i

Programming Reference

SetTimer

Sets the time-out value of timer T (1–32). Timer values are specified in 0.01-second intervals (1= 10 ms, 100 =
1 second). For one-shot timers, the SetTimer function must be called again to restart the timer once it has expired.

Method Signature:
function SetTimer (T : Integer ; V : Integer) : Syscode;

Parameters:

[in]

T

Timer number

[in]

V

Timer value

SysCode values returned:

SysInvalidTimer

The timer specified by

T

a not valid timer.

SysOK

The function completed successfully.

SetTimerDigout

SetTimer Digout is used to provide precise control of state changes for timers using TimerDigoutOff or
TimerDigoutOn modes. The state of the specified digital output (slot S, bit D)is changed when timer T (1–32)
expires.

Method Signature:
function SetTimer (T : Integer ; S : Integer ; D: Integer) : Syscode;

Parameters:

[in]

T

Timer number

[in]

S

Digital I/O slot number

[in]

D

Digital I/O bit number

SysCode values returned:

SysInvalidTimer

The timer specified by

T

a not valid timer.

SysOK

The function completed successfully.

Example:
SetTimer(1,100); -- Set value of Timer1 to 100 (1 second)

SetTimerMode(1,TimerDigoutOn); -- Set timer mode to turn on the digital output

SetTimerDigout(1,0,1); -- Set which digital output to control (slot 0, bit 1)

StartTimer(1); -- Start timer

SetTimerMode

Sets the mode value, M, of timer T (1–32). This function, normally included in a program startup handler, only
needs to be called once for each timer unless the timer mode is changed.

Method Signature:
function SetTimer (T : Integer ; M : TimerMode) : Syscode;

Parameters:

[in]

T

Timer number

[in]

M

Timer mode

TimerMode values sent:

TimerOneShot

Timer mode is set to one-shot.

TimerContinuous

Timer mode is set to continuous.

TimerDigOutOff

One-shot timer sets a digital output off when the timer expires.

TimerDigOutOn

One-shot timer sets a digital output on when the timer expires.

SysCode values returned:

SysInvalidTimer

The timer specified by

T

is a not valid timer.

SysInvalidState

The timer specified by

M

is a not valid timer mode.

SysInvalidRequest

The slot or bit number configured is not a valid digital output .

SysOK

The function completed successfully.

Advertising
This manual is related to the following products: