55xGenComm1_29
25
Password status
Status Meaning
0 No valid password has been entered, no operations can be performed on the slave
device except writing a password using function 16 (write multiple registers). In the
case of a hub no queries will be passed to its satellites at all. Reading from the control
module is permitted.
1 Reserved
2 Reserved
3 Valid password has been entered.
EXAMPLE : Reading the password status from the control module.
This example details how to check the password status of the control module.
An example of how to “log on” to the control module is given in the section headed “GenComm
Page 1”.
If ( ReadPage0 == SUCCESS )
{
if ( Page0[6] == 0 ) printf( “Control module locked – Read Only Access”);
else if ( Page0[6] == 3 ) printf( “Control Module open – Full Access”);
}
else
{
HandleExceptionResponse();
}
NOTE:- In the example above, If ( Read Page0 ) == SUCCESS reads the data from
GenComm Page0, and tests the response packet to make sure the data received is valid (ie
not an exception response).
The function HandleExceptionResponse would normally be written to “ignore” errors for a
short period of time to allow for possible poor data transmission that can sometimes be
encountered over telephone networks for example.
One fine example of a HandleExceptionResponse function in GenComm software is the
P810 and Link500Plus software from Deep Sea Electronics. The HandleExceptionResponse
function first stops the “comms link healthy” heart beating, then if ExceptionResponses
continue for more than a few seconds, the “broken” heart is shown, to indicate the broken
comms link to the user.
If data communication resumes, the heart begins to beat again.