ScriptClear Method - neoVI API

This method clears a script from a specific location on a neoVI device.

int _stdcall icsneoScriptClear(void * hObject, int iLocation);

Parameters

hObject

[in] Specifies the driver object created by OpenNeoDevice.

iLocation

[in] Specifies the physical location of the script to be cleared on the neoVI device. Valid values are:

SCRIPT_LOCATION_FLASH_MEM = 0 (Valid only on a neoVI Fire or neoVI Red)SCRIPT_LOCATION_SDCARD = 1 (Valid only on a neoVI Fire or neoVI Red)SCRIPT_LOCATION_VCAN3_MEM = 4 (Valid only on a ValueCAN 3 device)

These values are defined in the icsnVC40.h file

Return Values

1 if the function succeeded. 0 if it failed for any reason. GetLastAPIError must be called to obtain the specific error. The errors that can be generated by this function are:

NEOVI_ERROR_DLL_NEOVI_NO_RESPONSE = 75

NEOVI_ERROR_DLL_INVALID_SCRIPT_LOCATION = 213

NEOVI_ERROR_DLL_SDCARD_NOT_INSERTED = 214

NEOVI_ERROR_DLL_SDCARD_WRITE_ERROR = 216

NEOVI_ERROR_DLL_SCRIPT_ERROR_CLEARING_SCRIPT = 221

Remarks

If a script exists in the specified location it will be erased from that location. If the script is running it will be stopped. Any function blocks that are running will be stopped.

Examples

int iRetVal;
unsigned long lLastErrNum;
//Clear the script from it's storage location.
//Both SCRIPT_LOCATION_FLASH_MEM and SCRIPT_LOCATION_SDCARD are persistent.
//On a ValueCAN 3, SCRIPT_LOCATION_VCAN3_MEM will clear when the device
//loses power or resets.

iRetVal = icsneoScriptClear(hObject, DefaultScriptLocation);
if(iRetVal == 0)
{
    printf("\nFailed to clear the script);
}
else
{
    printf("\nSuccessfully cleared the script");
}

Last updated