4D v13.4RECEIVE BUFFER |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v13.4
RECEIVE BUFFER
RECEIVE BUFFER
RECEIVE BUFFER reads the serial port that was previously opened with SET CHANNEL. The serial port has a buffer that fills with characters until a command reads from the buffer. RECEIVE BUFFER gets the characters from the serial buffer, put them into receiveVar then clears the buffer. If there are no characters in the buffer, then receiveVar will contain nothing. On Windows On Mac OS RECEIVE BUFFER is different from RECEIVE PACKET in that it takes whatever is in the buffer and then immediately returns. RECEIVE PACKET waits until it finds a specific character or until a given number of characters are in the buffer. During the execution of RECEIVE BUFFER, the user can interrupt the reception by pressing Ctrl-Alt-Shift (Windows) or Command-Option-Shift (Macintosh). This interruption generates an error -9994 that you can catch with an error-handling method installed using ON ERR CALL. The project method LISTEN TO SERIAL PORT uses RECEIVE BUFFER to get text from the serial port and accumulate it into a an interprocess variable: ` LISTEN TO SERIAL PORT At this point, any other process can read the interprocess ◊vtBuffer to work with the data coming from the serial port. To stop listening to the serial port, just execute: ` Stop listening to the serial port Note that access to the interprocess ◊vtBuffer variable should be protected by a semaphore, so that processes will not conflict. See the command Semaphore for more information. |
PROPERTIES
Product: 4D
INDEX HISTORY
Modified: 4D v6.8.3 SEE ALSO
ON ERR CALL |
||||||||||||||||||||||||||||||||||||||||||||||||||||||