GPS FUNCTION BLOCK

The GPS function block performs 3 different functions:

1.       When SET_PLC input to the block is active the function block will transfer the GPS 100 00 time to the PLC time of day clock.

2.       When SET_GPS input to the block is active or when the GPS function block detects that the GPS 100 00 card has gone through a power on reset sequence the function block will transfer the PLC time of day clock to the GPS 100 00 card.

3.       The GPS function block continuously updates the time registers, GPS receiver status registers and the GPS position and velocity registers.

                      ____________________

                     |                    |

                     |        GPS         |

                     |                    |

             BOOL ---| SET_PLC      ERROR |--- BOOL  

             BOOL ---| SET_GPS            |           

                     |           GPS_DATA |--- GpsCardData

              INT ---| IW_ADDR      PULSE |--- GpsPulse

              INT ---| MW_ADDR            |

                     |            GPS_CLK |--- BOOL

              INT ---| OFFSET    IRIG_CLK |--- BOOL

             BOOL ---| IEEE1344  INTERNAL |--- BOOL

                     |                    |

                     |               GOOD |--- BOOL

                     |               FAIR |--- BOOL

                     |               POOR |--- BOOL

                     |                BAD |--- BOOL

                     |____________________|

 

GPS FUNCTION BLOCK INPUTS

SET_PLC
The SET_PLC input is a Boolean input.  A rising edge on the SET_PLC input will cause the PLC time of day clock to be set from the GPS 100 card.

SET_GPS
The SET_GPS input is a Boolean input.  A rising edge on the SET_GPS input will cause the GPS 100 card time to be set from the PLC time of day clock.

IW_ADDRESS- Address of First 3x Input in I/O Map

The GPS function block must read the values from the GPS module through 3x inputs.  The number entered here is an offset from 3X0000.  Register 3X0001 is addressed as 1.  Please note that the address entered here must match a 3x address as entered in the PLC's I/O map for the GPS module. 

MW_ADDRESS - Address of First 4x Input in I/O Map

The GPS function block must write the commands to the GPS module through 4x registers. .  The number entered here is an offset from 4X0000.  Register 4X0001 is addressed as 1.  Please note that the address entered here must match a 4x address as entered in the PLC's I/O map for the GPS module.

OFFSET
The offset to be added to the time received from the GPS or IRIG-B inputs. This allows the time to be converted to local time. The value can range from + 23 hours to – 23 hours. This value is written to the first 4X register addressed by the card.

IEEE1344
The standard IRIG-B time code signal does not include year information. As a result, the function block will use the year from the PLC time of day clock to update its clock when it is locked on to an IRIG-B source. The IEEE1344 extension to the IRIG-B specification encodes the year in the IRIG-B signal. When this input is set True, the function block will decode the year information from the IRIG-B signal. This option is not currently supported by the GPS 100 00 hardware. 

GPS FUNCTION BLOCK OUTPUTS

ERROR
The ERROR output is set true when there is a configuration error. Refer to the GPS_DATA structure for detailed error information.

GPS_DATA
The GPS_DATA output expects a data type of GpsCardData which is defined as follows:

typedef struct       GpsCardData

       {

       int    EfbError;

       int    DayOfWeek;          

       int    Month;                    

       int    Day;                

       int    Year;               

       int    Hour;               

       int    Minute;                   

       int    Second;                   

       int    Millisecond;        

       int    LongYear;           

       int    EfbVersion;         

       int    FirmwareVersion;    

       int    GpsStatus;          

       int    NumSats;            

       float  Latitude;           

       float  Longitude;          

       float  Altitude;           

       float  EastVelocity;       

       float  NorthVelocity;            

       float  UpVelocity;         

       int    TimeQuality; 

       bool   TimeGood;

       bool   TimeFair;

       bool   TimePoor;

       bool   TimeBad;

       bool   GpsClock;

       bool   IrigClock;

       bool   InternalClock;                   

       };

 

EfbError - GPS Function Block Error Status
This register contains the GPS function block error status. Its primary purpose is to aid debugging during the programming and testing of the ladder logic program. Whenever a bit is turned on, a certain error condition is present.      

Bit

Error Condition

15

The Time of Day Clock has not been configured in the PLC’s configuration.

13

An invalid 4X register address has been entered.

12

An invalid 3X register address has been entered.

DayOfWeek - Day of Week
1 = Sunday, 2 = Monday, … 7 = Saturday

Month - Month of Year
The current month of the year.

Day - Day of Month
The day of the month

Year – Year
The current year. (0 – 99)

Hour – Hour
The current hour.

Minute – Minute
The current minute.

Second – Second
The current second.

Millisecond – Millisecond
The current millisecond.

LongYear – Year
The current year as a 16 bit integer.  ( 1984 – 65536)

EfbVersion – EFB Function Block Version Number
This register contains the GPS function block version number.

FirmwareVersion - GPS 100 00 Card Firmware Version Number
This register contains the GPS 100 00 card firmware version number.

GpsStatus - GPS Status
The GPS status register contains information about the satellite tracking status of the GPS receiver.
0 = Fix not available
1 = Non-differential GPS fix available
2 = Differential GPS fix available

NumSats – Number of Satellites
The number of satellites currently being tracked by the GPS receiver.

Latitude - Latitude Position (Single Precision)
The current latitude in +/- ddmm.mmmm format. Positive being North latitude and negative being South latitude.  

Longitude – Longitude Position (Single Precision)
The current longitude in +/- dddmm.mmmm format. Positive being East longitude and negative being West longitude.

Altitude - Altitude Position (Single Precision)
The antenna height above or below mean sea level, -9999.9 to 99999.9 meters.

EastVelocity - East Velocity (Single Precision)
Not supported by the GPS 300 00 receiver.

NorthVelocity - North Velocity (Single Precision)
Not Supported by the GPS 300 00 receiver.

UpVelocity - Up Velocity (Single Precision)
Not Supported by the GPS 300 00 receiver.

TimeQuality - Time Quality
The current time quality.
0 = Good
1 = Fair
2 = Poor
3 = Bad.

TimeGood
The TimeGood output is of the type Boolean. It will be true when the time quality is good.

TimeFair
The TimeFair output is of the type Boolean. It will be true when the time quality is fair.

TimePoor
The TimePoor output is of the type Boolean. It will be true when the time quality is poor.

TimeBad
The TimeBad output is of the type Boolean. It will be true when the time quality is bad.

GpsClock
The GpsClock output is of the type Boolean.  It will be true when the GPS 100 card is using the GPS receiver as the time source.

IrigClock
The IrigClock output is of the type Boolean.  It will be true when the GPS 100 card is using the IRIG-B time code signal as the time source.

InternalClock
The InternalClock output is of the type Boolean.  It will be true when the GPS 100 card is using its crystal oscillator as the time source.

PULSE
The PULSE output expects a data type of  GpsPulse which is defined as follows:

typedef struct       GpsPulse

       {

       bool   Second;

       bool   Minute;

       bool   Hour;

       bool   Day;

       bool   Week;

       bool   Month;

       bool   Year;               

       };

 

Second
This One Pulse per Second output will transition from a 0 to a 1 for one scan cycle at the start of every second.

 

Minute
This One Pulse per Minute output will transition from a 0 to a 1 for one scan cycle at the start of every minute.

 

Hour
This One Pulse per Hour output will transition from a 0 to a 1 for one scan cycle at the start of every hour.

 

Day
This One Pulse per Day output will transition from a 0 to a 1 for one scan cycle at the start of every day.

 

Week
This One Pulse per Week output will transition from a 0 to a 1 for one scan cycle at the start of every week.

 

Month
This One Pulse per Month output will transition from a 0 to a 1 for one scan cycle at the start of every month.

 

Year
This One Pulse per Year output will transition from a 0 to a 1 for one scan cycle at the start of every year.