Re: RS232 serial commands
OK, so you need to check a couple of different Strings possibilities and act upon right?
Is this really need to be string? Did you built the "Transmitting unit" or it's just for learning purpose?
Most common and easiest way to implement such thing is to wait for a specific header and then use the next Byte for specific command.
ex:
Transmitter send: "NextCommandIs", 10
Receiver Wait for "NextCommandIs" and store 10 in a byte variable. Depending the value of that Byte Variable, it process various task.
So Easy as
Transmitter Side:
HSEROUT ["NextCommandIs", 10]
Receiver Side:
HSERIN [WAIT ("NextCommandIs"), ByteA]
SELECT CASE ByteA
'
'
'
'
Should you really need to wait for a specific String, then you'll need to build a string with each single character you receive parse them. Not hard, just a tad longer to implement.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks