Data fields, reports, and timers – Printronix PrintNet Enterprise User Manual
Page 267
Pin Code Protected Printer
267
When a key is pressed, the value of the corresponding data field is added to
the value in new_pin (which initially contains 0). If the down key is pressed,
new_pin now contains 6. If this is not the last (third) entry, the content of
new_pin is multiplied by 10 (effectively shifting it over 1 decimal place). The
message one_pin is sent to the LCD that now shows ‘PIN number: *--‘.
If the Feed key is pressed next, the value in the related data field (3) is added
to new_pin which now contains 63. Again, it is not the last entry so new_pin is
multiplied by 10, the content changes to 630 and the message two_pin is sent
to the LCD to show ‘PIN number: **-‘.
If the Menu key is the third and last key pressed, the value 5 is added to
new_pin. The content is now 635. Since this is the last key the number will not
be multiplied by 10. Instead, we will send a message to the LCD. We now
have the complete PIN code entered, compare it with the PIN code stored in
the printer. This is done by a simple comparison of two data fields, new_pin
and pin_number.
If the values match we’ll make all keys available to the user. If the values don’t
match we’ll increase the ‘pin_entry_count’ by one and start over. If the
‘pin_entry_count’ reaches three some message will be transmitted to the host
and the complete panel will be blocked.
Data Fields, Reports, and Timers
The following (U16) data fields need to be created for this application where
the content of the pin_number data field can be any value between 111 and
777.
Data Field Name
Initial Value
Pause_Key
1
Minus_Key
2
Up-Key
3
Plus_Key
4
Menu_Key
5
Down_Key
6
Enter_Key
7
Pin_Entry_Count
0
New_Pin
0
Pin_Number
635