alpha Posted September 24, 2010 Share Posted September 24, 2010 I post this same topic earlier, but did not see it appear on the forum, so I post it again. Hi, I have problems with sending data via serial port to another computer sometimes. The serial Tx stop sending data and sometimes stop the sequence (look at the code below). It only works again if I restart the program or sometimes require rebooting the computer. And I observe that this issue happen when the other computer stop sending data to our computer (usually, in the oil field, they stop drilling for few minutes). I appreciate for any advices while(1) Device.totco.Write("&&"+Chr(13)+Chr(10)+"0140"+ DoubleToStr(Floor(iGas[0])/100)+Chr(13)+Chr(10)+"!!"+Chr(13)+Chr(10)) Device.totco.Write("&&"+Chr(13)+Chr(10)+"0139"+ DoubleToStr(-1*LagDepth[0])+Chr(13)+Chr(10)+"!!"+Chr(13)+Chr(10)) delay(30) endwhile Link to comment Share on other sites More sharing options...
AzeoTech Posted September 24, 2010 Share Posted September 24, 2010 First, this is a moderated forum, meaning posts don't appear until we review and enable them. This is because spammers often try and post lists of links (presumably to increase page rank) or other inappropriate content. As for your question, are you getting any error message in the Command Alert window? Link to comment Share on other sites More sharing options...
alpha Posted September 24, 2010 Author Share Posted September 24, 2010 I don't receive any error or message on the command window Link to comment Share on other sites More sharing options...
alpha Posted September 27, 2010 Author Share Posted September 27, 2010 Hi, For the same function is sending data through serial port. First of all, if I let a sequence looping and calling another sequence as a function i.e //below codes are in sequence looping while(1) wits_send() delay(30) endwhile //below codes are in sequence wits_send Function wits_send() Device.totco.Write("&&"+Chr(13)+Chr(10)+"0140"+ DoubleToStr(Floor(iGas[0])/100)+Chr(13)+Chr(10)+"!!"+Chr(13)+Chr(10)) Device.totco.Write("&&"+Chr(13)+Chr(10)+"0139"+ DoubleToStr(-1*LagDepth[0])+Chr(13)+Chr(10)+"!!"+Chr(13)+Chr(10)) return The way sendding data out via serial port describe in example above, I had no error even if serial port is not available (installed) but it will stop sendding data sometime as I described in the top post The second way I did is //below codes are in sequence looping while(1) beginseq(wits_send) delay(30) endwhile //below codes are in sequence wits_send Device.totco.Write("&&"+Chr(13)+Chr(10)+"0140"+ DoubleToStr(Floor(iGas[0])/100)+Chr(13)+Chr(10)+"!!"+Chr(13)+Chr(10)) Device.totco.Write("&&"+Chr(13)+Chr(10)+"0139"+ DoubleToStr(-1*LagDepth[0])+Chr(13)+Chr(10)+"!!"+Chr(13)+Chr(10)) This way, I have a time out error if serial port is not available and this way I haven't try in the field yet Do you have any advice AND WHICH WAY SHOULD I USE Link to comment Share on other sites More sharing options...
BeeHay Posted September 28, 2010 Share Posted September 28, 2010 Welcome fellow oil-field hand... Are you guys mudlogging? I've also noticed serial problems when they change light plants... I'm not sure what the issue is, but I've found that restarting the DF and WITS machines always clear up serial issues.. Have you ran into incorrect decimal placing? I don't know what they are changing on the server side, but there are times when the decimal needs moved left or right... I have a cool workaround for easily moving the decimal...(Correct gas decimal placing for pason or totco with a few on/off buttons) Welcome to the forums! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.