I’m working on a project where I need to read running hours (driftstimer) from a heat pump system using a WAGO PFC (Codesys 3.5). The BACnet object on the device is of type Positive Integer Value (Object Type ID: 131).
I have tride with FbRemoteProperty_Unsigned and FbRemoteProperty_Any.
VAR
RemoteIK001_K1_RT : FbRemoteObject(10954, WagoTypesBACnet.eBACnetObjectType.BACnet_integer_value, 131); // Lest ut av varmepumpe OBJECT_POSITIVE_INTEGER_VALUE:131 Driftstimer komp 1
IK001_K1_RT : FbRemoteProperty_Unsigned(RemoteIK001_K1_RT, WagoTypesBACnet.eBACnetPropertyIdentifier.PROP_PRESENT_VALUE);
RemoteIK001_K2_RT : FbRemoteObject(10954, WagoTypesBACnet.eBACnetObjectType.BACnet_integer_value, 132); // Lest ut av varmepumpe OBJECT_POSITIVE_INTEGER_VALUE:132 Driftstimer komp 2
IK001_K2_RT : FbRemoteProperty_Any(RemoteIK001_K2_RT, WagoTypesBACnet.eBACnetPropertyIdentifier.PROP_PRESENT_VALUE);
END_VAR
// Når 30 sekunder er passert, aktiver én-puls trigger
IF tmrRead.Q THEN
xTrigger := TRUE;
tmrRead(IN := FALSE); // restart timer
END_IF
// Les verdier ved puls
IF xTrigger THEN
IK001_K1_RT.read(xTrigger); // Lest ut av varmepumpe
IK001_K2_RT.read(xTrigger); // Lest ut av varmepumpe
xTrigger := FALSE;
END_IF
BY2213C_320_001_IK001_K1_RT.rPresentValue := IK001_K1_RT.udiValue;
BY2213C_320_001_IK001_K2_RT.rPresentValue := IK001_K2_RT.iValue.IREAL.rValue;
When I download to the PLC I get:
Notification from target:
"This data type is not allowed for this object type by this property
Object Type : BACnet_integer_value
Property-ID : PROP_PRE"
Anybody know how I can read out the present value on a Positive Integer Value ?
espenbo,
Looking at the documentation for the fbRemoteProperty_Unsigned, the allowed object types are the following:
WagoTypesBACnet.eBACnetObjectType.BACnet_multi_state_input
WagoTypesBACnet.eBACnetObjectType.BACnet_multi_state_output
WagoTypesBACnet.eBACnetObjectType.BACnet_multi_state_value
I believe this is why you are receiving the error.
I would recommend using either the multi_state_input or the multi_state_value object.
I tride to use …
But I still can’t get any information from the bacnet object
PROGRAM Prg_320_001
VAR
RemoteIK001_K1_RT : FbRemoteObject(10954, WagoTypesBACnet.eBACnetObjectType.BACnet_multi_state_value, 131); // Lest ut av varmepumpe OBJECT_POSITIVE_INTEGER_VALUE:131 Driftstimer komp 1
IK001_K1_RT : FbRemoteProperty_Unsigned(RemoteIK001_K1_RT, WagoTypesBACnet.eBACnetPropertyIdentifier.PROP_PRESENT_VALUE);
RemoteIK001_K2_RT : FbRemoteObject(10954, WagoTypesBACnet.eBACnetObjectType.BACnet_multi_state_value, 132); // Lest ut av varmepumpe OBJECT_POSITIVE_INTEGER_VALUE:132 Driftstimer komp 2
IK001_K2_RT : FbRemoteProperty_Any(RemoteIK001_K2_RT, WagoTypesBACnet.eBACnetPropertyIdentifier.PROP_PRESENT_VALUE);
END_VAR
I got this error when downloading to the PLC
Notification from target:
"This data type is not allowed for this object type by this property
Object Type : BACnet_multi_state_value
Property-ID : PROP"
I did find somthing on codesys website, but I don’t think that is the same bacnet library as wago uses
My Library
Title: |
WagoSysBACnet |
Version: |
2.0.1.12 |
I highly recommend using the BACnet Configurator software along with the Codesys Add-on Solution Builder, both of which are available on the WAGO Download Center.
Here is a short guide that may help you get going: How To: Add BACnet to a WAGO CODESYS project
I consider this a much easier method than directly utilizing WagoSysBacnet, and gives access to a wider range of BACnet object types, including IntegerValue.
Hi, we have tested both approaches – using the BACnet Configurator with Solution Builder, and configuring everything directly in CODESYS.
Our conclusion is that defining all BACnet variables directly in CODESYS gives us much better structure and control, especially in larger projects with 3000+ tags. Managing that many tags inside the BACnet Configurator quickly becomes messy and hard to maintain.
By generating BACnet tags automatic from the dokumentasjon from IO lists, KNX mappings, or VAV configurations, it becomes easier to maintain consistency and grouping. Tags that belong together are naturally kept together in the CODESYS structure. It also makes it simpler to assign descriptions, engineering units (like °C, bar, etc.), and other metadata directly in code.
Reading values from other BACnet devices is also much clearer when done in structured ST code, rather than through links in the configurator – especially during early commissioning, when not all devices are online yet. In CODESYS, we can prepare the logic ahead of time without depending on external devices being present. And when you are going back some years later you can easy see it inn the code that it’s sending or receiving values from the other bacnet device.
I could not find any “Positive Integer Value (PIV)” object type in the BACnet Configurator – only “Integer Value (IV)” is available, and I can’t connect a IV to a PIV with the bacnet configurator.
If PIV and IV are not interoperable, I think you’ve moved beyond what this forum can help you with. According to the PICS, Positive Integer Value is not a supported object type by WAGO devices. I suggest contacting your local country’s WAGO office to begin a discussion with them to see if such an addition may be possible in a future or custom revision.
1 Like