let's say i have this command:
SEROUT serpout, N9600, "A",#RRECADD,"B",#RBITVALUE,"C","227","D"]
in which RRECADD and RBITVALUE are decimal byte variables which vary in length depending on if its like a 3 or a 255 in between the A - B etc.. ie. there are no leading 0's on the smaller values to "space out" the number of charecters in the string.
The thing is i think my pc side and it's parsing routines would benefit (our parsing wouldnt fail as much due to incomplete "packets" or packets in which two A's appear in the same received string) if we could limit the input to a fixed number of bytes to receive (which we can do using visual basics mscomm control using the OnComm / comEvReceive events and setting the MSComm1.InputLen to whatever our complete data packet is going to be) then our data to parse would be what we sent and (hopefully) no more or less. The project is trying to implement a 2 way communication via PIC's, PC, and it uses TWS-434 and RWS-434 modules to do so at (eek only) N1200 (ok no so bad it's pretty reliable)
The major problem is i cant count the length of my outgoing data string before i send it, i wanted to "fill" "packets" that were short charecters based on a subtracted total. But no length or LEN feature, so how to do this?
I'm even considering converting to BCD (binary coded decimal) to transmit (does seem like much of a solution considering i would be - i think - increasing the amount of transmission for the same amount of actual data). But BCD values would give the desired fixed length
I understand that this non byte array / buffer method of communication is "lossy" but i'm mostly interested in speed of data exchange (as close to real time as possible), data integrity is secondary, (its mostly reliable using this sort of "push" and "poll" method)
Bookmarks