DADiSP Worksheet Functions > Function Categories > Data Input/Output Functions > OUTPORT

 

OUTPORT

Purpose:

Output 1, 2, or 4 bytes to a port.

Syntax:

OUTPORT(port, value, datatype)

port

-

An integer, the output port

value

-

An integer or real, value to output

datatype

-

Optional. An integer. The type of data to input. Defaults to SBYTE, signed byte.

Returns:

An integer, the actual value written to the port.

Example:

outport(0x11, 32, SBYTE)

 

outputs the single byte value 32 to port 17 (0x11).

Example:

outport(0x11, 32, SINT)

 

outputs the two byte value 32 to port 17 (0x11).

Example:

outport(0x11, 32, LONG)

 

outputs the four byte value 32 to port 17 (0x11).

Remarks:

The datatype parameter may be SBYTE, UBYTE, SINT, UINT, LONG, FLOAT or DOUBLE.

See Also:

CASTBYTE

DOUBLE

FLOAT

INPORT

LONG

SBYTE

SINT

UBYTE

UINT