Security of Software Protection EtherCAT Programming Guide
29-10 March, 2017
29
29.8 _ECAT_Security_Get_Write_UserPassword_State
Syntax
U16 PASCAL _ECAT_Security_Get_Write_UserPassword_State (U16 CardNo, U16 *State )
Purpose
Acquire the status and result of writing in the user password.
Note: The password write-in function cannot be done until the the return code is not 2.
Parameter
Name
Data type Property Description
CardNo U16 Number Card No.
State U16*
Status
Return code:
0: Verification sussesful.
1: Verification failed.
2: Verification in progress.
3: _ECAT_Security_Write_UserPassword is not
executed.
4: Processing error of
_ECAT_Security_Write_UserPassword.
Example
U16 Status = 0;
U16 CardNo = 0, State = 0;
U32 UserPassword [8] = {0, 1, 2, 3, 4, 5, 6, 7};
// Write in the new password.
Status= _ECAT_Security_Write_UserPassword( CardNo, UserPassword);
// Wait for the write-in process to be completed.
While (1)
{
Status= _ECAT_Security_Get_Write_UserPassword_State ( CardNo, &State );
if (State != 2)
{
// Password write-in is done. Users can check the result from the return code.
break;
}
}