Welcome! Log In Create A New Profile

Advanced

Difficulty Automating

Posted by ugine 
Difficulty Automating
July 14, 2012 01:30PM
I can get the device to work okay using a terminal and manually entering commands but when I try to automate the process via a script I get unreliable results. I have tried using delays but this does not seem to work.
Re: Difficulty Automating
July 14, 2012 01:42PM
The trick here is to use hardware handshaking or the acknowledge mechanism. On all serial devices you need to know if the message you send as been received and understood and you do not want to send another message whilst the first one is being processed.

Setting up a hardware handshake is tricky and so the BV4626 has an ACK mechanism that is switched off by default. The command to switch it on is <esc>nE where n is the byte you want the BV4626 to send back when it’s done.

If you set n to say 6 then all you need to do is send out the command and read the serial input until 6 is received. When it is another command can be sent.

A point to note also when automating is that the automatic Baud rate detection takes about ½ second, so when you send out byte13 (printf(“\r”)) as the first bit of communication, wait ½ second or wait for byte 42 (0x2a) to be received which is always sent after the Baud rate is established.
Sorry, only registered users may post in this forum.

Click here to login