REFRESH_DB

Concept Link IconSee also

Asynchronous assignment of variable from an ASCII file.

WebVue support - Yes.

Mode

Mnemonic

Syntax

0 SETUP 1
1 LOAD 2

Syntax 1

IntVal = REFRESH_DB(Mode, AssignTime, IdleTime);

Return type: INTEGER.

Argument

Meaning

AssignTime

The time period allowed to assign values to the list of variables. Default value 250 ms. Type INTEGER.

IdleTime

The time during which the process is paused. Default value 250 ms. Type INTEGER.

Execution

Mode

Mnemonic

Action

0

SETUP

Change the delays used in assigning values to variables.

If the SETUP mode is used without any parameters, the assignment is treated in one block. If values are to be assigned to a large number of variables, this could eventually stop the system.

Syntax 2

IntVal = REFRESH_DB(Mode, Filename [, Type]);

Return type: INTEGER.

Filename

Name of the file from which the assignment will be made. The syntax must be as follows:

id1, val 1
id 2, val 2
............
id n, val n

 

where:

id is the identification of the variable(either its name or its internal Id).
val is the assignment value.

Type

Specifies the type of file:

0 The name of the variable is specified (default).
1 The internal ID of the variable is specified.

Execution

Mode

Mnemonic

Action

1

LOAD

Start the assignment process.
The default path for the file is the TP folder of the current project.

Return: 1 if OK, else 0.

Example

SUB rdb_set()
REFRESH_DB("SETUP", 800, 1000);
END SUB

SUB rdb_go()
DIM i as integer;
  i = 0;
  WHILE (i == 0)
  i = REFRESH_DB("LOAD", "C\\DLOAD\\tstvar.txt");
DELAY(2);
WEND
END SUB