Borrar filtros
Borrar filtros

How to send commands to gps via usb and defined as a serial port?

7 visualizaciones (últimos 30 días)
Philip Nahmias
Philip Nahmias el 14 de Dic. de 2018
Comentada: ZICHENG el 4 de Mzo. de 2020
Hello,
I am reading data from the BU-353S4 gps unit and have defined the connection as a serial/com. It receives commands in the NMEA system in order to define what outputs to give. This commands have the following format:
Enable WAAS/EGNOS - $PSRF151,01*0F
Disable WAAS/EGNOS - $PSRF151,00*0E
Enable GGA Output 1sec - $PSRF103,0,0,1,1*25
Disable GGA Output - $PSRF103,0,0,0,1*24
Enable GLL Output 1sec - $PSRF103,1,0,1,1*24
Disable GLL Output - $PSRF103,1,0,0,1*25
Enable GSA Output 5sec - $PSRF103,2,0,5,1*23
Disable GSA Output - $PSRF103,2,0,0,1*26
Enable GSV Output 10sec - $PSRF103,3,0,10,1*16
Disable GSV Output - $PSRF103,3,0,0,1*27
Enable RMC Output 1sec - $PSRF103,4,0,1,1*21
Disable RMC Output - $PSRF103,4,0,0,1*20
Enable VTG Output 1sec - $PSRF103,5,0,1,1*20
Disable VTG Output - $PSRF103,5,0,0,1*21
Enable ZDA Output 1sec - $PSRF103,8,0,1,1*2D
Disable ZDA Output - $PSRF103,8,0,0,1*2C
The commands start with the $ sign. How can I send any of these to the gps through MATLAB?

Respuestas (1)

Walter Roberson
Walter Roberson el 14 de Dic. de 2018
serial(). set properties. fopen(). fprintf() to send data. fclose when done.
  2 comentarios
Philip Nahmias
Philip Nahmias el 14 de Dic. de 2018
Hey Walter,
first of all thank you for your response. I have tried both fprintf() and fwritef() and neither have worked. One possible reason I think may be because I cant enter a return (enter) character in the sent string and as a result the gps just ignores the sent command. Any suggestions on how I can correct that?

Iniciar sesión para comentar.

Categorías

Más información sobre Vehicle Network Toolbox en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by