FC 92 - Invoke BASIC

The invoke BASIC function code causes the controller BASIC interpreter to execute. If automatic load/run has been selected in the configure BASIC function block, the interpreter runs the program. Otherwise it prompts for further action. This block must be in the same segment as the configure BASIC block. A function block segment can contain multiple invoke BASIC blocks, each of which will initiate execution of the BASIC program. This function code provides one output that is selected in the BASIC program with the BOUT command. Figure 92-1 shows a sample BASIC configuration. Reference the MFC BASIC Programming Language Reference for instructions on programming with BASIC.

 

NOTE: This function code is supported only on the BRC-100 and the IMMFP11/12 controllers.

 

Outputs:

Blk

Type

Description

N

R

The BOUT command in the BASIC program sets output N

 

 

Specifications:

Spec

Tune

Default

Type

Range

Description

S1

N

0.000

R

Full

Initiates execution of the BASIC program by providing

a value for SYSVAR

 

 

92.1 Explanation

 

This block initiates execution of the BASIC program by assigning a value to the BASIC variable SYSVAR.  SYSVAR is then either an input to the BASIC program itself or selects the entry point of a BASIC program as shown by examples one and two. Figure 92-1 shows a typical controller BASIC configuration.

 

 

 

92.2 Examples

 

92.2.1 Example 1

 

When SYSVAR is an input, assume:

 

S1 equals 2 and the first function containing SYSVAR is:

100 A = SYSVAR * 10

 

the program begins executing at line 100 and A equals 20.

 

If there are more than one invoke BASIC block configured, the value of S1 can remain the same or be different in each one.

 

For example, if the second invoke BASIC block has S1 equals three, then A equals 30 for that particular iteration of the

program, etc.

 

92.1.2 Example 2

 

SYSVAR selects the entry point of a BASIC program:

 

10 ON SYSVAR GOTO 100...

 

Every time the program receives a value for SYSVAR, it goes to line 100 and begins execution. When using SYSVAR in this manner (as a trigger), its value is unimportant.