Sign in to follow this  

Uncaught Error When Closing Daqfactory Down.

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:


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

         ?"Error C1136 caught in SocketRcv"
         ?"Error caught in SocketRcv"

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?


Share this post

Link to post
Share on other sites

I'm not sure the two are related, but to shut down gracefully, either end the sequence hard using endseq (which isn't too graceful), or add a flag to your while() and set the flag false when you want to quit, then wait for the sequence to quit.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this