資料介紹:
STX 02H 報文開始
ETX 03H 報文結束
幀格式
STX CMD DATA ...... DATA ETX SUM(upper) SUM(lower)
例子
STX ,CMD ,ADDRESS, BYTES, ETX, SUM
02H, 30H, 31H,30H,46H,36H, 30H,34H, 03H, 37H,34H
SUM=CMD+......+ETX
30h+31h+30h+46h+36h+30h+34h+03h=74h;
累加和過兩位取低兩位
1 DEVICE READ 讀出軟設備狀態值
計算機向PLC 發送
始 命令 首地址 位數 終 和校驗
STX CMD GROUP ADDRESS BYTES ETX SUM
例子從D123 開始讀取4 個字節數據
02h 30h 31h,30h,46h,36h 30h,34h 03h 37h,34h