Timeout Errors With Serial Communications


txturbo

Recommended Posts

 I am new to daqfactory, having fun with my first real program.

 

So far I have managed to get most of my program working, with the help of the manual and looking up answers on the forum. Now I am a bit stuck.
 
My system uses a MKS 651 Pressure controller connected via a USB to serial adapter (com2) and an Omega IR2C temperature controller on the native com port (1). The computer is an IBM R51 Centrino laptop.
 
When I poll the 651 controller using the sequence(s) below it runs for a minute then gives an error:
 

C1136 Timeout: tvalvestatus Line 21 - Uncaught error in sequence tvalvestatus

 

I have tried to add delays, increase the port timeout, change the speed of the communications but it does not seem to make any difference.

 

I have also tried to adjust the channel number in the channel parameters. I am not sure if that makes a difference or not. I can’t find any reference to the channel number within the MKS 651 serial commands.  
 

I also notice that when the sequence is running and I look at the channel table the top line is updated correctly with the value but sometimes it puts the correct value down a line or two and puts NaN on the top. It’s strange because it’s not scrolling down.

 

I have tried both sequences and they give the same error.

 

Sequence 1

 

private string datain
private data

While(1)
   device.mks651.purge()
   device.mks651.write("R6" + chr(13) + chr(10))
   datain = device.mks651.readUntil(10)
   data = strToDouble(mid(datain,3, 1000))
   tvalvepos.addValue(data)
   device.mks651.write("R5" + chr(13) + chr(10))
   datain = device.mks651.readUntil(10)
   data = strToDouble(mid(datain,3, 1000))
   tvalvepress.addValue(data)
   device.mks651.write("R37" + chr(13) + chr(10))
   datain = device.mks651.readUntil(10)
   data = strToDouble(mid(datain,1, 1000))
   status651.addValue(data)
   delay(1)
endwhile

 

Sequence 2

 

private string datain1
private data1
private string datain2
private data2
private string datain3
private data3

While(1)
   device.mks651.purge()
   device.mks651.write("R6" + chr(13) + chr(10))
   datain1 = device.mks651.readUntil(10)
   data1 = strToDouble(mid(datain1,3, 100))
   tvalvepos.addValue(data1)
   delay(.5)
   device.mks651.write("R5" + chr(13) + chr(10))
   datain2 = device.mks651.readUntil(10)
   data2 = strToDouble(mid(datain2,3, 100))
   tvalvepress.addValue(data2)
   delay(.5)
   device.mks651.write("R37" + chr(13) + chr(10))
   datain3 = device.mks651.readUntil(10)
   data3 = strToDouble(mid(datain3,4, 100))
   status651.addValue(data3)
   delay(1)
endwhile

 

Any ideas? Thanks!!

 

 

 

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

I'd really need to see the manual for the unit to give you a proper response, and the MKS site is one of those annoying sites that require you to register even to download manuals.

 

Timeout means that the device didn't respond in the timeout period.  It has nothing to do with what you do with the data after you receive it.  Most likely you have some sort of synchronization error.  It often helps to do a purge() before writing a query.

Link to comment
Share on other sites

  • 2 weeks later...

Oops...looks like you tried that, but I see you have delays adding up to 2 seconds...What is your timeout set to in your serial device config?

I believe our serial device did something along those lines too, I think I added a ?strlasterror and a try/catch in there and things seemed to be fine...

HTH

Link to comment
Share on other sites

Archived

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