从条码枪扫到的字符串位S001~S099,在触摸屏上输入字符串S001~S099,然后两者进行比较,一样输出PLC的M120为ON否则位OFF,宏指令这样编对不对,谢谢
macro_command main()
unsigned char a[4],b[4]
bool ret1
bool t = true, f = false
StringGet(a[0], "Barcode/Keyboard (USB/COM)", BARCODE, 1, 4)
StringGet(b[0], "Local HMI", LB, 10, 4)
if ret1==StringCompare(a[0], b[0]) then
SetData(t, "Mitsubishi FX3u/FX3G", M, 120, 1)
else
SetData(f, "Mitsubishi FX3u/FX3G", M, 120, 1)
end if
end macro_command
编译时出错 C37,请指正。谢谢 |