Intermec PC43d Fingerprint Developer's Guide (PC23d, PC43d/t, PM23c, PM43, PM4 - Page 125

Using a BEEP or SOUND Statement, Setting the Date and Time, Reading the Clock and Calendar

Page 125 highlights

Chapter 7 - Controlling the Printer Using a BEEP or SOUND Statement In addition to the visual signals from the display and LEDs, you can use a BEEP or SOUND statement for audible notification if your printer has a beeper. The beeper can be controlled by either a BEEP statement, which gives a short shrill signal, or by a SOUND statement, which allows you to vary both the frequency and duration. The SOUND statement even allows you to compose your own melodies. In this example, a warning signal is emitted from the beeper, for example when the error "printhead lifted" occurs and keeps sounding until the error is cleared. A short beep indicates that the printer is OK. 10 20 30 40 50 60 1000 1010 RUN ON ERROR GOTO 1000 PRPOS 100,100 FONT "Univers", 36 PRTXT "OK!" PRINTFEED : BEEP END SOUND 880,25 : SOUND 988,25 : SOUND 30000,10 RESUME Setting the Date and Time Some Intermec printers are equipped with a real-time clock (RTC) with battery backup. If an RTC is installed, the internal clock is updated from the RTC at each startup. If no RTC is installed, you need to manually set the clock using either a DATE$ or a TIME$ variable, or an error occurs when trying to read the date or time. If only the date is set, the internal clock starts at 00:00:00, and if only the time is set, the internal clock starts at Jan 01 1980. After setting the internal clock, you can use the DATE$ and TIME$ variables the same way as when an RTC is fitted, until a power off or REBOOT causes the date and time values to be lost. The built-in calendar runs from 1980 through 2048 and corrects illegal values automatically (for example, 081232 is corrected to 090101). In addition to the standard formats (YYMMDD and HHMMSS), other formats for date and time can be specified by these Fingerprint commands: • FORMAT DATE$ • FORMAT TIME$ • NAME DATE$ • NAME WEEKDAY$ Reading the Clock and Calendar These Fingerprint commands are used to read the clock and calendar: • =DATE$ • =DATE$("F") - Returns the current date in the format specified by FORMAT DATE$ to a string variable. • =TIME$ Fingerprint Developer's Guide 113

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163

Chapter 7 — Controlling the Printer
Fingerprint Developer’s Guide
113
Using a BEEP or SOUND Statement
In addition to the visual signals from the display and LEDs, you can use a BEEP or
SOUND statement for audible notification if your printer has a beeper.
The beeper can be controlled by either a BEEP statement, which gives a short shrill
signal, or by a SOUND statement, which allows you to vary both the frequency and
duration. The SOUND statement even allows you to compose your own melodies.
In this example, a warning signal is emitted from the beeper, for example when the
error “printhead lifted” occurs and keeps sounding until the error is cleared. A short
beep indicates that the printer is OK.
10
ON ERROR GOTO 1000
20
PRPOS 100,100
30
FONT “Univers”, 36
40
PRTXT “OK!”
50
PRINTFEED : BEEP
60
END
1000
SOUND 880,25 : SOUND 988,25 : SOUND 30000,10
1010
RESUME
RUN
Setting the Date and Time
Some Intermec printers are equipped with a real-time clock (RTC) with battery
backup. If an RTC is installed, the internal clock is updated from the RTC at each
startup.
If no RTC is installed, you need to manually set the clock using either a DATE$ or a
TIME$ variable, or an error occurs when trying to read the date or time. If only the
date is set, the internal clock starts at 00:00:00, and if only the time is set, the
internal clock starts at Jan 01 1980. After setting the internal clock, you can use the
DATE$ and TIME$ variables the same way as when an RTC is fitted, until a power
off or REBOOT causes the date and time values to be lost.
The built-in calendar runs from 1980 through 2048 and corrects illegal values
automatically (for example, 081232 is corrected to 090101).
In addition to the standard formats (YYMMDD and HHMMSS), other formats for
date and time can be specified by these Fingerprint commands:
FORMAT DATE$
FORMAT TIME$
NAME DATE$
NAME WEEKDAY$
Reading the Clock and Calendar
These Fingerprint commands are used to read the clock and calendar:
<svar>=DATE$
<svar>=DATE$(“F”) - Returns the current date in the format specified by
FORMAT DATE$ to a string variable.
<svar>=TIME$