Diagnostic output with FullDuplexSerial
RogerInHawaii
Posts: 87
I'm writing a program that has several objects. I want to be able to output diagnostic information to the Parallax Serial Terminal using the FullDuplexSerial object. This works fine when I have a single FullDuplexSerial object in ONE of the objects that I am debugging, but if I want to have diagnostic output produced by two or more of my objects I can't seem to get it to work. If I place a separate FullDuplexSerial object inside each of my to-be-debugged objects I end up getting garbage text, or nothing at all, in the Serial Terminal. Apparently the several FullDuplexSerial objects are interfering with one another.
So,how can I do diagnostic output from several objects at the same time?
So,how can I do diagnostic output from several objects at the same time?
Comments
You can use locks to prevent the several FullDuplexSerial objects from interfering with one another. Check locknew, lockclr, lockset and lockret in the Propeller manual.
John Abshier
You should modify the FullDuplexSerial object VAR section variables to be DAT and "start" the FullDuplexSerial object just one time. This way one set of variables is used for the FIFO and any spin object that uses the object will talk to the one FIFO.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve
Propalyzer: Propeller PC Logic Analyzer
http://forums.parallax.com/showthread.php?p=788230
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
“Before you criticize someone, you should walk a mile in their shoes. That way when you criticize them, you are a mile away from them and you have their shoes.” - Jack Handey.
It was only after I did that that I saw the subsequent posting about SerialMirror.
Is there a section on the Parallax website that categorizes the various objects that are posted there? Something like a category of "Diagnostic Aids" or "Diagnostic Output to the Serial terminal" would have been a big help in this situation, which I'm guessing is fairly common for developers.
The object exchange (obex) is somewhat categorised, but SerialMirror is under "Protocols", which may not have been obvious. Unfortunately, it's near-on impossible to get categoristion right for everyone (I've gone through that pain as a web developer!), so Obex is probably as good as we can get.
Glad you're sorted tho'
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
“Before you criticize someone, you should walk a mile in their shoes. That way when you criticize them, you are a mile away from them and you have their shoes.” - Jack Handey.