oSerialX Object
Description:
 

A Hardware Object that sends and receives serial transmissions on any pin.

Operation:
 

The oSerialX Object uses the I/O line specified by the IOLineS property to send or receive an 8-Bit serial data transmission at the baud rate specified by the Baud property.

When a value is written to the oSerialX Object's Value property, the oSerialX Object will wait until the flow control line indicates that the receiving device is ready to receive a serial transmission at which time the value is sent serially out the I/O line specified.

When the value property is read, the flow control line is set, indicating that the oSerialX Object is ready to receive a serial transmission.  The oSerialX Object then waits for an 8-Bit serial transmission to be received in from the I/O line specified and then returns the 8-Bit value.

When the IOLineF property is set to 0, or it has not been set to an initial value greater than 0, then the flow control functions described above are disabled and the serial transmissions are performed without first checking the flow control status.

Storage size & Availability:
 

The following table lists the size and availability of the oSerialX Object and its variations:

ObjectSizeVersion
oSerialX 5 Bytes B.1.0
Properties:
 

The following table lists the Properties of the oSerialX Object:

Property Description
Address

Returns a pointer to the address of the oSerialX Object instance.

Data-Type: Address, Read-Only

Data-Range: 0 - 127

Baud A value that specifies the baud rate of the serial port.

Data-Type: Nibble

Data-Range: 0 - 7

The following table lists the values of the Baud Property:

BaudConstant Description
1cv1200 The UART communicates at 1200 Baud.
2cv2400 The UART communicates at 2400 Baud.
3cv9600 The UART communicates at 9600 Baud. (Added in Ver B.2.0)
5cv4800 The UART communicates at 4800 Baud.
0, 4, 6, 7  Reserved
InvertF

Inverts the Flow Control logic level.

Data-Type: Bit, Flag

Data-Range: 0 - 1

InvertS

A value that specifies if the logic level of the serial transmissions will be inverted.

Data-Type: Bit, Flag

Data-Range: 0 - 1

IOLineF

A value that specifies the physical I/O Line to use for Flow Control.

Data-Type: Byte

Data-Range: 0 - 31

IOLineS

A value that specifies the physical I/O Line to use for serial communications.

Data-Type: Byte

Data-Range: 0 - 31

Operate

A value that specifies whether or not the data is updated.

Data-Type: Bit, Flag

Data-Range: 0 - 1

Value

A value that when set will be sent serially, and when read will be the value read in serially.

Data-Type: Byte, Default

Data-Range: 0 - 255

Example:
  In the following example, the oSerialX Object is used
'This program creates two oSerialX 
'Objects. One is used to receive a
'serial signal and the other is used
'to send a serial signal. 
'A oDio1 is used to show that while
'the oSerialX object is waiting
'for incoming serial data, the 
'program flow is stopped.

Dim A As New oSerialX
Dim B As New oSerialX
Dim C AS New oDio1

Sub Main()
  C.IOLine = 24
  C.Direction = cvOutput
  B.IOLineS = 23
  B.IOLinef = 18
  B.Baud = cv2400
  A.IOLineS = 22
  A.IOLinef = 16
  A.Baud = cv2400
  Do
    A=B
    C.Invert
  Loop
End Sub
See Also:
 

oSerial - A hardware serial Object.
oSerialPort - A hardware serial Object with a buffer.
oSPI - An Object that provides SPI serial input and output.