konstantin - 2023-02-13

Hi,

I use a WAGO PFC200 controller with MODBUS RTU on the integrated port. There are 8 damper valves for ventilation and 6 energymeters that are connected to the fieldbus.

Since I have to do a lot of mapping of the raw I created some function blocks but I cannot figure out how to do a specific addressing for an identifier.

There is Modbus objects - one of them in my case is "Energymeter_1" and the datatype is "typEnergymeter_1_rtu".

Therefore when I want to access a variable from "Energymeres_1" structure I write the following - "Modbus.Energymeter_1.L1_voltage".

Since I have 6 energymeters is it possible to create a variable that is an input for the function block and use the variable to change the energymeter I reference in each instance of the function. The variable should be written instead of the bold text on the above line.

"Modbus.var_for_energymeters_number.L1_voltage - it should look like similar to this.

Basically var_for_energymeters_number should be an inputs for the function block and should be changed every time I call and instance of the function block in the program.

I do not know if this addressing is possible, I have tried to play with pointers and string but with no success.

Best Regards
Konstantin Kolev

 

Last edit: konstantin 2023-02-13