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

How to simulate binary write and query #60

Open
pavelandr opened this issue Jun 12, 2022 · 0 comments
Open

How to simulate binary write and query #60

pavelandr opened this issue Jun 12, 2022 · 0 comments

Comments

@pavelandr
Copy link

Hello.

My setup version:
PyVISA-sim==0.4.0

  • pyvisa [required: >=1.11.0, installed: 1.11.3]
    • typing-extensions [required: Any, installed: 4.2.0]
  • PyYAML [required: Any, installed: 6.0]
  • stringparser [required: Any, installed: 0.5]

I am trying to simulate in unit test binary write (file transfer) command.
PyVisa command:
self._resource.write_binary_values(message, values, datatype=datatype)
The device is Rohde&Schwarz SMBV100B Vector Signal Generator.
The command should send the file to the virtual device, without raising system errors.

message = 'MMEM:DATA "/var/user/flight-plan.txt"'
values = b'RESOLUTION: 161897\n64.846910, 12.197980, 100\n64.882251, 12.197944, 100\n'
datatype = 'B'

But I don't know what to write to YAML file, or even if the pyvisa-sim has support for binary write.
The YAML file looks like that:

`spec: "1.0"

resources:
TCPIP0::gps-simulator::5025::SOCKET:
device: device 1

devices:
device 1:
eom:
TCPIP SOCKET:
q: "\n"
r: "\n"
error: ERROR
dialogues:
- q: "*CLS"
- q: "*RST"
- q: "*IDN?"
r: "TCPIP,MOCK,VERSION_1.0"
- q: "*OPC?"
r: 1
- q: "SYST:ERR?"
r: "+0,No error."
- q: 'MMEM:DATA "/var/user/flight-plan.txt" RESOLUTION: 161897\n64.846910, 12.197980, 100\n64.882251, 12.197944, 100\n'
properties:
frequency:
default: "1000"
getter:
q: "FREQ?"
r: "{:s}000000"
setter:
q: "FREQuency {:s} MHz"
e: "FREQ_ERROR"
specs:
type: str
`

Any ideas?

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

No branches or pull requests

1 participant