forked from konimarti/opc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconnection.go
More file actions
44 lines (39 loc) · 834 Bytes
/
connection.go
File metadata and controls
44 lines (39 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package opc
import (
"time"
)
const (
//OPCDataSource defines constants for Sources when reading data from OPC:
//Default implementation is OPCCache.
//From the cache
OPCCache int32 = 1
//From the device
OPCDevice int32 = 2
//OPCServerState defines the state of the server:
//Disconnected
OPCDisconnected int32 = 6
//Failed
OPCFailed int32 = 2
//Noconfig
OPCNoconfig int32 = 3
//Running
OPCRunning int32 = 1
//Suspended
OPCSuspended int32 = 4
//Test
OPCTest int32 = 5
)
// Connection represents the interface for the connection to the OPC server.
type Connection interface {
Add(...string) error
Tags() []string
Remove(string)
Read() map[string]Item
Close()
}
// Item stores the result of an OPC item from the OPC server.
type Item struct {
Value interface{}
Quality int16
Timestamp time.Time
}