Command RUN
 
Description Run previously defined user code or functions.
User code is supplied in C and compiled by our firmware department subject to order.
Maximum Function Size increased: 8192 ASCII characters - v49.32.
 
Syntax/Parameters RUN(Name);
 
Options Functions can be run as macros for compact menu design.
RUN(Func1);    or    RUN(Func1,Func2,Func3...FuncN); or a pointer to a function RUN(func-ptr);

Inline Command Blocks - v30.00
Inline functions supported - RUN( [ CmdA(); CmdB(); ... Cmdn(); ] );
> RUN( [LOAD( RS2, "Hello" );] );


RUN(varcmd) - v49.02
Added support for running commands from a text variable.
This is useful when sending a SMART command over a serial link embedded in a user protocol.
It is then possible to dynamically create new entities and pages remotely from a host in a user protocol.
LOAD( cmd, "LOAD(RS2,1);LOAD(RS2,\\22Hello\\22);" ); // cmd is a text variable.Use \\22 to insert double quotes
RUN( cmd );  //Sends 1Hello via RS232 port
 
Example RUN(UpFunc);

RUN(SaveFunc,ExitFunc);
 
Update Information

 Version

 Title

Date  

 Details

00.13.00

 Runtime Counter Interrupt Problem

25 Sep 15 

Show

Fixed problem where a combination of normal and priority interrupts would cause extra priority interrupts to be processed at the normal level. This problem would only occur when more than one runtime interrupt was defined, eg both CNTSECS and CNTMILLI, and one was set with a normal priority (ie zero) and another was set with a high priority of 1 or above.

49.59

 Runtime Counter Interrupt Problem

25 Sep 15 

Show

Fixed problem where a combination of normal and priority interrupts would cause extra priority interrupts to be processed at the normal level. This problem would only occur when more than one runtime interrupt was defined, eg both CNTSECS and CNTMILLI, and one was set with a normal priority (ie zero) and another was set with a high priority of 1 or above.

49.52

 No error when func does not exist RUN(func);

28 Feb 14 

Show

Modify the RUN() command so that no error is generated if the func does not exist.
The command processor moves on to the next function when the name is not found.
This provides a mechanism for the CASE method to process a known value without a need to test existence first.

RUN(fncNotFound,txtFnc1); // Do not generate error when fncNotFound or txtFnc1 does not exist

49.32

 Parser - Maximum Function Size increased: 8192 ASCII characters.

14 Feb 13 

Show

* Maximum Function Size increased: 8192 ASCII characters (was 4096 in V00.49.31)
* Error message "Memory Error - Function Too Big. Please split into smaller functions" if the 8192 limit is reached. Please make smaller functions (eg using RUN(fnc1,fnc2,fnc3);) or contact us if this is a problem.

49.02

 RUN( cmd ) - Added support for running commands from a text variable.

15 May 12 

Show

Added support for running commands from a text variable.
This is useful when sending a SMART command over a serial link embedded in a user protocol.
It is then possible to dynamically create new entities and pages remotely from a host in a user protocol.
LOAD( cmd, "LOAD(RS2,1);LOAD(RS2,\\22Hello\\22);" ); // cmd is a text variable.Use \\22 to insert double quotes
RUN( cmd ); //Sends 1Hello via RS232 port
* Inline functions also supported: RUN( [LOAD( RS2, "Hello" );] );

48.24

 IF() - A page name as well as the existing function name are now supported in the IF() then/else statement.

10 Mar 12 

Show

A page name as well as the existing function name are now supported in the IF() then/else statement, thus allowing a RUN(function) or SHOW(page) to be directly called.
K00-K30 are now supported in IF() test, eg IF( K03 = 1 ? func );

30.00

 Inline Command Blocks - enclosed in [...]'s - Commands that make calls to functions can now include the function code inline.

24 Sep 10 

Show

Commands that make calls to functions (RUN, IF, INT,KEY) can now include the function code inline by enclosing commands in square brackets [] or call a function.

IF( VarA op VarB ? [ CmdYA(); CmdYB(); ... CmdYn(); ] : [ CmdNA(); CmdNB(); ... CmdNn(); ] );

RUN( [ CmdA(); CmdB(); ... Cmdn(); ] );

INT( Name, Buf, [ CmdA(); CmdB(); ... Cmdn(); ] );

KEY( Name, [ CmdA(); CmdB(); ... Cmdn(); ], X, Y, Style );

Examples:
IF(VarA >= 50 ? [CALC(VarA,VarA,5,"-");TEXT(TxtA,VarA);;] : [LOAD(RS2,"VarA=",VarA);SHOW(PageN);] );

KEY(keyX,[CALC(varX,varX,1,"+");],123,12,stKey);

This reduces the number of lines in the file by almost 30% and keeps related code close to the action.

27.00

 Entity Pointers - Entity pointers have been added.

10 Sep 10 

Show

Entity pointers have been added.
STYLE( PtrData, DATA ) { type = pointer; }
VAR( EntPtr1, PtrData );

To set/change which entity the entity pointer is pointing to you enclose its name in quotes.
LOAD( "EntPtr1", "Var1" ); // Set EntPtr1 to point to "Var1"

To access the entity pointed to by the entity pointer, do not enclose is quotes.
LOAD( EntPtr1, "ABC" ); // Load the Entity pointed to
by EntPtr1 with "ABC"

The following commands now support entity pointers:
> LOAD(name|ptr|"ptr",num|"txt"|var|ptr,...);
> CALC(var|ptr,var|ptr,num|var|ptr,"op");
> TEXT(name|ptr,"txt"|var|ptr,...);
> IF(var|ptr op num|"txt"|var|ptr ? func|func_ptr : func|func_ptr);
> KEY(name,func|func_ptr,...);
> INT(name,buf,func|func_ptr,...);
> SHOW(name|ptr,...);
> HIDE(name|ptr,...);
> RUN(name|func_ptr,...);
> IMG(name|img_ptr,lib|img_ptr,...);

See the tu480.mnu file for an example of using pointers to update images representing CNTSECS.