The text of a manual · part 27 of 47
PDT 1100 Terminal Programmer's Guide: Chapter 10 Statement Reference, pages 241 to 250
Pages 241 to 250 of 413, from PDT 1100 Terminal Programmer's Guide
The original document is the PDF (3.5 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Symbol PDT-1100
Page 241
Statement Reference
Transmission direction: Parameter omitted (default)
Transmits a file from the PDT 1100.
R or r
Receives a file from the host computer.
Example:
XFILE “d2.dat”,“R”
“filename” or “drivename:filename” cannot be omitted even in file reception. Serial number: Parameter omitted (default)
No serial number setting.
S or s
Adds a serial number to every transmission block.
Example:
XFILE “d2.dat”,“S”
A 5-digit decimal serial number follows the text control character heading each transmission block. When less than five digits, the upper digits with no value are filled with zeros. Horizontal parity checking (BCC): Parameter omitted (default)
No horizontal parity checking.
P or p
Suffixes a BCC to every transmission block.
Example:
XFILE “d2.dat”,“P”
A block check character (BCC) follows the terminator of each transmission block. The horizontal parity checking checks all bits except for headers (SOH and STX).
10-131
Page 242
PDT 1100 Terminal Programmer’s Guide
Transmission monitoring: Parameter omitted (default)
No serial number indication.
M or m
Displays a serial number of the transmission block during file transmission.
Example:
XFILE “d2.dat”,“M”
A 5-digit decimal serial number appears at the current cursor position before execution of the XFILE instruction. Space codes in the tail of a data field during file transmission: Parameter omitted (default)
Ignores space codes.
T or t
Handles space codes as data.
Example:
XFILE “d2.dat”,“T”
Space codes in the tail of a data field are handled as 20h in file reception.
10-132
Page 243
Statement Reference
Timeout length Specify the timeout length when a link is to be established from 1to 9. Table 10-4. Timeout Length for XFILE Set value
Downloading
Uploading PDT 1100 protocol
PDT 1100 Ir protocol
1
30 sec.
Retries of ENQ, 10 times
Retries of ENQ, 60 times
2
60 sec.
Retries of ENQ, 20 times
Retries of ENQ, 120 times
3
90 sec.
Retries of ENQ, 30 times
Retries of ENQ, 180 times
4
120 sec.
Retries of ENQ, 40 times
Retries of ENQ, 240 times
5
150 sec.
Retries of ENQ, 50 times
Retries of ENQ, 300 times
6
180 sec.
Retries of ENQ, 60 times
Retries of ENQ, 360 times
7
210 sec.
Retries of ENQ, 70 times
Retries of ENQ, 420 times
8
240 sec.
Retries of ENQ, 80 times
Retries of ENQ, 480 times
9
No timeout
No timeout
No timeout
Example:
XFILE “d2.dat”,“2"
In file reception, the timeout length is 60 seconds; in file transmission, the maximum number of ENQ retries is 20 (when the PDT 1100 protocol is used.) !
! !
!
A communications device file should be opened before execution of the XFILE instruction (refer to OPEN “COM:” on page 10-95.) A data file to be transmitted should be closed beforehand. To transfer a file using the PDT 1100 Ir protocol or multilink protocol, set the PDT 1100's ID from 1 to FFFFh. Specifying zero (0) to the ID results in an execution error. Undefined letters, if specified in protocolspec, are ignored. The specifications below produce the same operation. The last timeout value becomes active. “RSPMT1” “R,S,P,M,T,1” “m,p,s,r,m,t,1” “ABCDEFGHIJKLMNOPQRSTUVWXYZ1”
10-133
Page 244
PDT 1100 Terminal Programmer’s Guide
“2” “3462” “22”
If you transmit a data file with the same name as another file in the receiving station: " the new file replaces the old when the field structure is matched. " an execution error occurs when the field structure is not matched. To receive a data file with the same name at the PDT 1100, delete the old file beforehand. !
!
Press the Clear key during file transmission to abort the execution of the XFILE instruction. This issues an EOT code and displays an execution error.
10-134
Page 245
Statement Reference
Syntax Error Error Code and Message Meaning error 3: ‘ ” ’ missing No double quote precedes or follows filename or drivename:filename. error 71: Syntax error filename or drivename:filename is not enclosed in double quotes.
Execution Error Error Code
Meaning
02h
Syntax error (filename is not correct.)
07h
Insufficient memory space (during file reception, the memory runs out.)
32h
File type mismatch (the received file is not a data file.)
33h
Received text format not correct.
34h
Bad file name or number (filename of an unopened file specified.)
35h
File not found.
37h
File already open.
38h
The file name is different from that in the receive header.
3Bh
The number of records is greater than the defined maximum value.
40h
ID not set.
46h
Communications error (a communications protocol error has occurred.)
47h
Abnormal end of communications or termination of communications by the Clear key (Clear key has aborted the file transmission.)
Example The sample below transmits a data file by adding a serial number and horizontal parity checking, and then displays the serial number on the first line of the screen. CLOSE OPEN “d0.dat”AS #1
10-135
Page 246
PDT 1100 Terminal Programmer’s Guide
FIELD #1,10 AS A$,20 AS B$ L%=LOF(1) CLOSE LOCATE 1,1 PRINT “00000/ ”;RIGHT$(“00000”+MID$(STR$(L%),2),5) LOCATE 1,1 OPEN “COM:19200,N,8,1” AS #8 XFILE “d0.dat”,“SPM” CLOSE #8
Before file transmission
After file transmission
00000/00100
00100/00100
Reference Statements
10-136
OPEN and OPEN “COM:”
Page 247
Statement Reference
$INCLUDE Statement Name: $ Include
Type: File I/O Statement
Description Specifies an included file.
Syntax Syntax 1 REM $INCLUDE:'filename'
Syntax 2 '$INCLUDE:'filename'
Notes $INCLUDE reads a source program specified by ' filename' into the program line following the $INCLUDE line in compilation.
Storing definitions of variables, subroutines, user-defined functions, and other data to be shared by source programs in the included files promotes application of valuable program resources. If you describe a $INCLUDE statement at the beginning of source programs, for example, same user-defined functions or subroutines may be shared by those source programs. !
filename is a file to be included.
!
If the specified filename does not exist in compiling a source program, a fatal error occurs and compilation terminates. Do not place characters, including a space, between $ and INCLUDE and between single quotes (') and filename. As shown below, if any character except for space or tab is placed between REM and $INCLUDE in Syntax 1 or between a single quote (') and $INCLUDE in Syntax 2, the program line is regarded as a comment line and the $INCLUDE instruction does not execute.
!
!
10-137
Page 248
PDT 1100 Terminal Programmer’s Guide
REM xxx $INCLUDE:'mdlprg1.SRC'
Before specifying included files, debug them carefully. ! $INCLUDE instructions cannot be nested. ! Program lines in included files are not output to the compile list. If a compilation error occurs in an included file, the error message shows the line number where the $INCLUDE statement is described. !
! !
Symbols defined in included files are not output to the symbol list. If a program line in an included file refers to a variable, user-defined function, or others defined outside the included file, the program line number where the $INCLUDE statement is described is output to the cross reference list, as the referredto line.
Fatal Error Error Code and Message
Meaning fatal error 30: Cannot No included file is found. find include file “XXX” fatal error 31: Cannot nest include file
10-138
Included files are nested.
Page 249
Chapter 11 Function Reference Introduction This chapter provides detailed descriptions of the functions used to program the PDT 1100.
11-1
Page 250
PDT 1100 Terminal Programmer’s Guide
ABS Function Name: ABSolute
Type: Numeric Function
Description Returns the absolute value of a numeric expression.
Syntax ABS(numericexpression)
Notes ABS returns the absolute value of numericexpression. The absolute value is the magnitude of numericexpression regardless of sign, e.g., both ABS (-12.34) and ABS (12.34) are equal to 12.34. !
11-2
If a real number is entered, this function returns a real number; if an integer number is entered, an integer number is returned.