plc4x
plc4x copied to clipboard
[Feature Request][OPC-UA]: PublishRequest is required to reduce server pressure
What would you like to happen?
- it seems that
SubscriptionRequestBuilderis not working properly, it aways saying "opcua.tag isn't a PlcSubscriptionTag". - It seems that PublishRequest is only implemented in MSpec, but is not used.
{
subRequest, err := connection.SubscriptionRequestBuilder().
AddChangeOfStateTagAddress("field1", "ns=1;s=values/int64").
Build()
if err != nil {
fmt.Println(fmt.Errorf("error preparing subscription-request: %s", err.Error()))
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// error preparing subscription-request: *opcua.tag isn't a PlcSubscriptionTag
os.Exit(1)
}
subRequestResult := <-subRequest.Execute()
if subRequestResult.GetErr() != nil {
fmt.Println(fmt.Errorf("error executing subscription-request: %s", subRequestResult.GetErr().Error()))
os.Exit(1)
}
resp := subRequestResult.GetResponse()
fmt.Println(resp.String())
handle, err := resp.GetSubscriptionHandle("field1")
if err != nil {
fmt.Println(fmt.Errorf("error getting handle: %s", err.Error()))
os.Exit(1)
}
handle.Register(func(event model.PlcSubscriptionEvent) {
fmt.Println("got event:\n", event.String())
})
}
Programming Languages
- [ ] plc4j
- [X] plc4go
- [ ] plc4c
- [ ] plc4net
Protocols
- [ ] AB-Ethernet
- [ ] ADS /AMS
- [ ] BACnet/IP
- [ ] CANopen
- [ ] DeltaV
- [ ] DF1
- [ ] EtherNet/IP
- [ ] Firmata
- [ ] KNXnet/IP
- [ ] Modbus
- [X] OPC-UA
- [ ] S7
Well ... generally the PLC4X API didn't have the concept of a Publish operation, but I have started on working on a PublishAPI extension ... so I guess that#s the reason we haven't got any publish-support yet.