• VEXcode Robotics Logo VEX Robotics Logo
  • VEX API Home Button VEX API Home Button
  • VEX 123 logo in purple VEX 123 logo in white
  • VEX GO logo in lime green VEX GO logo in white
  • VEXcode AIM logo in blue VEXcode AIM logo in white
  • VEX IQ logo in blue VEX IQ logo in white
  • VEX EXP logo in red VEX EXP logo in white
  • VEX V5 logo in red VEX V5 logo in white
  • VEX CTE logo in green VEX CTE logo in white
  • VEX AIR logo in orange VEX AIR logo in white
  • VEXcode VR logo in gold VEXcode VR logo in white
Saltar al contenido principal
Ctrl+K

< Back to Platform Select

  • VEX V5
  • Bienvenido al sitio de referencia de API para VEX V5
  • VEXlink
  • serial_link
Spanish
  • English
  • 简体中文
  • VEXcode Robotics Logo

Navegación de la sección

  • Bloques
  • Python
  • C++
    • Drivetrain
    • Motion
    • Vision
    • Screen
    • Controller
    • Sensing
    • inercial
    • 3-Wire Devices
    • Pneumatics
    • brain
    • SD Card
    • VEXlink
      • message_link
      • serial_link
    • Console
    • Logic
    • electromagnet
    • SD Card
    • competencia

Navegación de la plataforma

  • VEX 123 logo in purple VEX 123 logo in white
  • VEX GO logo in lime green VEX GO logo in white
  • VEXcode AIM logo in blue VEXcode AIM logo in white
  • VEX IQ logo in blue VEX IQ logo in white
  • VEX EXP logo in red VEX EXP logo in white
  • VEX V5 logo in red VEX V5 logo in white
  • VEX CTE logo in green VEX CTE logo in white
  • VEX AIR logo in orange VEX AIR logo in white
  • VEXcode VR logo in gold VEXcode VR logo in white

serial_link#

  • What is a Serial Link?

  • Initializing the SerialLink Class

  • Class Methods

    • send()

    • receive()

  • received()

What is a Serial Link?#

VEXlink enables a V5 Brain to communicate with another V5 Brain, allowing for point-to-point connections and the creation of communication meshes between multiple robots. It supports both wireless and wired communication, with wired connections recommending a modified smart cable to prevent power routing issues. For wireless communication, each robot needs a V5 Robot Radio connected to a Smart Port, and the VEXlink Radio can be used alongside a V5 Controller’s VEXnet radio, which should be connected to the highest numbered Smart Port to avoid conflicts.

The SerialLink class within VEXlink allows for a stream of data to be sent between robots, the contents of the stream needs to be understood by both the transmitting and receiving robot, this class is usually used as part of higher layer of software that encodes and decodes packets as necessary.

To create a VEXlink, both V5 Brains must be connected to a V5 Robot Radio.

Initializing the SerialLink Class#

A VEXlink is created by using the following constructor:

The serial_link constructor creates a serial_link object.

Parameter

Description

port

A valid Smart Port that the VEXlink Radio is connected to.

name

The name of this link. It is recommended that this unique string is long enough that when hashed by vexos it will create a unique ID. A bad link name would be something generic such as “vexlink” as it may be used by another team.

linktype

The type of link, either linkType::manager or linkType::worker. This information is used to correctly configure the radio and also determines available bandwidth for transmission and reception. A manager robot has double the available bandwidth (1040 bytes/second) to send information to the worker robot (520 bytes/second).

wired

Whether or not it is a wired link. Set to true if wired.

// Construct a VEXlink "seriallink" with the serial_link class.
serial_link seriallink = serial_link(PORT1, "Link", linkType::manager);

This seriallink object will be used in all subsequent examples throughout this API documentation when referring to serial_link class methods.

Class Methods#

send()#

The send(buffer) method sends a buffer through the serial link.

Parameters

Description

buffer

A string or bytearray. The message to send.

Returns: An integer representing the length of the message sent.

// Send the string "test".
  seriallink.send("test");

receive()#

The receive(length, timeout) method receives data from the serial link.

Parameters

Description

length

The maximum amount of data to wait for.

timeout

The timeout value in milliseconds before the function returns.

Returns: An integer with the length of the received data.

// Wait for 128 bytes of data for 1000mS.
  int buffer = seriallink.receive(128, 1000);

received()#

The received(callback) method registers a callback function for when data is received.

Parameters

Description

callback

The callback function to be called when data is received.

Returns: None.

anterior

message_link

siguiente

Console

En esta página
  • What is a Serial Link?
  • Initializing the SerialLink Class
  • Class Methods
    • send()
    • receive()
  • received()
Innovation First, International

VEX y VEX Robotics son marcas comerciales o marcas de servicio de Innovation First, Inc. Copyright ©2025Todos los derechos reservados. VEX Robotics, Inc. es una subsidiaria de Innovation First International, Inc. Todos los demás nombres de productos o marcas de terceros son propiedad de sus respectivos dueños. Patentes y/o patentes en trámite - innovationfirst.com/patents
Política de privacidad del sitio / Términos de uso del sitio / Política de cookies / Política de privacidad del software

Visita la página de Facebook de VEX Robotics Visita la página de Twitter de VEX Robotics Visita la página de Instagram de VEX Robotics Visita la página de YouTube de VEX Robotics
Formulario de comentarios de la API de VEX

¡Valoramos tus comentarios! Usa este formulario para compartir sugerencias, felicitaciones o informar errores con la API de VEX. Tus comentarios nos ayudan a mejorar la documentación de la API de VEX.

Si tiene problemas técnicos o necesita asistencia al cliente, visite support.vex.com.

  • Send Happy Feedback
  • Send Sad Feedback

Nota: la URL actual se compartirá con tu mensaje.

Al incluir su dirección de correo electrónico, usted acepta que VEX puede enviarle correos electrónicos si tenemos preguntas sobre sus comentarios.
Política de privacidad >
Por favor, envíenos sus comentarios. ¡Comentarios enviados exitosamente!
Choose Which VEX IQ Generation to View

VEX IQ (1st gen)

VEX IQ (2nd gen)