Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add example HP 34401A with RS232 #993

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

d-el
Copy link

@d-el d-el commented Dec 12, 2023

Add example with HP 34401A by RS232

Signed-off-by: d-el <d2.718l@gmail.com>
Signed-off-by: d-el <d2.718l@gmail.com>
Signed-off-by: d-el <d2.718l@gmail.com>
Signed-off-by: d-el <d2.718l@gmail.com>
Copy link
Member

@BenediktBurger BenediktBurger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution.

What do you want to show with your example?

You can add yourself to the authors.txt.

Comment on lines +48 to +59
adapter = SerialAdapter(port=args.serial,
baudrate=1200, # Recommend value
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_TWO,
bytesize=serial.EIGHTBITS,
xonxoff=True,
dsrdtr=True,
rtscts=False,
write_termination='\n',
read_termination='\n',
)
meter = HP34401A(adapter)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why don't you just use the default connection (VISA)?

Suggested change
adapter = SerialAdapter(port=args.serial,
baudrate=1200, # Recommend value
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_TWO,
bytesize=serial.EIGHTBITS,
xonxoff=True,
dsrdtr=True,
rtscts=False,
write_termination='\n',
read_termination='\n',
)
meter = HP34401A(adapter)
meter = HP34401A("ASRL" + args.serial)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm facing a problem where the "SYSTem:REMOte" command is missing.
Only now I see the solution in the previous PR.

meter = HP34401A("ASRL/dev/ttyUSB0", timeout=5000, baud_rate=1200, data_bits=8, parity=0)
meter.write('SYSTem:REMote')
...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be probably added in the __init__ method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants