viewing data in a block of ramspace
Hello all!
I am trying to read recieved serial data into a block of ram using long move but the data dosnt seem to be going to the block of ram am I using the complete wrong command/ approach the device Im trying to read from requires an unknown code sequence elese the watchdog timer times out communication.
heres the block of code Im trying to grab the data from
PRI RxCheck : bytechr
{Check if character received; return immediately.
Returns: -1 if no byte received, $00..$FF if character received.}
bytechr~~
if rx_tail <> rx_head
bytechr := rx_buffer[rx_tail]
rx_tail := (rx_tail + 1) & BUFFER_MASK
bytechrbuff := bytechr
longmove(@buffer, @bytechrbuff, 3000) ' adding this to copy data to memory
Thanks in advance for any help on this!
I am trying to read recieved serial data into a block of ram using long move but the data dosnt seem to be going to the block of ram am I using the complete wrong command/ approach the device Im trying to read from requires an unknown code sequence elese the watchdog timer times out communication.
heres the block of code Im trying to grab the data from
PRI RxCheck : bytechr
{Check if character received; return immediately.
Returns: -1 if no byte received, $00..$FF if character received.}
bytechr~~
if rx_tail <> rx_head
bytechr := rx_buffer[rx_tail]
rx_tail := (rx_tail + 1) & BUFFER_MASK
bytechrbuff := bytechr
longmove(@buffer, @bytechrbuff, 3000) ' adding this to copy data to memory
Thanks in advance for any help on this!
Comments
Please repost with proper formatting.
iride, it would be good to use the [ code ] and [ /code ] delimeters to preserve the indentation. It would also be good if you could post all your code. If buffer is 12,000 bytes in size you will be wiping out other parts of memory with the longmove. Also, you're really just copying the value of bytechr to the first long in buffer along with 2999 other longs that probably aren't useful. Post all your code, and we should be able to help you.
Here is how I receive data from the pst to my program
If pst.RxCheck does equal -1, ignore, but if it does not return a -1, array b_waitingToBeParsed increments by 1 and assigns the incoming byte to that array value.
It continues to increment that until it sees a carriage return (13) and then it sends the data to a parsing routine called DelimiterFinder. I can post that too if you need it, but I'm not sure what you are doing with the data so I won't post it yet. After that it clears the array b_waitingToBeParsed and its index and waits for the next set of characters and carriage return.