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

Change PLC4GO docs read syntax #276

Merged
merged 2 commits into from
Sep 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/site/asciidoc/users/getting-started/plc4go.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ In order to create and run such a `PlcReadRequest`, please add the following cod
----
// Prepare a read-request
readRequest, err := connection.ReadRequestBuilder().
AddItem("field1", "holding-register:1:REAL").
AddItem("field2", "holding-register:3:REAL").
AddQuery("field1", "holding-register:1:REAL").
AddQuery("field2", "holding-register:3:REAL").
Build()
if err != nil {
t.Errorf("error preparing read-request: %s", connectionResult.Err.Error())
Expand Down Expand Up @@ -201,7 +201,7 @@ Now in order to do something with the response:
value1 := readRequestResult.Response.GetValue("field1")
value2 := readRequestResult.Response.GetValue("field2")
fmt.Printf("\n\nResult field1: %f\n", value1.GetFloat32())
fmt.Printf("\n\nResult field1: %f\n", value2.GetFloat32())
fmt.Printf("\n\nResult field2: %f\n", value2.GetFloat32())
----

The `GetValue` function returns a `PlcValue` instance, this had accessors for the most general `Go` types.
Expand Down