gotmc/visa

failed go get github.com/gotmc/visa/drivers/tcpip

Closed this issue · 6 comments

According to the README, I should import

import (
    "github.com/gotmc/visa"
    _ "github.com/gotmc/visa/drivers/tcpip"
)

Unfortunately, I can't go get github.com/gotmc/visa/drivers/tcpip. I get the error message go get: module github.com/gotmc/visa@upgrade found (v0.4.0), but does not contain package github.com/gotmc/visa/drivers/tcpip.

When I do go mod tidy, I get the same error message. And go install returns this error message:

$ go install
main.go:9:2: no required module provides package github.com/gotmc/visa/drivers/tcpip; to add it:
	go get github.com/gotmc/visa/drivers/tcpip

Any help would be greatly welcomed, I need to communicate with an agilent4980A device. For now simply sending commands and queries would be all I need, and I can't find out how to do this with the examples.

@chmike If you're wanting to communicate using Ethernet, you could use the lxi package directly instead of using this visa package. If that still produces errors, please let me know. I will also see what I can do to reproduce your error.

@chmike Try using visa v0.5.0 in your go.mod and let me know what happens.

Thank you very much. I will have a look at it when I have time again. Your code is very helpful. I may use the prologix package if I manage to make it work since I’m using some.

Looking at the ixi package I found out that all I need is a tcp connection to port 5025. I added two optimizations. The bufio.Reader is member of the struct and not instantiated at each call. The second optimization is to use panics with recovery on communication errors instead of classical errors. This error handling pattern is not conventional, but OK to use inside a package or program.

When you say "looking at the ixi package", which package are you referring to?

Sorry, it is lxi (https://github.com/gotmc/lxi). I'll create an issue explaining the suggested change.

For now, I'm going to close this issue. If the problem was not resolved in visa v0.5.0, feel free to open a new issue.