-------------------------------------------- CONPROSYS Script sample programs No. 004 -------------------------------------------- Process name: Digital Switch Input (4-bit) Date of creation: February 17, 2016 Processing content: Read four digital switch inputs, DI0 to DI3 into the tag as one digit decimal number. [Signals] DI0 to DI3: Digital inputs (4 bits / 1 digit) [Operation] 1. Read the digital inputs to a tag (1 digit) [Description] The sample program has a main task (TASK9) and a subroutine (SUB9). To use this sample program, restores this sample program to the M2M controller and names the task number and the subroutine number. If the subroutine is renamed to a number that is not SUB9, change the calling number to the new one. Read DI0 to DI9 states to TAG90 then call SUB9 subroutine. The subroutine separates the state of the targeted 4 input bits and returns the result to LTAG 99. Subroutine adjusts bit positions by division operation. Save the LTAG99 content to TAG90.