Hi Ed,
I was able to replicate your -230 error when I had no signals being input into the FCA, which hints at the fact that it's probably caused by too long of a period between A and B, which leads to "stale data".
So, in between running your scripts the FCA is still trying to capture data but it's unable to, which creates this -230 error. You then catch this error next time you run your script.
In terms of a fix, what worked for me was to write *CLS
at the start of my script to clear the error queue, and then proceed as normally.
I've attached my script for your convenience.