-
Notifications
You must be signed in to change notification settings - Fork 402
Phase control of Tektronix AFG3152C #588
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the addition of the phase-control properties!
I found a small mistake in the doc-string for the phase_deg
property.
phase_deg = Instrument.control( | ||
"phase:adjust?", "phase:adjust %e DEG", | ||
""" A floating point property that controls the phase in radian units. | ||
This property can be set.""", | ||
validator=strict_range, | ||
values = PHASE_LIMIT['DEG'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably a simple c&p mistake, for this property the text should be changed to "... in degrees."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
Also, do both controls really have the same query string? I guess the reply/instrument state depends on which unit/control was last used when setting the phase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops yea it was a copy and paste mistake. And the string is actually different for phase_rad and phase_deg. phase_deg ends with %e DEG, while phase_rad ends with %e RAD.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I meant the get_command
argument is the same (phase:adjust?
) -- what's up with that? what happens if you do
print(instr.phase_deg)
print(instr.phase_rad)
Do they show the same phase with different units?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to 8000 others. Learn more.
Thanks for clarifying, I'm still quite new to the library and using python apis.
It looks like phase_deg won't return the phase in degrees unless it's been set previously to degrees. This also seems to be an issue with the get commands of amp_vpp and amp_vrms (haven't tried amp_dbm). My AFG is being used in an ongoing measurement right now, but I wonder if just added the units RAD/DEG like so:
'phase:adjust RAD?'
'phase:adjust DEG?'
would give the query back in the desired units.
also apologies for the late replies, I've been busy with coursework lately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to have this confirmed. Such statefulness in instruments/command sets is always annoying.
To answer your question, I guess you need to study the manual and/or try it out when the instrument is free again.
The linter found some formatting issues (check in the changed files view, or run flake8 locally) :-) |
Hey @FlyingCurryMonster , do you want to pick this PR up again or not? |
For sure, apologies I've been busy with apparatus development. |
8659eaa
to
711a85c
Compare
I was using the AFG3152C and noticed I couldn't control the phase of the signal with pymeasure, so I added in Instrument.control method for that.