What options exist for using the position or time data from a GPS receiver in an S7-200?
This FAQ describes how to use data from a GPS receiver with an S7-200.
- Geographical localization worldwide (position, altitude, speed)
- Time synchronization worldwide
- Track&Trace applications in connection with the Micro Automation Set 21 (Entry ID: 22537809)
- 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)
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.
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.
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.
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 )
GPS, NMEA, Navigation, Time synchronization, Real-time clock