gos7
gos7 copied to clipboard
About Set/Get PLC time function
Hi Robinson, PGClockWrite (implement GetPLCDateTime) , is it a mistake between 2 functions?
//implement GetPLCDateTime func (mb *client) PGClockWrite() (datetime time.Time, err error)
//implement SetPLCDateTime func (mb *client) PGClockRead(datetime time.Time) (err error) {
hi when you use PGClockRead to set time of plc,do you produce a panic?
I believe there are multiple issues in datetime.go PGClockRead / PGClockWrite function names are reversed - just confusing mb.send does not catch error and so will panic if PLC is disconnected s7.SetDateTimeAt(requestData, 32, datetime). I had to change this to s7.SetDateTimeAt(requestData, 31, datetime) to format date correctly.
PS. I am new to github. Happy to post my fixed datetime.go if required PPS. Great job with gos7.