fledge-power / fledge-south-iec104

A south plugin to gather data using the IEC 104 protocol.
Apache License 2.0
1 stars 3 forks source link

Implement M_ST_NA and M_ST_TB types #68

Open YmaIneo opened 1 year ago

YmaIneo commented 1 year ago

Is your feature request related to a problem? Please describe. M_ST_NA and M_ST_TB types are not supported by the south service (and the bit OV).

Value for those TS is not generated by the south plugin in the format expected by the IEC104 pivot: "[0,false]", meaning the value is lost during pivot conversion.

Fledge iec104south_s1[917]: DEBUG: iec104 - IEC104Client::handleASDU - Received ASDU with CA: 37873, interrogation response: false 
Fledge iec104south_s1[917]: INFO: iec104 - IEC104Client::handleASDU - Created data object for ASDU of type M_ST_NA_1 (5) with CA: 2123291536 IOA: 37873
Fledge iec104south_s1[917]: DEBUG: iec104_pivot_filter - IEC104PivotFilter::ingest - original Reading: ({"asset_code":"MAROL_0_S.AUX_FCT.DIE1_TS","user_ts":"2023-10-27 09:40:29.358458+00:00","ts":"2023-10-27 09:40:29.358458+00:00","reading":{"data_object":{"do_type":"M_ST_NA_1", "do_ca":37873, "do_oa":0, "do_cot":3, "do_test":0, "do_negative":0, "do_ioa":20707, "do_value":1, "do_quality_iv":0, "do_quality_bl":0, "do_quality_ov":0, "do_quality_sb":0, "do_quality_nt":0}}})
Fledge iec104south_s1[917]: DEBUG: iec104_pivot_filter - IEC104PivotFilter::ingest - converted Reading: ({"asset_code":"MAROL_0_S.AUX_FCT.DIE1_TS","user_ts":"2023-10-27 09:40:29.358458+00:00","ts":"2023-10-27 09:40:29.358458+00:00","reading":{"PIVOT":{"GTIM":{"ComingFrom":"iec104", "BscTyp":{"q":{"Source":"process", "Validity":"good"}, "t":{"SecondSinceEpoch":1698399629, "FractionOfSecond":6694109, "TimeQuality":{"clockFailure":0, "leapSecondKnown":1, "timeAccuracy":10}}}, "Identifier":"S_2367_0_2_47", "Cause":{"stVal":3}, "TmOrg":{"stVal":"substituted"}}}}})

Describe the solution you'd like The south service must manage M_ST_NA and M_ST_TB types.

FlorentP42 commented 1 year ago

Type support seems to be present since https://github.com/fledge-power/fledge-south-iec104/commit/b71a360ff422599e07a0834307b564229622a4e2, tested and working with latest develop version.

YmaIneo commented 1 year ago

The OV bit is not supported for these types

FlorentP42 commented 1 year ago

New test with latest develop version: