konimarti / opc

OPC DA client in Golang for monitoring and analyzing process data based on Windows COM.
MIT License
237 stars 85 forks source link

Reading OPC data from device #45

Open emilesalem opened 2 years ago

emilesalem commented 2 years ago

from connection.go

//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

there doesn't seem to be a way to read from device, can you confirm this?

konimarti commented 2 years ago

there doesn't seem to be a way to read from device, can you confirm this?

This is correct. Currently, the read routine has OPCCache hard-coded: https://github.com/konimarti/opc/blob/master/connection_windows.go#L312

Patches are welcome if you would like to implement a user-specified parameter for either OPCCache or OPCDevice.