×
Siemens Industry Online Support
Siemens AG
Entry type: FAQ Entry ID: 26311405, Entry date: 09/17/2007
(0)
Rate

What options exist for using the position or time data from a GPS receiver in an S7-200?

  • Entry
  • Associated product(s)

Configuration notes:
This FAQ describes how to use data from a GPS receiver with an S7-200.

Possible applications:

  • Geographical localization worldwide (position, altitude, speed)
  • Time synchronization worldwide
  • Track&Trace applications in connection with the Micro Automation Set 21 (Entry ID: 22537809)

Requirement:

  • S7-200 CPU224 XP or CPU226 with a second communication interface free
  • GPS receiver with a serial interface and NMEA data format
  • RS232 PC/PPI cable
  • Gender changer (for connecting the serial interface on the GPS receiver to the PC/PPI cable)

Communication:
The GPS receiver cyclically sends ASCII strings (with position, time and system data) in NMEA format to the S7-200.
The S7-200 uses the internal interface in user-programmable communication mode (Freeport). The ASCII strings in the NMEA format are saved in the data block.

NMEA format:
The NMEA format defines how and where data is "packed" in the ASCII string. There are different data records, such as for the geographical position or time.
Each of the data records always begins with a "$" and ends with a "CR" (carriage return) and "LF" (line feed). The actual values lie between these two characters and are separated by commas.

Analysis:
The disclosed data storage values (NMEA format) enable the required user data to be extracted from the ASCII string. This is done by counting the commas.

Sample program and library:
An S7-200 sample program is available here as a basis for separate projects with GPS receivers. This has been developed and tested with a Navilock NL-208P GPS receiver.
An S7-200 library has been generated from the sample program. If the same or an identical receiver is used, the library can be used in a separate project.

Downloads:
The download "GPS_NMEA_v1_2_e.pdf" comprises the German description of the block interfaces. The ZIP file "GPS_NMEA" contains the sample program "GPS_NMEA_RCV.mwp" and the library "gps_nmea_port1.mwl".

GPS_NMEA_v1_2_e.pdf ( 145 KB )

GPS_NMEA.zip ( 24 KB )

Keywords:
GPS, NMEA, Navigation, Time synchronization, Real-time clock

Security information
In order to protect technical infrastructures, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art IT security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about cyber security, please visit
https://www.siemens.com/cybersecurity#Ouraspiration.