Starting, stopping scripts, moving files to/from device. More...
Functions | |
| kvStatus | kvScriptStart (const int hnd, int slotNo) |
| kvStatus | kvScriptStop (const int hnd, int slotNo, int mode) |
| kvStatus | kvScriptUnload (const int hnd, int slotNo) |
| kvStatus | kvScriptSendEvent (const int hnd, int slotNo, int eventType, int eventNo, unsigned int data) |
| kvEnvHandle | kvScriptEnvvarOpen (const int hnd, const char *envvarName, int *envvarType, int *envvarSize) |
| kvStatus | kvScriptEnvvarClose (kvEnvHandle eHnd) |
| kvStatus | kvScriptEnvvarSetInt (kvEnvHandle eHnd, int val) |
| kvStatus | kvScriptEnvvarGetInt (kvEnvHandle eHnd, int *val) |
| kvStatus | kvScriptEnvvarSetFloat (kvEnvHandle eHnd, float val) |
| kvStatus | kvScriptEnvvarGetFloat (kvEnvHandle eHnd, float *val) |
| kvStatus | kvScriptEnvvarSetData (kvEnvHandle eHnd, const void *buf, int start_index, int data_len) |
| kvStatus | kvScriptEnvvarGetData (kvEnvHandle eHnd, void *buf, int start_index, int data_len) |
| kvStatus | kvScriptLoadFileOnDevice (const int hnd, int slotNo, char *localFile) |
| kvStatus | kvScriptLoadFile (const int hnd, int slotNo, char *filePathOnPC) |
| kvStatus | kvScriptRequestText (const int hnd, unsigned int slot, unsigned int request) |
| kvStatus | kvScriptGetText (const int hnd, int *slot, unsigned long *time, unsigned int *flags, char *buf, size_t bufsize) |
| kvStatus | kvScriptStatus (const int hnd, int slot, unsigned int *status) |
| kvStatus | kvScriptGetMaxEnvvarSize (int hnd, int *envvarSize) |
| kvStatus | kvScriptTxeGetData (const char *filePathOnPC, int item, void *buffer, unsigned int *bufsize) |
Detailed Description
Starting, stopping scripts, moving files to/from device.
Function Documentation
kvScriptEnvvarClose()
| kvStatus kvScriptEnvvarClose | ( | kvEnvHandle | eHnd | ) |
- C#
- static Canlib.kvStatus kvScriptEnvvarClose(kvEnvHandle eHnd);
- Delphi
- function kvScriptEnvvarClose(const eHnd: kvEnvHandle): kvStatus;
The kvScriptEnvvarClose() function closes an open envvar.
- Parameters
-
[in] eHnd An open handle to an envvar.
- Returns
- canOK (zero) if success
- canERR_xxx (negative) if failure
- See also
- kvScriptEnvvarOpen()
- Examples:
- example/c/tscript/envvar/envvar.c.
kvScriptEnvvarGetData()
| kvStatus kvScriptEnvvarGetData | ( | kvEnvHandle | eHnd, |
| void * | buf, | ||
| int | start_index, | ||
| int | data_len | ||
| ) |
- C#
- static Canlib.kvStatus kvScriptEnvvarGetData(kvEnvHandle eHnd, out byte[] buf, Int32 start_index, Int32 data_len);
- Delphi
- function kvScriptEnvvarGetData(const eHnd: kvEnvHandle; var buf; start_index: Integer; data_len: Integer): kvStatus;
The kvScriptEnvvarGetData() function retrieves a range of data bytes from an envvar.
- Note
- Not implemented in linux.
- Parameters
-
[in] eHnd An open handle to an envvar. [out] buf A pointer to a data area where the retrieved data range should be stored. [in] start_index The start index of the data range. [in] data_len The length in bytes of the data range.
- Returns
- canOK (zero) if success
- canERR_xxx (negative) if failure
- See also
- Environment Variable
- kvScriptEnvvarOpen(), kvScriptEnvvarSetData(), kvScriptEnvvarGetInt(), kvScriptEnvvarGetFloat()
- Examples:
- example/c/tscript/envvar/envvar.c.
kvScriptEnvvarGetFloat()
| kvStatus kvScriptEnvvarGetFloat | ( | kvEnvHandle | eHnd, |
| float * | val | ||
| ) |
- C#
- static Canlib.kvStatus kvScriptEnvvarGetFloat(kvEnvHandle eHnd, out Single val);
- Delphi
- function kvScriptEnvvarGetFloat(const eHnd: kvEnvHandle; var val: Single): kvStatus;
The kvScriptEnvvarGetFloat() function retrieves the value of a float envvar.
- Note
- Not implemented in linux.
- Parameters
-
[in] eHnd An open handle to an envvar. [out] val A pointer to a floatwhere the retrieved result should be stored.
- Returns
- canOK (zero) if success
- canERR_xxx (negative) if failure
kvScriptEnvvarGetInt()
| kvStatus kvScriptEnvvarGetInt | ( | kvEnvHandle | eHnd, |
| int * | val | ||
| ) |
- C#
- static Canlib.kvStatus kvScriptEnvvarGetInt(kvEnvHandle eHnd, out Int32 val);
- Delphi
- function kvScriptEnvvarGetInt(const eHnd: kvEnvHandle; var val: Integer): kvStatus;
The kvScriptEnvvarGetInt() function retrieves the value of an int envvar.
- Parameters
-
[in] eHnd An open handle to an envvar. [out] val The current value.
- Returns
- canOK (zero) if success
- canERR_xxx (negative) if failure
kvScriptEnvvarOpen()
| kvEnvHandle kvScriptEnvvarOpen | ( | const int | hnd, |
| const char * | envvarName, | ||
| int * | envvarType, | ||
| int * | envvarSize | ||
| ) |
- C#
- static kvEnvHandle kvScriptEnvvarOpen(CanHandle hnd, String envvarName, out Int32 envvarType, out Int32 envvarSize);
- Delphi
- function kvScriptEnvvarOpen(const hnd: canHandle; envvarName: PAnsiChar; var envvarType: Integer; var envvarSize: Integer): kvEnvHandle;
The kvScriptEnvvarOpen() opens an existing envvar and returns a handle to it.
- Parameters
-
[in] hnd An open handle to a CAN channel. [in] envvarName The envvar's name; a pointer to a NULLterminated array of chars.[out] envvarType A pointer to a 32-bit integer that will receive the kvENVVAR_TYPE_xxx type. [out] envvarSize A pointer to a 32-bit integer that will receive the size of the envvar in bytes.
- Returns
- A kvEnvHandle handle (positive) to an envvar if success
- canERR_xxx (negative) if failure
- Examples:
- example/c/tscript/envvar/envvar.c.
kvScriptEnvvarSetData()
| kvStatus kvScriptEnvvarSetData | ( | kvEnvHandle | eHnd, |
| const void * | buf, | ||
| int | start_index, | ||
| int | data_len | ||
| ) |
- C#
- static Canlib.kvStatus kvScriptEnvvarSetData(kvEnvHandle eHnd, byte[] buf, Int32 start_index, Int32 data_len);
- Delphi
- function kvScriptEnvvarSetData(const eHnd: kvEnvHandle; var buf; start_index: Integer; data_len: Integer): kvStatus;
The kvScriptEnvvarSetData() function sets a range of data bytes in an envvar.
- Note
- Not implemented in linux.
- Parameters
-
[in] eHnd An open handle to an envvar. [in] buf A pointer to a data area with the new values. [in] start_index The start index of the envvar's data range that we want to update. [in] data_len The length in bytes of the envvar's data range that we want to update.
- Returns
- canOK (zero) if success
- canERR_xxx (negative) if failure
- See also
- Environment Variable
- kvScriptEnvvarOpen(), kvScriptEnvvarGetData(), kvScriptEnvvarSetInt(), kvScriptEnvvarSetFloat()
- Examples:
- example/c/tscript/envvar/envvar.c.
kvScriptEnvvarSetFloat()
| kvStatus kvScriptEnvvarSetFloat | ( | kvEnvHandle | eHnd, |
| float | val | ||
| ) |
- C#
- static Canlib.kvStatus kvScriptEnvvarSetFloat(kvEnvHandle eHnd, Single val);
- Delphi
- function kvScriptEnvvarSetFloat(const eHnd: kvEnvHandle; val: Single): kvStatus;
The kvScriptEnvvarSetFloat() sets the value of a float envvar.
- Note
- Not implemented in linux.
- Parameters
-
[in] eHnd An open handle to an envvar. [in] val The new value.
- Returns
- canOK (zero) if success
- canERR_xxx (negative) if failure
kvScriptEnvvarSetInt()
| kvStatus kvScriptEnvvarSetInt | ( | kvEnvHandle | eHnd, |
| int | val | ||
| ) |
- C#
- static Canlib.kvStatus kvScriptEnvvarSetInt(kvEnvHandle eHnd, Int32 val);
- Delphi
- function kvScriptEnvvarSetInt(const eHnd: kvEnvHandle; val: Integer): kvStatus;
The kvScriptEnvvarSetInt() sets the value of an int envvar.
- Parameters
-
[in] eHnd An open handle to an envvar. [in] val The new value.
- Returns
- canOK (zero) if success
- canERR_xxx (negative) if failure
kvScriptGetMaxEnvvarSize()
| kvStatus kvScriptGetMaxEnvvarSize | ( | int | hnd, |
| int * | envvarSize | ||
| ) |
- C#
- static Canlib.kvStatus kvScriptGetMaxEnvvarSize(CanHandle hnd, out Int32 size);
- Delphi
- function kvScriptGetMaxEnvvarSize(hnd: canHandle; var envvarSize: Integer): kvStatus;
The kvScriptGetMaxEnvvarSize() function returns the maximum size of an envvar.
- Note
- Not implemented in linux.
- Parameters
-
[in] hnd An open handle to a CAN channel. [out] envvarSize The maximum size of an envvar.
- Returns
- canOK (zero) if success
- canERR_xxx (negative) if failure
kvScriptGetText()
| kvStatus kvScriptGetText | ( | const int | hnd, |
| int * | slot, | ||
| unsigned long * | time, | ||
| unsigned int * | flags, | ||
| char * | buf, | ||
| size_t | bufsize | ||
| ) |
- C#
- static Canlib.kvStatus kvScriptGetText(CanHandle hnd, out Int32 slot, out Int64 time, out Int32 flags, out String buf);
- Delphi
- function kvScriptGetText(hnd: canHandle; var slot: integer; var time: Cardinal; var flags: Cardinal; buf: PAnsiChar; bufsize: size_t): kvStatus;
The kvScriptGetText() Reads a printf from a subscribed script slot. Set up a subscription with kvScriptRequestText().
- Parameters
-
[in] hnd An open handle to a CAN channel. [out] slot The slot where the printf originated. [out] time The printf timestamp. [out] flags Printf flags. A combination of canSTAT_xxx flags. [out] buf Buffer to hold the printf string. [in] bufsize Size of the buffer.
- Returns
- canOK (zero) if success
- canERR_xxx (negative) if failure
kvScriptLoadFile()
| kvStatus kvScriptLoadFile | ( | const int | hnd, |
| int | slotNo, | ||
| char * | filePathOnPC | ||
| ) |
- C#
- static Canlib.kvStatus kvScriptLoadFile(CanHandle hnd, Int32 slotNo, String filePathOnPC);
- Delphi
- function kvScriptLoadFile(hnd: canHandle; slotNo: Integer; filePathOnPC: PAnsiChar): kvStatus;
The kvScriptLoadFile() function loads a compiled script file (.txe) stored on the host (PC) into a script slot on the device.
- Note
- The canHandle is used to determine what channel is set as the default channel for the loaded script. If your canHandle was opened via a device's second channel, the default channel number will be set to 1 (the numbering of channel on the card starts from 0).
- Parameters
-
[in] hnd An open handle to a CAN channel. [in] slotNo The slot where to load the script. [in] filePathOnPC The script file name; a pointer to a NULLterminated array of chars.
- Returns
- canOK (zero) if success
- canERR_xxx (negative) if failure
- See also
- Load and Unload Script
- kvScriptLoadFileOnDevice(), kvFileCopyToDevice(), kvScriptStart(), kvScriptStop()
- Examples:
- example/c/tscript/envvar/envvar.c.
kvScriptLoadFileOnDevice()
| kvStatus kvScriptLoadFileOnDevice | ( | const int | hnd, |
| int | slotNo, | ||
| char * | localFile | ||
| ) |
- C#
- static Canlib.kvStatus kvScriptLoadFileOnDevice(CanHandle hnd, Int32 slotNo, String localFile);
- Delphi
- function kvScriptLoadFileOnDevice(hnd: canHandle; slotNo: Integer; localFile: PAnsiChar): kvStatus;
The kvScriptLoadFileOnDevice() function loads a compiled script file (.txe) stored on the device (SD card) into a script slot on the device.
- Parameters
-
[in] hnd An open handle to a CAN channel. [in] slotNo The slot where to load the script. [in] localFile The script file name; a pointer to a NULLterminated array of chars.
- Returns
- canOK (zero) if success
- canERR_xxx (negative) if failure
kvScriptRequestText()
| kvStatus kvScriptRequestText | ( | const int | hnd, |
| unsigned int | slot, | ||
| unsigned int | request | ||
| ) |
- C#
- static Canlib.kvStatus kvScriptRequestText(CanHandle hnd, Int32 slot, Int32 request);
- Delphi
- function kvScriptRequestText(hnd: canHandle; slotNo: cardinal; request: cardinal): kvStatus;
The kvScriptRequestText() Sets up a printf subscription to a selected script slot. Read the printf messages with kvScriptGetText().
- Parameters
-
[in] hnd An open handle to a CAN channel. [in] slot The slot to subscribe to. [in] request Subscription request i.e. kvSCRIPT_REQUEST_TEXT_xxx.
- Returns
- canOK (zero) if success
- canERR_xxx (negative) if failure
kvScriptSendEvent()
| kvStatus kvScriptSendEvent | ( | const int | hnd, |
| int | slotNo, | ||
| int | eventType, | ||
| int | eventNo, | ||
| unsigned int | data | ||
| ) |
- C#
- static Canlib.kvStatus kvScriptSendEvent(CanHandle hnd, Int32 slotNo, Int32 eventType, Int32 eventNo, Int32 data);
- Delphi
- function kvScriptSendEvent(const hnd: canHandle; slotNo: integer; eventType: integer; eventNo: integer; data: Cardinal): kvStatus;
The kvScriptSendEvent() function sends an event of a type, and an event number and associated data to a script running in a specific slot.
- Note
- Not implemented in linux.
- Parameters
-
[in] hnd An open handle to a CAN channel. [in] slotNo The slot where the script was loaded and is running. [in] eventType The event to send, of type kvEVENT_xxx [in] eventNo The event's number. [in] data The event's data.
- Returns
- canOK (zero) if success
- canERR_xxx (negative) if failure
- See also
- Send Event
kvScriptStart()
| kvStatus kvScriptStart | ( | const int | hnd, |
| int | slotNo | ||
| ) |
- C#
- static Canlib.kvStatus kvScriptStart(CanHandle hnd, Int32 slotNo);
- Delphi
- function kvScriptStart(const hnd: canHandle; slotNo: integer): kvStatus;
The kvScriptStart() function starts a loaded script.
- Parameters
-
[in] hnd An open handle to a CAN channel. [in] slotNo The slot with the loaded script we want to start.
- Returns
- canOK (zero) if success
- canERR_xxx (negative) if failure
- Examples:
- example/c/tscript/envvar/envvar.c.
kvScriptStatus()
| kvStatus kvScriptStatus | ( | const int | hnd, |
| int | slot, | ||
| unsigned int * | status | ||
| ) |
- C#
- static Canlib.kvStatus kvScriptStatus(CanHandle hnd, Int32 slotNo, out Int32 status);
- Delphi
- function kvScriptStatus(hnd: canHandle; slot: integer; var status: Cardinal): kvStatus;
The kvScriptStatus() function reads the current status of a script slot.
- Parameters
-
[in] hnd An open handle to a CAN channel. [in] slot The slot which status we want. [out] status The script status, as kvSCRIPT_STATUS_xxx flag bits
- Returns
- canOK (zero) if success
- canERR_xxx (negative) if failure
kvScriptStop()
| kvStatus kvScriptStop | ( | const int | hnd, |
| int | slotNo, | ||
| int | mode | ||
| ) |
- C#
- static Canlib.kvStatus kvScriptStop(CanHandle hnd, Int32 slotNo, Int32 mode);
- Delphi
- function kvScriptStop(const hnd: canHandle; slotNo: integer; mode: integer): kvStatus;
The kvScriptStop() function stops a started script.
- Parameters
-
[in] hnd An open handle to a CAN channel. [in] slotNo The slot with the loaded and running script we want to stop. [in] mode Stop mode of type kvSCRIPT_STOP_xxx
- Returns
- canOK (zero) if success
- canERR_xxx (negative) if failure
- Examples:
- example/c/tscript/envvar/envvar.c.
kvScriptTxeGetData()
| kvStatus kvScriptTxeGetData | ( | const char * | filePathOnPC, |
| int | item, | ||
| void * | buffer, | ||
| unsigned int * | bufsize | ||
| ) |
- C#
- static Canlib.kvStatus kvScriptTxeGetData(String filePathOnPC, Int32 item, out object buffer);
- Delphi
- function kvScriptTxeGetData(filePathOnPC: PAnsiChar; item: Integer; var buffer; var bufsize: Cardinal): canStatus;
This function can be used to retrieve information from a compiled script file (.txe).
- Parameters
-
[in] filePathOnPC The compiled script file name; a pointer to a NULLterminated array of chars.[in] item This parameter specifies what data to obtain. Valid values are one of the constants canTXEDATA_xxx. [out] buffer The address of a buffer which is to receive the data. [in,out] bufsize The size of the buffer to which the buffer parameter points. When the function returns, bufsize contains the number of bytes copied into the buffer.
- Returns
- canOK (zero) if success
- canERR_xxx (negative) if failure
If the buffer specified by buffer and bufsize is not large enough to hold the data requested, the function returns canERR_BUFFER_TOO_SMALL and stores the required buffer size in the integer pointed to by bufsize. The content of buffer is undefined.
If parameter buffer is NULL, and bufsize is non-NULL, the function returns canOK and stores the required buffer size in the integer pointed to by bufsize.
kvScriptUnload()
| kvStatus kvScriptUnload | ( | const int | hnd, |
| int | slotNo | ||
| ) |
- C#
- static Canlib.kvStatus kvScriptUnload(CanHandle hnd, Int32 slotNo);
- Delphi
- function kvScriptUnload(const hnd: canHandle; slotNo: integer): kvStatus;
The kvScriptUnload() function unloads a stopped script.
- Parameters
-
[in] hnd An open handle to a CAN channel. [in] slotNo The slot with the loaded and stopped script we want to unload.
- Returns
- canOK (zero) if success
- canERR_xxx (negative) if failure
- Examples:
- example/c/tscript/envvar/envvar.c.