boardSetApplication (Function)

Top  Previous  Next

Architecture:

NX32 / NX32L

Device support:

All

Firmware version:

4.60 / 1.10.00


This function sets an alternative application to run when the device boots.

The changes will take effect at device reset. (e.g. by using boardReset).

 

The application must be a valid VSX file and can be placed on the Project Drive (P:). On LX/NX devices the VSX file can also be placed on the internal drive (B:) or on the SD-CARD drive (A:).

 

The VSX file must be accessible and valid at the time of the call to boardSetApplication.

 

When the device boots it will look for the alternative application file and if found valid it will be executed instead of the default application on the Project Drive.

Calling boardSetApplication with an empty filename or transferring a new project to the device will reset to use the default application.

 

 

Input:

filename : STRING

The application file name. This can be a fully qualified path such as "A:\myapp\test.vsx". When no drive specification is present, it will implicitly refer to the Project Drive.

If the filename is empty, the default application will be selected.
 

 

Returns: INT

1

Successful.

0

Not supported.

-1

Not a valid application filename.

-2

Application could not be found or is invalid.

-3

Invalid media.

 

Declaration:

FUNCTION boardSetApplication : INT;
VAR_INPUT
  filename : STRING;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
 
// Change application
boardSetApplication(filename := "example.vsx");
boardReset();
 
END_PROGRAM;