DELAY

Concept Link IconSee also

Suspends execution of the current program for the given period.

WebVue support - Yes.

Syntax

DELAY(Period);

There is no return type.

Argument

Meaning

Period

The number of seconds for the delay in the range 0.1 to 3277. Any numeric type.

Execution

The current program relinquishes control to the PcVue software and requests execution after the given delay.

The use of the instruction DELAY is forbidden in functions that may run concurrently, in particular in:

  • Functions called by CYCLIC, EVENT, CRONTAB, KEY or SELECTOR

  • Send Program animations,

  • Actions associated to alarms.

A DELAY is global to a program and suspends the execution of all its functions.

If the DELAY instruction is used in the GLOBAL program, it is the program that called GLOBAL which is suspended.

Example

SUB MainDelay()

DIM dblFrequency as double; 'in Hz

DIM dblPeriod as double;' in ms

DIM intSeconds as integer; ' seconds

 

dblFrequency = 1000;

dblPeriod = 100;

intSeconds = 4;

BEEP (dblFrequency,dblPeriod);

DELAY (intSeconds);

BEEP (dblFrequency,dblPeriod);

END SUB