10: D ATA C ONVERSION INSTRUCTIONS10-12FC6A SERIES MICROS MART LADDER PROGRAMMING M ANUAL FC9Y-B1726ATOB (ASCII to BCD)Valid DevicesFor valid device address ranges, see "Device Addresses" on page 2-1.Special internal relays cannot be designated as D1.When T (timer) or C (counter) is used as S2, the timer/counter current value (TC or CC) is displayed. When T (timer) or C (counter) is used as D1,the data is written in as a preset value (TP or CP).Valid values for source S1 data to convert are 30h through 39h. When the data type is W (word), the valid range of S2 (quantity of digits to convert)is 1 to 5.When the data type is D (double word), the valid range of S2 (quantity of digits to convert) is 1 to 10.Make sure that the values for each source designated by S1 and the quantity of digits designated by S2 are within the valid range. If the S1 or S2data exceeds the valid range, a user program execution error will result, turning on special internal relay M8004 and the ERR LED on the FC6A SeriesMICROSmart.Make sure that the last source data determined by S1+S2-1 is within the valid device range. If the derived source device exceeds the valid devicerange, a user program execution error will result, turning on special internal relay M8004 and ERROR LED on the FC6A Series MICROSmart.When a user program execution error occurs, the execution of the instruction is canceled. The value of D1 is left unchanged and the next instructionis executed. For user program execution errors, see "User Program Execution Errors" on page 3-10.Since the ATOB instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.Valid Data TypesWord data: S1, S1+1, S1+2, S1+3, S1+4 → D1Double-word data: S1, S1+1, S1+2, ... , S1+9 → D1·D1+1When input is on, the ASCII data assigned by S1 as many times as the quantity ofdigits assigned by S2 is converted into BCD, and converted into 16- or 32-bit binarydata. The result is stored to the destination assigned by device D1.Valid values for source data to convert are 30h through 39h.The number of digits that can be converted is through 5 for word data, and 1 through10 for double-word data.ATOB(*) S1*****S2*****D1*****Device Function I Q M R T C D P Constant RepeatS1 (Source 1) ASCII data to convert — — — — — — X — — —S2 (Source 2) Quantity of digits to convert X X X X X X X — 1-5, 1-10 —D1 (Destination 1) Destination to store conversion results — X X X X X — — —W (word) X When a bit device such as I (input), Q (output), M (internal relay), or R (shift register) is assigned as the sourceor destination, 16 points (word data) or 32 points (double-word data) are used.When a word device such as T (timer), C (counter), or D (data register) is assigned as the source or destination,1 point (word data) or 2 points (double-word data) are used.I (integer) —D (double word) XL (long) —F (float) —