From: Chad Bullock <[EMAIL PROTECTED]>
Hey everyone, I'm trying to get a serial device to work (through a Keyspan serial->usb converter)...though have run into some troubles. It's a fairly simple device, and I have the basic set of commands available. I'm also able to successfully connect to it and send/receive data using other 3rd party terminal emulator programs on the Mac. But, in my RB app, I'm having no luck. For example, there's a simple command that just turns the device on; this works perfectly in other terminal emulator programs and turns the device on. When I setup a serial control in RB (making sure the settings - baud, parity, etc are exactly the same), there's no activity, and I can't turn on the device. Some quick things about the serial device... A) a command like "HI?" should turn it on (and does in another terminal program) B) no carriage return or line feed should be necessary to have it work. It should just turn on at the end of typing the "?" in "HI?" I've tried messing around with the encoding of the text string that's being sent, but am guessing I'm missing something somewhere. Since I can't even send a correct command to the device, I won't even bother dealing with the Data Available data until I can get this first part working - since they're probably related. 1) even though the baud rate is set correctly (9600), is there a chance that it's just sending too quickly....er something like that? 2) *something* must be different about how RB is sending the serial command than other terminal apps, but I can't find any details specifically about what special encodings, etc the other programs use, so I really don't know. 3) I've tried converting the string before sending to ascii, and the other normal ones I thought it might be, but still nothing. Using: Dim s1, s2 as string s2="HI?" s1=s2.convertEncoding(encodings.ascii) serial1.write(s1) And, I've tried sending each letter with a chr(x) [the character]...but nothing. Sorry for the long post, but can anyone think of any other thing I could try on this? I'm pretty stuck at the moment, and would really appreciate it. Thanks to all. Chad
Did you remember to call Open on the serial port? if serial1.Open then serial1.write("HI?") end if Paul Rodman _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives of this list here: <http://support.realsoftware.com/listarchives/lists.html>