Hi Pesti,
With the VB MScomm control you can set the parity as following:
Code:
Setting Description
E Even
M Mark
N (Default) None
O Odd
S Space
If you use MARK parity, then the bit after the data word is a logical 1.
If you use SPACE parity, then the bit after the data word is a logical 0.
With MARK parity the slave device will see the data as a 9-bit transmission. (Last bit = 1)
Use the MARK parity to send the address to the slaves.
With SPACE parity the slave device will see the data as a 9-bit transmission. (Last bit = 0)
Use SPACE parity to send the data to the selected slave.

(Click on the picture to enlarge)
(VB pseudocode)
Code:
VB pseudocode
.....
Insert a delay here to ensure that UART FIFO buffer of the PC is
empty before you change the parity. The UART 16550 has up to 16 bytes
for the FIFO transmit buffer.
MSComm.Settings = "9600,M,8,1"
MSComm.Output = (The slave Address)
Insert a delay here to ensure that UART FIFO buffer of the PC is
empty before you change the parity. The UART 16550 has up to 16 bytes
for the FIFO transmit buffer.
MSComm.Settings = "9600,S,8,1"
MSComm.Output = (The data for the selected slave)
.....
From the Windows control panel you can adjust the size of the FIFO buffers of the used serial port.

(Click on the picture to enlarge)
Best regards,
Luciano
Bookmarks