Delta Electronics — 6.3.2 Explanation of Data Conversion Instructions

AS Series Programming Manual Additional remarks 1. If the value in S is not the binary-coded decimal value, an operation error occurs, SM0 is ON, and the error code in SR0 is 16#200D. The binary-coded decimal value is represented by the hexadecimal value, but one of digits is not between 0–9. 2. Application of the BCD and BIN instructions:  Before the value of the binary-coded decimal type of DIP switch is read into the PLC, use the BIN instruction to convert the data into the binary value and store the conversion result in the PLC.

 If you want to display the data stored inside the PLC in a seven-segment display of the binary-coded decimal type, use the BCD instruction to convert the data into the binary-coded decimal value before the data is sent to the seven-segment display.  When X1.0 is ON, the BIN instruction converts the binary-coded decimal value in X0.0–X0.15 into the binary value, and stores the conversion result in D100. Subsequently, the BCD instruction converts the binary value in D100 into the binary-coded decimal value, and stores the conversion result in Y0.0–Y0.15.

_6 10 3 10 2 10 1 10 0 Four-digit binary-coded decimal type of DIP switch Four-digit binary-coded decimal type 6-82 6 6 8 1 8 6 6 4 2 1 8 1 8 X0.15 X0.0 Four-digit binary-coded decimal value The instruction B IN is used to store the binary value in D100. The instruction B CD is used to convert the value in D100 into the four-digit binary-coded decimal value. Y0.15 Y0.0 Four-dig of seven