Hi O_Proulx,
I put a VISA Write into USB RAW - Interrupt.vi so that I could send a
command to my device and then read back the response via Interrupt IN.
The result was the same as with my own VI. I could open a session,
send all the commands, and read back all the responses I wanted to
until I closed the VISA session. Then when I tried to re-open a
session, the device would hang until I cycled power.
I tried something else that has helped, although it doesn't
completely solve the problem. I added a case structure after VISA Wait
On Event. If no error is returned by VISA Wait On Event, then I read
the data using VISA Get USB Interrupt Data, but if there is an error, I
call VISA Clear instead. After calling VISA Clear, I can again
communicate with my device--without closing the session that is open.
That is, when I open a second session and send the first command, VISA Wait On Event times out
and so VISA Clear is called. Then for subsequent commands I can send
them and read back the responses until I close the session. Now at
least I don't have to cycle power between sessions.
Seems to me, though, like there might be some data left over in one of the endpoints, since VISA Clear resets endpoints. In
this case, maybe only the Interrupt OUT endpoint is being reset because
my device doesn't have a Bulk IN endpoint. Not sure quite what to think since I don't know exactly the VISA VI's do.
If this brings anything to mind for you, let me know. In the
meantime, I think I'll look at some firmware and API source code and see what might be different.
Thanks,
Mike