macro_command main()
unsigned short c,a,e
unsigned char b[5]
float d
GetData(a, "MODBUS RTU (zero-based addressing)", 3x, 2, 1)
//讀取寄存器數(shù)值如:34567(3是放大倍數(shù),4567為有效數(shù)值)
DEC2ASCII(a, b[0], 5)//將34567轉為ASCII碼
ASCII2FLOAT(b[1], d, 4)//將4567轉為浮點數(shù)
c=b[0]-48//將3的ASCII碼減去48得出數(shù)字(放大倍數(shù))
//ASCII2DEC(b[0], c, 1)
POW(10,c,e)//10的c次方賦于e
d=d/e
SetData(d, "Local HMI", LW, 0, 1)
end macro_command
謝謝大佬們的解答幫助,初步程序如上基本實現(xiàn)顯示問題