WAGO PFC200 Modbus RTU

Hi,

These days I decided to move the energymeters to a separate Modbus RTU module on the WAGO PFC 200. The module is 750-653/003-000.
This is the module: 750-653

My energymeters are: 1 is ELNET and 5 are NOARK

I have been struggling with getting the data in the WAGO, there is always 0 on all of data I read despite the fact that there is NO error in the function.

The library I use is WagoAppPlcModbus 1.1.3.4.

I also polled one of energymeter with CAS Scanner and it responded. Then I sniffed the poll and response on the WAGO and it is identical to the poll and response on the CAS Scanner. The only energymeter that responded on the CAS Scanner is the ELNET. Noark energymeter do NOT respond on the CAS Scanner.

You can find the code below, I used the example from the help file and modified according to my needs.

I used a separate bit for xConnect since in other forums they claim that if it is initialised as TRUE there are problems with the library for some versions.

Basically there is NO data in the utResponse, there is NO error on output of the function and the sniffing data is the same as the data in the CAS Scanner.

Code:
PROGRAM ModbusRS485
VAR
    mySerialMaster: FbMbMasterSerial;

    utQuery: typMbQuery := (bUnitId := 26, // Slaveaddress
					  bFunctionCode := 16#04, // read input registers
					  uiReadAddress := 0, // Startaddress
					  uiReadQuantity := 2, // Quantity of wanted registers
					  uiWriteAddress := 0, // not needed for FC4
					  uiWriteQuantity := 0, // not needed for FC4
					  awWriteData := [124(0)] // not needed for FC4
				         );

    xTxTrigger: BOOL; (* Set this variable once for start a job. This variable will be automaticly reset by the master if the job is done.*)

    utResponse : typMbResponse; // After the job is done you can find at this structure the result.

    tonDelay: TON := (PT := T#500MS); // This is the silence time between two requests
	xConnect: BOOL;
END_VAR

//--- delay between two requests ----------------------
tonDelay( IN := (NOT tonDelay.Q) AND (NOT xTxTrigger));
xTxTrigger := tonDelay.Q; // trigger the next request

//--- call cyclic the master --------------
mySerialMaster( xConnect := xConnect,
			I_Port := RS485_Interface_Adjust, // my serial port
		        udiBaudrate := 9600,
		        usiDataBits := 8,
		        eParity := eTTYParity.None,
		        eStopBits := eTTYStopBits.One,
		        eHandshake := eTTYHandshake.None,
		        ePhysical := eTTYPhysicalLayer.RS485_HalfDuplex,
		        eFrameType := eMbFrameType.RTU,
		        tTimeOut := T#1000MS,
                        utQuery := utQuery,
                        xTrigger := xTxTrigger,
                        utResponse := utResponse,
		        xIsConnected => ,
		        xError =>,
		        oStatus =>
                       );
//-----------------------------------------

Best Regards
Konstantin Kolev
 
Last edited:

Similar Topics

Is there any main difference between PFC200 and PFC100? Is that so then, please elaborate. Thank you
Replies
1
Views
1,845
Hi! I've bought WAGO PFC200 controller to automate my smart home installation. After that I've noticed, that I also need to buy e!****PIT or...
Replies
1
Views
2,871
Good day, I've been browsing this forum for 2 years now, but this will be my first post. I have device with USB serial output. I would like to...
Replies
8
Views
2,779
Hello, I am in possession of a WAGO PFC 200 750-8216 which I was successfully able to set up as a Modbus RTU Master to a slave device using...
Replies
0
Views
87
I have a project to setup base programs across multiple PLC platforms that can be used for Modbus communications to various sensors that have...
Replies
0
Views
123
Back
Top Bottom