Hi All,
This may be a Python question rather than a CASPER/KATCP one, but I have
not been able to solve it. I am trying to connect to multiple ROACHes in
order to write delays to the coarse delay registers once per second. I
attempted to do the following (minimal code that displays the bug) to check
the availability of each ROACH, and this works fine when typed into an
interactive session, but when used in a program it fails with a "Client not
connected" error.
roach_ip = ('roach1.solar.pvt','roach2.solar.pvt')
fpga = []
for roach in roach_ip:
# Make connection to ROACHes
fpga.append( corr.katcp_wrapper.FpgaClient(roach) )
fpga[-1].ping()
I am guessing that the difference is that something goes awry when run as
compiled code. Still, this must be a fairly common thing to do. I could
get around this by just connecting to each client once a second, sending
the delay values, and disconnecting, but this seems unnecessary overhead
compared with maintaining the open connection all of the time.
Can someone suggest a fix, or a better method for what I want to do?
Thanks,
Dale