Integration
The integration of a terminal driver is shown here as an example using the manual terminal driver:
- Create a local instance of the terminal driver, e.g. in a global variable list or as a variable in USER_PRG. If necessary, replace "SEW_MK_PES_PowerMode" with the software module used in the following code example.
fbExtConsumManual:SEW_MK_PES_PowerMode.SEW_PwrMon.ACTermDriverManual_3Phase;- For example, in the USER_PRG.Init action, add the call to link the driver to the corresponding software module. In this example, "MDP92A" is the name of the software module.
MDP92A.LinkExtConsumerPM(
itfQueryInterfaceSEW:=fbExtConsumManual
);- For example, in the USER_PRG.Init action, add the following call to initialize the terminal driver (NOTE: In the init method of the terminal drivers, different transfer variables are queried depending on the terminal. For manual terminal drivers, this is for example, the information about which channels are to be measured. In the following code example, the manual driver provides all measured variables except the frequency, for example. Other terminal drivers may require other information (e.g. transformer ratios of current transformers used).
fbExtConsumManual.Init(
xActivePowerValid:=TRUE,
xApparentPowerValid:=TRUE,
xReactivePowerValid:=TRUE,
xFrequencyValid:=FALSE,
xVoltageValid:=TRUE);
- The terminal driver is completely linked and initialized and is automatically queried by the PowerMonitor in the software module.