not really sure what you mean, like single character byte as in 1 or 7? this would leave me in the sticky situation as I mentioned up top, not sure if I'm understanding you
not really sure what you mean, like single character byte as in 1 or 7? this would leave me in the sticky situation as I mentioned up top, not sure if I'm understanding you
Last edited by kenpo; - 27th April 2007 at 21:05.
Disconnect between us = didn't get what you wanted, gave you the wrong thing, whatever...
Now I'm not sure what you don't understand.
PBP doesn't work with strings. The serial commands, in general, will work with an array of a variable, not exactly the same thing as a string, but close. And yes, you can send multiple characters or a variable array, but they are treated as multiple, individual bytes, and not a string.
ok, how would I send an array of a variable via hyperterminal? is it possble? I haven't used variable arrays in pbp before, only in other languages.
maybe the best question is: how would you do it?
if you wanted to have 3 sets of date sent, how would you send it, and make sure they don't get mixed up. ie, what if one set doesn't get sent, I don't want things getting out of synch after 1 month of contnuos usage... it would be cool to send it all at once as an array, but I'd have no idea how to do that via the windows end, so for now, I'm sticking to sending one at a time
How would I do it?
I would write a quick program in VB6 (others will say to use VC+, C#, whatever, I use VB6 'cause I know it well and it works for me, so whatever works for you) for the PC end of things to run the serial port, pick a byte sequence to be a leader (preferably 2 bytes that I would be reasonably sure wouldn't be used in the data payload), maybe add in a 'sequence' number to keep everything lined up, send the data, 1, 2, 3, then a checksum byte (or word, whatever), and maybe a trailer byte pair if needed.
At the PIC end, I would receive the data in a single SERIN statement into my variables, check the leader bytes are correct, check the 'sequence' number against the last one received, keep the data for the time being, do my error detection/checksum, check the trailer byte pair, then put the data where I needed it if all checks out ok.
Not very difficult stuff...usually. Sometimes you just gotta break it down into smaller chunks because the overall chunk almost looks daunting.
I'd just work on sending one or two bytes at a time, get used to sending stuff, maybe some error detection, etc...then work my way up to the big stuff.
cool, thanks dude, that's what I had in mind then. except I was thinking either C or vb.net
for now acctually just php/mysql on the pc end connected to the serial port.
Bookmarks