var device, addr: integer; v1, v2, v3: variant; strTargetDataSource: string; begin strTargetDataSource := GetVariable('DATA_SOURCE'); device := GetVariable('DEVICE_ID'); // MODBUS device ID addr := GetVariable('OFFSET'); // MODBUS memory offset v1 := GetVariable('VALUE1'); // Int value v2 := GetVariable('VALUE2'); // Float value v3 := GetVariable('VALUE3'); // UInt16 value if VarToStr(v1) <> '' then SendEventEx('WRITE-INT', [ 'EVENT-TO-CFG', strTargetDataSource, 'DEVICE', device, 'ADDRESS', addr, 'VALUE', v1 ]); if VarToStr(v2) <> '' then SendEventEx('WRITE-FLOAT', [ 'EVENT-TO-CFG', strTargetDataSource, 'DEVICE', device, 'ADDRESS', addr, 'VALUE', v2 ]); if VarToStr(v3) <> '' then SendEventEx('WRITE-UINT16', [ 'EVENT-TO-CFG', strTargetDataSource, 'DEVICE', device, 'ADDRESS', addr, 'VALUE', v3 ]); end.