background image

C200H-ASC11/ASC21/ASC31 
ASCII Units

Operation Manual

Revised June 2000

Summary of Contents for C200H-ASC11

Page 1: ...C200H ASC11 ASC21 ASC31 ASCII Units Operation Manual Revised June 2000...

Page 2: ...iv...

Page 3: ...s 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 a...

Page 4: ...vi...

Page 5: ...nctions 18 2 2 Installation 22 SECTION 3 IR CIO and DM Area Allocations 29 3 1 IR CIO Area Allocations 30 3 2 DM Area Allocations 38 SECTION 4 Data Exchange with General purpose External Devices 43 4...

Page 6: ...232 SECTION 8 Data Exchange Application Programs 235 8 1 Asynchronous Processing 236 8 2 High speed Data Exchanges 237 8 3 High volume Data Exchanges 239 8 4 Data Transfer ASCII Unit to CPU Unit 239...

Page 7: ...o the ASCII Unit in the IR and DM Areas and the applications of the bits and words in these areas Section 4 describes the ASCII Unit commands in conjunction with transmission control signals for openi...

Page 8: ...ection is important for the safe and reliable application of the Programmable Controller You must read this section and understand the information contained before attempting to set up or operate a PC...

Page 9: ...equipment with 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 man ual clo...

Page 10: ...s within the specified conditions during the life of the system 5 Application Precautions Observe the following precautions when using the ASCII Unit or PC System WARNING Always heed these precautions...

Page 11: ...n malfunction Double check all the wiring before turning ON the power supply Incorrect wiring may result in burning Mount the Unit only after checking the connectors and wring Be sure that the termina...

Page 12: ...ns and a comparison of the ASCII Unit models covered in this manual with the previous ASCII Unit 1 1 Overview 2 1 2 System Configuration 3 1 3 Internal Configuration 5 1 4 Specifications 7 1 5 Compari...

Page 13: ...t from communicating with general purpose peripheral devices ASCII Units can also be used for special operations Data operations character string processing logic flow processing and other operations...

Page 14: ...n Commands The FCS instruction can be used to calculate error check codes including those for LRC longitudinal parity CRC CCITT XMODEM CRC 16 MOD BUS and SUM 1 byte or 2 byte This allows you to elimin...

Page 15: ...t 3 on C200H ASC31 Terminal Peripheral device 15 m max 15 m max C200H ASC11 C200H ASC11 Communications port 1 Communications port 2 RS 232C RS 232C Peripheral device Or C200H ASC21 C200H ASC21 15 m ma...

Page 16: ...of shared memory with the CPU Unit 10 Setup Area words and 90 general purpose words The ASCII Unit and the CPU Unit can access these areas independently asynchronously PC CPU Unit Total no of Units o...

Page 17: ...gram Internal operation Interrupt Data exchange with the CPU Unit PC READ PC WRITE PC READ PC WRITE PC QREAD PC QWRITE Data exchange with general purpose periph eral devices OPEN PRINT INPUT INPUT etc...

Page 18: ...ce memory Flash ROM RS 232C interface RS 232C or RS 422 485 interface START STOP switch Indicators I O MPU I O bus ASCII Unit User memory User memory default switch Rotary switch Terminating resistanc...

Page 19: ...ariables Note The BASIC program has battery backup Make sure the battery is installed before operating Flash ROM 200 Kbytes The BASIC program can be stored in the flash ROM from the user memory area I...

Page 20: ...28 words max per instruction PC QREAD PC QWRITE 128 words max per command CPU Unit and ASCII Unit read write to shared memory asynchronously IOWR 00 IORD 00 Note C200HX HG HE or CS1 90 words max per i...

Page 21: ...to 9 0 to 15 MPU 8 bits 32 bits Interfaces ports Two RS 232C Two RS 232C OR One RS 232C and one RS 422A 485 OR One terminal port and two RS 232C Baud rate 19 200 bps max 38 400 bps max User program m...

Page 22: ...mory Exchanging data with ASCII Unit from CPU Unit IOWR IORD instruc tions read write to ASCII Unit s shared memory IR CIO area transfer and interrupts None Yes C200HX HG HE or CS1 Error check code ca...

Page 23: ...ASCII Unit Inter rupts PC interrupts Using allocated IR CIO area words Yes Yes Using IOWR CC instruction None Yes Maximum number 15 99 Communica tionsinterrupts via received data Interrupts when data...

Page 24: ...clear the ASCII Unit s program 2 Input Auto to automatically display the line numbers 3 Input the BASIC program and press the Enter Key Transferring a BASIC Program from a Text Editor to the ASCII Uni...

Page 25: ...o 15 of the DM word m to 5Ahex in the DM Setup Area allocated to the Unit 3 Set the port number to 3 when using the LOAD or SAVE command for the C200H ASC31 1 6 3 Connection and Transfer to External D...

Page 26: ...e Unit must be set to START first Note 1 Use one of the following steps to pause the BASIC program Press the Ctrl X Keys from the terminal Set the START STOP switch on the front panel of the Unit to S...

Page 27: ...g mounting to the PC Backplane and connecting to external devices computers 2 1 Nomenclature and Functions 18 2 1 1 Names of Parts 18 2 1 2 Front Panel 19 2 1 3 Rear Panel 21 2 2 Installation 22 2 2 1...

Page 28: ...1 1 Names of Parts 2 wire 4 wire switch Terminating resistance switch C200H ASC11 C200H ASC21 Front Panel Indicators Unit No switch START STOP switch Communications port 1 RS 232C Communications port...

Page 29: ...M setting is incorrect BASIC Green System mode Lit The BASIC program is running Bit 7 of n 5 Slow flashing INPUT LINE INPUT INPUT command standby awaiting input L PRINT command standby awaiting transm...

Page 30: ...ng or transmitting data C200H ASC31 only ERR 1 Red Communications port 1 error Lit A reception error parity error reception buffer overflow etc has occurred at communications port 1 Bit 4 of n 5 ERR 2...

Page 31: ...e user memory switch is turned OFF set to the left If the switch is turned ON set to the right and the power turned ON all programs in the ASCII Unit will be deleted Refer to 9 2 Trou bleshooting for...

Page 32: ...the upper section of the ASCII Unit onto the Back plane 2 Insert the ASCII Unit connector into the Backplane connector Note When removing the ASCII Unit lift it out while pressing down on the lock le...

Page 33: ...S1H CPU66 E 65 E 64 E 63 E CS1G CPU45 E 44 E 43 E 42 E 16 None C200H C200H CPU01 E 02 E 03 E 11 E 21 E 23 E 31 E 10 Do not mount Unit to rightmost two slots on CPU Rack Dimensions Unit Dimensions when...

Page 34: ...t Output Other ports 7 DSR Data set ready Input 8 DTR Data terminal ready Output 9 SG Signal ground Hood FG Frame ground C200H ASC11 21 C200H ASC31 1 6 5 9 9 5 6 1 Item Specifications Electrical chara...

Page 35: ...t used 8 RDB Receive data B Input 9 NC Not used Hood FG Frame ground 1 5 9 6 Item Specifications Communications mode Half duplex 1 ms is required after transmission has been completed until the ASCII...

Page 36: ...ontrol is re quired use Xon Xoff flow control 2 2 3 General purpose Peripheral Device Connections Bar Code Reader Connected with RS 232C C200H ASC11 ASC21 ASC31 IBM PC AT or compatible 3 SD 2 RD 7 RTS...

Page 37: ...pin D sub female Signal Pin No Shield Data Carrier Data Carrier R W Head R W Head ID Controller ID Controller C200H ASC21 ASCII Unit only Connecting a V600 620 ID Controller Connec tor hood RDB 8 SDB...

Page 38: ...tion Section 2 2 Note 1 Make sure that the shield is grounded at either the Digital Operator end or the ASCII Unit end but not both ends 2 Make sure to set the 2 4 wire switch on the C200H ASC21 Unit...

Page 39: ...ocate words to the ASCII Unit in the IR CIO and DM Areas and the applications of the bits and words in these areas 3 1 IR CIO Area Allocations 30 3 1 1 Overview 30 3 1 2 Overview of IR CIO Area Alloca...

Page 40: ...of 16 Special I O Units Special I O Area Allocation for the C200HX HG HE C200H C200HS Note For C200HG CPU53 E 63 E 53 ZE 63 ZE and C200HX CPU54 E 64 E 54 ZE 64 ZE 65 ZE 85 ZE CPU Units only Unit No Al...

Page 41: ...nit numbers 0 to F n 2000 10 x Unit number Unit No Allocated words Unit No Allocated words Unit No Allocated words Unit No Allocated words 0 CIO 2000 to CIO 2009 4 CIO 2040 to CIO 2049 8 CIO 2080 to C...

Page 42: ...PC Write Request Output Data from CPU Unit to ASCII Unit n 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Output Data 16 bit from CPU Unit to ASCII Unit n 1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Interrupt Num...

Page 43: ...errupt Bit 05 Sync Time Set Bit 0 to 1 Sets the ASCII Unit RTC according to the CPU Unit RTC The time on the clock in the ASCII Unit is set to the time on the clock in the CPU Unit 06 Error Code Read...

Page 44: ...next I O refresh period 12 to 15 Transfer Data Area The memory area for ASCII Unit PC READ PC WRITE commands is set using the following codes No Data area C200HX HG HE C200H C200HS CS1 Series 0 DM Ar...

Page 45: ...ror Flag Port 1 Error Flag Battery Error Flag IOWR Request Flag n 5 Port 2 Error Flag Not used Interrupt Fail Flag 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Input Data ASCII Unit to CPU Unit 16 bit n 6 15...

Page 46: ...ry voltage drop or no battery con nected 0 Normal 07 BASIC RUN Flag 1 BASIC program running 0 BASIC program stopped 08 Error Code Type 1 New 0 Old This flag shows whether the error for the error code...

Page 47: ...7 00 to 11 Error Code Error code Each time word n bit 06 changes status ON to OFF or OFF to ON in the CPU Unit the next newest error code and error type are read from the ASCII Unit s error code tabl...

Page 48: ...the Setup Area 2 The IORD IOWR Area m 10 to m 99 can be used as work bits when not used for the transfer to the ASCII Unit as described in note 1 DM Area Allocation C200HX HG HE C200H C200HS Note Uni...

Page 49: ...words you can set which words the CPU Unit can read using the IORD instruction i e the area written by the ASCII Unit via the PC EPUT command called the IORD Area and which words the CPU Unit can writ...

Page 50: ...x 0 m 00 to 07 Program No Sets the startup program number 00 No 1 01 No 1 02 No 2 03 No 3 04 No 4 00 08 to 15 Automatic transfer from flash ROM Determines whether the program is read from the flash RO...

Page 51: ...mber of transfer words per cycle C200HX HG HE or CS1 only Determines the maximum number of transfer words per CPU Unit cycle for PC READ PC WRITE commands including variants 00 20 words max 5A 127 wor...

Page 52: ...n the START STOP switch is used 3 When there is an error in the DM settings the ERR indicator will be lit Since terminals cannot be connected when this indicator is lit use a Pro gramming Console to c...

Page 53: ...Port 44 4 2 1 OPEN Command 44 4 2 2 OPEN Command Specifications 45 4 2 3 Control Monitor Commands for Transmission Control Signals 46 4 2 4 Device Symbol 46 4 3 Sending Data 47 4 3 1 PRINT Command 47...

Page 54: ...LPRINT command executes device LPRT Receiving data CR terminator INPUT command The LINE INPUT command receives everything in one character variable Specified character length INPUT function Closing a...

Page 55: ...ring the execution of I O commands PRINT and INPUT turning it OFF at all other times BASIC s RTS control is disabled RS 232C port transmission controls DSR DSR_ON When output commands such as PRINT or...

Page 56: ...command Turn DTR signal ON OFF DTR DTR 1_SET Possible when the port is open Monitor the DSR signal DSR IF DSR 1 THEN None Monitor the CTS signal CTS IF CTS 1 THEN None Device symbol Periphera l devic...

Page 57: ...T or SCRN If delimited with commas output is divided into 9 character fields If delimited with semi colons or spaces output is continuous If there is no semi colon at the end then a new line is insert...

Page 58: ...ount of DMA data that can be sent at one time is 255 bytes max To transmit data that is more than 255 bytes write a program as follows Example A 200 bytes B 100 bytes PRINT A B This example will trans...

Page 59: ...will flash slowly If CTS turns OFF during data transmission data transmission will stop and wait For OPEN Command with CTS_OFF DSR_ON If DSR is ON at the start of transmission data will be transmitted...

Page 60: ...cknowledgment 07 BEL Bell 08 BS Backspace 09 HT Horizontal tab 0A LF Return line field 0B VT Vertical tab 0C FF Form forward 0D CR Carriage return 0E SO Shift out 0F SI Shift in 10 DLE Device line exp...

Page 61: ...A and B Note CR or LF is not received as data for the INPUT command 4 4 2 Transmission Control Signals If the RTS signal is ON received data will be stored in the receive buffer inde pendent of the IN...

Page 62: ...with the ON COM command communications inter rupt or ON KEY command key interrupt so that when a communications interrupt or key interrupt occurs it is possible to store a specified number of charact...

Page 63: ...ive buffer is cleared All communications ports are also closed by the END CLEAR and NEW commands They are not closed by the STOP command 4 5 1 Transmission Control Signals 4 5 2 Transmission Control S...

Page 64: ...r receiving data OFF Port 2 COMU Ports 1 and 2 for ASC31 RTS_ON OFF OFF to ON ON ON ON to OFF RTS_OFF OFF OFF Switches from OFF to ON then back OFF again after receiving data Switches from OFF to ON F...

Page 65: ...ed Port 1 TERM and COMU Port 3 for ASC31 ON ON ON ON ON Port 2 COMU Ports 1 and 2 for ASC31 OFF OFF to ON ON ON ON to OFF Port 1 KYBD Port 3 for ASC31 ON ON ON ON Port 2 KYBD Ports 1 and 2 for ASC31 O...

Page 66: ...ck DSR_OFF No check No check No check No check No check No check Command Mode Open Receive data Send data Close OFF RTS OFF ON RTS RTS_ON ON RUN Command Mode OFF DTR ON OFF CTS CTS_ON No check No chec...

Page 67: ...No check No check No check No check No check No check Command Mode Open Receive data Send data Close OFF ON RTS RTS_ON ON RUN Command Mode OFF ON OFF Status depends on DTR command RTS_OFF DTR CTS CTS...

Page 68: ...heck No check Command Mode Open Receive data Send data Close OFF RTS_OFF ON RTS RTS_ON ON RUN Command Mode OFF DTR ON OFF None None Status depends on DTR command CTS CTS_ON No check No check Check No...

Page 69: ...he ON ERROR com mand Alternatively do not use the ON ERROR command in a situation like the one below where execution of the BASIC program should be continued even if a communications error occurs Othe...

Page 70: ...unction can be used to determine the type of error that occurred Since communications errors can be detected from the BASIC program retry processing is easily performed from the BASIC program ON ERROR...

Page 71: ...amples of processing character strings bits receive buffers looping and interrupts 5 1 Processing Character Strings 62 5 2 Processing Bits 62 5 3 Processing Receive Buffers 62 5 4 Time Processing 63 5...

Page 72: ...rching for character string from char acter number m in A and getting position of first character B INSTR m A character_string Getting number of characters in A B LEN A Converting character string A t...

Page 73: ...errupt interrupt subroutine is executed every minute HH MM 00 when the seconds equal zero Using TIMER interrupt interrupt subroutine executes process A after every sixty seconds Standby processing If...

Page 74: ...number of characters is also received in the receive buffer See note 1 ON COM n GOSUB HEAD XX BYTE YY n 1 or 2 Key interrupts The interrupt subroutine is executed when a certain key signal is input S...

Page 75: ...e If further interrupts are generated during the execution of an interrupt subrou tine they will be processed after execution of the current interrupt subroutine has been completed according to the in...

Page 76: ...0 500 A INPUT LOC 2 2 510 RETURN If ETX is received all data in the receive buffer is stored in A 100 ON COM 2 GOSUB 500 BYTE 20 110 COM 2 ON 120 GOTO 120 500 A INPUT 20 2 510 RETURN If 20 characters...

Page 77: ...sponse after 3 repeti tions error processing will commence Repetition under set conditions A C command is executed and the command response reception are repeated as long as the 2 characters following...

Page 78: ...e Method No 6 85 6 3 7 Data Exchange Method No 7 86 6 4 Data Exchange Time Charts 87 6 4 1 PC READ PC WRITE Timing 87 6 4 2 PC READ PC WRITE Timing 87 6 4 3 PC PUT PC GET Timing 88 6 4 4 IOWR 00 IORD...

Page 79: ...ASCII Unit uses the PC READ WRITE command to access the memory area in dicated by the CPU Unit 2 The ASCII Unit independently accesses the CPU Unit I O memory The CPU Unit s user program is not requir...

Page 80: ...changed during the I O refresh period 4 The ASCII Unit accesses its own shared memory via a PC EGET EPUT command Asynchronously the CPU Unit reads writes the ASCII Unit s shared memory via an IORD 00...

Page 81: ...he ASCII Unit It is not possible to send interrupts to the CPU Unit from the ASCII Unit 1 2 3 1 Interrupts are sent during the I O refresh period An interrupt number is set in the allocated IR CIO are...

Page 82: ...line number specified in the ON PC command If the IOWR 00 instruction has previously set input data in the shared memory it is possible to access the shared memory via the PC EGET EPUT com mand in the...

Page 83: ...the ASCII Unit the CPU Unit reads writes I O memory data to the ASCII Unit when the IOWR IORD FD00 instruction is executed CPU to ASCII The CPU Unit sends an interrupt to the ASCII Unit and reads wri...

Page 84: ...ecution of PCWRITE PCREAD until completion of transfer PC WRITE PC READ 255 words Using a C200HX HG HE or CS1 series PC and when the number of bytes transferred per cycle set in the Setup Area Bits 08...

Page 85: ...ag changes to ON the Write Bit is turned OFF in the ladder diagram 6 Once the PC READ command s data transfer has been completed the ASCII Busy Flag is turned OFF by the system The following example i...

Page 86: ...OFF in the ladder diagram 6 Once the PC WRITE command data transfer has been completed the ASCII Busy Flag is turned OFF by the system The following example is for a C200HX HG HE PC CPU Unit ASCII Bu...

Page 87: ...is for a C200HX HG HE PC PC WRITE The ASCII Unit writes to the CPU Unit s internal I O memory as specified in the PC WRITE command 1 2 3 1 PC WRITE command executed 2 The ASCII Unit writes data during...

Page 88: ...2 The ASCII Unit writes data during the I O refresh period The ASCII Unit is on standby during the transfer CPU Unit ASCII Unit 2 Via PC WRITE command At I O refresh 255 words max None DM 0200 0201 0...

Page 89: ...it writes specified memory area data to the ASCII Unit s shared memory areas using the IOWR instruction 1 2 3 1 Using the IOWR 00 instruction write data to the ASCII Unit s shared memory area 2 Using...

Page 90: ...Read data from the ASCII Unit s shared memory area when the IORD 00 instruction is executed in the ladder diagram The following example is for a C200HX HG HE PC Note 1 The PC EGET EPUT commands can s...

Page 91: ...2 Data is written to the ASCII Unit when the IOWR FD00 instruction is ex ecuted in the ladder diagram 3 As a result of the PC QREAD command the received data is read to a specified variable The follo...

Page 92: ...directly The CPU Unit will not monitor the words when dummy ad dresses are used In the above example the address of the first word D07000 cannot be specified for PC QREAD even though it can be speci...

Page 93: ...en executing PC QWRITE if it cannot address the re quired words directly The CPU Unit will not monitor the words when dummy addresses are used In the above example the address of the first word D07000...

Page 94: ...an interrupt to the ASCII Unit when the IOWR instruc tion CC00 is executed in the ladder diagram 3 Once the interrupt is received by the ASCII Unit data is read in the ASCII Unit via the PC EGET comm...

Page 95: ...CII Unit when the IOWR instruc tion CC00 is executed in the ladder diagram 2 The ASCII Unit receives the interrupt and writes data to the shared mem ory using a PC EPUT command 3 When a change is dete...

Page 96: ...g using the OUT instruction Write Bit Transfer on PC READ command ASCII Busy Flag Write Bit I O refresh same below If the number of transfer words specified in the PC READ command is more than the max...

Page 97: ...he IOWR 00 IORD 00 instruction is executed The ASCII Unit BASIC program continues execution 6 4 5 PC EPUT PC EGET Timing The internal shared memory is read written to immediately when the execu tion o...

Page 98: ...ta is transferred immediately by the IOWR 00 instruction The IOWR CC00 instruction sends an interrupt to the ASCII Unit The ASCII Unit receives data via the PC EGET command in an interrupt subroutine...

Page 99: ...nit in the allocated words in the IR CIO area When the PC Interrupt Bit turns ON an interrupt is sent The ASCII Unit executes the interrupt subroutine if the interrupt number is the same as the ON PC...

Page 100: ...refresh period For this reason high speed interrupts to the ASCII Unit occur in the same cycle not in the next cycle By combining the IOWR IORD 00 instruction at the CPU Unit with the PC EGET PC EPUT...

Page 101: ...Fail Flag word n 5 bit 09 will be set to ON 1 for one scan in the next cycle Execution condition ON for 1 cycle n 5 bit 09 PC Interrupt Fail Flag Interrupt Subroutine Completed Flag n bit 04 PC Interr...

Page 102: ...upt Fail Flag will be set to ON 1 for one scan in the next cycle The operation of the PC Interrupt Fail Flag when an interrupt is not accepted is explained next Execution condition ON for 1 cycle Inte...

Page 103: ...it 1 2 MOV or OUT instruction 7 DIFU instruction Completion processing Interrupt Enable Flag PC Interrupt Number Interrupt subroutine completion Interrupt subroutine Interrupt Subroutine Completed Fla...

Page 104: ...Interrupt Fail The Interrupt Fail Flag turns ON at the next cycle after an interrupt is not received from the PC even though the PC Interrupt Bit has turned ON It stays ON for only one cycle then tur...

Page 105: ...ord in CPU Unit memory from IR CIO n 8 and IR CIO n 9 D 15 12 11 0 Unit No of the ASCII Unit 0 to F No of Transfer Words 001 to 128 from IR CIO n 8 from CPU Unit to ASCII Unit C200HX HG HE Item Detail...

Page 106: ...67 n 0 to C Constants 0000 to FFFF binary Data Registers Directly addressing Index Registers Indirect addressing using Index Regis ters IR0 to IR15 2048 to 2047 IR0 to IR15 DR0 to 15 IR0 to IR15 IR0 t...

Page 107: ...ork Area W000 to W511 Holding Bit Area H000 to H511 Auxiliary Bit Area A000 to A959 Timer Area T0000 to T4095 Counter Area C0000 to C4095 DM Area D00000 to D32767 EM Area without bank E00000 to E32767...

Page 108: ...rds 001 to 090 limited by DM setting m 6 m 7 from the CPU Unit to the ASCII Unit C200HX HG HE D 15 4 3 0 Unit No of the ASCII Unit 0 to F CS1 series PCs 0 0 0 D 1 15 0 No of transfer words 0001 to 005...

Page 109: ...it Must be used in combination with the ASCII Unit s ON PC Interrupt Number command S Interrupt Number corresponds to the ASCII Unit s ON PC Interrupt Number command D 15 12 11 0 Unit No of the ASCII...

Page 110: ...0HX HG HE D Rightmost 4 digits D 1 Leftmost 4 digits Value see note ON OFF Instruction Execution Error Flag ER SR 25503 The number of transfer words is not in BCD or it is 0 words or greater than 128...

Page 111: ...5404 Underflow Flag UF 25405 Negative Flag N 25402 Value see note ON OFF C Control code S Source Unit No No of transfer words D First destination word IORD C S D Value 4 digit hex C Details Combinatio...

Page 112: ...a 2 SR 256 to SR 299 IR Area 2 IR 300 to IR 511 HR Area HR 00 to HR 99 AR Area AR 00 to AR 27 LR Area LR 00 to LR 63 TC Area TC 000 to TC 511 TR Area DM Area DM 0000 to DM 6143 EM Area Indirect DM add...

Page 113: ...om the first word in the IORD Area of the ASCII Unit s shared memory to the specified words in the CPU Unit memory Set in DM m 7 word allocated in the DM Setup area May be used in combination with the...

Page 114: ...6143 Work Area W000 to W511 Holding Bit Area H000 to H511 Auxiliary Bit Area A448 to A959 Timer Area T0000 to T4095 Counter Area C0000 to C4095 DM Area D00000 to D32767 EM Area without bank E00000 to...

Page 115: ...ution condition so that the ASCII Unit does not execute an IOWR IORD instruction during data transfer with the CPU Unit Value see note ON OFF Instruction Execution Error Flag ER 25503 The number of tr...

Page 116: ...Since the Equals Flag will change at the execution of oth er instructions commands as well such as comparison instructions be careful when writing programs Normal Completion Abnormal Completion 2 The...

Page 117: ...essed using the allocated words n 3 and n 4 can be used for data transfer Possible addresses are shown in the following table Note Other addresses cannot be accessed directly in CS1 series CPU Unit me...

Page 118: ...t will not monitor the specified words when dummy addresses are used Note The number of read write words for IOWR IORD must be specified in hexa decimal for the CS1 Series 6 6 1 Using the Sync Time Se...

Page 119: ...ries CPU Units correspond to words AR 18 to AR 21 in C200HX HG HE CPU Units The above XFER instruction uses this information to enable using the Sync Time Set Bit with CS1 series PCs by transferring t...

Page 120: ...BASIC Program 120 7 3 1 Starting the Program 120 7 3 2 Stopping the Program 120 7 3 3 Stopping the Program at a Specified Line Number 120 7 3 4 Continuing the Program after Stopping at a Line 120 7 4...

Page 121: ...Backplane 3 Turn OFF the power to the CPU Unit and connect the RS 232C port COM 1 in this example to communications port 1 for the C200H ASC11 ASC21 or the terminal port for the C200H ASC31 using an R...

Page 122: ...ady correct then click OK Baud rate 9 600 bps Data bits 8 Parity None Stop bits 2 bits Flow control Xon Xoff Note The default communications settings are 9 600 bps 8 bit data no parity 2 stop bits and...

Page 123: ...gram NEW_ Note The ASCII Unit has four program areas No 1 to 4 within the user memory area RAM Programs input using the default settings will be input in program area 1 To input a program into another...

Page 124: ...les to the ASCII Unit using Transmit text file Not doing so may cause errors in file reception Example Setting Flow Control At the terminal In the Port settings field specify Xon Xoff for the flow con...

Page 125: ...is shown at the terminal By turning OFF the power supply there is a possibility that the flash ROM will be electrically destroyed and that it will no longer be capable of storing data Do not turn OFF...

Page 126: ...SAVE 1 or SAVE 3 for C200H ASC31 only and press the En ter Key PASSWORD will be displayed at the ASCII Unit Input the pass word 2 Enable the text data receiving mode at the terminal 3 When the termin...

Page 127: ...rogram will be statically reserved in user memory Setting At the beginning of the BASIC program the maximum character variable con tent to be used in the BASIC program is specified using the OPTION LE...

Page 128: ...ch character variable in the BASIC program is reserved dynamically in user memory Setting The OPTION LENGTH command is not used Content Only the required amount of user memory is used If the size of t...

Page 129: ...to START 3 If starting automatically when power is turned ON or when the Unit is re started set the START STOP switch on the front of the Unit to START and set bits 08 to 11 of DM m 1 to 5Ahex automat...

Page 130: ...1 Command Execution Modes There are two modes for executing commands Command Mode By entering a command and pressing the Enter Key when is displayed on the terminal screen the command will be immediat...

Page 131: ...aximum length of a label is 16 characters including the asterisk Text strings that begin with reserved words cannot be used When characters continue after a label in a line they are separated by a col...

Page 132: ...al Constants Whole numbers between 32 768 and 32 767 can be used for short integers and whole numbers between 2 147 483 648 and 2 147 483 647 can be used for long integers An optional percent sign for...

Page 133: ...1 23456789 As a number in exponential form using D 1 2D 3 As a number with the character at the end 2 34 Note Precautions on Real Numbers A real number expressed in the floating point format is advan...

Page 134: ...ere is a second way to declare variable types The BASIC statements DEFINT DEFLNG DEFSTR DEFSNG and DEFDBL may be used to declare the types for certain variable names starting with a certain letter By...

Page 135: ...rray The following 12 variables can be used 7 4 7 Type Conversion When necessary BASIC will automatically convert a numeric constant from one TYPE to another The following rules apply 1 2 3 1 If the n...

Page 136: ...ade up of character constants and variables that are linked with the character operator Instead of adding characters together the operator links the characters together to form one character string In...

Page 137: ...ational operations The outcome of a logical operation is determined as shown in the following table The operators are listed in the order of precedence Relational operator Example Operation A B Equal...

Page 138: ...errupt General 140 ASC ASC character expression Determines the ASCII code of the first character of the character string given by the argument Character string 140 ASIN ASIN numeric expression Determi...

Page 139: ...l 147 DATE DATE YY MM DD Sets or gives date Special 147 DAY DAY numeric expression Sets or gives day Special 148 DEF FN DEF FN Name argument argument expression Defines a BASIC function written by the...

Page 140: ...ression Determine the exponential of a numeric expression Arithmetic operation 155 FCS FCS character expression FCS type Determines the error check code for the character expression Arithmetic operati...

Page 141: ...tart position character expression 1 character expression 2 Searches for character expression 2 in character expression 1 and obtains the position of the first character Character string 163 INT INT n...

Page 142: ...sion Assigns LPRT as the device symbol using the specified format and outputs the expression value to a specified port General 171 MID MID character expression character position number of characters...

Page 143: ...ted from PC General 181 ON TIME ON TIME time character expression GOSUB line number or label Branches to interrupt subroutine at a certain time General 182 ON TIMER ON TIMER time expression GOSUB line...

Page 144: ...equest to execute an IORD instruction at the PC and writes data to the specified I O memory area General 193 PC READ OR PC READ PC READ PC format PC format variable variable or PC READ area address re...

Page 145: ...Specifies the line number of the DATA command that is starting to be read using the READ command General 212 RESUME RESUME line number or RESUME NEXT Resumes program execution after an error handling...

Page 146: ...and 220 STOP STOP Terminates program execution General 220 STR STR numeric expression Converts the numeric value into a character string Character string 221 STRING STRING numeric expression numeric e...

Page 147: ...aiting time line number Sets the monitoring time until execution of following instruction is completed General 227 WATCH WATCH SET variable name or WATCH DEL variable name Sets SET deletes DEL or disp...

Page 148: ...brackets are repeated zero or more times e g data data field data field 7 Items enclosed in quotes should be entered as they are written if Syntax IF numerical expression THEN program ELSE program END...

Page 149: ...amples 10 A 4 20 PRINT ABS A RUN 4 See also acos Syntax ACOS numerical expression Description Function Calculates the arc cosine of a numerical expression Remarks numerical expression may be any integ...

Page 150: ...rupt may be valid If more than one is set in a program then the last one executed is valid 2 After branching processing the ALARM interrupt the interrupt is disabled and all subsequent ALARM interrupt...

Page 151: ...adians and will be in the range 2 2 The return type is single precision floating point if the argument is of type integer or single precision floating point If the argument is of type double precision...

Page 152: ...marks line number is any valid line in the BASIC program Valid range 1 65535 SET sets a breakpoint at the specified line number DEL deletes the breakpoint from the specified line number If the BRKPT c...

Page 153: ...er however will have the number of digits required for double precision If the number contains consecutive zeros only the digits for single precision may sometimes be output as described above Example...

Page 154: ...iable Space Allocations for details on allocating space in the character variable area Dynamic Method 1 All values 0 Delete all temporary memory blocks 2 Close all open ports 3 For character variables...

Page 155: ...in the range 1 3 If the port number is omitted the number of the terminal port will be used 1 for the C200H ASC11 21 and 3 for the C200H ASC31 Remarks Note 1 Port 3 corresponds to the terminal port of...

Page 156: ...double precision floating point The return type is single precision floating point if the argument is of type integer or single precision floating point If the argument is of type double precision flo...

Page 157: ...ed by the READ statement and the variables type and order must match The data defined in these statements will be read in order by READ statements When the last data item in a DATA statement is read t...

Page 158: ...f the defined function It may be any valid BASIC variable name Names starting with reserved words cannot be used The following characters cannot be used at the end of a name Variable name 1 variable n...

Page 159: ...all numeric variables are assumed to be single precision floating point When the OPTION LENGTH statement is used in a program a variable name defined by a DEF statement cannot be used before the DEF s...

Page 160: ...ng the array Note The DIM command must be executed before any substitute expression Remarks Note 1 An array variable allows multiple elements of data to be specified with a single variable name The da...

Page 161: ...specified port is active and 0 if the DSR line is not active Remarks Note 1 Port 3 corresponds to the terminal port of the ASC31 2 If Port 3 is specified on the ASC11 or if port 2 or port 3 is specifi...

Page 162: ...terminated and the editor returns to command mode Up Key Inputs the line currently being edited and displays the previous program line If the Up Key is pressed when the top line is already displayed...

Page 163: ...the input buffer of the specified port is empty and 0 not Remarks Note 1 The port specified must be open and configured for input 2 Port 3 corresponds to the terminal port of the ASC31 3 If Port 3 is...

Page 164: ...les 10 ON ERROR GOTO 1000 20 A A 0 30 END 1000 PRINT ERROR ERR OCCURRED AT LINE ERL 1010 END RUN ERROR 11 OCCURRED AT LINE 20 See also ERC ERR err Syntax ERR Description System Variable Stores the err...

Page 165: ...OTO statement ERROR and ON ERROR GOTO can be used together to simulate the occurrence of an error and test the operation of an error processing program in an interrupt subroutine Examples 10 ON ERROR...

Page 166: ...return depends on whether a BINARY or ASCII calculation is requested BINARY calculations return integers and ASCII calculations return character strings FCS code data fcs type Calculation method Data...

Page 167: ...t The return type is the type of argument Remarks Note 1 Returns the integer part without rounding down or up after the decimal point 2 If the argument value is positive FIX will return the same value...

Page 168: ...op is executed indefinitely If the initial value of the variable is greater than the TO value then the increment specified must be negative If not then the loop is never executed The NEXT statement ca...

Page 169: ...on will continue at the next line Subroutines may be called from other subroutines nested subroutines the only limit is the free user memory To prevent inadvertent entry to a subroutine it is advisabl...

Page 170: ...ision floating point expressions will be truncated before the conversion 2 If a floating point value is within the short integer range the value will be converted to a hexadecimal integer If the float...

Page 171: ...the BASIC program If there is no ELSE statement then execution will continue with the next statement If a valid line number is used instead of statements after the THEN or ELSE clauses then execution...

Page 172: ...ue entered at the prompt must correspond to the types of the variables specified in the INPUT statement Otherwise a NO SUPPORT error code 0064 will result Input is terminated by a carriage return Mult...

Page 173: ...resume from the INPUT command when the interrupt subroutine has been completed 5 Execution of the BASIC program will be paused and the BASIC LED indicator on the front of the Unit will blink slowly u...

Page 174: ...s in 7 4 4 Constants Examples 10 A INT 6 1 20 B INT 6 9 30 C INT 6 1 40 D INT 6 9 50 PRINT A B C D RUN 6 6 7 7 See also FIX intrb Syntax INTRB Description System Variable Stores the number of the line...

Page 175: ...PRINT THE SOURCE OF THIS INTERRUPT IS TYPE INTRR 1020 RETURN See also INTRB INTRS intrs Syntax INTRS Description System Variable Stores the number of the program line that has set up the interrupt pro...

Page 176: ...0 15 KEY ON 20 GOTO 20 1000 PRINT YOU PRESSED A KEY 1010 PRINT THE BASIC LINE NUMBER THAT WAS INTERRUPTED BY THIS ROUTINE IS LINE INTRL 1020 RETURN See also ON KEY GOSUB GOTO left Syntax LEFT string e...

Page 177: ...atement Inputs an entire line of characters from the keyboard or some other input device without delimiters port expression is an expression returning an integer in the range 1 3 If the port expressio...

Page 178: ...beginning of the program to the specified line number will be listed 5 If only a dot is used the line entered or displayed last will be listed If the output of list does not fit on a screen device it...

Page 179: ...If a dash is followed by a line number then all program lines from the beginning of the program to the specified line number will be listed 5 If only a dot is used the line entered or displayed last w...

Page 180: ...r information about loading a BASIC program to the ASCII Unit Examples NEW LOAD 1 COMU 9600 8 N 2 LIST 10 REM THIS IS THE SAMPLE PROGRAM THAT WAS LOADED 20 PRINT HELLO WORLD See also OPEN SAVE loc Syn...

Page 181: ...essions the format for each expression must be separated by a space If there is no space expression may not be output in the correct format Format type Code Description Prints only the first character...

Page 182: ...T TO THE PRINTER See also PRINT WAIT mid Syntax MID string expression numerical expression 1 numerical expression 2 Description Function Returns the specified number of characters starting from the sp...

Page 183: ...acters from string 2 will be inserted in string 1 No matter if numerical expression 2 is omitted or not the total length of the original string 1 cannot be exceeded numerical expression 1 cannot speci...

Page 184: ...protected with a PNAME statement cannot be erased with NEW The program name must first be cleared using PNAME Attempts to clear a program protected with PNAME will result in a PROTECTED PROGRAM error...

Page 185: ...47483648 2147483647 The resulting character string will be in the octal range 0 7777777777 Remarks Note 1 Single precision or double precision floating point expressions will be truncated before the c...

Page 186: ...M statement When the timer reaches zero program execution branches to the defined interrupt subroutine The ALARM interrupts are one shot interrupts Once program execution has branched to the specified...

Page 187: ...re the interrupt takes place Valid range is 1 255 ON COM interrupts can be used in 5 different ways 1 ON COM port GOSUB xxxx 2 ON COM port GOSUB xxxx CODE xx 3 ON COM port GOSUB xxxx BYTE yy 4 ON COM...

Page 188: ...cessing routine label is a BASIC program label It references a line number somewhere in the BASIC program When an error occurs the error code is assigned to the system variable ERR and the line number...

Page 189: ...pression is 1 then first branch will be taken if 2 then the second branch will be taken and so on The valid range of the expression is 1 255 If the value of the expression is out of this valid range t...

Page 190: ...nterrupt will be on standby when the PC READ PC WRITE including commands are executing for an ON KEY GOSUB statement The port connecting the keyboard must first be opened using an OPEN statement Press...

Page 191: ...C interrupt by either of the following methods 1 Allocated I O PC Interrupt Flag Interrupts The PC interrupt number can be set in the PC s CPU Unit by turning ON the corresponding bit in IR n 2 bits 0...

Page 192: ...he TIME OFF statement The TIME STOP statement masks and enables the time interrupts so the interrupts are recorded but the ISRs are not executed until the next TIME ON statement unmasks the interrupts...

Page 193: ...ment masks and enables the timer interrupts so the interrupts are recorded but the ISRs are not executed until the next TIMER ON statement unmasks the interrupts The ISR should be terminated by a RETU...

Page 194: ...mat device describes the type of the device that is connected to the port The following table shows the input and output buffer usage and transfer control signal RS and ER status for each type of the...

Page 195: ...turns ON DS DS_OFF The ASCII Unit will not check DSR signal when the port is opened XN XN_ON Specifies that Xon Xoff flow control will be used for both the ASCII Unit s input buffer and the periphera...

Page 196: ...S DS and XN signals are not relevant for port 2 of the C200H ASC21 option base Syntax OPTION BASE 0 1 Description Statement Declares the default subscript for the first array element Remarks The OPTIO...

Page 197: ...LENGTH 30 PRINT A RUN THIS STRING IS LONGER THAN THE S See also DIM pc on off stop Syntax PC pc interrupt number ON OFF STOP Description Statement Enables disables or stops interrupts from the PC Rem...

Page 198: ...a variable This result indicates the success or otherwise of the PC EGET command If the result is 0 then the command was successfully carried out and the data read is valid If the result is 1 then the...

Page 199: ...lt indicates the success or otherwise of the PC EPUT command If the result is 0 then the command was successfully carried out and the data is written successfully If the result is 1 then the PC EPUT c...

Page 200: ...PC GET statement For a detailed description of how to use the PC GET statement refer to 6 3 Details of the Data Exchange Methods Examples See also PC EGET PC PUT pc put Syntax PC PUT numerical express...

Page 201: ...ries PCs for details C200HE HG HX Designation method Area PC Address Code First word address DM Area DM 0000 to DM 6655 D 0000 to 6655 IR SR Area 000 to 511 R 0000 to 0511 LR Area LR 00 to LR 63 L 000...

Page 202: ...d not be carried out because another data transfer was active The PC QREAD statement should be used in conjunction with the CPU Unit s IOWR FD00 instruction By executing the PC QREAD statement the ASC...

Page 203: ...ons for CS1 series PCs for details C200HE HG HX Designation method Area PC Address Code First word address DM Area DM 0000 to DM 6143 D 0000 to 6143 IR SR Area 000 to 511 R 0000 to 0511 LR Area LR 00...

Page 204: ...was active The PC QWRITE statement should be used in conjunction with the CPU Unit s IORD FD00 instruction By executing the PC QWRITE statement the ASCII Unit requests execution of the IORD instructio...

Page 205: ...0 11 4 digits 1 4 bits 0 15 I Format m I n Treats the m words as hexadecimal data and stores n digits of data from each word in the variable m the number of words n the number of digits read from eac...

Page 206: ...ariable can be associated with a single format If the m setting is omitted the default setting is 1 word The setting range for m is 1 to 255 For numerals it is 1 to 255 for characters it is 1 to 64 St...

Page 207: ...number of elements does not match the PC format setting 4 Before using a character string variable for the variable setting be sure to read Appendix A Operating Precautions and Appendix C PC Format th...

Page 208: ...C200H 000 to 255 0000 to 0255 C200HS 000 to 299 0000 to 0299 IR SR Area C200HE HG HX 000 to 511 R 0000 to 0511 LR Area LR 00 to LR 63 L 0000 to 0063 HR Area HR 00 to HR 99 H 0000 to 0099 AR Area C200...

Page 209: ...result This result indicates whether the PC READ statement was successful or not If the result is 0 then the command was successfully carried out and the data is written successfully If the result is...

Page 210: ...m I n Takes the first n digits of data from each of the m variables converts the data to hexadecimal and stores it in the first n digits of the each of the m data area words m number of words n numbe...

Page 211: ...me Except for the A and S formats and where a character variable is used as the variable there must be a one to one correspondence between each word and variable With the A format one format must be u...

Page 212: ...cation specified in IR n 3 and IR n 4 The data is transferred at the next I O refreshing cycle after the PC WRITE request from the CPU Unit the ASCII Unit will pause execution of the BASIC program unt...

Page 213: ...0000 to 6143 C200H 000 to 255 0000 to 0255 C200HS 000 to 299 0000 to 0299 IR SR Area C200HE HG HX 000 to 511 R 0000 to 0511 LR Area LR 00 to LR 63 L 0000 to 0063 HR Area HR 00 to HR 99 H 0000 to 0099...

Page 214: ...a result This result indicates whether the PC WRITE statement was successful or not If the result is 0 then the command was successfully carried out and the data is written successfully If the result...

Page 215: ...as program execution Examples 10 A PEEK H30000 20 PRINT A RUN 32 See also POKE pgen Syntax PGEN program expression Description Command Selects which of the four BASIC program areas is the current are...

Page 216: ...OF BYTES USED P2 NAME R W NUMBER OF BYTES USED P3 NAME R W NUMBER OF BYTES USED P4 NAME R W NUMBER OF BYTES USED LIB NUMBER OF BYTES USED I_CODE NUMBER OF BYTES USED AVAILABLE FREE SPACE P1 through P4...

Page 217: ...NF PNAME pname Syntax PNAME string expression Description Command Assigns a name to the current BASIC program area Remarks string expression is any valid BASIC string with a maximum length of 8 charac...

Page 218: ...ut one immediately after the other on the output If they are separated by commas they are output with a tab character separating them on the output stream If the terminating comma or semicolon is omit...

Page 219: ...ill displayed with more significant digits If the number of digits of data is greater than the number indicated by the symbols the number will displayed after a symbol Note 1 The port must be opened f...

Page 220: ...will occur If the password is correct then the command will be executed as normal Even if a password is set using the PWORD statement the program will not be protected from the NEW command Examples 1...

Page 221: ...the constants in the DATA statements are read in the order that they appear in the program When the RESTORE statement is executed data will be read again starting from the first DATA statement If all...

Page 222: ...tement would cause an invalid program number then it is not executed An ILLEGAL FUNCTION CALL error code B005 will result Examples 1 REM FIRST LINE 2 REM SECOND LINE 3 GOTO 3 RENUM 100 1 LIST 100 REM...

Page 223: ...0 PRINT ERROR HAS OCCURRED 90 B 5 100 RESUME 1 6 166667 2 5 4 3 4 75 4 3 1 33333 5 2 2 5 6 1 6 ERROR HAS OCCURRED 7 5 1 4 8 4 2 9 3 3 10 2 5 See also ERROR ON ERROR right Syntax RIGHT string expressio...

Page 224: ...nction Examples 10 RANDOM 654 20 PRINT RND RUN 234831 PRINT RND 969226 RUN 234831 See also RANDOM romload Syntax ROMLOAD Description Command Restores BASIC programs from FlashROM to program areas in R...

Page 225: ...BE SAVED ROMSAVE 10 REM THIS WILL BE OVERWRITTEN LIST 10 REM THIS WILL BE OVERWRITTEN ROMLOAD LIST 10 REM THIS PROGRAM WILL BE SAVED See also ROMLOAD ROMVERIFY romverify Syntax ROMVERIFY Description...

Page 226: ...ied in a program an UNDEFINED LINE NUMBER error will occur The RUN command clears all variables and closes all open ports before beginning execution of the program Program execution can be aborted by...

Page 227: ..._OFF DS_OFF XN_ON See also LOAD search Syntax SEARCH integer array numerical expression 1 numerical expression 2 numerical expression 3 Description Function Searches an specified array variable one di...

Page 228: ...ical expression numerical expression may be any integer single precision floating point or double precision floating point The return type is single precision floating point if the argument is of type...

Page 229: ...ical expression is greater than 255 then an ILLEGAL FUNCTION CALL error code B005 will result Examples 10 PRINT HELLO WORLD 20 PRINT HELLO SPC 5 WORLD RUN HELLOWORLD HELLO WORLD See also TAB sqr Synta...

Page 230: ...is no information about the last executed line for instance after an END LOAD or EDIT command then STEP will execute the first line of the program Examples 10 PRINT STARTED 20 STOP 30 PRINT CONTINUING...

Page 231: ...ion 2 string expression Description Function Outputs a specified number of a certain character Remarks numerical expression 1 is the number of the specified character that should be in the output stri...

Page 232: ...pression Description Function Calculates the tangent of a numerical expression numerical expression may be any integer single precision floating point or double precision floating point The return typ...

Page 233: ...ples 10 ON TIME 08 00 00 GOTO 100 20 TIME ON 30 GOTO 30 100 PRINT WAKE UP 110 RETURN See also ON TIME timer on off stop Syntax TIMER ON OFF STOP Description Statement Enables disables or stops the tim...

Page 234: ...s of the trace buffer will be cleared when the NEW or TROFF command is executed Examples TRON M 10 FOR A 1 TO 5 20 PRINT A 30 NEXT A RUN 1 2 3 4 5 TRACE 10 20 30 10 20 30 10 20 30 10 20 30 10 20 30 10...

Page 235: ...0 TRON 20 FOR A 1 TO 5 30 NEXT A 40 TROFF 50 FOR A 1 TO 5 60 NEXT A RUN 20 30 20 30 20 30 20 30 20 30 20 40 See also TRACE TROFF val Syntax VAL string expression Description Function Converts a charac...

Page 236: ...has already had a value assigned to it The address of the value field in the identifier table is returned If the variable is an array variable the memory address where the leftmost bit of the memory...

Page 237: ...LEGAL FUNCTION CALL error code B005 will occur The WAIT statement monitors the statement that immediately follows it If it finishes execution within the specified time then program execution will cont...

Page 238: ...variable is specified as the variable name a NO SUPPORT error code 0064 will occur To monitor array variables use PRINT array variables WATCH SET is used to add variables to the watch list WATCH DEL...

Page 239: ...ecution jumps back to the WHILE statement containing the condition If the condition is never true then the statements in the WHILE WEND loop will never be executed Unlike FOR NEXT loops that have a sp...

Page 240: ...xecute the program using the BASIC function name User defined BASIC Function Definition DEF FN Syntax DEF FN function_name variable_name variable_name expression Meaning DEF FN declares a user defined...

Page 241: ...ommand the program will stop at that point Once it has stopped a message indicating a break in execution and the current line number will be displayed at the termi nal The ASCII Unit will switch to Co...

Page 242: ...is input then whenever the BASIC program breaks due to a STOP command a STEP com mand a breakpoint or a program error the display will indicate that a break has occurred and the current line number an...

Page 243: ...ollow After RUN the executed lines are displayed at the terminal enclosed in brackets If the option M is used the trace is output to the trace buffer A maximum of 255 lines can be traced Example TRON...

Page 244: ...rograms This section provides examples of data exchange applications 8 1 Asynchronous Processing 236 8 2 High speed Data Exchanges 237 8 3 High volume Data Exchanges 239 8 4 Data Transfer ASCII Unit t...

Page 245: ...transferred between ASCII Units The CPU Unit acts as an intermediary ASCII Unit CPU Unit Refreshes at high speed the measurement data from the controller to the ASCII Unit s shared memory using the P...

Page 246: ...memory of ASCII Unit No 2 from DM 0000 to DM 0009 Unit No 1 10 words Equals Flag Unit No 2 10 words IORD 00 1010 DM0000 IOWR 00 DM0000 2010 DM0000 DM0000 ASCII Unit CPU Unit 1 Sends an IORD Request F...

Page 247: ...truction then sends an interrupt to the ASCII Unit via the IOWR CC00 instruction Receives the interrupt reads the data written to the shared memory via the PC EGET command in the interrupt subroutine...

Page 248: ...monitoring data CPU Unit ASCII Unit Sends a Write Bit to the ASCII Unit via allocated IR CIO words Reads the CPU Unit memory via the PC READ command to a maximum of 255 words During the I O refresh pe...

Page 249: ...ler sends an ON signal to the CPU Unit once a certain temperature is reached ASCII Unit CPU Unit Response data is stored in the variable arrays The ASCII Unit uploads as required using the PC WRITE co...

Page 250: ...dure for Dealing with Damage to the Program Memory 251 9 3 CPU Unit Error Indicators 252 9 3 1 Special I O Unit Error List 252 9 3 2 Useful Flags and Control Bits 253 9 4 Reading and Clearing the Erro...

Page 251: ...le Terminal Display Note If the execution of a BASIC program is stopped when the terminal port is con figured as a non terminal device the ASCII Unit will wait for a message to be displayed In this ca...

Page 252: ...F or other command and review the program or free some mem ory B008 UNDEFINED LINE NUMBER Input line number is incorrect Check the destination line number B009 BAD SUBSCRIPT ERROR The array variable s...

Page 253: ...is not operating properly Turn OFF the power and then turn ON again If the error persists replace the Unit 0031 FATAL ERROR ADDRESS ERROR 0032 FATAL ERROR PRIVILEGE VIOLATION 0033 FATAL ERROR UNINTIAL...

Page 254: ...itions for port 1 and 2 have not been exceeded 056 DIRECT STATEMENT When the LOAD command was executed a line with no line number was discovered in the program being transferred to the ASCII Unit Chec...

Page 255: ...ith the flash ROM or nothing has been written to the flash ROM Try again or replace the Unit 0066 VERIFY ERROR Error generated when comparing and verifying flash ROM If there is no problem with the pr...

Page 256: ...99 0086 No message The PC interrupt number is an illegal BCD value Use a valid BCD value 0087 Not used 0088 Not used 0089 Not used Error code Error message Probable cause Corrective measures 0090 No m...

Page 257: ...nsure that the unit numbers do not occur more than once The unit number can be viewed using Read I O Table The refresh between the CPU Unit and the ASCII Unit has not occurred properly Special Unit er...

Page 258: ...hing and PROGRAM MEMORY ERROR appears on the initial screen and pressing Ctrl X Keys is ineffective The BASIC program memory is destroyed Change the DM setting so that the flash ROM is not read automa...

Page 259: ...ory Check the power supply or restart the Unit Correct the DM set tings and restart the Unit If the RUN indicator and all the ERR indi cators are still ON replace the Unit BASIC error System error Com...

Page 260: ...remove the ASCII Unit from the Backplane 5 Set the user memory default switch on the back panel of the ASCII Unit to the left OFF and attach the ASCII Unit to the Backplane 6 Turn the power to the PC...

Page 261: ...e duplications The unit numbers can be listed with the I O Table Read operation Special I O Unit error Refreshing between the CPU Unit and Special I O Unit did not proceed normally In this case only t...

Page 262: ...occurred in Unit 5 AR 0006 SR 28206 A41806 A41106 ON when an error occurred in Unit 6 AR 0007 SR 28207 A41807 A41107 ON when an error occurred in Unit 7 AR 0008 SR 28208 A41808 A41108 ON when an erro...

Page 263: ...ts Unit 9 SR 28110 A50210 Restarts Unit A 10 SR 28111 A50211 Restarts Unit B 11 SR 28112 A50212 Restarts Unit C 12 SR 28113 A50213 Restarts Unit D 13 SR 28114 A50214 Restarts Unit E 14 SR 28115 A50215...

Page 264: ...s By executing the ERC command while in Command Mode the error status at that point will be deleted and the error types and codes in the Error Log Table will also be cleared Clearing Errors from the A...

Page 265: ...teries Name Battery Set Model C200H BAT 09 Battery Life and Replacement Time The effective period maximum life of a battery is five years at an ambient temperature of 25 C whether or not the ASCII Uni...

Page 266: ...mands and operations will not run smoothly e g if an interrupt is generated while the PRINT command is executing and the interrupt subroutine contains the PRINT INPUT LINE INPUT command for the same p...

Page 267: ...are written and only these four char acters are read to the variable For the C200H ASC11 ASC21 ASC31 all of the characters stored in the vari able are written and word data up to 255 characters can b...

Page 268: ...are func tions may result in some ASCII Unit functions being unavailable For example the Cursor Keys on the Hyper terminal for the Japanese version of WINDOWS 95 cannot be used EDIT Command Restrictio...

Page 269: ...expressions is described below Check that the equations are the same as those for the exter nal devices CRC CCITT Using XMODEM All 8 bit data is placed in series it is then divided by a specific 17 b...

Page 270: ...the program memory may contain garbage This may cause delays in starting program execution after turn ON the power supply If this occurs save the program at a terminal load the program from the termi...

Page 271: ...Special Unit error on the PC side will occur and CPU Unit operation will be held The PC can be restarted by using the default switch on the back panel of the ASCII Unit In this situation the program m...

Page 272: ...lit BASIC indicator flashes slowly Limiting the output code when executing the PRINT command depending on the device code specifications for the OPEN command Depending on the code some codes are not...

Page 273: ...rs while a command is being executed it will not branch into the interrupt subroutine Branching will only occur after the command has been executed When a BASIC interrupt occurs while a command is bei...

Page 274: ...ere the variable is a character variable there must be one variable cor responding to each word In the A format one variable corresponds to one format In the S format one array variable corresponds to...

Page 275: ...ightmost 1 to 3 digits of each word bits 00 to 11 is stored in 2 variables B bit format mBn When variables are numerals m 1 to 255 n 0 to 15 When variables are characters m 1 to 255 see note 1 n 1 to...

Page 276: ...ost 1 to 3 digits of each word for 2 words H hexadecimal format mHn When variables are numerals m 1 to 255 n 1 to 4 When variables are characters m 1 to 64 n 1 to 4 Data from the rightmost 1 to n digi...

Page 277: ...t byte leftmost byte is 00 hex n 2 Leftmost byte rightmost byte is 00 hex n 3 Leftmost and rightmost bytes 2A3 The first 4 characters in 1 character variable is converted to ASCII data and stored to t...

Page 278: ...4 n n 1 PC word data Integer variables PC READ O1 J J 4 4 PC READ O2 J J 34 28 PC READ O3 J J 234 156 PC READ O4 J J 1234 668 Character variables PC READ O1 A A 4 PC READ O2 A A 34 PC READ O3 A A 234...

Page 279: ...mat 5 1 5 2 PC word data Character variables PC READ 2A1 A A RT PC READ 2A2 A A QS PC READ 2A3 A A QRST 5 3 5 4 Q H51 R H52 S H53 T H54 0 1 2 3 PC word data Integer variables In I type format PC READ...

Page 280: ...0 0 4 PC word data Integer variables J 1234 PC WRITE I1 J PC WRITE I2 J PC WRITE I3 J PC WRITE I4 J 0 0 3 4 0 2 3 4 1 2 3 4 0 0 0 1 Character variables A 1234 PC WRITE I1 A PC WRITE I2 A PC WRITE I3 A...

Page 281: ...ger variables J 30293 H89AB PC WRITE H1 J PC WRITE H2 J PC WRITE H3 J PC WRITE H4 J 0 0 A B 0 9 A B 8 9 A B 0 0 0 8 Character variables A 89AB PC WRITE H1 A PC WRITE H2 A PC WRITE H3 A PC WRITE H4 A 0...

Page 282: ...turn OFF all the PC bits Example 32749 H8013 1000 0000 0001 0011 B0 B1 B4 B15 ON B2 B3 B5 to B14 OFF 0 0 0 4 PC word data Integer variables J 668 1234 PC WRITE O1 J PC WRITE O2 J PC WRITE O3 J PC WRIT...

Page 283: ...format to read or write character data Example PC READ D 0 2 10 10H4 A 3 Only one character string variable can be used in the variable list so multiple strings are not possible 4 If using mA1 mA2 whe...

Page 284: ...MSB 15 0 S D 1 bit 31 bits S Sign 0 positive 1 negative D Numeric value LSB Address 15 0 S 31 0 S E 1 bit 8 bits S Sign 0 positive 1 negative E Exponent offset 127 M Mantissa LSB E M M M 23 bits 15 0...

Page 285: ...0 A 1 A 2 A n 0 n For one dimensional arrays As an element of the array each variable is stored in memory in order B 0 1 B 0 2 B x y B 0 0 0 n For two dimensional arrays For multi dimensional arrays...

Page 286: ...es Relationship between Variable Type and VARPTR Address Rightmost 8 bits Short integer variable Leftmost 8 bits Address Rightmost position of stored address Leftmost position of stored address String...

Page 287: ...ray variable A 0 address Character string array variable A 2 address Address Rightmost memory block address A 3 address A n address Longest Current length 1 character 2 characters 8 0 0 n Leftmost mem...

Page 288: ...TO 10000 NEXT I for one loop 0 14 FOR I 1 TO 10000 NEXT I for one loop 0 07 GOSUB TEST TEST RETURN 0 13 GOTO 0 03 IF A 0 THEN B 0 ELSE B 1 true and false 0 45 INPUT 2 A 200 characters Approx 20 0 LET...

Page 289: ...A B C D E See note 1 4 2 PC WRITE 10I4 A B C D E F G H I J See note 1 7 7 PC WRITE 63H4 A See note 1 20 7 PC READ D 0 1 I4 A See note 1 5 8 PC READ D 0 5 5I4 A B C D E See note 1 5 9 PC READ D 0 10 10...

Page 290: ...parity 1 0 C FIX 1 1 0 26 D HEX 1 0 5 INPUT 100 2 3 0 C INT 1 1 0 25 D LEFT ASCII 2 0 51 A LEN ASCII 0 17 A LOC 2 0 22 A LOG 5 1 0 D MID ASCII 1 1 0 62 D OCT 051 0 54 D RIGHT ASCII 2 0 5 A SIN 0 5 0...

Page 291: ...fourth digit 16 bit of data are stored read in the 5 variables A B C D E 3 Transferring ASCII Unit Data from the ASCII Unit to the PC Ladder Program Basic Program 100 PC WRITE 3I4 A B C The 3 variable...

Page 292: ...a that were transferred using the IOWR FD00 command are converted to BCD and stored in the 5 variables A B C D E as 4 digit 16 bit data 6 Transferring Data Asynchronously from ASCII Unit to PC C200HX...

Page 293: ...g data to ASCII Unit 2 words of data beginning with DM 0000 are transferred to the leading address 00 of the IOWR Area in the shared memory of the ASCII Unit of Unit No 0 PC interrupt No Interrupt No...

Page 294: ...equired in each step 1 2 3 1 Cut the cable to the required length 2 Peel the sheath using a razor blade without damaging the shield weaving 3 Remove the shield using scissors 4 Peel the core wire of e...

Page 295: ...ch wire and to its connector pin 3 Solder each wire firmly in place 4 Move the heat shrinking tube to the soldered section and shrink the tube by heating it Assembling Hood Assemble the connector hood...

Page 296: ...NT SET CHR SEARCH DATA MAP STEP CINT SGN DEF NEW STOP CLNG SIN DEFDBL NEXT SUB COS SPACE DEFINT OFF SYSBACK CSNG SPC DEFLNG ON SYSLOAD CTS SQR DEFSNG OPEN SYSMOVE DATE SSTACK DEFSTR OPTION THEN DAY ST...

Page 297: ...0H ASC02 comparison of functions and operation 263 cable wiring 287 cables processing 287 soldering 288 character constant definition 123 character expressions 127 character strings processing 62 char...

Page 298: ...tion 255 communications errors 59 DM setting errors 247 execution errors 246 operational errors 244 PC Interface errors 247 execution errors 246 execution times for BASIC commands 279 expressions defi...

Page 299: ...265 PC Interface errors 247 Peripheral Device general connections 26 specifying with device symbol 46 Peripheral Devices ASCII communications with 2 personal computer use as a terminal 26 Port 1 baud...

Page 300: ...ol signals 53 TRACE command 234 trace function TRON and TRACE 234 transmission control signals controlling 46 timing charts 53 when receiving data 51 when sending data 48 TRON command 234 troubleshoot...

Page 301: ...on 6 6 1 Using the Sync Time Set Bit added Page 114 Description on stopping an open program added to the end of Con necting the Terminal Page 115 Description on T R indicator added to the end of step...

Reviews: