Q: I want to write a communication program, but the other party only supports ASCII code. How to convert between ASCII and decimal? For example, the value of a word VW1000 is 12345. I want to convert this word to 31, 32, 33, 34, 35 from the starting address VB200.
A: Integers can be directly converted to ASCII code.
Network1// converts the integer value in VW2 to VB10
//The first 8 ASCII characters,
/ / Use the format of 16 # 0B
LDI2.3
ITAVW1000, VB197, 16#00
Note: Because it takes 8 bytes when converting, it is necessary to start conversion from 197. VW197-VW199 is 0VW200 and it is the result you want.
Small Gear Motor,Customized Dc Motor,Customized Dc Gear Motor,Dc Permanent Magnet Motor
NingBo BeiLun HengFeng Electromotor Manufacture Co.,Ltd. , https://www.hengfengmotor.com