Skip to content

Go (Golang) wrapper for the Twincat ADS library, enabling you to effortlessly read and write PLC variables while also managing device notifications in your Go applications.

License

Notifications You must be signed in to change notification settings

dinceruur/goads

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

goads

Go (Golang) wrapper for the Twincat ADS library, enabling you to effortlessly read and write PLC variables while also managing device notifications in your Go applications.

Read a Variable

package main

import (
	"fmt"
	"github.com/dinceruur/goads"
)

func main() {
	plc := goads.NewPLC()

	var boolVariable bool
	if err := plc.ReadByName("Main.BoolVariable", &boolVariable); err != nil {
		fmt.Println(err)
	}
	fmt.Println(boolVariable)
}

Write a Variable

package main

import (
	"fmt"
	"github.com/dinceruur/goads"
)

func main() {
	plc := goads.NewPLC()

	var boolVariable bool
	boolVariable = true
	if err := plc.WriteByName("Main.BoolVariable", &boolVariable); err != nil {
		fmt.Println(err)
	}
}

About

Go (Golang) wrapper for the Twincat ADS library, enabling you to effortlessly read and write PLC variables while also managing device notifications in your Go applications.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages