Comments (3)
2019/08/19 13:12:35 Could not load OPC Automation object with wrapper OPC.Automation.1
2019/08/19 13:12:35 Loaded OPC Automation object with wrapper Graybox.OPC.DAWrapper.1
2019/08/19 13:12:35 Connecting to Kepware.KEPServerEX.V6 on node 127.0.0.1
2019/08/19 13:14:35 Connected.
2019/08/19 13:14:35 Transport [http] Listening on [::]:5218
2019/08/19 13:14:35 Broker [http] Connected to [::]:5219
from opc.
Hi @HOULL2 your performance issue seems to be while the OLE connect function of the DLL is being called. Please also check out the closed issue #11 where a successful connection to an Kepware OPC sever can be established within seconds. Hence, I don't think the long connection time is package related. Maybe you can post your code and I'll have a look at it.
from opc.
func opcconnect() error {
Println(handler.VarResult.Servers.Name)
Println(handler.VarResult.Servers.IP)
fopc.Debug()
var err error
handler.OpcClient, err = fopc.NewConnection(handler.VarResult.Servers.Name,
[]string{handler.VarResult.Servers.IP}, []string{})
if err != nil {
return err
}
return nil
}
func main() {
// New Service
service := micro.NewService(
micro.Name("go.micro.srv.opc"),
micro.Version("latest"),
)
// Initialise service
service.Init(
micro.BeforeStart(func() error {
if err := ReadXml(); err != nil {
return err
}
if err := opcconnect(); err != nil {
return err
}
return nil
}),
)
// Register Handler
opcPb.RegisterOpcServiceHandler(service.Server(), new(handler.OpcServiceHandler))
go func() {
ch := make(chan os.Signal, 1)
signal.Notify(ch, os.Interrupt, syscall.SIGINT, os.Kill, syscall.SIGKILL, syscall.SIGTERM)
select {
case <-ch:
Println("shutdown....")
timeout := 5 * time.Second
_, cancle := context.WithTimeout(context.Background(), timeout)
// defer cancel
Println(cancle)
// app.Shutdown(ctx)
handler.OpcClient.Close()
}
}()
// Run service
if err := service.Run(); err != nil {
log.Fatal(err)
}
}
from opc.
Related Issues (20)
- reconnect & read opc data is zero HOT 1
- Question regarding group by different refreshRate HOT 1
- panic: runtime error: invalid memory address or nil pointer dereference HOT 4
- Question regarding program sometimes crashes at readFromOpc HOT 6
- How to deal with concurrent reading of tags HOT 1
- Influxdb Authentication HOT 2
- Could not load OPC Automation object with wrapper OPC.Automation.1 HOT 3
- How config dcomcnfg.exe in win10
- read() to get discribe and datatype info
- Reading OPC data from device HOT 1
- How to confirm param in opc.NewConnection HOT 4
- read item quality value is uncertain
- the return of CreateBrowser items can include datetype?
- something wrong in cgo when I try read tag by "opc-cli.exe read localhost Graybox.Simulator.1 options.sinfreq numeric.sin.float" HOT 5
- tag/{id} api not support slash
- The opc server Matrikon.OPC.Simulation.1 cannot be obtained using opc-cli.exe
- opc-cli.exe扫描不到Matrikon.OPC.Simulation.1
- it's can be build to wasm file?
- Higher versions of Golang will crash HOT 4
- opc.NewConnection error HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opc.