Usina BRAdvPL Guide
Sign in
← All topics
COMMANDUnder review

OPEN SERIAL

OPEN SERIAL nSerial TO hHandle BAUD nBaud BYTESIZE nBits PARITY nParity STOPBITS nStop

Historical reference for opening a serial port.

OPEN SERIALAdvPL
01 · OVERVIEW

Overview

The eADVPL guide documents a port number, handle variable and BAUD, BYTESIZE, PARITY and STOPBITS options. This does not establish support in current SmartClient/AppServer or which machine owns the port. The consulted section does not explain closure/error handling, so the example leaves the instruction commented out. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

OPEN SERIAL nSerial TO hHandle BAUD nBaud BYTESIZE nBits PARITY nParity STOPBITS nStop

Parameters

nSerial
NumericRequired

Port number in the historical guide.

hHandle
Output variableRequired

Destination for the port handle.

nBaud / nBits / nParity / nStop
NumericRequired

Serial options from historical syntax; validate values in the runtime.

Return value

Command: the guide indicates a TO output handle, not a function return.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed562()
    // Commented documentation fragment: opens no port.
    // OPEN SERIAL 1 TO hHandle BAUD 9600 BYTESIZE 8 PARITY 0 STOPBITS 1
    ConOut("OPEN SERIAL")
Return Nil
Expected result

Prints OPEN SERIAL without hardware access. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Confirm runtime, machine, option mapping and closure API before integration. Test with a simulated device first and document timeouts/handle cleanup.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. Guia de Referência eADVPL (histórico). §5.3, p. 28. Accessed on 2026-10-27.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha