Hi Rosilari,
Thanks for the log files.
The first thing I notice is that you are getting the “Out of Range” errors that I mentioned previously, e.g.
SENT: 01 RAT 100.0 MM
WARNING: The syringe pump returned an error: Out of Range (OOR)
RETURNED: 01S?OOR
Based on my (limited) testing, I believe the pump’s response to an invalid rate request is to select some default, valid infusion rate. Maybe that doesn’t matter to you, but it’s probably worth checking.
That aside, it looks like the core issue is that some responses from the pumps are delayed. For example, here’s an excerpt from your first log file:
REWARD! (1886573870)
SENT: 02 DIR INF
WARNING: Did not receive a complete response from the pump
RETURNED:
SENT: 02 RAT 100.0 MM
WARNING: Did not receive a complete response from the pump
RETURNED:
SENT: 02 VOL 0.020
WARNING: Did not receive a complete response from the pump
RETURNED:
SENT: 02 RUN
WARNING: Did not receive a complete response from the pump
RETURNED:
Give additional licking time (1886990835)
Here, MWorks tries to send four commands to pump 2. Each time, it fails to get a response within the allotted time (100ms), issues a warning, and moves on. Then, a bit later, we see the following:
REWARD! (1889457068)
SENT: 01 DIR INF
RETURNED: 02S02S?OOR
SENT: 01 RAT 100.0 MM
RETURNED: 01S
SENT: 01 VOL 0.020
WARNING: The syringe pump returned an error: Unspecified error (OOR01S)
RETURNED: 01S?OOR01S
SENT: 01 RUN
RETURNED: 01I
Give additional licking time (1889673917)
Here, the first “RETURNED” line contains the (overdue) responses to the first two commands sent to pump 2 in the previous log excerpt. After that, we see the expected responses from the new commands being sent to pump 1 (mashed together in one case, leading to the “Unspecified error” message). However, we don’t see responses for the other two commands sent to pump 2, so either those responses were lost, or the pump never received those commands.
In this case, it appears that the pumps recovered, as both pumps 1 and 2 exhibit normal command/response behavior afterward. However, the delayed-response issue appears again at the very beginning of the last run in the log file, which is when you noticed the pumps weren’t responding.
The second log file (after reboot) is more puzzling. After some response timeouts, MWorks reports an extremely long response from pump 1:
Wait for triggered trial ... (81705195)
SENT: 01 DIR INF
WARNING: Did not receive a complete response from the pump
RETURNED: 01S001S001S001S001S001S... [this goes on and on]
While I don’t know where all this response data is coming from, a message this long would trigger a buffer-overflow bug (which I just discovered) inside MWorks’ NE500 plugin. This, in turn, would result in memory corruption, which is probably the cause of the weird OpenGL errors you’re seeing.
At this point, there are a few obvious steps we can take to try to eliminate this issue. On my end, I can
- fix the buffer-overflow bug and
- extend the timeout interval for responses from the pump. (I think one second would be reasonable, but it can be a user-configurable parameter, if you prefer.)
On your end, the next time the pumps stop responding, I recommend shutting down MWServer and restarting the pumps and the StarTech. This should clear out any unsent command responses or other bad state.
Beyond that, I’m wondering if we can ditch the StarTech and switch to a serial-over-USB interface. (For example, I have a FTDI cable that would do the job.) This would eliminate one potential point of failure and simplify your setup a bit. Or is there some reason you need a serial-over-TCP solution?
Thanks,
Chris