NurApiTagSetLock Method
Set memory lock for tag
Note: prior to locking, the access password needs to beset with e.g.
SetAccessPassword(UInt32, Boolean, UInt32).
Example of locking user memory only for writing:
// Use in try-catch, may throw NurApiException.
void ProtectUserMemory(NurApi.Tag aTag, uint password)
{
aTag.SetLock(password, NurApi.LOCK_USERMEM, NurApi.LOCK_SECURED);
}
Example of locking the whole password memory for reading and writing, the tag has not been programmed with a password yet:
// Use in try-catch, may throw NurApiException.
void ProtectPasswordMemory(NurApi.Tag aTag, uint password)
{
// Write...
aTag.SetAccessPassword(0, false, password);
// ...and lock.
aTag.SetLock(password, NurApi.LOCK_ACCESSPWD | NurApi.LOCK_KILLPWD, NurApi.LOCK_SECURED);
}