[go: up one dir, main page]

Skip to content

Missing values from HP 8753E using Prologix GPIB to USB adapter #981

Answered by Sionwage
Sionwage asked this question in Q&A
Discussion options

You must be logged in to vote

Figured out my solution:

instead of vna.read() I needed to call vna.read_bytes(50) for reading 50 bytes from the buffer at a time as fast as possible to avoid losing data points

import time
from time import sleep

timeout = 4000
points = vna.scan_points = 1601
vna.scan_single()
sleep(1)
vna.write("OUTPDATA")

buffer = []

vna.adapter.auto = 1

start = time.time()
while len(buffer) < (points):
    if vna.adapter.connection.bytes_in_buffer >= 50:
        buffer.append(vna.read_bytes(50))
        start = time.time()
    else:
        # try not to overwhelm the prologix adapter
        sleep(0.001)
    # break the loop if the sweep gets interrupted
    if time.time() - start > timeout/1000:
 …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Sionwage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant