Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- master_modbus(
- xOPEN_SOCKET:= xOpenSocket,
- strIP_ADDRESS:= '172.22.10.59',
- wPORT:= 502,
- bUNIT_ID:= ,
- bFUNCTION_CODE:= 23,
- wREAD_ADDRESS:= 12288,
- wREAD_QUANTITY:= 10,
- ptREAD_DATA:= ADR(readData),
- wWRITE_ADDRESS:= 12388,
- wWRITE_QUANTITY:= 10,
- ptSEND_DATA:= ADR(SendData),
- tTIME_OUT:= ,
- xSEND:= xStart,
- xIS_OPEN=> ,
- wERROR=> ,
- bRESPONSE_UNIT_ID=> );
- timer1(IN:= xOpenSocket, PT:= t#100ms, Q=> xStartSend, ET=> );
- CASE iKrok OF
- 0:
- SendData[1] := wai1;
- SendData[2] := 100;
- SendData[3] := 200;
- SendData[4] := 300;
- xOpenSocket := TRUE;
- IF master_modbus.xIS_OPEN THEN
- xStart := TRUE;
- iKrok := iKrok +1;
- ELSE
- iKrok := 0;
- END_IF;
- 1:
- readData[1];
- IF master_modbus.wERROR > 0 THEN
- xdo4 := TRUE;
- ELSE
- xdo4 := FALSE;
- iKrok := 0;
- END_IF;
- END_CASE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement