Uncaught Error When Closing Daqfactory Down.


RodSwan

Recommended Posts

I'm using a device with null protocol to communicate over ethernet to a server.

Everything works fine until I need to close DaqFactory down then every time I get a "C1136" Timeout error - Uncaught Error in sequence yet I have a Try/catch construct around the statement that fails:

 

   while(1)
      try
         ReceiveData = device.StraqTCP.ReadUntil(chr(10))         
           Lots of other code.....

      catch("C1136")
         ?"Error C1136 caught in SocketRcv"
      endcatch
      catch()
         ?"Error caught in SocketRcv"
         System.ErrorMessage(strLastError)
      endcatch
            
   endwhile

I guess I have to close this device and the ReadUntil before I close Daqfactory - but How do I do that? I have a sequence called "OnShutdown" that I use to tidy things up when the app closes and that works ok but I haven't figured out how to close the device down gracefully.

 

 

I've tried 

 
   device.StraqTCP.Timeout= 0
   device.StraqTCP.Address = ""
   device.StraqTCP.port = 0
   device.StraqTCP.Timeout= 10
 
but nothing seems to stop the device. 
 
Problem is that onsite (where I run Daqfactory only in RunTime mode) getting a dialog saying "Daqfactory has encountered a problem" ... "Please tell Microsoft...." does not install confidence in the customer.
On my development system running in development mode I get "C1136 Timeout: SocketRcv Line 13 - Uncaught error in sequence SocketRcv" shortly after whenever I switch to safe mode.
 
 
How do I shut the device down gracefully?
 
Rod.
 
 

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.