background image

Cat. No. W165-E1-04

ASCII Unit

SYSMAC

C200H-ASC02

Summary of Contents for SYSMAC C200H-ASC02

Page 1: ...Cat No W165 E1 04 ASCII Unit SYSMAC C200H ASC02 ...

Page 2: ...C200H ASC02 ASCII Unit Operation Manual Revised September 2002 ...

Page 3: ...iv ...

Page 4: ...ans word and is abbreviated Wd in documentation in this sense The abbreviation PC means Programmable Controller and is not used as an abbreviation for any thing else Visual Aids The following headings appear in the left column of the manual to help you locate different types of information Note Indicates information of particular interest for efficient and convenient operation of the product 1 2 3...

Page 5: ...vi ...

Page 6: ...4 Assembly Routines 18 SECTION 4 BASIC Language 19 4 1 Program Configuration 20 4 2 BASIC Language 25 SECTION 5 Assembly Programming 67 5 1 Assembly Language Programming 68 5 2 Terminology and Formatting 69 5 3 Monitor Mode Commands 69 SECTION 6 Program Examples 79 6 1 Example Programs 80 6 2 Execution Sequence 94 6 3 Assembly Language Example 102 Appendices A Standard Models 107 B Specifications ...

Page 7: ...TABLE OF CONTENTS viii Glossary 159 Index 163 Revision History 165 ...

Page 8: ...also explains how to write load save and run an ASCII Unit BASIC program Section 4 presents the ASCII Unit BASIC programming language Since many of the BASIC com mands are nonstandard and particular to an ASCII Unit PC system it is recommended that even readers already proficient in BASIC pay careful attention to this section Section 5 explains the assembly language programming environment and how...

Page 9: ...portant for the safe and reliable application of the C200H Temperature Sensor Unit You must read this section and understand the information contained before attempting to set up or oper ate the C200H Temperature Sensor Unit 1 Intended Audience xii 2 General Precautions xii 3 Safety Precautions xii 4 Operating Environment Precautions xii 5 Application Precautions xiii ...

Page 10: ...ith double safety mechanisms This manual provides information for programming and operating the Unit Be sure to read this manual before attempting to use the Unit and keep this manual close at hand for reference during operation WARNING It is extremely important that a PC and all PC Units be used for the specified purpose and under the specified conditions especially in applications that can direc...

Page 11: ...o 100 Ω or less when installing the Units Not con necting to a ground of 100 Ω or less may result in electric shock Always turn OFF the power supply to the PC before attempting any of the fol lowing Not turning OFF the power supply may result in malfunction or electric shock Mounting or dismounting I O Units CPU Units Memory Units or any other Units Assembling the Units Setting DIP switches or rot...

Page 12: ...cables and other items with locking devices are properly locked into place Improper locking may result in malfunction Check the user program for proper execution before actually running it on the Unit Not checking the program may result in an unexpected operation Confirm that no adverse effect will occur in the system before attempting any of the following Not doing so may result in an unexpected ...

Page 13: ...ompares the monitored temperature with a danger value stored in memory If the system temperature exceeds this value the PC could be programmed to shut the system down until the temperature falls below a safe level The above is a very basic example In a more complicated system it might be necessary to process large quantities of data from many different inputs and based on the results of mathematic...

Page 14: ... program The standard configuration is to connect a personal computer to port 1 and a printer or other I O device to port 2 Switches The START STOP switch is a toggle switch that is used for initiating and halt ing execution of the ASCII Unit program The Machine No switch is used for identifying the particular ASCII Unit Since it is possible to have more then one ASCII Unit connected to a given PC...

Page 15: ...icator LEDs Name Indication Function Run green Lit when the ASCII Unit is operating normally Unlit if an error occurs T R for ports 1 and 2 green Blinks during data transmission port 1 and port 2 ERR 1 error for port 1 ERR 2 error for port 2 red Lit if an error such as parity error occurs or while the ASCII Unit is waiting for specific transmission conditions to be satisfied red 1 only Blinks when...

Page 16: ...The BASIC pro gram can be automatically booted when power is applied or it can be acti vated after power is applied by depressing the START STOP switch Pin 2 allows automatic loading of a BASIC program from the EEPROM to the RAM when power is applied Pin 3 and Pin 4 are used to select which of the three BASIC programs will be used as the boot program Pin 5 is not used Pins 6 7 and 8 are used to se...

Page 17: ...o Function Set this pin to 0 if only the RAM is to be used 2 Set this pin to 1 to automatically transfer the program from the EE PROM to RAM on power applica tion or reset 0 1 Setting Program No Pin No Function 3 4 0 0 1 0 0 1 1 1 No 1 No 2 No 3 Setting Screen size Pin No Screen Size Setting 40 columns x 7 lines 40 columns x 8 lines 40 columns x 15 lines 40 columns x 16 lines 80 columns x 16 lines...

Page 18: ... 7 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 Pin No Setting 1 2 3 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 300 BPS 600 BPS 1200 BPS 2400 BPS 4800 BPS 9600 BPS 300 BPS 600 BPS 1200 BPS 2400 BPS 4800 BPS 9600 BPS 19 200 BPS Baud rate selection for port 1 Baud Rate Not used Always set these pins to OFF Baud rate selection for port 2 Baud Rate Not used Always set these pins to OFF OFF ON ...

Page 19: ...ing installation of the ASCII Unit A personal computer used for entering the BASIC program should be connected to Port 1 and oth er peripheral I O devices such as a printer or a display terminal can be con nected to Port 2 refer to the following diagram For more detailed informa tion on peripheral interface connections and timing refer to Appendix B Specifications C200H ASC02 Port 1 RS 232C Port 1...

Page 20: ...area used to communicate with the ASCII Unit This section also defines several important terms which are used throughout this manual The material in this section will be come more clear later on when you begin working with an actual ASCII Unit program 2 1 Bits and Bytes 10 2 2 Data Section 11 ...

Page 21: ...n be accessed by specifying its address Each word contains 16 bits A bit is the smallest piece of information that can be stored or accessed by a computer A bit is always either one or zero Cer tain bits can be accessed individually and are used as flags A flag is usually set 1 or cleared 0 by the hardware to indicate some state of the computer or to allow or disallow certain operations Bits can a...

Page 22: ... for detailed information on the location breakdown and purpose of each bit of the Data Section SYSMAC C200H C200HS C200HX HG HE Transferred to each Unit every time the I O data is refreshed ASCII Unit Refresh timing Words n to n 2 OUT refresh Word n 3 IN refresh 4 words are used n 100 10 unit no IR Area Word 100 to 103 Unit 0 Word 110 to 113 Unit 1 Word 120 to 123 Unit 2 Word 130 to 133 Unit 3 wo...

Page 23: ...ill be terminated 03 Restart The ASCII Unit is initialized and restarted at the negative transition of this flag i e from ON to OFF When this flag is set the ASCII Unit is initialized 04 to 07 Interrupt number These four bits constitute an interrupt number that is used when the ON PC command is executed These bits are read as a hexadecimal number numbers 01 to 15 are treated as interrupt numbers w...

Page 24: ...or This bit is used as an error flag that is set if a transmission error such as parity error has occurred in port 1 05 Port 2 error This bit is used as an error flag it is set if a transmission error such as parity error has occurred in port 2 06 Battery error This bit is used as a flag that is set when the supply voltage of the built in battery has dropped below the rated level or the battery is...

Page 25: ...run the pro gram it must be transferred to the RAM of the ASCII Unit The ASCII Unit program can be permanently stored in the ASCII Unit EEPROM and also loaded from the EEPROM The program can also be transferred back to the personal computer or other storage device Section 3 4 explains how to run a BASIC program once it has been transferred to the ASCII Unit 3 1 Programs 16 3 2 Program Transfer 17 ...

Page 26: ... the designated operations When the PC is ready the appropriate flag is set and the ASCII Unit proceeds with the data transfer In the second method no special PC data exchange code is necessary to facilitate communication between the two devices If the memory area desig nator parameter is specified with the PC READ or PC WRITE statement the ASCII Unit can directly access the specified PC memory ar...

Page 27: ...AD command refer to Section 4 2 2 Commands Pro grams can also be transferred from the ASCII Unit s EEPROM to the ASCII Unit s RAM using the LOAD command Programs can be transferred from the ASCII Unit s RAM to the EEPROM or to a personal computer or other storage device connected to one of the com munication ports using the BASIC SAVE command refer to Section 4 2 2 Commands The ASCII Unit can be b...

Page 28: ...here are three ways to execute the specified BASIC program 1 2 3 1 Enter the RUN command from the keyboard of the personal computer Keying in CTRL X will abort the program 2 Pressing the START STOP switch on the ASCII Unit will start the pro gram Pressing it again will stop the program 3 If pin 1 of the left side DIP switch is set to the ON position the specified program will be executed automatic...

Page 29: ...y those that control I O operations Experienced BASIC users may wish to skip Section 4 1 and move directly to Section 4 2 All readers should pay special attention to the explanation of statements that are prefixed with PC Also pay special attention to the OPEN statement 4 1 Program Configuration 20 4 2 BASIC Language 25 4 2 1 BASIC Format 25 4 2 2 Commands 26 4 2 3 General Statements 32 4 2 4 Devi...

Page 30: ...sts of one or more statements If several statement are written on the same line they must be separated with colons A line can be no longer than 255 charac ters Use single quotation marks to separate comments Example of four statements on a line 10 FOR L 1 TO 100 J L I PRINT J NEXT L Line Numbers Every BASIC program line begins with a line number Line numbers indicate the order in which the program...

Page 31: ... character at the end 2 34 Double precision This type of constant is stored with 16 digit precision and is output as 16 digits or less It is represented by one of the following methods 1 2 3 1 As a number with 8 or more valid digits 1 23456789 2 As a number in exponential form using D 1 2D 3 3 As a number with the character at the end 2 34 Variables Variables are names used to represent values tha...

Page 32: ...ll elements of an array must be of the same TYPE Type Conversion When necessary BASIC will convert a numeric constant from one TYPE to another The following rules and examples apply 1 2 3 1 If the numeric data on the right side of an assignment statement differs from the type of data on the left side the right side is converted to match the left However character data cannot be converted to numeri...

Page 33: ...emarks If A or B is a real number in an expression using the or MOD operator the decimal part is first rounded up to convert the real number into an integer and then the operation is performed Relational Operators Relational operators compare two values The output is 1 HFFFF if the two values are equal and 0 if they are not Relational Operator Example Operation A B Equal A B Not equal A B Less tha...

Page 34: ...1 1 0 0 1 0 0 0 1 1 0 IMP implication A B A IMP B 1 1 1 0 0 1 0 0 1 0 1 1 EQV equivalence A B A EQV B 1 1 1 0 0 1 0 0 1 0 0 1 Operator Priority Arithmetic and logical operations are performed in the following order Note however that an expression or function enclosed by parentheses is executed first irrespective of operator priority 1 exponentiation 8 NOT 2 negation 9 AND 3 10 OR 4 11 XOR 5 MOD 12...

Page 35: ...wing section 4 2 1 BASIC Format Purpose Explains the purpose or use of the instruction Format Shows the correct format for the instruction The following rules apply to the format descriptions of all commands instruc tions and functions Items in CAPITAL LETTERS must be input as shown Items in lower case letters enclosed in angle brackets are to be supplied by the user Items in square brackets are o...

Page 36: ...ready existing line number is specified an asterisk is displayed im mediately after the line number If a new line number is input followed by a CR key the new line number will be used instead Pressing only the CR key leaves the line number unchanged CONT Command Purpose To resume execution of a program after a Ctrl X has been typed a STOP or END statement has been executed or an error has occurred...

Page 37: ...a range of lines on the screen or other specified device If the line range is omitted the entire program is listed LIST displays or prints the line that was last input or was last displayed Output can be aborted by entering CTRL B or CTRL X If CTRL B is used listing can be resumed by entering CTRL B again LIST LLIST Commands can be written into the program but the following statement will not be e...

Page 38: ...area currently used is cleared immediately after the LOAD com mand is executed For details on communication parameters valid signal lines and COMU re fer to the OPEN instruction MON Command Purpose To change to monitor mode Format MON Remarks This Command passes control from BASIC mode to monitor mode refer to Section 5 for details on monitor mode To return to BASIC mode enter CTRL B MSET Command ...

Page 39: ...ea System area Assembly language program area Basic text area System stack area System area Character String area Standard 1K byte H5000 NEW Command Purpose To delete the program currently in memory and clear all variables Format NEW Remarks New is used to clear memory before a new program is entered New causes all files and ports to be closed Programs named with the PNAME command cannot be erased...

Page 40: ...e must be eight characters or less Program areas assigned a name with the PNAME command are protected from execution of the LOAD and NEW commands which erase program area contents It is necessary to erase all assigned program names with the PNAME command before execution of the LOAD or NEW commands RENUM Command Purpose To renumber program lines Format RENUM new number old number inc new number is...

Page 41: ...SAVE port COMU valid signal line port is one of the two ports 1 2 valid signal line refer to the OPEN statement tables Example SAVE 1 COMU 43 Remarks When this command is executed the BASIC LED indicator on the ASCII Unit will blink rapidly warning the user to prepare the peripheral device for data transfer When the device is set press the START STOP switch During execution of this command the STA...

Page 42: ...ort number is an integer 1 or 2 Example COM1 ON Remarks The COM ON statement enables an interrupt defined by the ON COM GO SUB statement After this statement has been executed an interrupt will be generated each time data is written to the specified port buffer The interrupt will cause pro gram execution to branch to a routine defined by the associated ON COM GOSUB statement The COM OFF statement ...

Page 43: ...in the DATA statement DATA statements may be reread from the beginning by use of the RESTORE statement No comment with or can be written after the DATA statement DEF FN statement Purpose To define and name a function written by the user Format DEF FN name arg1 arg2 def name which must be a legal variable name is the name of the function argn is a list of variable names called parameters that will ...

Page 44: ... declaration characters to be single precision variables Example DEFINT A D X All variables beginning with A B C D and X will be integer variables DEF USER Statement Purpose To specify the starting address of an assembly language subrou tine that will be called via the USR function Format DEF USR digit offset digit is an integer from 0 to 9 The digit corresponds to the USR routine number whose add...

Page 45: ...turns to command level after an END is executed ERROR Statement Purpose To simulate the occurrence of an error or to allow error codes to be defined by the user Format ERROR n n is the error code to be simulated Remarks Error code numbers 1 to 255 are predefined and reserved by BASIC Higher numbers can be used for user defined error code messages User defined error codes can be used together with ...

Page 46: ...each loop must have a unique variable name for its counter The NEXT statement for the inside loop must come be fore the NEXT statement for the outer loop If nested loops have the same endpoint the same NEXT statement can be used for both of them If a NEXT statement is encountered before its corresponding FOR statement an error message is issued and execution is terminated GOSUB and RETURN Statemen...

Page 47: ...e number THEN may be fol lowed by either a line number for branching or one or more statements to be executed If the result of expression is zero the THEN or GOTO clause will be ig nored and the ELSE clause if present will be executed IF there is no ELSE clause execution will continue with the next executable statement INPUT Statement Purpose To allow input from the keyboard during program executi...

Page 48: ...layed To eliminate when COMU etc is selected by the OPEN statement use the LINE INPUT command The INPUT statement cannot be executed in direct mode If the port number is omitted port 1 is assumed as the default port KEY n Statement Purpose To enable disable or stop an interrupt invoked by key input and defined by the ON KEY GOTO or ON KEY GOSUB statements Format KEY n ON OFF STOP n is the key numb...

Page 49: ... is the port number 1 or 2 prompt is a message displayed on the screen prompting the user for input string is a string variable that is assigned to the input charac ter string Example LINE INPUT 2 DATE A Remarks All of the characters input from the end of the prompt to the carriage return are assigned to the character variable as a series of data Commas and co lons are also treated as character da...

Page 50: ...ot be interrupted by another interrupt If a new interrupt occurs during processing of a previous interrupt branching to handle the new interrupt will not take place until after the RETURN statement of the first interrupt service routine is executed This means that depending on the branch timing nothing may be in the buffer when execution branches to the interrupt routine It is therefore necessary ...

Page 51: ... execution to the proper error handling routine When an error is detected the error number is assigned to the variable ERR and the line number where the error occurred is assigned to ERL To disable error processing execute ON ERROR GOTO 0 Subsequent er rors will cause an error message to be printed and execution to be halted If an error occurs during execution of an error handling subroutine a BAS...

Page 52: ...ecu tion will begin with the first executable statement following the branch line number If zero is specified as the branch line number it is assumed that the KEY OFF statement has been executed If the port number is omitted port 1 is selected There should be only one ON KEY GOTO statement for each key number Key input will not be processed during execution of an assembly language program The ON K...

Page 53: ...ng Program Remarks A B and C are displayed by pressing keys 1 2 and 3 respectively To cancel the specification write 0 as the branch destination ON PC GOSUB Statement Purpose Defines an interrupt service routine invoked by the PC Format ON PC int num GOSUB line int num is an integer from 1 to 15 line is a valid line number Example ON PC 3 GOSUB 1000 Remarks The interrupt number is indicated with b...

Page 54: ...a entered through the keyboard to the PC Programming Interrupts Interrupting from the PC is prohibited while the ASCII busy flag is ON and so in this case the ON PC GOSUB statement will not be executed For this rea son interrupting will not be possible during the execution of PC READ and other statements that turn ON the ASCII busy flag When programming using statements for which the ASCII busy fl...

Page 55: ...al data 0 through 255 before assigning it to the specified variables PC ON OFF STOP Statement Purpose To enable disable or stop a PC interrupt defined with an ON PC GOSUB statement Format PC num ON OFF STOP num is a specific interrupt number Remarks The PC ON statement enables an interrupt defined by the ON PC GOSUB statement After this statement has been executed each PC interrupt will cause pro ...

Page 56: ... format var1 var2 format specifies how the data will be read For specific format information refer to Appendix D Formatting and Data Conver sion Examples PC READ 2H1 A3 I4 O2 X Y A I J Remarks When the PC has written the data to the ASCII Unit the PC READ statement is executed If the PC has not written the data to the ASCII Unit the ASCII Unit will wait for the data and the PC READ statement is no...

Page 57: ...OR will occur If the value of exp is not an integer the INT function is internally executed to round it off Single precision and double precision numeric expressions are internally converted into integer expressions The PC WRITE statement s formatting parameters can be assigned to a single character variable and that variable may then be used in the PC WRITE statement Example A H4 A2 I3 O4 PC WRIT...

Page 58: ...s omitted port 1 is assumed for the PRINT state ment and port 2 for the LPRINT statement The LPRINT statement outputs data under control of the device connected to port 2 irrespective of the OPEN statement directives PRINT LPRINT USING Statement Purpose To output strings or numbers according to a specified format Format PRINT port USING format list of exp Example PRINT 1 USING A B Remarks The foll...

Page 59: ...ach RUN For more information refer to the explanation of RND READ Statement Purpose To read values from a DATA statement and assign them to the specified variables Format READ list of var Example READ A B Remarks A read statement must always be used in conjunction with a DATA state ment READ statements assign variables to DATA statement values on a one to one basis READ statement variables may be ...

Page 60: ...If line is specified the next READ statement accesses the first item in the specified DATA state ment RESUME Statement Purpose To resume program execution after an error handling procedure has been performed Formats RESUME 0 execution resumes at the statement which caused the error RESUME NEXT execution resumes at the statement immediate ly following the one which caused the error RESUME line exec...

Page 61: ...atement other than one of those listed above is specified to be moni tored by a WAIT statement and if execution of that statement is not com pleted within the set time of the WAIT statement an error will occur Program Example 10 WAIT 10 0 100 20 PC READ 3I4 A B C 30 PRINT A B C 40 END 100 PRINT PC ERR 110 GOTO 40 Program Remarks This example will display the message PC ERR if the PC READ statement...

Page 62: ...ger 1 or 2 device name identifies the device com spec stands for the communication specifications vsl stands for valid signal line Examples OPEN 1 KYBD OPEN 2 COMU 14 The following three tables define the communication parameters for the OPEN Statement Peripheral Device Name Output from ASCII Unit Input to ASCII Unit Terminal TERM YES YES Keyboard KYBD NO YES Display SCRN YES NO Printer LPRT YES N...

Page 63: ...ts will not be received When data is received with the XON code specified to be valid and the data buffer is filled to 3 4 of its capacity the XOFF code is sent requesting a pause of transfer If the contents of the receive buffer decrease to 1 4 of the buffer capacity the XON code is sent requesting resumption of transfer When the XOFF code is received during data transfer transfer is paused When ...

Page 64: ... output The cursor is moved as specified on the screen when code H08 BS H1C or H1D is output Codes H00 to H09 and H0E to H1B are ignored not output Closed Nothing is executed LPRT Open Sets the column position to 0 i e the leftmost position when code H0A H0D H0B or H0C is output Characters exceeding 80th character are output with code H0A LF appended Closed If characters 80 characters or less rema...

Page 65: ... convert a single precision numeric value into double precision Format CDBL x Example CDBL 2 3 CINT Function Purpose To round off a numeric value at the decimal point and convert it into an integer Format CINT x Example A CINT B COS Function Purpose To return the cosine of the numeric value given by the argument Format COS x x is an expression in radian units Example A COS pi 2 CSNG Function Purpo...

Page 66: ...s negative a new random number is generated If x is omitted or if it is positive the next random number of the sequence is generated If x is 0 the last generated random number is repeated The sequence can be changed by executing the RANDOM statement SGN Function Purpose To return the sign of an argument Format SIGN x Example B SGN A Remarks If the value of x is positive SGN returns 1 If the value ...

Page 67: ... represents the hexadecimal value of the decimal argument Format HEX x Example A HEX 52 Remarks If the value of the decimal number includes a decimal point the INT function is internally executed to round it off to an integer INSTR Function Purpose To return the position of the first occurrence of string y within string x Format INSTR i x y i is the position from where the search starts i must be ...

Page 68: ...r of characters to be returned Example B MID A 2 5 Remarks i must be from 1 to 255 j must be from 0 to 255 If j is 0 or if the value of the specified character position i is greater than the number of characters in the character expression x an empty string is returned If j is omitted or if j exceeds the number of characters to the right of the specified position i in the character expression all ...

Page 69: ...ction Purpose Converts the specified numeric value into a character string Format STR x Example B A STR 123 Remarks The VAL function performs the inverse operation STRING Function Purpose To return a character string of the specified character and length Formats STRING i j STRING i x i is the number of characters to be returned j is the ASCII code of some character x is a given string Example A ST...

Page 70: ...yyyy mm dd yy mm dd yyyy y A ten character string in mm dd yyyy format mm two digit value for the month 01 12 dd two digit value for the day 01 31 yy two digit value for the year yyyy for digit value for the year Example DATE 89 05 23 Remarks If DATE is on the right side of the assignment statement or in a PRINT statement the current date is assigned or printed respectively If DATE is on the left ...

Page 71: ...L ERL and ERR can be used in error handling routines to control the execution flow of the program FRE Function Purpose To return the amount of unused memory Format FRE 0 FRE x Example PRINT FRE 0 Remarks If the argument is numeric the number of unused bytes in the program area is given If the argument is a character expression the number of unused bytes in the character variable area is given INKE...

Page 72: ...arks The port specified must already be open and in input mode The number of data items in the buffer of the specified port is given in byte units PEEK Function Purpose To read the contents of a specified memory address Format PEEK I I is the memory location and must be in the range of 0 to 65535 HFFFF Example A PEEK H3000 Remarks If the specified address is not an integer it is converted into one...

Page 73: ...he watchdog timer refresh will be performed as usual If the W parameter is specified then the user must include a watchdog timer refresh routine in the assembly program The watchdog timer prevents the program from overrunning When the set time has run out the ASCII Unit is reset and the message I O ERR is dis played on the programming console of the PC By refreshing the watchdog timer before its s...

Page 74: ...ent Higher 8 bits of mantissa Middle 8 bits of mantissa Lower 8 bits of mantissa Sign most significant bit X MSB is always 1 Double Precision Real Number Type Exponent Higher 8 bits of mantissa Lower 8 bits of mantissa Sign most significant bit Program Example BASIC Program 100 A H1234 110 DEF USR0 H2000 120 A USER A 130 PRINT A 140 END Assembly language program 2000 PSHA 2001 PSHX BASIC Language ...

Page 75: ... Remarks The VARPTR function returns the address of the first byte of data identified with the variable A value must be assigned to the variable prior to the call to VARPTR or an error will result Any type variable name may be used numer ic string array Note that all simple variables should be assigned before calling VARPTR for an array because addresses of arrays change whenever a new simple vari...

Page 76: ...th of character string Single Precision Real Number Type 0100 Variable name length 1 Variable name Address Double Precision Real Number Type 1000 Variable name length 1 Variable name Sign and higher 7 bits of mantissa Exponent Exponent Sign and higher 7 bits of mantissa Middle 8 bits of mantissa Lower 8 bits of mantissa Lower 8 bits of mantissa Variable name length 1 BASIC Language Section 4 2 ...

Page 77: ...vantageous to use assembly routines instead of BASIC to perform specialized functions An assembly routine can be called from the BASIC program and used in much the same way as a BASIC subroutine Assembly programs are written edited and tested in what is called monitor mode The monitor mode commands and examples of their use are presented in this section 5 1 Assembly Language Programming 68 5 2 Ter...

Page 78: ...vice 3 Press the START STOP switch on the ASCII Unit to start data transfer 4 Reconnect the input terminal and key in ctrl x An assembly language program can be called from BASIC with the USR function USR number argument Before the USR function can be used the DEF USR statement must be ex ecuted to reserve space for the assembly routine When the USR function is executed it calls the specified asse...

Page 79: ... address held in the program counter is the base address used for displaying and writing data when using the monitor commands Format The left and right arrow brackets and that have been previously used to denote user supplied text in BASIC programming format statements are used as actual operators in monitor mode Therefore whenever you see an arrow bracket character in a monitor mode command it mu...

Page 80: ... the addresses from the base address to the entered address will be dis played refer to examples 3 and 4 New data can be stored in memory as well this data will overwrite existing data Input data must be in hexadecimal Upper case characters must be used for the alphanumeric values of A through F hex When the leftmost digit is a 0 it can be omitted There are two ways to poke data directly store dat...

Page 81: ...ve Command Purpose To transfer the data stored in a consecutive range of addresses to another place in memory Format M destination start address source start address source end address Remarks This command will transfer a block of data starting from source start ad dress and ending at source end address to destination start address Note that the source address range must not overlap the destinatio...

Page 82: ...k of data of the same size beginning at start address 1 If the contents of the two address ranges differ the corresponding address es where the data is not the same is displayed with its contents Example Enter C3000 4000 4007 Displayed 4003 FF 03 Enter 3000 3007 Displayed 3000 00 01 02 03 04 05 06 07 Enter 4000 4007 Displayed 4000 00 01 02 FF 04 05 06 07 Example Remarks In the above example data s...

Page 83: ...rs A and X are rewritten as specified Break Point Command Purpose To set a breakpoint at a specified address Format BP address Remarks Up to two breakpoints can be set at the same time If BP is entered by itself the current breakpoint s will be displayed If BP is followed by an address a new breakpoint will be set at that address Examples 1 Enter BP3000 Sets a breakpoint 2 Enter BP Displayed BP 30...

Page 84: ...s 20 lines of code starting from the specified ad dress 2 Enter I I Displayed 3032 26 02 BNE 3036 3034 A7 00 STAA 00 X 3036 39 RTS 3080 08 INX Each time I I is subsequently entered the next 20 lines of code will be dis played Save Command Purpose To transfer the specified block of data to port 1 in S format Format S start address end address Remarks Transfers the data stored from start address to ...

Page 85: ... Data transfer will not start until the ASCII Unit START STOP switch is pressed Verify Command Purpose To verify whether data sent through port 1 is the same as data stored in the specified memory locations Format V offset Example Enter V100 Press the START STOP switch Displayed 3120 12 Remarks The input data is compared with the data stored in the specified address range The base address for data...

Page 86: ...e Enter T3000 Displayed 3000 86 80 LDAA 80 C C8 A 80 B 00 X 0000 S 2EFF P 3002 Remarks When address is specified the instruction stored starting at address is executed If address is not specified the instruction stored at the address indicated by the program counter is executed To execute several program steps execute the Step command as many times as required When Step is executed the instruction...

Page 87: ...nter STD 4000 Displayed 3004 FD 40 00 STD 4000 Enter ASLA Displayed 3007 48 ASLA Enter BNE 3000 Displayed 3008 26 F6 BNE 3000 Enter X Arithmetic Using Hexadecimal Purpose To add or subtract 4 digit hexadecimal data Format hex data hex data hex data hex data Examples Enter 1234 5678 Displayed 1234 5678 68AC Enter ABCD EF01 Displayed ABCD EF01 9ACE Enter AB 12 Displayed AB 12 0099 Monitor Mode Comma...

Page 88: ...ements are used with the Memory Area Designator In some of the program examples there are two versions of the ASCII Unit Program one runs in conjunction with a PC data transfer routine and the other runs independently of a PC program The purpose of the second part of this section is to give a step by step explanation of what the ASCII Unit and PC are doing during execution of their respective prog...

Page 89: ...e number of words to be transferred specifies the base word for data transfer WRITE flag PC READ 5I4 A B C D E Number of words to be transferred Word n 1 Word n 2 where n 100 10 x unit no A B C D A B C D Remarks In this example when the execution statement flag is set the data stored in words 0000 to 0004 is written to the ASCII Unit after the WRITE flag word n bit 01 has been set When the ASCII U...

Page 90: ...d number Transfer base word DM 0010 Number of words to be transferred Word n 1 Word n 2 where n 100 10 x unit no A B C D A B C D Remarks In the above program when the execution statement flag is set data is writ ten to PC DM words 0010 0011 and 0012 after the READ flag word n bit 02 is set When the ASCII Unit executes the PC WRITE statement variables P Q and R are converted into BCD and stored in ...

Page 91: ...9 to 10 00 The clock 24 hour must be set prior to program execu tion Example 4a Purpose To transfer data from the keyboard to the PC using the BASIC INPUT statement 10 OPEN 2 KYBD 20 INPUT 2 A 30 PC WRITE 2A3 A MOV 0002 101 10002 MOV 0020 102 PC Program ASCII Unit Program Execution statement 10300 ASCII busy READ flag specifies the number of words to be transferred specifies the number of words to...

Page 92: ...ds 0020 and 0021 During PC WRITE execution the busy flag word n 3 bit 00 is set Example 5 Purpose To control the ASCII Unit from the PC using the ON PC state ment 50 ON PC 3 GOSUB 200 60 ON PC 4 GOSUB 300 70 PC ON 200 A 1234 RETURN 300 A 2345 RETURN 10001 PC Program ASCII Unit Program Execution statement WRITE flag MOV 0030 100 Remarks In this example the PC controls execution of the ASCII Unit by...

Page 93: ...tion 2 Specification 3 10009 Remarks The PC GET statement reads bits 10008 to 10015 of the PC as a word The word is logically ANDed with 3 00000011 and the result of this operation is used to branch the program When bit 10008 is set k will be equal to 1 and the program will branch to line 100 If bit 10009 is set k will be equal to 2 and the program will branch to line 200 Example 7 Purpose To cont...

Page 94: ...00 B 30 C MID TIME 4 5 40 IF C A GOTO 30 50 D LEFT TIME 2 60 IF D B GOTO 30 70 B D 80 PC READ I4 X 90 PRINT 2 DM X 100 GO TO 30 Remarks The printer should be connected to port 2 The baud rate should be set to 4 800 baud Example 8b Purpose To read and print PC data at specific times using the ASCII Unit PC READ statement This example does not require a PC data transfer routine ASCII Unit program 10...

Page 95: ... replaced by data input through a keyboard The data is represented as 4 digit hexadecimal numbers Example 9b Purpose To accept input from the keyboard and write it to the PC using the PC WRITE statement ASCII Unit Program 10 INPUT I 20 PC WRITE D 0 1 I4 I 30 GOTO 10 Example 10 Purpose To retrieve and print several types of data from the PC using the PC GET statement Example Programs Section 6 1 ...

Page 96: ... MOV 0000 102 PC Program ASCII Unit Program 10300 ASCII busy WRITE flag MOV 0100 100 MOV 0200 100 SW1 Start SW1 Remarks Two lot size areas stored in PC DM words 0000 and 0001 are retrieved and printed Connect the printer to port 2 and set the baud rate to 4 800 bps Example 11 Purpose To use PC interrupts to direct execution of the ASCII Unit Example Programs Section 6 1 ...

Page 97: ... Three ON PC GOSUB statements are used to direct program execution to three different interrupt service routines After the branch destinations are defined by the ON PC GOSUB statements the ON PC statement is executed enabling the interrupts The statement GOTO 60 at line 60 causes the pro gram to wait for a PC interrupt to initiate further action If PC interrupt 1 interrupts the ASCII Unit the cont...

Page 98: ...PC READ 2I4 D1 D2 30 PRINT 2 DATA1 D1 DATA2 D2 TIME TIME 40 GOTO 20 Remarks PC data and the time of transfer are output to a printer connected to port 2 of the ASCII Unit The PC read statement is used to obtain the data from the PC Output DATA1 5678 DATA1 3249 DATA2 9876 DATA2 12 TIME 13 45 03 TIME I4 02 51 Example 13 Purpose To display the state of PC bit 1000 on a display device con nected to po...

Page 99: ...igure defines the output format of the bar code reader PC Program DM000 DM001 Data 1 Data 3 DM002 DM003 Data 5 Data 7 DM004 Data 9 Data 2 Data 4 Data 6 Data 8 Data 10 ASCII Unit Program 10 OPEN 2 COMU 22 20 A INPUT 1 2 30 IF A CHR 2 GOTO 50 40 GOTO 20 50 B INPUT 11 2 60 IF CHR 3 RIGHT B 1 THEN B MID B 1 10 ELSE GOTO 20 70 PC WRITE D 0 5 5A3 B 80 GOTO 20 Note For details on the COMU statement refer...

Page 100: ...t Program Start 10300 ASCII busy WRITE flag 100 PRINT START 110 WAIT 10 00 0 1000 120 PC READ 5I4 A B C D E 130 PRINT A B C D E I40 END 1000 PRINT ERROR READY Y N 1010 F INKEY 1020 IF F Y THEN 100 1030 IF F N THEN END ELSE 1010 Remarks Pressing the PC START switch will cause specified PC data to be transferred to the ASCII Unit and displayed on the monitor When the program is ex ecuted the message...

Page 101: ...busy WRITE flag Remarks In this example a terminal is connected to port 1 and an RS 232C communi cation device is connected to port 2 Initially all the interrupts are disabled The program will wait for one of two inputs from the keyboard KEY 1 or KEY 2 each of which will direct the program to process subsequent inter rupts in a unique way 1 2 3 1 If key 1 is pressed the COM2 and PC interrupts will...

Page 102: ...3 04003 MOV 21 0005 141 04006 04004 14001 04006 04001 14001 14308 04002 04003 14001 14308 14308 MOV 21 0200 142 04005 Start 1 3 1 3 10 PC PUT 0 20 ON PC 1 GOSUB 100 30 PC 1 ON 40 GOTO 40 100 PC PUT 1 110 FOR I 1 TO 50 NEXT 1 120 PC READ 514 A1 A2 A3 A4 A5 130 PRINT A1 A2 A3 A4 A5 140 PC PUT 0 150 RETURN Note The time required to complete the 110 PC PUT transfer and to turn OFF the WRITE flag must ...

Page 103: ...20 PC PUT 0 130 PRINT A1 A2 A3 A4 A5 1 2 5 7 8 3 4 Execution Sequence 1 2 3 1 ASCII The PC PUT 1 statement sets bit 10308 2 ASCII Executes the PC READ statement 3 PC The self holding circuit is set on the positive edge transition of bit 10308 4 PC Sets the transfer base word number and the number of words to be transferred to the ASCII Unit when contact 04001 is set and sends the data to the ASCII...

Page 104: ...A2 A3 A4 A5 110 PRINT A1 A2 A3 A4 A5 Execution Sequence 1 2 3 1 ASCII Reads data using the PC READ statement independently of the PC program 2 ASCII Displays the data read in step 1 Example 2a Purpose To transfer data from the ASCII Unit to the PC with the ASCII Unit maintaining control MOV 0005 101 10002 MOV 0000 102 PC Program ASCII Unit Program 10300 04002 04001 DIFU 04000 10309 04000 04001 040...

Page 105: ...TE statement has been executed i e after the ASCII busy flag 10300 has been cleared Remarks If this program is executed repeatedly and if the time required to set bit 10309 with PC PUT 2 after it has been cleared with PC PUT 0 is longer than the scan time of the PC the PC cannot detect the state of bit 10309 Example 2b Purpose To transfer data from the ASCII Unit to the PC with the ASCII Unit main...

Page 106: ...0 GOTO 30 100 PC READ 5I4 A1 A2 A3 A4 A5 110 PRINT A1 A2 A3 A4 A5 120 RETURN MOV 0010 100 04005 PC Program ASCII Unit Program 10300 04002 04001 DIFU 04000 Start 04000 04001 04001 10001 10300 04002 MOV 0005 101 04006 MOV 0200 102 10300 04004 04003 04002 04003 04003 10001 10300 04004 10001 04005 04006 MOV 0000 100 04002 2 1 1 3 3 Execution Sequence Section 6 2 ...

Page 107: ... the PC READ parameters sets the WRITE flag 10001 and initiates process ing of the PC READ statement 4 ASCII Executes the PC READ statement on direction from the PC and displays the data Processing then returns to the main routine and the ASCII Unit waits for the next interrupt 5 PC Returns to its initial status after execution of the PC READ state ment i e when the ASCII busy flag 10300 has been ...

Page 108: ...ransfer data from the ASCII Unit to the PC with the PC main taining control 10 ON PC 2 GOSUB 100 20 PC 2 ON 30 ordinary processing 40 GOTO 30 100 PC WRITE D 400 5 5I4 A1 A2 A3 A4 A5 110 PRINT A1 A2 A3 A4 A5 120 RETURN MOV 0020 100 10001 MOV 0000 100 PC Program ASCII Unit Program 10300 04002 04001 DIFU 04000 Start 04000 04001 04001 10001 10300 04002 04002 3 1 2 Execution Sequence 1 2 3 1 PC The sel...

Page 109: ...A2 A3 A4 A5 I40 END MOV 0005 101 10002 MOV 0400 102 PC Program ASCII Unit Program 10300 04002 10009 DIFU 04000 Start 04000 10009 10009 10002 10300 04002 2 3 1 Execution Sequence 1 2 3 1 PC The self holding circuit 10009 is set on the leading edge of the start statement signal The WRITE flag is then set to initiate execution of the PC WRITE statement 2 ASCII Executes the PC WRITE statement 3 PC Cle...

Page 110: ...0200 to 02I4 Execution Sequence 1 2 3 1 PC The self holding circuit 04001 is set on the positive edge transition of bit 01000 An interrupt number is then generated for execution of the the ON PC 1 GOSUB statement and the WRITE flag 10001 is set 2 ASCII After the interrupt is enabled with the ON PC statement execu tion branches to an interrupt service routine statements 1000 to 1110 and the specifi...

Page 111: ...TO 100 1 3 2 Execution Sequence 1 2 3 1 ASCII The PC is initialized with the PC PUT 0 statement Data is en tered via the keyboard and read with the INPUT statement The data is then written to the PC with the PC WRITE statement PC process ing is then initiated with the PC PUT 1 statement 2 PC When data processing is complete the self holding circuit 10008 is set requesting the ASCII Unit to read th...

Page 112: ...emory areas are used as a program area work area and buffer area respectively Program Area Address Area 2000 to 24FF Program area 2500 to 2507 Work area 2600 to 27FF Buffer area Work Area Address Function 2500 to 2501 Stores buffer 1 stores numerals pointer 2502 to 2503 Stores buffer 2 stores characters pointer 2504 to 2505 Stores transfer source word 2506 to 2507 Stores transfer destination word ...

Page 113: ...of characters to GET Character variable first address GET DOUNTIL number of times equal to the number of characters Character GET Character variable address pointer 1 IF 30 min THEN IF numeral less than 39 THEN Stores numeral in buffer 1 ENDIF Stores character in buffer 2 Updates counter ENDDO Transfer from buffer 1 to a character variable 2000 PSHA PSHB PSHX LDD 2600 STD 2500 LDD 2700 STD 2502 LD...

Page 114: ...HX LDX 1 X ABX STX 2506 LDD 2502 SUBD 2700 JSR 2100 PULX PULB PULA RTS 2100 LDX 2504 LDAA 0 X INX STX 2504 LDX 2506 STAA 0 X INX STX 2506 DECB BNE 2100 RTS Data transfer subroutine Assembly Language Example Section 6 3 ...

Page 115: ...107 Appendix A Standard Models Item Description Model No ASCII Unit EEPROM C200H ASC02 Battery Set Backup battery for C200H only C200H BAT09 ...

Page 116: ...ytes EEPROM The program memory area can be segmented into 3 program areas Transfer capacity 255 words at a maximum of 20 words per scan Timer function Year month day date hour minute second leap year can be programmed Accuracy month 30 seconds at 25 C Diagnostic functions CPU watchdog timer battery voltage drop Battery life 5 years at 25 C The life of the battery is shortened if the ASCII Unit is ...

Page 117: ...rt up of a BASIC program upon power application 2 Automatic program transfer from EEPROM to RAM Specifies whether the BASIC program is automatically transferred from the EEPROM to RAM on power application or reset 3 Program No Sets the program number The program number can be changed by the PGEN 4 command 5 Data Section mode selector Sets the Data Section to either two word or four word mode 6 Scr...

Page 118: ... 232C D sub 9 pin connectors are used for both ports Assemble the cable connectors supplied with the ASCII Unit To connect the cables correctly refer to the fol lowing signal table Port 1 Port 2 9 9 6 6 5 1 5 1 Plug XM2A 0901 OMRON or equivalent Applicable Connector Hood XM2S 0901 OMRON or equivalent Two plugs and two hoods are supplied with the ASCII Unit Cable Length 15 m Pin No Symbol Name Dire...

Page 119: ... RTS 2 3 4 7 3 4 GND TXD RXD RTS 1 9 2 ASCII Unit Display Terminal Shielded cable CTS DSR 5 7 8 20 DCD DTR Connections to a Plasma Display FG SG SD RD RTS 2 3 4 1 9 CTS DSR 5 7 FG SG SD RD RTS CTS DSR DTR 8 DTR 1 7 2 3 4 5 6 20 Connections to a Personal Computer ASCII Unit Personal Computer Shielded cable Interface Signal Timing The RTS CTS DTR and DSR signals are processed as follows ...

Page 120: ...ce in the OPEN command is TERM or COMU when the OPEN command is executed the DTR signal will go HIGH and the RTS signal will go LOW The RTS signal will go HIGH when the PRINT command is executed If both the CTS and DSR signals are HIGH data will then be transferred 3 If the name of the peripheral device in the OPEN command is LPRT or SCRN when the OPEN command is executed both the DTR and RTS sign...

Page 121: ...thing is executed LPRT At execution The cursor is set to the leftmost position when code H0A H0D H0B or H0C is output If an output line exceeds 80 characters code H0A LF is automatically appended to the line data CLOSE If data remains in the transmission buffer it is output with code H0A appended COMU At execution Data is output when characters are sent to the buffer CLOSE If data remains in the t...

Page 122: ...Appendix B Specifications 115 130 35 100 5 ...

Page 123: ...h Instruction Execution Instruction Execution Data Transfer Data Transfer Processing in BASIC program ASCII Unit C200H CPU BASIC Statements and PC Scan Time PC GET The ASCII Unit takes in data obtained in the last PC I O refresh before execution of PC GET I O Refresh I O Refresh ASCII Unit C200H CPU Instruction Execution Instruction Execution PC GET Statement PC GET Statement Data from before ...

Page 124: ...tion Execution PC PUT Statement Data Transfer Data Transfer PC READ In four word mode when the PC s WRITE flag is set the base address is transferred By the next I O refresh the data is read I O Refresh ASCII Unit C200H CPU Instruction Execution I O Refresh I O Refresh I O Refresh Write Flag word n bit 01 ASCII Busy word n 3 bit 00 Instruction Execution Instruction Execution PC READ statement READ...

Page 125: ...cution READ PC READ statement ASCII busy word n 3 bit 00 PC WRITE In four word mode when the PC s READ flag is set during I O refresh the PC WRITE statement obtains the base word address and the number of words to be transferred With the next I O refresh data is transferred I O Refresh ASCII Unit C200H CPU Instruction Execution I O Refresh I O Refresh I O Refresh READ Flag word n bit 02 ASCII Busy...

Page 126: ...word n 3 bit 00 WRITE ON PC GOSUB After the ON PC GOSUB statement is executed the PC s interrupt number is written in When the Write flag is set the GOSUB statement is executed Only when the WRITE flag is set will the ON PC GOSUB statement be executed I O Refresh I O Refresh I O Refresh Instruction Execution Instruction Execution Instruction Execution ASCII Unit C200H CPU I O Refresh ON PC GOSUB S...

Page 127: ...tatement is executed Only when the WRITE flag is set will the ON PC GOSUB statement be executed I O Refresh I O Refresh I O Refresh Instruction Execution Instruction Execution Instruction Execution ASCII Unit C200H CPU I O Refresh PC ON Statement Execution PC ON Statement Execution Interrupt Number word n bits 04 through 07 WRITE Flag word n bit 01 ASCII Unit word n 3 bit 00 ...

Page 128: ...ime but the GOSUB statement is not executed Only after the PC ON statement is executed will the ON PC GOSUB statement be executed I O Refresh I O Refresh I O Refresh Instruction Execution Instruction Execution Instruction Execution ASCII Unit C200H CPU I O Refresh PC STOP Statement Execution PC STOP Statement Execution Interrupt Number word n bits 04 through 07 WRITE Flag word n bit 01 ASCII Unit ...

Page 129: ... if the Write flag is set the GOSUB statement will not be executed and the ASCII busy flag will not be set I O refresh I O refresh I O refresh Instruction execution Instruction execution Instruction execution ASCII Unit C200H CPU I O refresh ON PC GOSUB statement execution ON PC GOSUB statement execution Interrupt number word n bits 04 through 07 WRITE flag word n bit 01 ASCII Unit word n 3 bit 00...

Page 130: ...A format one format designator corresponds to only one variable in the variable list e g the first format designator corresponds to the first variable in the list the second format designator corresponds to the second variable in the list etc In all formats except A and S one format designator can apply to many variables For example 5H2 A B C D E This is the same as 1H2 1H2 1H2 1H2 1H2 A B C D E A...

Page 131: ... 162 x 161 x 160 4 x 163 x 162 x 161 x 160 Example 3H4 Three hexadecimal words of 4 digits each O Format mOn This format is used for octal numbers 0 to 7 m number of words O octal format designator n the nth byte of the word Digit n Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1 x 80 2 x 81 x 80 3 x 82 x 81 x 80 4 x 83 x 82 x 81 x 80 Example 4O2 Indicates four octal words of two digits each B Format ...

Page 132: ...ach A maximum of 255 words can be transferred at one time when the A format is used because many PC words can be represented by one BASIC variable Example PC READ 50A3 100A2 30A1 75A3 A B C D A Fifty PC words 50 words x 2 characters 100 characters indicated by 50A3 are assigned to this vari able B One hundred PC words 100 words x 1 character 100 characters indicated by 100A2 are assigned to this v...

Page 133: ...ipt a specific element within the array The number of words to be written to or read from the array will be increm ented from the specified element For example if the array variable T 4 is specified in a READ statement and the corresponding format is S100I4 then 100 words will be read from the array starting at T 4 and ending at T 104 Example PC READ S100I4 S75H2 S80O3 A 1 B 11 C 51 A 1 to A 100 A...

Page 134: ... 1 J J 4 PC READ O 2 J J 3 4 PC READ O 3 J J 2 3 4 PC READ O 4 J J 1 2 3 4 4 2 8 1 5 6 6 6 8 PC READ O 1 A A 4 PC READ O 2 A A 3 4 PC READ O 3 A A 2 3 4 PC READ O 4 A A 1 2 3 4 1 2 3 4 O Format Contents of PC word Integer variable Character variable B Format Contents of PC word C 1 2 2 PC READ B 1 J J 2 PC READ B 2 J J 0 PC READ B 5 J J 3 2 PC READ B 1 4 J J 1 6 3 8 4 PC READ B 1 5 J J 3 2 7 6 8 I...

Page 135: ... A 1 9 8 7 6 A 2 5 4 3 2 A 3 1 0 9 8 A 4 7 6 5 4 Examples of PC Write Format Conversion I Format Contents of PC word 0 0 0 4 PC WRITE I 1 J Integer variable Character variable 0 0 3 4 PC WRITE I 2 J 0 2 3 4 PC WRITE I 3 J 1 2 3 4 PC WRITE I 4 J J 1 2 3 4 0 0 0 1 PC WRITE I 1 A 0 0 1 2 PC WRITE I 2 A 0 1 2 3 PC WRITE I 3 A 1 2 3 4 PC WRITE I 4 A A 1 2 3 4 ...

Page 136: ...2 9 3 H 8 9 A B 0 0 0 8 PC WRITE H 1 A 0 0 8 9 PC WRITE H 2 A 0 8 9 A PC WRITE H 3 A 8 9 A B PC WRITE H 4 A A 8 9 A B H Format O Format Contents of PC word 0 0 0 4 PC WRITE O 1 J Integer variable Character variable 0 0 3 4 PC WRITE O 2 J 0 2 3 4 PC WRITE O 3 J 1 2 3 4 PC WRITE O 4 J J 6 6 8 1 2 3 4 0 0 0 1 PC WRITE O 1 A 0 0 1 2 PC WRITE O 2 A 0 1 2 3 PC WRITE O 3 A 1 2 3 4 PC WRITE O 4 A A 1 2 3 ...

Page 137: ...at 1 Note Integer variables in B format will cause an error A Format Contents of PC word 0 0 5 1 PC WRITE 2 A 1 A 0 0 5 2 PC WRITE 2 A 2 A 5 1 0 0 PC WRITE 2 A 3 A 5 2 0 0 A Q R S T 5 1 5 2 5 3 5 4 Character variable Q H 5 1 R H 5 2 S H 5 3 T H 5 4 A 1 1 2 3 A 2 4 5 6 7 A 3 8 9 0 1 A 4 2 3 4 5 9 8 7 6 Contents of PC word 5 4 3 2 1 0 9 8 7 6 5 4 PC WRITE S 4 I 4 A 1 Integer variable in format I S F...

Page 138: ... 1 0 0 A 3 5 5 A 3 A B C 65 3 PC WRITE D 0 1 I 4 A 4 4 PC WRITE D 0 5 5 I 4 A B C D E 19 0 PC WRITE D 0 10 1 0 I 4 A B C D E G H I J 37 5 PC WRITE D 0 2 5 5 1 0 0 A 3 1 0 0 A 3 5 5 A 3 A B C 54 4 Remarks The execution times listed in this table do not include the time required for handshaking The actual execution time varies depending on the scan time of the PC as follows Twenty or fewer words are...

Page 139: ...d with MSET command BASIC Text are Stores intermediate language codes of BASIC program The size of this area can be changed with the MSET command System stack area Stack area used by the system Character string area Stores character strings The size of this area is normally 200 bytes and is set with the CLEAR command Common memory area or the Data Section H8000 to H8FFF RAM area for interfacing be...

Page 140: ...alue 0010 Port 1 R W Transfer rate mode control register 34 0011 R W TX RX control status register 00 0012 R Receive data register None 0013 W Transmit data register None 9400 Port 2 R Status register None 9400 W Control register 11 9401 R Receive data register None 9401 W Transmit data register None ...

Page 141: ...STOP switch is ON Normally 1 1 when battery voltage drops Port 1 DSR signal active low Port 2 DSR signal active low Port 1 CTS signal active low Communication Input Flags Address 0003 BANK2 BANK1 WDREF DTR2 DTR1 ___ ___ 7 6 5 4 3 2 1 0 TXD1 RXD1 RTS1 ___ Port 1 DTR signal active low Port 2 DTR signal active low 1 RTS signal active low 1 receive data Port 1 transfer data Watchdog timer refresh port...

Page 142: ... counter None W Higher byte MSB of buffer register None Changes depend on transfer rate 9807 R Lower byte LSB of buffer register None W Lower byte of timer 3 latch None RTC 62461 Real Time Clock Address R W Contents System Default Value 9000 R W 1 second digit 0 9 None 9001 R W 10 second digit 0 5 None 9002 R W 1 minute digit 0 9 None 9003 R W 10 minute digit 0 5 None 9004 R W 1 hour digit 0 9 Non...

Page 143: ...on 0146 Data extraction pointer reception 0147 Data storage pointer transfer 0148 Reception buffer 256 bytes 024B Port 2 Data storage pointer reception 024C Data extraction pointer reception 024D Data storage pointer transfer 024E Reception buffer 256 bytes 1440 Port 1 Transfer buffer 256 bytes 1540 Port 2 Transfer buffer 256 bytes ...

Page 144: ...OR 60 Wrong device name has been specified DIVISION BY ZERO ERROR 11 Attempt is made to divide data by 0 DIRECT STATEMENT IN PORT ERROR 56 Unnumbered line has been read while program is being loaded DUPLICATE DEFINITION ERROR 10 Array or user function is defined in duplicate FORMAT ERROR 67 Incorrect format or memory area designator number of words to be transferred or base address has not been sp...

Page 145: ...or nothing is written in the EEPROM PROTECTED PROGRAM ERROR 62 Program is protected To change program delete name with PNAME command RESUME WITHOUT ERROR 20 RESUME statement is executed when no error exists RETURN WITHOUT GOSUB ERROR 3 RETURN statement is encountered before execution of GOSUB statement STRING FORMULA TOO COMPLEX ERROR 16 Character expression is too complex STRING TOO LONG ERROR 15...

Page 146: ...ble or faulty contact exists Repair or replace cable Transfer rates and communication conditions of ASCII Unit and peripheral device do not match Correct transfer rates and communication conditions ERR 1 indicator comes on Battery connector is disconnected Correctly connect battery connector Battery voltage has dropped Replace battery Initial screen is PROGRAM MEMORY ERROR and CTRL X is ineffectiv...

Page 147: ... from the ASCII Unit 4 With a standard screwdriver remove the cover of the ASCII Unit 5 Pull out the PC board from the housing 6 Disconnect the battery and connector and replace them with new ones 7 Reassemble the ASCII Unit in the reverse order of disassembly Back of Unit Battery holder Battery connector Battery Set C200H BAT09 Notes on Handling Replace the ASCII Unit after turning off the power ...

Page 148: ... corresponding to the ASCII code given by the argument Char 2 5 57 CINT Converts a numeric value into a double precision real number Arith 3 1 55 CLEAR Initializes numeric and character variables Gen 1 7 32 CLOSE Closes a port Dev 1 3 51 CLS Clears the screen Dev 25 4 52 COM ON OFF STOP Enables disables or stops an interrupt from a communication port Gen 32 CONT Resumes execution of a program that...

Page 149: ...sion Gen 5 5 37 INKEY Returns a character read from the keyboard Spec 2 1 61 INPUT Reads key input and assigns it to the specified variable Gen 37 INPUT Returns a character string read from the keyboard and assigns it to the specified variable Spec 61 INSTR Searches for the first occurrence of a character string and returns its position Char 3 8 57 INT Shortens an expression to a whole number Arit...

Page 150: ...signs it to the specified variable Gen 5 4 3 1 45 PC ON STOP Enables or stops an interrupt invoked by the PC Gen 45 PC PUT Writes the value of a numeric expression to the PC input data area Gen 3 46 PC READ Reads data from the specified PC memory area converts it to the specified format and assigns it to the specified variables Gen 9 8 46 PC WRITE _ Converts data to the specified format and writes...

Page 151: ...pty string of the specified number of characters Char 2 4 59 STOP Stops program execution Gen 50 STR Converts a numeric value into a character string Char 3 3 59 STRING Returns a character string of the specified length Char 3 1 59 TAB Outputs spaces up to the specified column position Char 59 TAN Returns the tangent of a number Arith 31 9 56 TIME Sets or gives the time Spec 1 8 2 8 59 TRON TROFF ...

Page 152: ...TE Statement 92 6 1 10 Retrieves and prints PC data using the PC GET Statement 93 6 1 11 Uses PC interrupts to direct execution of the ASCII Unit 87 6 1 12 Prints PC data and the time of transfer 96 6 1 13 Displays the state of PC bit 1000 96 6 1 14 Inputs data from a bar code reader using the PC WRITE Statement 97 6 1 15 Reads data form an input file through a com port 97 6 1 16 Transfers data us...

Page 153: ...s on the terminal screen Setup Connections Provide a connecting cable for connecting the ASCII Unit to the computer Connector specifications and the connection configuration are shown below Connector a D sub 9 pin female Hood XM2S 0913 Connector XM2D 0901 b D sub 9 pin male Hood XM2S 0911 Connector XM2A 0901 IBM PC AT or compatible C200H ASC02 3 SD 2 RD 7 RTS 8 CTS 6 DSR 4 DTR 5 GND 2 SD 3 RD 4 RT...

Page 154: ...00 Select OK Default settings can be used for all the other settings These settings do not have to be repeated each time you use HyperTerminal Simply select the icon with the required name If the modem settings have already been made for the computer you are using only the settings from Con nection Description onwards are required Confirming Connection Key in Ctrl X at the computer The following m...

Page 155: ...ut the following SAVE 1 COMU 43 1 2 3 1 Select Capture Text from the Transfer menu and specify the name of the file for saving 2 Start program transfer using the START STOP switch on the front panel of the ASCII Unit 3 When program transfer has finished select Stop in Transfer Capture Text and key in Ctrl X ...

Page 156: ...other manuals 2 Reserve an assembly language programming area in the memory area H2000 to H7FFF using the MSET command as shown below READY MSET H3000 READY Reserves H2000 to H3000 as assembly language area Note For details on actual assembly language programming refer to the HD6303X user s manual Hitachi 2 Creating Programs The ASCII Unit has an in built mini assembler The procedure for inputting...

Page 157: ...rmat S start address end address H2000 to H2100 saved 2 Select Capture Text from the Transfer menu and specify the name of the file for saving 3 Start program transfer using the START STOP switch on the front panel of the ASCII Unit 4 When program transfer has finished select Stop in Transfer Capture Text and key in Ctrl X 4 Returning to BASIC Key in Ctrl B to leave monitor mode and return to BASI...

Page 158: ... the front panel of the ASCII Unit 3 Transfer the programs saved by selecting Send Text File from the Transfer menu The operations required to go between BASIC mode monitor mode and mini assembler mode are summa rized in the diagram below Power ON Ctrl X MON Ctrl B Monitor mode Ctrl A X Mini assembler mode BASIC mode ...

Page 159: ...its that is regarded as one unit communication port A connector through which external peripheral devices can communicate with a host computer or microprocessor The ASCII Unit has two communica tion ports used to connect to a personal computer printer or other I O de vices data section A special PC memory area that is assigned to each individual ASCII Unit The ASCII Unit uses the data section for ...

Page 160: ...al or hex is a numerical system based on the number 16 One hex digit can be represented by four binary digits in the range of zero to 15 The numbers 10 through 15 are represented by the letters A through F respec tively Index register One of the microprocessor s hardware registers It is used for assembly lan guage programming interrupt number A code that is sent from the interrupting device to the...

Page 161: ...e specified action port buffer Special memory that is used to temporarily store data that has just been re ceived or is about to be sent out through a communication port program counter A microprocessor register that keeps track of program execution It is used for assembly language programming RAM Stands for Random Access Memory and is used for running the ASCII Unit program RAM will not retain da...

Page 162: ...fies which communication signals CTS DSR RTS are to be used for handshaking watchdog timer A clock on the PC that measures the time it takes the PC program to com plete one scan If the scan time is longer than 100 ms a warning is issued If the scan time is longer than 130 ms the PC will suspend operation The watchdog timer is reset at the beginning of each scan word A word is made up of two bytes ...

Page 163: ...ands 18 B backplane 4 7 base address 16 base word 13 BASIC arrays 22 character set 20 commands 20 26 configuration 20 constants 20 data types 21 expressions 23 format 25 functions 20 operator priority 24 operators 23 statements 20 general 32 type conversion 22 variables 21 BASIC program execution 18 storage 17 transfer 17 battery life 109 baud rate 109 baud rate setting Port 1 6 Port 2 6 booted 4 ...

Page 164: ...Work Area 139 peripheral devices connection to personal computer 112 connection to plasma display 112 connection to printer 112 personal computer communication settings 17 physical dimensions 109 114 port address assignments 136 port error flags 13 ports 2 precautions xi applications xiii general xii operating environment xii safety xii program program transfer 17 programs ASCII program 16 PC prog...

Page 165: ...second sentence Page 129 Table at top of page revised and table of memory area designates add ed for PC READ and PC WRITE Page 132 Definition of n corrected for S Format Page 136 Four numbers at top right of page corrected Appendix F Execution times added 2B November 1992 Page 21 Paragraph on syntax errors added to Variable Name Page 92 Example 18 has been added to Example Programs 2C December 199...

Page 166: ...eadquarters OMRON EUROPE B V Wegalaan 67 69 NL 2132 JD Hoofddorp The Netherlands Tel 31 2356 81 300 Fax 31 2356 81 388 OMRON ELECTRONICS LLC 1 East Commerce Drive Schaumburg IL 60173 U S A Tel 1 847 843 7900 Fax 1 847 843 8568 OMRON ASIA PACIFIC PTE LTD 83 Clemenceau Avenue 11 01 UE Square Singapore 239920 Tel 65 6835 3011 Fax 65 6835 2711 ...

Page 167: ...Cat No W165 E1 04 Note Specifications subject to change without notice Printed in Japan Authorized Distributor ...

Page 168: ...Cat No W165 E1 04 C200H ASC02 ASCII Unit OPERATION MANUAL ...

Page 169: ...USER ALONE HAS DETERMINED THAT THE PRODUCTS WILL SUITABLY MEET THE REQUIREMENTS OF THEIR INTENDED USE OMRON DISCLAIMS ALL OTHER WARRANTIES EXPRESS OR IMPLIED LIMITATIONS OF LIABILITY OMRON SHALL NOT BE RESPONSIBLE FOR SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES LOSS OF PROFITS OR COMMERCIAL LOSS IN ANY WAY CONNECTED WITH THE PRODUCTS WHETHER SUCH CLAIM IS BASED ON CONTRACT WARRANTY NEGLIGENCE OR STR...

Page 170: ...ply that the uses listed may be suitable for the products Outdoor use uses involving potential chemical contamination or electrical interference or conditions or uses not described in this manual Nuclear energy control systems combustion systems railroad systems aviation systems medical equipment amusement machines vehicles safety equipment and installations subject to separate industry or governm...

Page 171: ...to confirm actual specifications of purchased products DIMENSIONS AND WEIGHTS Dimensions and weights are nominal and are not to be used for manufacturing purposes even when tolerances are shown PERFORMANCE DATA Performance data given in this manual is provided as a guide for the user in determining suitability and does not constitute a warranty It may represent the result of OMRON s test condition...

Reviews: