Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request][OPC-UA]: PublishRequest is required to reduce server pressure #1362

Open
2 of 16 tasks
zhyang-liu opened this issue Jan 25, 2024 · 1 comment
Open
2 of 16 tasks
Labels
go Pull requests that update Go code new feature

Comments

@zhyang-liu
Copy link

zhyang-liu commented Jan 25, 2024

What would you like to happen?

  1. it seems that SubscriptionRequestBuilder is not working properly, it aways saying "opcua.tag isn't a PlcSubscriptionTag".
  2. 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
  • plc4go
  • plc4c
  • plc4net

Protocols

  • AB-Ethernet
  • ADS /AMS
  • BACnet/IP
  • CANopen
  • DeltaV
  • DF1
  • EtherNet/IP
  • Firmata
  • KNXnet/IP
  • Modbus
  • OPC-UA
  • S7
@zhyang-liu zhyang-liu changed the title [Feature Request]: PullRequest is required to reduce server pressure [Feature Request]: PublishRequest is required to reduce server pressure Jan 25, 2024
@chrisdutz
Copy link
Contributor

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.

@chrisdutz chrisdutz changed the title [Feature Request]: PublishRequest is required to reduce server pressure [Feature Request][OPC-UA]: PublishRequest is required to reduce server pressure Feb 10, 2024
@splatch splatch added the go Pull requests that update Go code label Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go Pull requests that update Go code new feature
Projects
None yet
Development

No branches or pull requests

3 participants