========= EPD-FRAME ========= .. sidebar:: Contents .. contents:: :depth: 3 :local: The Ethernet Process Data (EPD-Frame) is a proprietary protocol developed by CAF that allows different devices to exchange information over IP networks. It uses the UDP protocol to encapsulate data and multicast addressing for efficient data distribution. The transmission unit used in this protocol is referred to as a **frame**. Frames can be configured as: - **Source frames**: Periodically transmitted by the device to multicast addresses - **Sink frames**: Periodically received by the device from multicast addresses Each frame is a structured dataset with a variable length of 2^n bytes (where 1 ≤ n ≤ 7, resulting in sizes from 2 to 128 bytes). Data is transmitted over a configured period to a specific multicast address and UDP port defined for each frame type. Frames are considered valid as long as the time between two consecutive frames is less than or equal to five times the configured period. The protocol uses variable types defined in the TCN standard, including TIMEDATE48, REAL32, INTEGER32/16/8, UNSIGNED32/16/8, BITSET32/16/8, CHARACTER8, ENUM4, ANTIVALENT2, and BOOLEAN1. Data variables must be aligned at bit offsets that are multiples of their size in bits. Frame Types =========== The EPD-Frame service supports multiple frame formats, each designed for specific purposes. The available frame types are: eth_router_gps -------------- **Type**: Source This frame format includes GPS data and system information. The frame fields are: - **STS** (offset 0, BITSET16): System status word containing router OK status, cellular module presence, error modes, and connection states - **RSSI_M1** (offset 16, UNSIGNED8): Module 1 signal strength (0 to 255, equivalent to 0 to -255 dBm) - **RSSI_M2** (offset 24, UNSIGNED8): Module 2 signal strength (0 to 255, equivalent to 0 to -255 dBm) - **RSSI_M3** (offset 32, UNSIGNED8): Module 3 signal strength (0 to 255, equivalent to 0 to -255 dBm) - **RSSI_M4** (offset 40, UNSIGNED8): Module 4 signal strength (0 to 255, equivalent to 0 to -255 dBm) - **PROVIDER1_CHAR#** (offset 48-200, UNSIGNED8): Characters 1 to 20 of Provider 1's name - **PROVIDER2_CHAR#** (offset 208-360, UNSIGNED8): Characters 1 to 20 of Provider 2's name - **PROVIDER3_CHAR#** (offset 368-520, UNSIGNED8): Characters 1 to 20 of Provider 3's name - **PROVIDER4_CHAR#** (offset 528-680, UNSIGNED8): Characters 1 to 20 of Provider 4's name - **UPTIME_LifeB** (offset 688, UNSIGNED16): System uptime from startup - **GPS_LATFD** (offset 704, UNSIGNED32): Latitude degrees, fraction part (0 to 99999) - **GPS_LONFD** (offset 736, UNSIGNED32): Longitude degrees, fraction part (0 to 99999) - **GPS_TIME_OF_POS** (offset 768, TIMEDATE48): Moment GPS data is calculated - **GPS_SPEED** (offset 816, UNSIGNED16): Train speed in km/h according to GPS board - **GPS_HEADING** (offset 832, UNSIGNED16): Direction in which the device is traveling - **GPS_LATD** (offset 848, UNSIGNED8): Latitude in decimal degrees (0 to 90) - **GPS_LOND** (offset 856, UNSIGNED8): Longitude in decimal degrees (0 to 180) - **GPS_TIME** (offset 864, TIMEDATE48): Time received by the GPS module - **GPS_HDOP** (offset 912, UNSIGNED8): Horizontal dilution of precision - **GPS_HDOFP** (offset 920, UNSIGNED8): Fraction of horizontal dilution of precision - **GPS_VDOP** (offset 928, UNSIGNED8): Vertical dilution of precision - **GPS_VDOFP** (offset 936, UNSIGNED8): Fraction of vertical dilution of precision - **GPS_STSW** (offset 944, BITSET8): GPS status word (latitude/longitude direction, dead reckoning, simulated position, GPS signal correct) - **GPS_COORDINATE_SYSTEM** (offset 952, UNSIGNED8): Coordinate system to be used (WGS84) - **GPS_GNSS_TYPE** (offset 960, UNSIGNED8): GNSS type (GPS, GLONASS, GALILEO, BEIDOU, IRNSS, etc.) - **GPS_NMBR_SAT** (offset 968, UNSIGNED8): Number of visible satellites - **GPS_SIGNAL_QUALITY** (offset 976, UNSIGNED8): GPS signal quality indicator - **GPS_BOARD_CV** (offset 984, ANTIVALENT2): Control variable associated with the GPS board - **GPS_SIGNAL_CV** (offset 986, ANTIVALENT2): Control variable associated with the GPS signal - **SW_VER** (offset 992, UNSIGNED32): System's OSDx version eth_hmi1_c1_sts_m ----------------- **Type**: Sink This frame format requests EPD frames to be received and parsed in OSDx devices. The frame fields are: - **EVR_Distance** (offset 0, UNSIGNED32): Total distance - **EVR_LifeB** (offset 32, UNSIGNED8): When running, validates all EVR variables - **EVR_TIME_Y_H** (offset 40, UNSIGNED8): BCD format. Local time. 2-digit higher part of year - **EVR_TIME_Y_L** (offset 48, UNSIGNED8): BCD format. Local time. 2-digit lower part of year - **EVR_TIME_MON** (offset 56, UNSIGNED8): BCD format. Local time. Month (1..12) - **EVR_TIME_DAY** (offset 64, UNSIGNED8): BCD format. Local time. Day (1..31) - **EVR_TIME_HOR** (offset 72, UNSIGNED8): BCD format. Local time. Hour (0..23) - **EVR_TIME_MIN** (offset 80, UNSIGNED8): BCD format. Local time. Minutes (0..59) - **EVR_TIME_SEC** (offset 88, UNSIGNED8): BCD format. Local time. Seconds (0..59) - **PLC_LifeB** (offset 96, UNSIGNED8): When running, validates all PLC variables - **PLC_ControlB** (offset 104, BITSET8): PLC control word - **PLC_ModeW** (offset 112, BITSET16): PLC mode word - **PLC_MC_StsW** (offset 128, BITSET16): PLC MC status word - **PLC_TramCompo** (offset 144, BITSET16): Tram composition - **HMI_PPP_GUI** (offset 160, BITSET16): HMI passenger information GUI - **PLC_PPP_AcouConnB_Cmd** (offset 176, BITSET8): Acoustic connection command pulse bits - **PLC_SDIAG_START_UPLOAD** (offset 184, BOOLEAN1): Upload data signal - **PLC_PPP_CT** (offset 192, BITSET16): Control bits for various operations - **PLC_VNumberB** (offset 208, UNSIGNED8): Vehicle number - **PLC_LimitedSpeed** (offset 224, UNSIGNED16): Maximum speed limit due to degraded mode - **PLC_DriverID** (offset 240, UNSIGNED16): Driver ID - **PLC_TPP_PICPulsado** (offset 256, BITSET32): Picture pulsed state bits - **PLC_TempOut** (offset 288, INTEGER8): Outside temperature - **EVR_Speed** (offset 304, UNSIGNED16): Tram speed according to speed sensors - **HMI_LifeB** (offset 320, UNSIGNED8): When running, validates HMI variables - **HMI_TempIn** (offset 328, INTEGER8): Inside temperature. Return flow temperature - **PLC_PPP_PICPulsadoAco** (offset 352, BITSET32): Picture pulsed acoustic state bits - **PLC_PPP_MsgDBCode** (offset 512, UNSIGNED16): Message code to be played from database - **PLC_PPP_SetRouteID1-4** (offset 528-552, CHARACTER8): Route number characters - **PLC_PPP_SetStationID1-4** (offset 560-584, CHARACTER8): Station index characters - **PLC_PPP_MsgPrio** (offset 592, UNSIGNED8): Message priority (0 lowest to 100 highest) - **PLC_PPP_CabVolumeSet** (offset 600, ENUM4): Cabin volume level (1 to 10) - **PLC_PPP_ExtVolumeSet** (offset 608, ENUM4): External volume level (1 to 10) - **PLC_PPP_SalVolumeSet** (offset 616, ENUM4): Saloon volume level (1 to 10) - **PLC_RearCamMon_LLowCab1/2** (offset 624-648, UNSIGNED8): Camera selection for TFT fields - **PLC_RearCamMon_LLowCab1/2_Prop** (offset 632-648, BITSET8): Camera rotation and mirror properties - **PLC_RearCamMon_LUppCab1/2** (offset 656-680, UNSIGNED8): Upper cabin camera selection - **PLC_RearCamMon_LUppCab1/2_Prop** (offset 664-680, BITSET8): Upper cabin camera properties - **PLC_RearCamMon_RLowCab1/2** (offset 688-712, UNSIGNED8): Right low cabin camera selection - **PLC_RearCamMon_RLowCab1/2_Prop** (offset 696-712, BITSET8): Right low cabin camera properties - **PLC_RearCamMon_RUppCab1/2** (offset 720-744, UNSIGNED8): Right upper cabin camera selection - **PLC_RearCamMon_RUppCab1/2_Prop** (offset 728-744, BITSET8): Right upper cabin camera properties - **PLC_CCTV_CT** (offset 784, BITSET16): CCTV control bits - **PLC_CCTV_TFT_BrightLevel** (offset 800, UNSIGNED8): Brightness level - **EVR_Time_CV** (offset 1018, ANTIVALENT2): EVR time control variable - **PLC_VNumberB_CV** (offset 1020, ANTIVALENT2): Vehicle number control variable - **EVR_Speed_CV** (offset 1022, ANTIVALENT2): Speed control variable eth_hmi1_c2_sts_m ----------------- **Type**: Sink This frame format requests EPD frames to be received and parsed in OSDx devices. The frame fields are identical to eth_hmi1_c1_sts_m. eth_router_sts2_m ----------------- **Type**: Source This frame format includes system information. The 128-byte frame contains: - **Conf_ID** (offset 0, UNSIGNED16): Configuration identification number set by configuration - **Not defined** (offset 16-1023): Free for future use The frame allows dynamic field addition through operational commands, making it flexible for custom field definitions. Configuration ============= This service is only available in H5-Rail devices and its configuration is under the 'service' path. The syntax to configure :osdx:cfg:`service epd-frame`: is: .. code-block:: none set service epd-frame [ ... ] This path has the following parameters: * ``type``: defines the frame type and format to be configured * ``log-level``: set the priority of logs related to epd-frame. By default is error. Frame Type Configuration ------------------------ The ``type`` parameter specifies whether the frame is ``source`` (transmitted) or ``sink`` (received), followed by the frame format. .. code-block:: none set service epd-frame type format address
port period Available frame types and formats: - **source formats**: ``eth-router-gps``, ``eth-router-sts2-m`` - **sink formats**: ``eth-hmi1-c1-sts-m``, ``eth-hmi1-c2-sts-m`` Parameters: * ``type``: ``source`` (transmitted) or ``sink`` (received) * ``format``: Frame format identifier * ``address``: Multicast IP address for the frame * ``port``: UDP port number (1-65535) * ``period``: Frame transmission/reception period in milliseconds Additional parameters for specific formats: * ``gps``: GPS source identifier (only for eth-router-gps format) * ``config-id``: Configuration identification number 0-256 (only for eth-router-sts2-m format) .. code-block:: none set service epd-frame type source format eth-router-gps gps set service epd-frame type source format eth-router-sts2-m config-id set service epd-frame log-level Examples ======== Source Frame: eth-router-gps ----------------------------- Configuration example for GPS and system information frame: .. code-block:: none admin@osdx$ set service epd-frame type source format eth-router-gps address 239.33.0.80 admin@osdx$ set service epd-frame type source format eth-router-gps gps gps0 admin@osdx$ set service epd-frame type source format eth-router-gps period 512 admin@osdx$ set service epd-frame type source format eth-router-gps port 2127 Source Frame: eth-router-sts2-m -------------------------------- Configuration example for customizable system information frame: .. code-block:: none admin@osdx$ set service epd-frame type source format eth-router-sts2-m address 239.33.0.82 admin@osdx$ set service epd-frame type source format eth-router-sts2-m config-id 5 admin@osdx$ set service epd-frame type source format eth-router-sts2-m period 64 admin@osdx$ set service epd-frame type source format eth-router-sts2-m port 2129 Sink Frame: eth-hmi1-c1-sts-m ------------------------------ Configuration example for frame eth-hmi1-c1-sts-m: .. code-block:: none admin@osdx$ set service epd-frame type sink format eth-hmi1-c1-sts-m address 239.33.0.1 admin@osdx$ set service epd-frame type sink format eth-hmi1-c1-sts-m port 2048 admin@osdx$ set service epd-frame type sink format eth-hmi1-c1-sts-m period 128 Sink Frame: eth-hmi1-c2-sts-m ------------------------------ Configuration example for frame eth-hmi1-c2-sts-m: .. code-block:: none admin@osdx$ set service epd-frame type sink format eth-hmi1-c2-sts-m address 239.33.0.2 admin@osdx$ set service epd-frame type sink format eth-hmi1-c2-sts-m port 2049 admin@osdx$ set service epd-frame type sink format eth-hmi1-c2-sts-m period 128 .. :doc:`Here `, you can find an example related to epd-frames. Monitoring commands =================== The EPD-Frame service provides operational commands to monitor and customize frame variables. Reading Frame Variables ----------------------- To read a variable from a sink frame (received frames): .. code-block:: none service epd-frame read .. note:: When using variable names in commands, replace underscores (_) with hyphens (-) and convert all letters to lowercase. For example, ``EVR_LifeB`` becomes ``evr-lifeb``. Example: .. code-block:: none admin@osdx$ service epd-frame read eth-hmi1-c1-sts-m evr-lifeb EPD frame information: --------------------------- evr-lifeb: 12 Writing Frame Variables ----------------------- To write custom values to source frames (transmitted frames): .. code-block:: none service epd-frame write add service epd-frame write delete service epd-frame write list-epd Variable types: - ``bitset``: Bitset type (size: 1-32 bits) - ``unsigned``: Unsigned integer type (size: 8, 16, or 32 bits) - ``antivalent``: Antivalent type (size: 2 bits) Add custom value ~~~~~~~~~~~~~~~~ .. code-block:: none admin@osdx$ service epd-frame write eth-router-gps add unsigned 8 32 25 OK This command adds a custom unsigned integer value of 25 at offset 32 (8 bits size). For bitset and antivalent types, values must be in binary format (e.g., "10110011"): .. code-block:: none admin@osdx$ service epd-frame write eth-router-gps add bitset 16 48 1010101010101010 OK admin@osdx$ service epd-frame write eth-router-gps add antivalent 2 100 01 OK List custom values ~~~~~~~~~~~~~~~~~~ .. code-block:: none admin@osdx$ service epd-frame write eth-router-gps list-epd 0. Offset[32]: 25 1. Offset[48]: 43690 -EPD frames sent: 1523 Delete custom values ~~~~~~~~~~~~~~~~~~~~ Delete a specific custom value by ID: .. code-block:: none admin@osdx$ service epd-frame write eth-router-gps delete 0 Value removed successfully Delete all custom values: .. code-block:: none admin@osdx$ service epd-frame write eth-router-gps delete all All values have been removed successfully Notes ~~~~~ - **Sink frames** (eth-hmi1-c1-sts-m, eth-hmi1-c2-sts-m) are used to **read** variables from received frames - **Source frames** (eth-router-gps, eth-router-sts2-m) are used to **write/customize** variables in transmitted frames - Offset values must be specified in bits - For unsigned integers, offset must be a multiple of 8 - Binary values for bitset/antivalent must match the specified size Command Summary =============== .. osdx:cmdtree:: cfg :maxdepth: 8 service epd-frame .. osdx:cmdtree:: op :maxdepth: 5 service epd-frame