Join us today!

Notifications
Clear all

Strange behaviour between reading MODBUS register task and WIRESHARK period request

2 Posts
2 Users
0 Reactions
145 Views
Posts: 1
Topic starter
(@juandav)
New Member
Joined: 12 months ago

Hello,

I code a program to read 4 register through Modbus. Here is my code:

PROGRAM ModbusCommunication
VAR
		
  fbMBReadRegs : FB_MBReadRegs;
  st_ModbusRead : ST_ModbusRead;
  
END_VAR 




IF fbMBReadRegs.bBusy = FALSE AND fbMBReadRegs.bError = FALSE THEN
	fbMBReadRegs(
		sIPAddr:= '192.168.2.20', 
		nTCPPort:= 1504, 
		nUnitID:= 16#FF, 
		nQuantity:= 4, 
		nMBAddr:= 0, 
		cbLength:= SIZEOF(st_ModbusRead), 
		pDestAddr:= ADR(st_ModbusRead), 
		bExecute:= TRUE, 
		tTimeout:= , 
		bBusy=> , 
		bError=> , 
		nErrId=> , 
		cbRead=> );
	
ELSE
	fbMBReadRegs(bExecute := FALSE);
END_IF

I configure a task of this program in 100ms. But I note in wireshark that the period of request is around 200ms and not 100ms (MASTER:192.168.2.16 and SLAVE:192.168.2.20).

Could anyone could explain why the period is 200ms?

 

capturedd
Reply
1 Reply
1 Reply
(@joris)
Joined: 2 years ago

Eminent Member
Posts: 17

Hi @juandav,

I don't understand. your task is it cyclic at 100ms?

is it working once or more?

Reply
Share: