Skip to content

Commit

Permalink
example configuration and a log line
Browse files Browse the repository at this point in the history
  • Loading branch information
Ted Scharff committed Apr 9, 2020
1 parent 46e785f commit 9ea3e78
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nodes.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
{
"nodeName": "ns=1;s=[L2S2_TMCP]Lift_Station_Consume.Alarms[3]",
"metricName": "lift_station_alarm_3"
},
{
"nodeName": "ns=1;s=[L2S2_TMCP]Lift_Station_Consume.Status[1]",
"extractBit": 16,
"metricName": "lift_station_common_alarm"
}
]

2 changes: 2 additions & 0 deletions opcua_bitvector_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"encoding/binary"
"fmt"
"log"

"github.com/gopcua/opcua/ua"
"github.com/prometheus/client_golang/prometheus"
Expand All @@ -26,6 +27,7 @@ func (h OpcuaBitVectorHandler) Handle(v ua.Variant) error {
if err != nil {
return err
}
log.Printf("Extracted bit number %d: value=%d\n", h.extractBit, int(floatVal))
h.gauge.Set(floatVal)
return nil
}
Expand Down

0 comments on commit 9ea3e78

Please sign in to comment.