SVKEY

Concept Link IconSee also

Read the contents of the protection key on multi-station systems.

WebVue support - No. Returns an unsuccessful code if used in this context.

Mode Mnemonic Syntax
1 READ 1
2 ORDER 2
3 CANCEL 2
SVKEY is asynchronous. You must create a function to be activated at the end of the request, using the ResultVar variable and EVENT, if you want to perform another action depending on the result of the SVKEY instruction.

Syntax 1

Intval = SVKEY(Mode[, LogVar[, ResultVar]]);

Return type: INTEGER.

Argument Meaning
LogVar The name of a variables tree bit variable. Type STR.
ResultVar The name of a variables tree register variable. Type STR.

Execution

Mode Mnemonic Action
1 READ

Request a re-read of the license from the protection key on the local station.

Value of the LogVar bit variable:
0 = Request in progress.
1 = Request complete. If the read is successful, the result is available in the ResultVar register.

Value of ResultVar register variable:
0 = Request in progress.
1 = Request successful.
-1 = Request failed (no key).

Return:

0 if unsuccessful (incorrect parameter or executed in WebVue context).
1 = OK.
-1 = The previous request is still being processed.
-5 = The variable LogVar does not exist or incorrect type.
-6 = The variable ResultVar does not exist or incorrect type.

Syntax 2

Intval = SVKEY(Mode, RightsType, Slot, Station[, LogVar[, ResultVar]]);

Return type: INTEGER.

Argument Meaning
RightsType

Always 1

Type INTEGER.

Slot

1 = The first slot.
2 = The second slot.

Type INTEGER.

Station The station number on which the key is connected. Type INTEGER.
LogVar The name of a variables tree bit variable. Type STR.
ResultVar The name of a register variable. Type STR.

Execution

Mode Mnemonic Action
2 ORDER

Request (order) a license from a protection key on another station.

Value of the LogVar bit variable:
;0 = Request in progress.
1 = Request complete. If the request was successful, the result is available in the ResultVar register.

Value of ResultVar register variable:
0 = Request in progress.
1 = Request successful. The license was read.
-1 = Request failed. No protection key found.
-2 = Request failed. No license remaining.
-3 = The license has already been used.
-4 = Request failed, network disconnection or PC failure.
-5 = Request timeout.

3 CANCEL

Release a license previously read from a protection key on another station.

Value of the LogVar bit variable:
0 = Release in progress.
1 = Release complete. If successful, the result is available in the ResultVar register.

Value of ResultVar register variable:
0 = Request in progress.
2 = Request successful. The license was released.
-3 = The license to release was not found.
-4 = Request failed, network disconnection or PC failure.
-5 = Request timeout.

   

Return:

0 if unsuccessful (incorrect parameter or executed in WebVue context).
1 = OK.
-1 = The previous request is still being processed.
-2 = The parameter RightsType is out of range.
-3 = The station number was not found in this project.
-4 = The parameter Slot is out of range.
-5 = The variable LogVar does not exist or incorrect type.
-6 = The variable ResultVar does not exist or incorrect type.