matt.hoy
Member
I have posted on this app a couple of times already. It's almost done!
I have a barcode reader talking ASCII through Ch0 of a ML1500.
I looked around the forum and saw that ACB was recommended to check the buffer before reading. What I wasn't sure about is whether the characters arrive at the buffer all at once or not. It's called "serial", so I figured that they don't. So when I used the ACB, how do I know if there are more characters coming?
I am trying to read an 8 digit part number (including CR) and a 10 digit serial number (including CR). I wanted to prevent getting them mixed, so I was using the POS value of the ACB control word as the condition for firing an ARD to copy to one of two ST elements depending on how many characters.
Returning to the question of "When have I received all of the characters?" I use a self-resetting timer rung to "poll" the port with the ACB. (Every 200msec)
This seemed to be working, but I occasionally get a math overflow fault. I eventually determined that it was from feeding PN data into the SLN part of the program. (Gets converted to a number > 32,767 using ACI.) I thought I had that trapped using the method above, but it appears that it is often a fragment from a previous scan concatenated with the current scan that happens to meet the right number of digits.
My main questions are:
1. Is it better to check # of characters before actually reading the buffer, or just to copy whatever comes into the buffer into a register and then evaluate it?
If the latter is true, let's say "A" comes in. I write it to a register. Do I have to explicitly index to the next register for the each subsequent character, or is there an easier method?
Thanks, and have a good weekend.
Matt
I have a barcode reader talking ASCII through Ch0 of a ML1500.
I looked around the forum and saw that ACB was recommended to check the buffer before reading. What I wasn't sure about is whether the characters arrive at the buffer all at once or not. It's called "serial", so I figured that they don't. So when I used the ACB, how do I know if there are more characters coming?
I am trying to read an 8 digit part number (including CR) and a 10 digit serial number (including CR). I wanted to prevent getting them mixed, so I was using the POS value of the ACB control word as the condition for firing an ARD to copy to one of two ST elements depending on how many characters.
Returning to the question of "When have I received all of the characters?" I use a self-resetting timer rung to "poll" the port with the ACB. (Every 200msec)
This seemed to be working, but I occasionally get a math overflow fault. I eventually determined that it was from feeding PN data into the SLN part of the program. (Gets converted to a number > 32,767 using ACI.) I thought I had that trapped using the method above, but it appears that it is often a fragment from a previous scan concatenated with the current scan that happens to meet the right number of digits.
My main questions are:
1. Is it better to check # of characters before actually reading the buffer, or just to copy whatever comes into the buffer into a register and then evaluate it?
If the latter is true, let's say "A" comes in. I write it to a register. Do I have to explicitly index to the next register for the each subsequent character, or is there an easier method?
Thanks, and have a good weekend.
Matt