easy-scpi icon indicating copy to clipboard operation
easy-scpi copied to clipboard

Add a proper full example to using the easy-scpi library to make it "easy"

Open calumroy opened this issue 2 years ago • 1 comments

Your example in the readme is confusing for beginners who don't know about VISA. What should "<port>" look like in

# Connect to an instrument
inst = scpi.Instrument( <port> )

e.g I have a device I want to talk scpi comms to over tcp/ip on ip address 169.254.89.0 port 5025.

Trying these all fail:

inst = scpi.Instrument( "169.254.89.0:5025" , read_termination='\n', write_termination='\n')
inst = scpi.Instrument("169.254.89.0", read_termination='\n', write_termination='\n')
inst = scpi.Instrument("TCPIP0::169.254.89.0::5025::SOCKET", read_termination='\n', write_termination='\n')

What is a concrete example for the value ?

I eventually found that this worked:

inst = scpi.Instrument(read_termination='\n', write_termination='\n')
inst.rid="TCPIP0::169.254.89.0::5025::SOCKET"

Can you add an explanation to setting the rid in the readme if this is the correct connection method for tcp/ip case or explain the scpi.Instrument( <port> ) better.

calumroy avatar Aug 01 '23 09:08 calumroy

Thank you for the suggestion. I'll get around to this when I can, but am quite busy these days so don't know when that will be. If you're up for it, you can create a PR and either add an examples folder or add it into the README.

bicarlsen avatar Aug 07 '23 09:08 bicarlsen