Here is the detailed description of KeyChk Function #2:

Function #2

This function allows you to verify the presence of your Key based on the Product‑ID and Product PIN. Optionally, you may also verify the Key's Serial Number.

Additionally, this function will update the Uses Limit based on the setting of this field when KeyChk is called (see field details below).

If the Key is found, the following fields are returned:

  • Serial Number (if not specified).

  • Uses Limit (updated value).

  • Time Limit.

  • Expire-Date.

  • User-Data.

  • Lasered-ID.

  • Feature-Flags.

  • Registration Info (if supported by Key).

Except for the Uses Limit, no other fields in the Key are updated by this call.

If the Key has a Time Limit and it's Timer has not yet started, this function will start the Timer ticking.

Before calling KeyChk setup the following SCB fields:

Error Code

6240 (hex)

It's a good programming practice to always set the Error Code to this value before calling KeyChk. If KeyChk doesn't find your SCB, it can't set the Error Code, but it will already be set to the correct value and your program will take the proper action.

Function Code

2

SCB‑ID

Kc.6” (ASCIIZ)

Product‑ID

Set this to your Product‑ID shown on the Build Keys screen of the KeyBuild program.

This field is case sensitive.

PIN

Set this to your Product PIN shown on the Build Keys screen of the KeyBuild program. Please note that you CANNOT use the User-Data PIN here.

Product Serial Number

Normally, you will set this field to zero so the Key check will succeed as long as KeyChk finds a Key with your specific Product‑ID and Product PIN.

If you also want to verify that the Key present has a specific Product Serial Number, then set this field to the specific Serial Number that you want to verify.

Uses Limit

or

Uses Update

Set this field to zero if you do not wish to update the Uses Limit of the Key. Otherwise, set this field to a negative number equal to the number of “uses” that you wish to subtract from the Key's current Uses Limit. For example, to take one “use” away, set this field to "-1" (negative one).

Please Note: KeyChk is not allowed to ADD to the current value of the Uses Limit. This can only be done with the Renew program.

The remaining SCB fields will be ignored by KeyChk.