diff --git a/CANape/CANape.ini b/CANape/CANape.ini index 983c722..929c8ac 100644 --- a/CANape/CANape.ini +++ b/CANape/CANape.ini @@ -6,7 +6,7 @@ ;------------------------------------------------------------------------------- [!!!!!_CONSISTENCY_CHECK_START_SECTION_!!!!!] -GUID={B327033E-837B-41D7-9A2B-FB4C0400BC89} +GUID={580211CD-AEFD-422D-AB18-0ECAFC0A9D24} [FILE_INFO] Identification=CANape-Project-File @@ -22,8 +22,8 @@ CreationTime=22:29 CreationDate=09/06/2020 ; Month/Day/Year Protected=0 CurrentWindowsACP=1252 -ModificationTime=00:08 -ModificationDate=08/31/2024 ; Month/Day/Year +ModificationTime=18:51 +ModificationDate=09/25/2024 ; Month/Day/Year [CANAPE] @@ -513,7 +513,7 @@ MDF_WRITE_INVAL_BITS=1 ; 0x10 Show trigger messages (if a trigger is fired) ; 0x20 Show command messages (with a hand symbol) ; As default all messages are shown -SHOW_MESSAGES=255 +SHOW_MESSAGES=4351 LOG=0 LOGFILE=WriteWindow_log.TXT LOG_OVERWRITE=0 @@ -1092,7 +1092,7 @@ RIGHTPANE2HEIGHT=-2 TREEX=530 TREEY=1709 ACTIVEPANE=1 -SELECTED_TREENODE=Geräte/xcp_lite_Device/Protokoll/Event-Liste +SELECTED_TREENODE=Geräte/xcp_lite_Device/Protokoll/Transportschicht FIRSTVISIBLE_TREENODE=Geräte TREEEXPAND_COUNT=7 TREEEXPAND_0=Geräte @@ -1626,8 +1626,8 @@ FIELD_DISPLAY_CSUS_HEIGHT_dpi96=0 FIELD_DISPLAY_REMARK_HEIGHT_dpi96=0 FIELD_DISPLAY_DATE_HEIGHT_dpi96=0 FIELD_DISPLAY_SD_FIELDS_HEIGHT_dpi96=0 -PREDEFINED_ENTRY_00=---2024-08-30T23:58:05 -PREDEFINED_ENTRY_01=changed2024-08-30T23:58:05 +PREDEFINED_ENTRY_00=---2024-09-25T08:31:48 +PREDEFINED_ENTRY_01=changed2024-09-25T08:31:48 [RIBBON] ISMINIMIZED=0 @@ -2062,7 +2062,7 @@ MDF_SELECT_SORT_UPWARD=1 LAST_PAGE_NAME_DLG_FILTER= LAST_PAGE_ID_DLG_FILTER=1504 LAST_PAGE_NAME_DLG_VARIABLE= -LAST_PAGE_ID_DLG_VARIABLE=21029 +LAST_PAGE_ID_DLG_VARIABLE=21048 1 EDITOR_SHOW_TOOLTIPS=1 EDITOR_SHOW_DISPLAY_NAMES=0 @@ -2898,7 +2898,7 @@ SUPPRESS_EVENT_DETECTION=1 CONNECT_MODE=0x00 CONNECT_MODE_FOR_FLASH=0xFFFFFFFF XCP_MAXCTO=248 -XCP_MAXDTO=7968 +XCP_MAXDTO=6992 XCP_COMM_MODE_BASIC=0x80 XCP_MAX_DLC_REQUIRED=0 XCP_MAX_DLC=8 @@ -2914,7 +2914,7 @@ XCP_COMM_MODE_PGM=0x00 XCP_DAQ_PROPERTIES=0x51 -XCP_DAQ_KEY_BYTE=0x40 +XCP_DAQ_KEY_BYTE=0xF0 XCP_DAQ_TIMESTAMP_MODE=0x3C XCP_DAQ_TIMESTAMP_TICKS=1 XCP_MIN_DAQ=0 @@ -2987,7 +2987,7 @@ OVERRUN_HANDLING=0 -EVENT_COUNT=14 +EVENT_COUNT=15 EVENT_CHANNEL_0=0x0000 EVENT_CHANNEL_1=0x0001 @@ -3125,7 +3125,7 @@ DAQ_TIMEOUT=0 DAQ_RESUME_SUPPORTED=0 DAQ_PRESCALER_SUPPORTED=0 DAQ_SINGLE_EVENT=1 -DTO_SINGLE_EXT=0 +DTO_SINGLE_EXT=1 DOUBLE_AS_FLOAT=0 ODT_ENTRY_ADDRESS_OPT_DISABLED=0 FLOAT32_AS_FLOAT16=0 @@ -3138,7 +3138,7 @@ PSEUDO_CAN_ID_START=2415919104 DSP_MODE=0 DAQ_LIST_AUTODETECT=0 DAQ_COUNT=0 -DAQ_CONFIG_ID=33510 +DAQ_CONFIG_ID=31993 DAQ_START_STOP_ALL_DISABLED=0 INIT_CAL_PAGE_SEGMENTWISE=0 CALRAM_CHECK_INITIAL_PAGE=1 @@ -3272,7 +3272,7 @@ PACKET_CTR=0 -HOST=192.168.179.2 +HOST=192.168.8.128 PORT=5555 LOCAL_PORT=9999 TRANSPORT_LAYER_PROTOCOL=1 @@ -3424,7 +3424,7 @@ EVENT_SAMPLE_UNIT_13=3 EVENT_MODE_13=4 EVENT_PRIO_13=0 EVENT_MAX_DAQ_LIST_13=255 -EVENT_NAME_13=task2_static +EVENT_NAME_13=task2_inst_10 EVENT_MULTISAMPLES_13=0 EVENT_MIN_CYCLE_TIME_CYCLE_13=0 EVENT_MIN_CYCLE_TIME_UNIT_13=9 @@ -3437,7 +3437,7 @@ XCP_OPTIONAL_CMD_AVAILABLE_2=2 XCP_OPTIONAL_CMD_AVAILABLE_3=2 XCP_OPTIONAL_CMD_AVAILABLE_4=2 XCP_OPTIONAL_CMD_AVAILABLE_5=2 -XCP_OPTIONAL_CMD_AVAILABLE_6=3 +XCP_OPTIONAL_CMD_AVAILABLE_6=4 XCP_OPTIONAL_CMD_AVAILABLE_7=3 XCP_OPTIONAL_CMD_AVAILABLE_8=2 XCP_OPTIONAL_CMD_AVAILABLE_9=2 @@ -3565,7 +3565,7 @@ CALRAM_SECTOR_ADDR_EXT_4=0x00 CALRAM_SECTOR_ATTRIBUTE_4=0x00000000 CALRAM_SECTOR_FLASH_OFFSET_4=0x00000000 CALRAM_SECTOR_ADDRESS_MAPPING_4= -EVENT_CHANNEL_14=0x000B +EVENT_CHANNEL_14=0x000E EVENT_CHANNEL_15=0x000D EVENT_CHANNEL_16=0x000E EVENT_CHANNEL_17=0x000F @@ -3656,7 +3656,7 @@ EVENT_CHANNEL_101=0x0063 EVENT_CHANNEL_102=0x8003 EVENT_CHANNEL_103=0x0064 EVENT_CHANNEL_104=0x0065 -EVENT_CYCLE_14=15 +EVENT_CYCLE_14=0 EVENT_CYCLE_15=15 EVENT_CYCLE_16=15 EVENT_CYCLE_17=15 @@ -4111,7 +4111,7 @@ EVENT_MAX_DAQ_LIST_101=255 EVENT_MAX_DAQ_LIST_102=255 EVENT_MAX_DAQ_LIST_103=255 EVENT_MAX_DAQ_LIST_104=255 -EVENT_NAME_14=task1_11 +EVENT_NAME_14=task2_static EVENT_NAME_15=task2_13 EVENT_NAME_16=task2_14 EVENT_NAME_17=task2_15 @@ -4606,10 +4606,10 @@ ColWidthTransparent_dpi96=77 [ModuleExplorer_xcp_lite] ScreenDPIinSection=192 -POSX=4461 -POSX_dpi96=2231 -POSY=434 -POSY_dpi96=217 +POSX=450 +POSX_dpi96=225 +POSY=184 +POSY_dpi96=92 SIZEX=2030 SIZEX_dpi96=1015 SIZEY=1900 @@ -5473,6 +5473,64 @@ SortUpward=1 [MEASUREMENT_DISPLAY_SELECT_DYNAMIC_COLUMNS] Count=0 +[DEVICE_EXPLORER_COLUMNLIST_CHANNELS] +ScreenDPIinSection=192 +ColumnCount=4 +Column_0=0, 306 +Column_0_dpi96=0, 153 +Column_1=1245185, 132 +Column_1_dpi96=1245185, 66 +Column_2=1245186, 66 +Column_2_dpi96=1245186, 33 +Column_3=1245187, 106 +Column_3_dpi96=1245187, 53 +ColumnIdSort=-1 +SortUpward=1 + +[DEVICE_EXPLORER_COLUMNLIST_DEVICES] +ScreenDPIinSection=192 +ColumnCount=10 +Column_0=34, 64 +Column_0_dpi96=34, 32 +Column_1=0, 172 +Column_1_dpi96=0, 86 +Column_2=131078, 104 +Column_2_dpi96=131078, 52 +Column_3=131103, 98 +Column_3_dpi96=131103, 49 +Column_4=131079, 178 +Column_4_dpi96=131079, 89 +Column_5=262145, 298 +Column_5_dpi96=262145, 149 +Column_6=131085, 248 +Column_6_dpi96=131085, 124 +Column_7=131080, 160 +Column_7_dpi96=131080, 80 +Column_8=131081, 180 +Column_8_dpi96=131081, 90 +Column_9=196609, 192 +Column_9_dpi96=196609, 96 +ColumnIdSort=-1 +SortUpward=1 + +[DEVICE_EXPLORER_COLUMNLIST_NETWORKS] +ScreenDPIinSection=192 +ColumnCount=6 +Column_0=34, 64 +Column_0_dpi96=34, 32 +Column_1=0, 304 +Column_1_dpi96=0, 152 +Column_2=983041, 192 +Column_2_dpi96=983041, 96 +Column_3=983042, 530 +Column_3_dpi96=983042, 265 +Column_4=983043, 252 +Column_4_dpi96=983043, 126 +Column_5=983044, 300 +Column_5_dpi96=983044, 150 +ColumnIdSort=-1 +SortUpward=1 + [MEASUREMENT_DISPLAY] ScreenDPIinSection=192 POSX=126 @@ -5486,8 +5544,8 @@ SIZEY_dpi96=845 SHOWTOOLBAR=1 SHOWSTATUSBAR=1 SHOWGRID=0 -RIGHTPANE2HEIGHT=596 -RIGHTPANE2HEIGHT_dpi96=298 +RIGHTPANE2HEIGHT=326 +RIGHTPANE2HEIGHT_dpi96=163 TREEX=524 TREEX_dpi96=262 TREEY=1499 @@ -5802,64 +5860,6 @@ MODE=12 VALUE_COUNT=0 HISTORY_COUNT=0 -[DEVICE_EXPLORER_COLUMNLIST_CHANNELS] -ScreenDPIinSection=192 -ColumnCount=4 -Column_0=0, 306 -Column_0_dpi96=0, 153 -Column_1=1245185, 132 -Column_1_dpi96=1245185, 66 -Column_2=1245186, 66 -Column_2_dpi96=1245186, 33 -Column_3=1245187, 106 -Column_3_dpi96=1245187, 53 -ColumnIdSort=-1 -SortUpward=1 - -[DEVICE_EXPLORER_COLUMNLIST_DEVICES] -ScreenDPIinSection=192 -ColumnCount=10 -Column_0=34, 64 -Column_0_dpi96=34, 32 -Column_1=0, 172 -Column_1_dpi96=0, 86 -Column_2=131078, 104 -Column_2_dpi96=131078, 52 -Column_3=131103, 98 -Column_3_dpi96=131103, 49 -Column_4=131079, 178 -Column_4_dpi96=131079, 89 -Column_5=262145, 298 -Column_5_dpi96=262145, 149 -Column_6=131085, 248 -Column_6_dpi96=131085, 124 -Column_7=131080, 160 -Column_7_dpi96=131080, 80 -Column_8=131081, 180 -Column_8_dpi96=131081, 90 -Column_9=196609, 192 -Column_9_dpi96=196609, 96 -ColumnIdSort=-1 -SortUpward=1 - -[DEVICE_EXPLORER_COLUMNLIST_NETWORKS] -ScreenDPIinSection=192 -ColumnCount=6 -Column_0=34, 64 -Column_0_dpi96=34, 32 -Column_1=0, 304 -Column_1_dpi96=0, 152 -Column_2=983041, 192 -Column_2_dpi96=983041, 96 -Column_3=983042, 530 -Column_3_dpi96=983042, 265 -Column_4=983043, 252 -Column_4_dpi96=983043, 126 -Column_5=983044, 300 -Column_5_dpi96=983044, 150 -ColumnIdSort=-1 -SortUpward=1 - [POSTPROCESS_OPTIONS] POSTPROC_MODE=0 @@ -5867,5 +5867,5 @@ POSTPROC_MODE=0 Count=0 [~~~~~_CONSISTENCY_CHECK_END_SECTION_~~~~~] -GUID={B327033E-837B-41D7-9A2B-FB4C0400BC89} +GUID={580211CD-AEFD-422D-AB18-0ECAFC0A9D24} diff --git a/CANape/XCPlite.cna b/CANape/XCPlite.cna index 2de7c0f..a9beefd 100644 --- a/CANape/XCPlite.cna +++ b/CANape/XCPlite.cna @@ -10,8 +10,8 @@ PrgDate=08.07.2024 Description= CreationTime=23:25 CreationDate=04/18/2021 ; Month/Day/Year -ModificationTime=00:08 -ModificationDate=08/31/2024 ; Month/Day/Year +ModificationTime=18:51 +ModificationDate=09/25/2024 ; Month/Day/Year Protected=0 CurrentWindowsACP=1252 @@ -25,13 +25,13 @@ Count=0 Count=22 [CALIBRATION_OBJECT_1] -EditOffset=10000 +EditOffset=1 EditFactor=2 EditFormat=2 ShowWorkingPoint=0 FollowWorkingPoint=0 Module=xcp_lite -Name=CalPage.cycle_time_us +Name=CalPage.cycle_time_ms StimMode=0 IsFallback=0 @@ -305,7 +305,7 @@ OptionCSVListSeparator=0 OptionCSVExport=0 OptionMARMFExport=0 OptionMARMFExtended=0 -OptionSuppressCASLRuntimeErrors=0 +OptionSuppressCASLRuntimeErrors=1 FromTime=-1 FromActive=0 FromTimePartActive=0 @@ -458,10 +458,10 @@ ApplyColorToBackground=0 ColorFunction=0 ColorFunctionScope=1 LineTyp=2 -YMinHome=0 -YMaxHome=0.005 -YMin=0 -YMax=0.005 +YMinHome=-0.002 +YMaxHome=0.018 +YMin=-0.002 +YMax=0.018 XOffsetNS=0 XOffset=0 ValueFormat=3 @@ -476,7 +476,7 @@ LineWidth=1 Precision=-2 Digits=6 Enabled=1 -StoredFocused=1 +StoredFocused=0 SublMask=1 MeaSublMask=3 LockScaling=0 @@ -544,10 +544,10 @@ ApplyColorToBackground=0 ColorFunction=0 ColorFunctionScope=1 LineTyp=2 -YMinHome=0 -YMaxHome=0.005 -YMin=0 -YMax=0.005 +YMinHome=-0.002 +YMaxHome=0.018 +YMin=-0.002 +YMax=0.018 XOffsetNS=0 XOffset=0 ValueFormat=3 @@ -679,9 +679,9 @@ ColorFunction=0 ColorFunctionScope=1 LineTyp=2 YMinHome=0 -YMaxHome=0.1 +YMaxHome=0.2 YMin=0 -YMax=0.1 +YMax=0.2 XOffsetNS=0 XOffset=0 ValueFormat=3 @@ -696,7 +696,7 @@ LineWidth=1 Precision=-2 Digits=6 Enabled=1 -StoredFocused=0 +StoredFocused=1 SublMask=1 MeaSublMask=3 LockScaling=0 @@ -1499,8 +1499,8 @@ GUID=DISPLAY_256249ed-1aca-470d-8b4b-efcba0f64df1 Module=xcp_lite Name=counter Disabled=0 -Mode=1 -Rate=1000 +Mode=2147483651 +Rate=0 Row=0 Column=0 MeaReferenced=0 @@ -2091,7 +2091,7 @@ GlobalCursorTime=0 GlobalCursorTimeNs=0 GlobalTimeAxis=1 GlobalTimeAxisStartTime=0 -GlobalTimeAxisEndTime=6411955595 +GlobalTimeAxisEndTime=102919508422 MainWindowPos=1, 167, 10, 3416, 2068 ;cmd, x, y, w, h [PAR_COMMENT] @@ -2293,18 +2293,18 @@ Column_0=21, 74 Column_0_dpi96=21, 37 Column_1=22, 156 Column_1_dpi96=22, 78 -Column_2=23, 998 -Column_2_dpi96=23, 499 +Column_2=23, 1332 +Column_2_dpi96=23, 666 Title=Write Type=128 Comment=Write-Fenster Number=1 GUID=WINDOW_4798d7f2-90e2-4365-b34a-8aacad84f1a4 ScreenDPIinSection=192 -Position=0, 1566, 1422, 1286, 224 ;cmd, x, y, w, h -Position_dpi96=0, 783, 711, 643, 112 ;cmd, x, y, w, h -Position_Page01=0, 1566, 1422, 1286, 224 ;cmd, x, y, w, h -Position_Page01_dpi96=0, 783, 711, 643, 112 ;cmd, x, y, w, h +Position=0, 1566, 766, 1286, 880 ;cmd, x, y, w, h +Position_dpi96=0, 783, 383, 643, 440 ;cmd, x, y, w, h +Position_Page01=0, 1566, 766, 1286, 880 ;cmd, x, y, w, h +Position_Page01_dpi96=0, 783, 383, 643, 440 ;cmd, x, y, w, h FloatingWindow=0 ShowSignalComments=1 DisplayMask=1 ; pages 1 @@ -2400,8 +2400,8 @@ DisplayMask=1 ; pages 1 XLen=28204 XMin=0 XMinNs=0 -XMax=6411 -XMaxNs=6411955595 +XMax=102919 +XMaxNs=102919508422 Grid=1 Mark=0 YValue=2 @@ -2471,8 +2471,8 @@ COL_0_dpi96=31, 120 XLen=28204 XMin=0 XMinNs=0 -XMax=6411 -XMaxNs=6411955595 +XMax=102919 +XMaxNs=102919508422 Grid=1 Mark=1 YValue=2 @@ -2541,9 +2541,9 @@ COL_0_dpi96=31, 120 [WINDOW_5] ProgID= PROPERTIES_COUNT=1 -PROPERTY_1={"Version":"1.3.0.0","Configuration":{"ArrayWindowSubControlConfiguration":{"NumericGraphicCompositeWidth":337,"NumericGraphicCompositeHeight":271,"LegendCoordinatePoint":{"X":0,"Y":0},"LegendWidth":0,"LegendHeight":0,"LegendLayoutGroupSizeWidth":0,"LegendLayoutGroupSizeHeight":0,"NumericCoordinatePoint":{"X":1,"Y":24},"NumericWidth":335,"NumericHeight":246,"NumericLayoutGroupSizeWidth":335,"NumericLayoutGroupSizeHeight":246,"Intersection2DXWCoordinatePoint":{"X":0,"Y":0},"Intersection2DXWWidth":0,"Intersection2DXWHeight":0,"Intersection2DXWLayoutGroupSizeWidth":0,"Intersection2DXWLayoutGroupSizeHeight":0,"Intersection2DYWCoordinatePoint":{"X":0,"Y":0},"Intersection2DYWWidth":0,"Intersection2DYWHeight":0,"Intersection2DYWLayoutGroupSizeWidth":0,"Intersection2DYWLayoutGroupSizeHeight":0,"Graphic3DCoordinatePoint":{"X":0,"Y":0},"Graphic3DWidth":0,"Graphic3DHeight":0,"Graphic3DLayoutGroupSizeWidth":0,"Graphic3DLayoutGroupSizeHeight":0},"ShowCalibrationBar":true,"ShowHorizontalChartLines":false,"ShowVerticalChartLines":false,"NonSelectedIntersectionLineTransparency":0.75,"FocusedValueSymbol":"DEVICE:\"xcp_lite\":\"CalPage.run\":P","ValueObjectConfigurations":[{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage.cycle_time_us\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":0,"ValueAxisMax":1000000000000,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"calpage00.task1_cycle_time_us\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":0,"ValueAxisMax":4294967295,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"calpage00.task2_cycle_time_us\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":0,"ValueAxisMax":4294967295,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage.run\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":0,"ValueAxisMax":255,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage.run1\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":0,"ValueAxisMax":255,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage.run2\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":0,"ValueAxisMax":255,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage2.period\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":0,"ValueAxisMax":1000,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage2.ampl\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":0,"ValueAxisMax":400,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage1.counter_max\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":0,"ValueAxisMax":1000000,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage1.TestInts.test_bool\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":0,"ValueAxisMax":255,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage1.TestInts.test_i8\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":-128,"ValueAxisMax":127,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage1.TestInts.test_u8\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":2,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":0,"ValueAxisMax":255,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage1.TestInts.test_i16\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":-32768,"ValueAxisMax":32767,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage1.TestInts.test_u16\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":2,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":0,"ValueAxisMax":65535,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage1.TestInts.test_f32\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":-1000000000000,"ValueAxisMax":1000000000000,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage1.TestInts.test_i32\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":-2147483648,"ValueAxisMax":2147483647,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage1.TestInts.test_u32\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":2,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":0,"ValueAxisMax":4294967295,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage1.TestInts.test_f64\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":-1000000000000,"ValueAxisMax":1000000000000,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"static_vars.test_u32\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":0,"ValueAxisMax":4294967295,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"static_vars.test_f64\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":-1000000000000,"ValueAxisMax":1000000000000,"CustomAxisLabels":["","","","","",""]}],"NumericGraphicControlPosition":0,"NumericGraphicControlSelectedTab":0,"GraphicControlPosition":4,"Height2DXControl":1,"Height2DYControl":1,"Height3DControl":2,"HeightNumericControl":1,"HeightChartControl":1,"HeightLegendControl":0.45,"Width2DXControl":1,"Width2DYControl":1,"Width3DControl":2,"WidthNumericControl":2,"WidthChartControl":2,"WidthLegendControl":0.3,"HeightValueControl":1,"WidthValueControl":1,"HeightNumericGraphicControl":1,"WidthNumericGraphicControl":1,"Height2DChartsControl":1,"Width2DChartsControl":1,"IsXAxisHeightSynchronizedBetweenCharts":true,"SyncedXAxisHeight":NaN,"XWChartXAxisHeight":NaN,"YWChartXAxisHeight":NaN,"LegendPosition":0,"LegendViewType":0,"LegendTableColumnAttributes":[{"TypeId":"1048594","Size":40},{"TypeId":"1048601","Size":45},{"TypeId":"31","Size":100},{"TypeId":"3","Size":250},{"TypeId":"16","Size":70},{"TypeId":"1048627","Size":100},{"TypeId":"1048631","Size":100},{"TypeId":"1048634","Size":100}],"LegendTabItemAttributes":[{"TypeId":"31","Size":100}],"FlipAxes":false,"AxisDisplayNameMode":3,"ReversedAxis":[false,false],"ShowUnits":false,"ShowObjectColor":false,"SortDescending":false,"SortAttributeId":null,"ShowWorkingPointHistory":false,"NumericViewValueObjectDisplayOption":1,"ValueColumnWidth":124,"ValueColumnWidthDouble":124,"ParameterGroup":"","ModuleName":"","GroupIsFunction":false,"NumericControlAxisAttributes":[],"NumericControlColumnAttributes":[{"TypeId":"31","Size":189}],"ChartViewValueObjectDisplayOption":1,"SerializationCameraPosition":{"X":1,"Y":1,"Z":-1},"SerializationCameraTarget":{"X":0,"Y":0.5,"Z":0},"IsValueAnnotationRotated":false,"EquidistantAxisPoints":false,"BarThickness":1,"WorkingPointMarker":0,"LinearWorkingPointInterpolation":true,"ShowAllIntersectionLines":false,"IsValueAxisIndependent":true,"TickLabelRotationAngle":-90,"IsTickLabelRotationEnabled":false,"IsTickLabelRightAligned":false,"ShowBoundarySurface":true,"ShowBoundarySurfaceGradient":false,"ShowCursorAsCrosshair":false,"XAxisAutoRange":true,"ValueAxisAutoRange":true,"ShowAllValueAxes":false,"CurrentColumnChartType":0,"SerializationCursorCrosshairColor":{"R":0,"G":0,"B":0,"A":255},"AlignBarToZero":true,"DefaultChartViewType":2,"AttributeColumnPositioning":2}} +PROPERTY_1={"Version":"1.3.0.0","Configuration":{"ArrayWindowSubControlConfiguration":{"NumericGraphicCompositeWidth":337,"NumericGraphicCompositeHeight":271,"LegendCoordinatePoint":{"X":0,"Y":0},"LegendWidth":0,"LegendHeight":0,"LegendLayoutGroupSizeWidth":0,"LegendLayoutGroupSizeHeight":0,"NumericCoordinatePoint":{"X":1,"Y":24},"NumericWidth":335,"NumericHeight":246,"NumericLayoutGroupSizeWidth":335,"NumericLayoutGroupSizeHeight":246,"Intersection2DXWCoordinatePoint":{"X":0,"Y":0},"Intersection2DXWWidth":0,"Intersection2DXWHeight":0,"Intersection2DXWLayoutGroupSizeWidth":0,"Intersection2DXWLayoutGroupSizeHeight":0,"Intersection2DYWCoordinatePoint":{"X":0,"Y":0},"Intersection2DYWWidth":0,"Intersection2DYWHeight":0,"Intersection2DYWLayoutGroupSizeWidth":0,"Intersection2DYWLayoutGroupSizeHeight":0,"Graphic3DCoordinatePoint":{"X":0,"Y":0},"Graphic3DWidth":0,"Graphic3DHeight":0,"Graphic3DLayoutGroupSizeWidth":0,"Graphic3DLayoutGroupSizeHeight":0},"ShowCalibrationBar":true,"ShowHorizontalChartLines":false,"ShowVerticalChartLines":false,"NonSelectedIntersectionLineTransparency":0.75,"FocusedValueSymbol":"DEVICE:\"xcp_lite\":\"calpage00.task1_cycle_time_us\":P","ValueObjectConfigurations":[{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage.cycle_time_ms\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":0,"ValueAxisMax":4294967295,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"calpage00.task1_cycle_time_us\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":0,"ValueAxisMax":4294967295,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"calpage00.task2_cycle_time_us\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":0,"ValueAxisMax":4294967295,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage.run\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":0,"ValueAxisMax":255,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage.run1\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":0,"ValueAxisMax":255,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage.run2\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":0,"ValueAxisMax":255,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage2.period\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":0,"ValueAxisMax":1000,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage2.ampl\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":0,"ValueAxisMax":400,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage1.counter_max\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":0,"ValueAxisMax":1000000,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage1.TestInts.test_bool\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":0,"ValueAxisMax":255,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage1.TestInts.test_i8\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":-128,"ValueAxisMax":127,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage1.TestInts.test_u8\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":2,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":0,"ValueAxisMax":255,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage1.TestInts.test_i16\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":-32768,"ValueAxisMax":32767,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage1.TestInts.test_u16\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":2,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":0,"ValueAxisMax":65535,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage1.TestInts.test_f32\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":-1000000000000,"ValueAxisMax":1000000000000,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage1.TestInts.test_i32\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":-2147483648,"ValueAxisMax":2147483647,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage1.TestInts.test_u32\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":2,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":0,"ValueAxisMax":4294967295,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"CalPage1.TestInts.test_f64\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":-1000000000000,"ValueAxisMax":1000000000000,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"static_vars.test_u32\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":0,"ValueAxisMax":4294967295,"CustomAxisLabels":["","","","","",""]},{"Symbol":"DEVICE:\"xcp_lite\":\"static_vars.test_f64\":P","SerializationColor":{"R":0,"G":0,"B":0,"A":255},"Collapsed":false,"SerializationFrameColor":{"R":0,"G":0,"B":0,"A":255},"ValueFormat":0,"AxisValueFormats":[],"NumericFormat":4,"AxisNumericFormats":[],"NumericFormatDigits":6,"IsActive":true,"CurrentChartViewType":2,"PointMarker":1,"IsValueAnnotationEnabled":false,"ValueAxisMin":-1000000000000,"ValueAxisMax":1000000000000,"CustomAxisLabels":["","","","","",""]}],"NumericGraphicControlPosition":0,"NumericGraphicControlSelectedTab":0,"GraphicControlPosition":4,"Height2DXControl":1,"Height2DYControl":1,"Height3DControl":2,"HeightNumericControl":1,"HeightChartControl":1,"HeightLegendControl":0.45,"Width2DXControl":1,"Width2DYControl":1,"Width3DControl":2,"WidthNumericControl":2,"WidthChartControl":2,"WidthLegendControl":0.3,"HeightValueControl":1,"WidthValueControl":1,"HeightNumericGraphicControl":1,"WidthNumericGraphicControl":1,"Height2DChartsControl":1,"Width2DChartsControl":1,"IsXAxisHeightSynchronizedBetweenCharts":true,"SyncedXAxisHeight":NaN,"XWChartXAxisHeight":NaN,"YWChartXAxisHeight":NaN,"LegendPosition":0,"LegendViewType":0,"LegendTableColumnAttributes":[{"TypeId":"1048594","Size":40},{"TypeId":"1048601","Size":45},{"TypeId":"31","Size":100},{"TypeId":"3","Size":250},{"TypeId":"16","Size":70},{"TypeId":"1048627","Size":100},{"TypeId":"1048631","Size":100},{"TypeId":"1048634","Size":100}],"LegendTabItemAttributes":[{"TypeId":"31","Size":100}],"FlipAxes":false,"AxisDisplayNameMode":3,"ReversedAxis":[false,false],"ShowUnits":false,"ShowObjectColor":false,"SortDescending":false,"SortAttributeId":null,"ShowWorkingPointHistory":false,"NumericViewValueObjectDisplayOption":1,"ValueColumnWidth":124,"ValueColumnWidthDouble":124,"ParameterGroup":"","ModuleName":"","GroupIsFunction":false,"NumericControlAxisAttributes":[],"NumericControlColumnAttributes":[{"TypeId":"31","Size":189}],"ChartViewValueObjectDisplayOption":1,"SerializationCameraPosition":{"X":1,"Y":1,"Z":-1},"SerializationCameraTarget":{"X":0,"Y":0.5,"Z":0},"IsValueAnnotationRotated":false,"EquidistantAxisPoints":false,"BarThickness":1,"WorkingPointMarker":0,"LinearWorkingPointInterpolation":true,"ShowAllIntersectionLines":false,"IsValueAxisIndependent":true,"TickLabelRotationAngle":-90,"IsTickLabelRotationEnabled":false,"IsTickLabelRightAligned":false,"ShowBoundarySurface":true,"ShowBoundarySurfaceGradient":false,"ShowCursorAsCrosshair":false,"XAxisAutoRange":true,"ValueAxisAutoRange":true,"ShowAllValueAxes":false,"CurrentColumnChartType":0,"SerializationCursorCrosshairColor":{"R":0,"G":0,"B":0,"A":255},"AlignBarToZero":true,"DefaultChartViewType":2,"AttributeColumnPositioning":2}} OBJECTS_COUNT=20 -OBJECT_1=DEVICE:"xcp_lite":"CalPage.cycle_time_us":P +OBJECT_1=DEVICE:"xcp_lite":"CalPage.cycle_time_ms":P OBJECT_2=DEVICE:"xcp_lite":"calpage00.task1_cycle_time_us":P OBJECT_3=DEVICE:"xcp_lite":"calpage00.task2_cycle_time_us":P OBJECT_4=DEVICE:"xcp_lite":"CalPage.run":P @@ -4606,7 +4606,7 @@ GUID=DISPLAY_d595f5f6-5f42-499a-8541-61348e0e30ba [WINDOW_5_OBJECT_1] Type=2 Module=xcp_lite -Name=CalPage.cycle_time_us +Name=CalPage.cycle_time_ms Window=5 Index=0 Color=0 @@ -4617,7 +4617,7 @@ LineTyp=2 YMinHome=0 YMaxHome=4294967295 YMin=0 -YMax=1e+12 +YMax=4294967295 XOffsetNS=0 XOffset=0 ValueFormat=3 @@ -4650,7 +4650,7 @@ Row=0 Col=0 YAxis_ID=0 AxisTemplate= -GUID=DISPLAY_85c0783b-9671-4773-b57f-864147007165 +GUID=DISPLAY_9e16bc8e-856d-4a84-a5f5-87811f9901e8 [WINDOW_5_OBJECT_10] Type=2 @@ -4699,7 +4699,7 @@ Row=0 Col=0 YAxis_ID=0 AxisTemplate= -GUID=DISPLAY_2d9fc052-3e54-4d04-aabb-769ee6b20d38 +GUID=DISPLAY_81859a1f-c6a0-4879-ba09-4f08cec3885c [WINDOW_5_OBJECT_11] Type=2 @@ -4748,7 +4748,7 @@ Row=0 Col=0 YAxis_ID=0 AxisTemplate= -GUID=DISPLAY_ccbbe436-0613-450a-939c-3c64237e179b +GUID=DISPLAY_b600a8d4-39ce-463c-b839-910bf0b85b3b [WINDOW_5_OBJECT_12] Type=2 @@ -4797,7 +4797,7 @@ Row=0 Col=0 YAxis_ID=0 AxisTemplate= -GUID=DISPLAY_5052be02-f936-47b5-a987-25a5c2822f19 +GUID=DISPLAY_6b0b67c5-6152-4420-a0f8-c96dfcde6e91 [WINDOW_5_OBJECT_13] Type=2 @@ -4846,7 +4846,7 @@ Row=0 Col=0 YAxis_ID=0 AxisTemplate= -GUID=DISPLAY_0b439f60-f97e-493d-a761-894f708b843f +GUID=DISPLAY_5a68bb48-4632-45de-ac18-c5df1e5b64f4 [WINDOW_5_OBJECT_14] Type=2 @@ -4895,7 +4895,7 @@ Row=0 Col=0 YAxis_ID=0 AxisTemplate= -GUID=DISPLAY_a6dc0949-d738-4b3b-ab4b-46a82fd4656d +GUID=DISPLAY_cfa8d3c1-553d-46fd-b5e0-a55e09f34edf [WINDOW_5_OBJECT_15] Type=2 @@ -4944,7 +4944,7 @@ Row=0 Col=0 YAxis_ID=0 AxisTemplate= -GUID=DISPLAY_190b012c-abdf-4bda-980b-eef0a0d261a9 +GUID=DISPLAY_387a84b7-5968-4b95-bffc-fa8665644d02 [WINDOW_5_OBJECT_16] Type=2 @@ -4993,7 +4993,7 @@ Row=0 Col=0 YAxis_ID=0 AxisTemplate= -GUID=DISPLAY_391a1969-70bf-4df6-88d3-6b7aadc0f08f +GUID=DISPLAY_8221e514-8ce7-4292-bf2e-4e00d683d121 [WINDOW_5_OBJECT_17] Type=2 @@ -5042,7 +5042,7 @@ Row=0 Col=0 YAxis_ID=0 AxisTemplate= -GUID=DISPLAY_4f058c03-1395-4ed0-a25f-584a529f0c1f +GUID=DISPLAY_40d2ba55-188a-4ae3-a321-1aeaf0a13450 [WINDOW_5_OBJECT_18] Type=2 @@ -5091,7 +5091,7 @@ Row=0 Col=0 YAxis_ID=0 AxisTemplate= -GUID=DISPLAY_25c82f34-3176-45cf-abe3-1ebad093ee70 +GUID=DISPLAY_8db49101-9821-49d9-bc11-eb8282b1a550 [WINDOW_5_OBJECT_19] Type=2 @@ -5140,7 +5140,7 @@ Row=0 Col=0 YAxis_ID=0 AxisTemplate= -GUID=DISPLAY_f0f99509-e43e-46dd-8fc5-800a2f11633b +GUID=DISPLAY_14e1632f-ef05-4173-be6b-69b549e3d3c9 [WINDOW_5_OBJECT_2] Type=2 @@ -5189,7 +5189,7 @@ Row=0 Col=0 YAxis_ID=0 AxisTemplate= -GUID=DISPLAY_973a5ea6-11a1-4012-b044-5842502a4f5a +GUID=DISPLAY_86797472-66ba-44b6-8129-638e3f28874e [WINDOW_5_OBJECT_20] Type=2 @@ -5238,7 +5238,7 @@ Row=0 Col=0 YAxis_ID=0 AxisTemplate= -GUID=DISPLAY_5c628e78-2c65-4bee-ba08-0a12da2fdd6b +GUID=DISPLAY_beb344c7-1921-4157-83bd-ac895828e413 [WINDOW_5_OBJECT_3] Type=2 @@ -5287,7 +5287,7 @@ Row=0 Col=0 YAxis_ID=0 AxisTemplate= -GUID=DISPLAY_371e55a8-062f-4881-b135-289ae41a7bc0 +GUID=DISPLAY_fcd29271-0b97-486a-9bbe-bd6e15fb80ea [WINDOW_5_OBJECT_4] Type=2 @@ -5336,7 +5336,7 @@ Row=0 Col=0 YAxis_ID=0 AxisTemplate= -GUID=DISPLAY_aad1f804-154a-4770-9847-6ffc2221ffb9 +GUID=DISPLAY_80fad12d-5811-4486-882f-a8d3e1b23285 [WINDOW_5_OBJECT_5] Type=2 @@ -5385,7 +5385,7 @@ Row=0 Col=0 YAxis_ID=0 AxisTemplate= -GUID=DISPLAY_89e73a6d-70e6-43ff-b42e-89102d7f3616 +GUID=DISPLAY_009c740d-1731-49d6-88e5-db3b02d1252b [WINDOW_5_OBJECT_6] Type=2 @@ -5434,7 +5434,7 @@ Row=0 Col=0 YAxis_ID=0 AxisTemplate= -GUID=DISPLAY_55c1913c-5868-4fb9-954f-7952287d1d78 +GUID=DISPLAY_392efd9e-e965-4f63-b13f-3999f86a04a3 [WINDOW_5_OBJECT_7] Type=2 @@ -5483,7 +5483,7 @@ Row=0 Col=0 YAxis_ID=0 AxisTemplate= -GUID=DISPLAY_4768d740-b3ad-4381-afd0-25bb39fa66c6 +GUID=DISPLAY_cb7b9112-e2b1-4a56-9654-fea62f5279d4 [WINDOW_5_OBJECT_8] Type=2 @@ -5532,7 +5532,7 @@ Row=0 Col=0 YAxis_ID=0 AxisTemplate= -GUID=DISPLAY_1b4c8fc1-f564-4b33-8d45-f5b2912bd988 +GUID=DISPLAY_20e64337-f5a6-4218-84d5-bd44ff5ddb83 [WINDOW_5_OBJECT_9] Type=2 @@ -5581,7 +5581,7 @@ Row=0 Col=0 YAxis_ID=0 AxisTemplate= -GUID=DISPLAY_98690201-8797-46c0-ac88-9775602aec93 +GUID=DISPLAY_1788c0c4-1c26-4376-bddd-0269644b4831 [WINDOW_6] ProgID=CNPTRACE.TraceCtrl.1 @@ -5686,7 +5686,7 @@ GridTitleHeight=10 GridX=0 GridY=0 InterpolateWorkingPoint=0 -LastFocus=CalBar_5325 +LastFocus=SpreadSheet LeftCol=1 LegendWindowSelectionMode=0 LegendWindowSizeInPercent=0.152317880795 @@ -5950,8 +5950,8 @@ ValueFormat=3 Count=10 [Y_COMMON_AXIS_1] -YMin=0 -YMax=0.005 +YMin=-0.002 +YMax=0.018 ValueFormat=3 AxisTemplate= LockScaling=0 @@ -5959,8 +5959,8 @@ ID=1 Comment= Color=65535 Name=Dt -YMin-Home=0 -YMax-Home=0.005 +YMin-Home=-0.002 +YMax-Home=0.018 DisplayOnlyComment=0 XAxisGroup=0 diff --git a/CANape/xcp_lite_autodetect.a2l b/CANape/xcp_lite_autodetect.a2l index de71b2f..4c6159d 100644 --- a/CANape/xcp_lite_autodetect.a2l +++ b/CANape/xcp_lite_autodetect.a2l @@ -130,7 +130,7 @@ OPTIONAL_LEVEL1_CMD GET_VERSION /end PROTOCOL_LAYER /begin DAQ - DYNAMIC 0 14 0 OPTIMISATION_TYPE_DEFAULT ADDRESS_EXTENSION_FREE IDENTIFICATION_FIELD_TYPE_RELATIVE_BYTE GRANULARITY_ODT_ENTRY_SIZE_DAQ_BYTE 0xF8 OVERLOAD_INDICATION_PID + DYNAMIC 0 15 0 OPTIMISATION_TYPE_DEFAULT ADDRESS_EXTENSION_FREE IDENTIFICATION_FIELD_TYPE_RELATIVE_BYTE GRANULARITY_ODT_ENTRY_SIZE_DAQ_BYTE 0xF8 OVERLOAD_INDICATION_PID /begin TIMESTAMP_SUPPORTED 0x1 SIZE_DWORD UNIT_1US TIMESTAMP_FIXED /end TIMESTAMP_SUPPORTED @@ -148,11 +148,12 @@ /begin EVENT "task2_inst_7" "task2__7" 10 DAQ 0xFF 0 0 0 CONSISTENCY DAQ /end EVENT /begin EVENT "task2_inst_8" "task2__8" 11 DAQ 0xFF 0 0 0 CONSISTENCY DAQ /end EVENT /begin EVENT "task2_inst_9" "task2__9" 12 DAQ 0xFF 0 0 0 CONSISTENCY DAQ /end EVENT -/begin EVENT "task2_static" "task2_st" 13 DAQ 0xFF 0 0 0 CONSISTENCY DAQ /end EVENT +/begin EVENT "task2_inst_10" "task2__10" 13 DAQ 0xFF 0 0 0 CONSISTENCY DAQ /end EVENT +/begin EVENT "task2_static" "task2_st" 14 DAQ 0xFF 0 0 0 CONSISTENCY DAQ /end EVENT /end DAQ -/begin XCP_ON_UDP_IP 0x104 5555 ADDRESS "172.19.11.24" /end XCP_ON_UDP_IP +/begin XCP_ON_UDP_IP 0x104 5555 ADDRESS "192.168.8.128" /end XCP_ON_UDP_IP /end IF_DATA @@ -162,11 +163,11 @@ /begin CHARACTERISTIC static_vars.test_u32 "Test static u32" VALUE 0x148278 U32 0 NO_COMPU_METHOD 0 4294967295 ECU_ADDRESS_EXTENSION 1 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 2 /end DAQ_EVENT /end IF_DATA /end CHARACTERISTIC /begin GROUP Cal "" /begin REF_CHARACTERISTIC calpage00.task1_cycle_time_us calpage00.task2_cycle_time_us static_vars.test_f64 static_vars.test_u32 /end REF_CHARACTERISTIC /end GROUP -/begin CHARACTERISTIC CalPage.cycle_time_us "main task cycle time" VALUE 0x80010000 U32 0 NO_COMPU_METHOD 0 4294967295 PHYS_UNIT "us" /end CHARACTERISTIC +/begin CHARACTERISTIC CalPage.cycle_time_ms "main task cycle time" VALUE 0x80010000 U32 0 NO_COMPU_METHOD 0 4294967295 PHYS_UNIT "ms" /end CHARACTERISTIC /begin CHARACTERISTIC CalPage.run "" VALUE 0x80010004 U8 0 NO_COMPU_METHOD 0 1 PHYS_UNIT "bool" /end CHARACTERISTIC /begin CHARACTERISTIC CalPage.run1 "" VALUE 0x80010005 U8 0 NO_COMPU_METHOD 0 1 PHYS_UNIT "bool" /end CHARACTERISTIC /begin CHARACTERISTIC CalPage.run2 "" VALUE 0x80010006 U8 0 NO_COMPU_METHOD 0 1 PHYS_UNIT "bool" /end CHARACTERISTIC -/begin GROUP CalPage "" /begin REF_CHARACTERISTIC CalPage.cycle_time_us CalPage.run CalPage.run1 CalPage.run2 /end REF_CHARACTERISTIC /end GROUP +/begin GROUP CalPage "" /begin REF_CHARACTERISTIC CalPage.cycle_time_ms CalPage.run CalPage.run1 CalPage.run2 /end REF_CHARACTERISTIC /end GROUP /begin CHARACTERISTIC CalPage1.TestInts.test_bool "" VALUE 0x8002002A U8 0 NO_COMPU_METHOD 0 255 /end CHARACTERISTIC /begin CHARACTERISTIC CalPage1.TestInts.test_f32 "" VALUE 0x80020020 F32 0 NO_COMPU_METHOD -1000000000000 1000000000000 /end CHARACTERISTIC @@ -191,9 +192,11 @@ /begin MEASUREMENT array1 "" FLOAT64_IEEE NO_COMPU_METHOD 0 0 -1000000000000 1000000000000 PHYS_UNIT "" ECU_ADDRESS 0x3F7F4 ECU_ADDRESS_EXTENSION 2 MATRIX_DIM 256 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 3 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT /begin COMPU_METHOD channel.Conv "" LINEAR "%6.3" "Volt" COEFFS_LINEAR 1 0 /end COMPU_METHOD -/begin MEASUREMENT channel "sine: f64" FLOAT64_IEEE channel.Conv 0 0 -1000000000000 1000000000000 PHYS_UNIT "Volt" ECU_ADDRESS 0xD0000 ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 13 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT +/begin MEASUREMENT channel "sine: f64" FLOAT64_IEEE channel.Conv 0 0 -1000000000000 1000000000000 PHYS_UNIT "Volt" ECU_ADDRESS 0xE0000 ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 14 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT /begin COMPU_METHOD channel_1.Conv "" LINEAR "%6.3" "Volt" COEFFS_LINEAR 1 0 /end COMPU_METHOD /begin MEASUREMENT channel_1 "sine: f64" FLOAT64_IEEE channel_1.Conv 0 0 -1000000000000 1000000000000 PHYS_UNIT "Volt" ECU_ADDRESS 0x40000 ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 4 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT +/begin COMPU_METHOD channel_10.Conv "" LINEAR "%6.3" "Volt" COEFFS_LINEAR 1 0 /end COMPU_METHOD +/begin MEASUREMENT channel_10 "sine: f64" FLOAT64_IEEE channel_10.Conv 0 0 -1000000000000 1000000000000 PHYS_UNIT "Volt" ECU_ADDRESS 0xD0000 ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 13 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT /begin COMPU_METHOD channel_2.Conv "" LINEAR "%6.3" "Volt" COEFFS_LINEAR 1 0 /end COMPU_METHOD /begin MEASUREMENT channel_2 "sine: f64" FLOAT64_IEEE channel_2.Conv 0 0 -1000000000000 1000000000000 PHYS_UNIT "Volt" ECU_ADDRESS 0x50000 ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 5 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT /begin COMPU_METHOD channel_3.Conv "" LINEAR "%6.3" "Volt" COEFFS_LINEAR 1 0 /end COMPU_METHOD @@ -221,7 +224,7 @@ /begin GROUP mainloop "" /begin REF_MEASUREMENT mainloop_counter1 mainloop_counter2 /end REF_MEASUREMENT /end GROUP /begin GROUP task1 "" /begin REF_MEASUREMENT array1 counter counter_u16 counter_u32 counter_u64 counter_u8 /end REF_MEASUREMENT /end GROUP -/begin GROUP task2_inst "" /begin REF_MEASUREMENT channel_1 channel_2 channel_3 channel_4 channel_5 channel_6 channel_7 channel_8 channel_9 /end REF_MEASUREMENT /end GROUP +/begin GROUP task2_inst "" /begin REF_MEASUREMENT channel_1 channel_10 channel_2 channel_3 channel_4 channel_5 channel_6 channel_7 channel_8 channel_9 /end REF_MEASUREMENT /end GROUP /end MODULE /end PROJECT diff --git a/build.rs b/build.rs index 2430702..bf0f4a1 100644 --- a/build.rs +++ b/build.rs @@ -49,6 +49,7 @@ fn main() { .file("xcplib/src/platform.c") .file("xcplib/src/xcpLite.c") .file("xcplib/src/xcpTlQueue.c") + .file("xcplib/src/xcpTl.c") .file("xcplib/src/xcpEthTl.c") .file("xcplib/src/xcpEthServer.c") .flag("-O2") @@ -65,6 +66,8 @@ fn main() { println!("cargo:rerun-if-changed=xcplib/src/platform.c"); println!("cargo:rerun-if-changed=xcplib/src/xcpTlQueue.h"); println!("cargo:rerun-if-changed=xcplib/src/xcpTlQueue.c"); + println!("cargo:rerun-if-changed=xcplib/src/xcpTl.h"); + println!("cargo:rerun-if-changed=xcplib/src/xcpTl.c"); println!("cargo:rerun-if-changed=xcplib/src/xcpEthTl.h"); println!("cargo:rerun-if-changed=xcplib/src/xcpEthTl.c"); println!("cargo:rerun-if-changed=xcplib/src/xcpEthServer.h"); diff --git a/src/reg/registry/a2l_writer.rs b/src/reg/registry/a2l_writer.rs index 613380d..88c530f 100644 --- a/src/reg/registry/a2l_writer.rs +++ b/src/reg/registry/a2l_writer.rs @@ -27,7 +27,7 @@ impl GenerateA2l for RegistryXcpTransportLayer { let port = self.port; let addr = self.addr; trace!("write transport layer: {protocol} {addr}:{port}"); - format!(r#"/begin XCP_ON_{protocol}_IP 0x104 {port} ADDRESS "{addr}" /end XCP_ON_UDP_IP"#) + format!(r#"/begin XCP_ON_{protocol}_IP 0x104 {port} ADDRESS "{addr}" /end XCP_ON_{protocol}_IP"#) } } diff --git a/src/xcp.rs b/src/xcp.rs index 251db12..9b06e43 100644 --- a/src/xcp.rs +++ b/src/xcp.rs @@ -581,9 +581,9 @@ impl Xcp { None } - pub fn tl_transmit_queue_next(&self, len: u16) { + pub fn tl_transmit_queue_next(&self) { unsafe { - xcplib::XcpTlTransmitQueueNextMsg(len); + xcplib::XcpTlTransmitQueueNextMsg(); } } diff --git a/src/xcplite.rs b/src/xcplite.rs index d1384bd..9f51a9e 100644 --- a/src/xcplite.rs +++ b/src/xcplite.rs @@ -34,7 +34,7 @@ extern "C" { pub fn XcpTlTransmitQueuePeekMsg(msg_len: *mut u16) -> *const u8; } extern "C" { - pub fn XcpTlTransmitQueueNextMsg(msg_len: u16); + pub fn XcpTlTransmitQueueNextMsg(); } extern "C" { pub fn XcpInit(); diff --git a/tests/xcp_server_task.rs b/tests/xcp_server_task.rs index 407f988..5f4e3e1 100644 --- a/tests/xcp_server_task.rs +++ b/tests/xcp_server_task.rs @@ -59,7 +59,7 @@ where // Empty the transmit queue while let Some(buf) = xcp.tl_transmit_queue_peek() { socket.send_to(buf, addr).await?; - xcp.tl_transmit_queue_next(buf.len() as u16); + xcp.tl_transmit_queue_next(); log::trace!("xcp_task: Sent {} bytes to {}", buf.len(), client_addr.unwrap()); } } diff --git a/tests/xcp_test_executor.rs b/tests/xcp_test_executor.rs index d6bfa92..c96e287 100644 --- a/tests/xcp_test_executor.rs +++ b/tests/xcp_test_executor.rs @@ -25,9 +25,9 @@ pub const OPTION_LOG_LEVEL: xcp::XcpLogLevel = xcp::XcpLogLevel::Info; pub const OPTION_XCP_LOG_LEVEL: xcp::XcpLogLevel = xcp::XcpLogLevel::Info; // Test parameters -pub const MULTI_THREAD_TASK_COUNT: usize = 10; // Number of threads +pub const MULTI_THREAD_TASK_COUNT: usize = 32; // Number of threads +pub const DAQ_TEST_TASK_SLEEP_TIME_US: u64 = 100; // us const DAQ_TEST_DURATION_MS: u64 = 4000; // ms -const DAQ_TEST_TASK_SLEEP_TIME_US: u64 = 500; // us const CAL_TEST_MAX_ITER: u32 = 4000; // Number of calibrations const CAL_TEST_TASK_SLEEP_TIME_US: u64 = 50; // Checking task cycle time in us diff --git a/xcplib/src/platform.c b/xcplib/src/platform.c index ea59aef..dc44e00 100644 --- a/xcplib/src/platform.c +++ b/xcplib/src/platform.c @@ -565,7 +565,7 @@ BOOL socketListen(SOCKET sock) { return 1; } -SOCKET socketAccept(SOCKET sock, uint8_t addr[]) { +SOCKET socketAccept(SOCKET sock, uint8_t* addr) { struct sockaddr_in sa; socklen_t sa_size = sizeof(sa); diff --git a/xcplib/src/platform.h b/xcplib/src/platform.h index 5b2c8af..3b83816 100644 --- a/xcplib/src/platform.h +++ b/xcplib/src/platform.h @@ -144,7 +144,7 @@ extern BOOL socketOpen(SOCKET* sp, BOOL useTCP, BOOL nonBlocking, BOOL reuseaddr extern BOOL socketBind(SOCKET sock, uint8_t* addr, uint16_t port); extern BOOL socketJoin(SOCKET sock, uint8_t* maddr); extern BOOL socketListen(SOCKET sock); -extern SOCKET socketAccept(SOCKET sock, uint8_t addr[]); +extern SOCKET socketAccept(SOCKET sock, uint8_t* addr); extern int16_t socketRecv(SOCKET sock, uint8_t* buffer, uint16_t bufferSize, BOOL waitAll); extern int16_t socketRecvFrom(SOCKET sock, uint8_t* buffer, uint16_t bufferSize, uint8_t* srcAddr, uint16_t* srcPort, uint64_t *time); extern int16_t socketSend(SOCKET sock, const uint8_t* buffer, uint16_t bufferSize); diff --git a/xcplib/src/xcpEthTl.c b/xcplib/src/xcpEthTl.c index f3b74cd..e3bb7d4 100644 --- a/xcplib/src/xcpEthTl.c +++ b/xcplib/src/xcpEthTl.c @@ -18,42 +18,17 @@ #include "xcpLite.h" #include "xcpTlQueue.h" -// Parameter checks -#if XCPTL_TRANSPORT_LAYER_HEADER_SIZE != 4 -#error "Transportlayer supports only 4 byte headers!" -#endif -#if ((XCPTL_MAX_CTO_SIZE&0x07) != 0) -#error "XCPTL_MAX_CTO_SIZE should be aligned to 8!" -#endif -#if ((XCPTL_MAX_DTO_SIZE&0x03) != 0) -#error "XCPTL_MAX_DTO_SIZE should be aligned to 4!" -#endif - - -typedef struct { - uint16_t dlc; - uint16_t ctr; - uint8_t packet[XCPTL_MAX_CTO_SIZE]; -} tXcpCtoMessage; - - - - -static struct { - - // Generic transport layer - //int32_t lastError; #if defined(XCPTL_ENABLE_UDP) || defined(XCPTL_ENABLE_TCP) +static struct { - // Ethernet SOCKET Sock; - #ifdef XCPTL_ENABLE_TCP - SOCKET ListenSock; - #endif - #ifdef PLATFORM_ENABLE_GET_LOCAL_ADDR - uint8_t ServerMac[6]; - #endif +#ifdef XCPTL_ENABLE_TCP + SOCKET ListenSock; +#endif +#ifdef PLATFORM_ENABLE_GET_LOCAL_ADDR + uint8_t ServerMac[6]; +#endif uint8_t ServerAddr[4]; uint16_t ServerPort; BOOL ServerUseTCP; @@ -63,14 +38,18 @@ static struct { BOOL MasterAddrValid; // Multicast - #ifdef XCPTL_ENABLE_MULTICAST - tXcpThread MulticastThreadHandle; - SOCKET MulticastSock; - #endif +#ifdef XCPTL_ENABLE_MULTICAST + tXcpThread MulticastThreadHandle; + SOCKET MulticastSock; +#endif +#if defined(_WIN) // Windows + HANDLE queue_event; + uint64_t queue_event_time; #endif } gXcpTl; +#endif #if defined(XCPTL_ENABLE_TCP) && defined(XCPTL_ENABLE_UDP) @@ -88,108 +67,10 @@ static struct { static int handleXcpMulticastCommand(int n, tXcpCtoMessage* p, uint8_t* dstAddr, uint16_t dstPort); #endif - - -//------------------------------------------------------------------------------------------------------- -// Generic transport layer functions - -BOOL XcpTlInit() { - - XcpTlInitTransmitQueue(); - - DBG_PRINT3("\nInit XCP transport layer\n"); - DBG_PRINTF3(" SEGMENT_SIZE=%u, MAX_CTO_SIZE=%u, QUEUE_SIZE=%u, ALIGNMENT=%u, %uKiB memory used\n", XCPTL_MAX_SEGMENT_SIZE, XCPTL_MAX_CTO_SIZE, XCPTL_QUEUE_SIZE, XCPTL_PACKET_ALIGNMENT, (unsigned int)sizeof(gXcpTl) / 1024); - DBG_PRINT3(" Note: These parameters in xcptl_cfg.h need to be configured for optimal memory consumption and performance!\n"); -#ifdef XCPTL_ENABLE_MULTICAST - DBG_PRINT3(" Option ENABLE_MULTICAST is not recommended\n"); -#endif -#ifndef XCPTL_QUEUED_CRM - DBG_PRINT3(" Option QUEUED_CRM is disabled, enabled is recommended\n"); -#endif - - return TRUE; -} - -void XcpTlShutdown() { - - XcpTlFreeTransmitQueue(); -} - - -#if defined(XCPTL_QUEUED_CRM) && !defined(XCPTL_QUEUED_CRM_OPT) - -// Queue a response or event packet -// Must be thread save, if XcpPrint used, XcpCommand is never called from multiple threads -// If transmission fails, when queue is full, tool times out, retries or take appropriate action -// Note: CANape cancels measurement, when answer to GET_DAQ_CLOCK times out -void XcpTlSendCrm(const uint8_t* packet, uint16_t packet_size) { - - void* handle = NULL; - uint8_t* p; - - // Queue the response packet - if ((p = XcpTlGetTransmitBuffer(&handle, packet_size)) != NULL) { - memcpy(p, packet, packet_size); - XcpTlCommitTransmitBuffer(handle, TRUE /* flush */); - } - else { // Buffer overflow - DBG_PRINT_WARNING("WARNING: queue overflow\n"); - // Ignore, handled by tool - } -} - -#endif - -// Execute XCP command -// Returns XCP error code -uint8_t XcpTlCommand( uint16_t msgLen, const uint8_t* msgBuf) { - - BOOL connected = XcpIsConnected(); - tXcpCtoMessage* p = (tXcpCtoMessage*)msgBuf; - assert(msgLen>=p->dlc+XCPTL_TRANSPORT_LAYER_HEADER_SIZE); - - /* Connected */ - if (connected) { - return XcpCommand((const uint32_t*)&p->packet[0], p->dlc); // Handle command - } - - /* Not connected yet */ - else { - /* Check for CONNECT command ? */ - if (p->dlc == 2 && p->packet[0] == CC_CONNECT) { - XcpTlResetTransmitQueue(); - return XcpCommand((const uint32_t*)&p->packet[0],p->dlc); // Handle CONNECT command - } - else { - DBG_PRINTF_WARNING("WARNING: XcpTlCommand: no valid CONNECT command, dlc=%u, data=%02X\n", p->dlc, p->packet[0]); - return CRC_CMD_SYNTAX; - } - - } -} - - -//------------------------------------------------------------------------------------------------------- -// XCP (UDP or TCP) transport layer segment/message/packet queue (DTO buffers) - -// Notify transmit queue handler thread -// Not thread save! -BOOL notifyTransmitQueueHandler() { - - // Windows only, Linux version uses polling -#if defined(_WIN) // Windows - // Notify when there is finalized buffer in the queue - // Notify at most every XCPTL_QUEUE_TRANSMIT_CYCLE_TIME to save CPU load - uint64_t clock = clockGetLast(); - if (clock== gXcpTl.queue_event_time) clock = clockGet(); - if (gXcpTl.queue_len == 2 || (gXcpTl.queue_len > 2 && clock >= gXcpTl.queue_event_time + XCPTL_QUEUE_TRANSMIT_CYCLE_TIME)) { - gXcpTl.queue_event_time = clock; - SetEvent(gXcpTl.queue_event); - return TRUE; - } -#endif - return FALSE; -} +// #define XCPTL_OK 0 +// #define XCPTL_ERROR_WOULD_BLOCK 1 +// #define XCPTL_ERROR_SEND_FAILED 2 +// #define XCPTL_ERROR_INVALID_MASTER 3 @@ -201,11 +82,13 @@ BOOL notifyTransmitQueueHandler() { // Transmit a UDP datagramm or TCP segment (contains multiple XCP DTO messages or a single CRM message (len+ctr+packet+fill)) // Must be thread safe, because it is called from CMD and from DAQ thread // Returns -1 on would block, 1 if ok, 0 on error -static int sendEthDatagram(const uint8_t *data, uint16_t size, const uint8_t* addr, uint16_t port) { +int XcpEthTlSend(const uint8_t *data, uint16_t size, const uint8_t* addr, uint16_t port) { int r; assert(size<=XCPTL_MAX_SEGMENT_SIZE); // Check for buffer overflow + + DBG_PRINTF5("XcpEthTlSend: msg_len = %u\n", size ); #ifdef XCPTL_ENABLE_TCP if (isTCP()) { @@ -236,7 +119,7 @@ static int sendEthDatagram(const uint8_t *data, uint16_t size, const uint8_t* ad return -1; // Would block } else { - DBG_PRINTF_ERROR("ERROR: sendEthDatagram: send failed (result=%d, errno=%d)!\n", r, socketGetLastError()); + DBG_PRINTF_ERROR("ERROR: XcpEthTlSend: send failed (result=%d, errno=%d)!\n", r, socketGetLastError()); //gXcpTl.lastError = XCPTL_ERROR_SEND_FAILED; return 0; // Error } @@ -246,112 +129,6 @@ static int sendEthDatagram(const uint8_t *data, uint16_t size, const uint8_t* ad } -// Transmit all completed and fully commited UDP frames -// Returns number of bytes sent or -1 on error -int32_t XcpTlHandleTransmitQueue() { - - const uint32_t max_loops = 20; // maximum number of packets to send without sleep(0) - - int32_t n = 0; - uint16_t l = 0; - const uint8_t *b = NULL; - - for (;;) { - for (uint32_t i = 0; i < max_loops; i++) { - - // Check - b = XcpTlTransmitQueuePeekMsg(&l); - if (b == NULL) break; // Ok, queue is empty or not fully commited - - // Send this frame - int r = sendEthDatagram(b, l, NULL, 0); - if (r == (-1)) { // would block - b = NULL; - break; - } - if (r == 0) { // error - return -1; - } - n += l; - - // Free this buffer when succesfully sent - XcpTlTransmitQueueNextMsg(l); - - - } // for (max_loops) - - if (b == NULL) break; // queue is empty - sleepMs(0); - - } // for (ever) - - return n; // Ok, queue empty now -} - - -#if !defined(XCPTL_QUEUED_CRM) || defined(XCPTL_QUEUED_CRM_OPT) - -// Transmit XCP response or event packet -// No error handling in protocol layer -// Must be thread save, if XcpPrint used, XcpCommand is never called from multiple threads -// If transmission fails, tool times out, retries or take appropriate action -// Note: CANape cancels measurement, when answer to GET_DAQ_CLOCK times out -void XcpTlSendCrm(const uint8_t* packet, uint16_t packet_size) { - -#ifdef XCPTL_QUEUED_CRM - - void* handle = NULL; - uint8_t* p; - int r = 0; - -#ifdef XCPTL_QUEUED_CRM_OPT - // If transmit queue is empty, save the space and transmit instantly - mutexLock(&gXcpTl.Mutex_Queue); - if (gXcpTl.queue_len <= 1 && (gXcpTl.msg_ptr == NULL || gXcpTl.msg_ptr->size == 0)) { - - // Send the response - // Build XCP CTO message (ctr+dlc+packet) - tXcpCtoMessage msg; - uint16_t msg_size; - msg.ctr = gXcpTl.ctr++; - memcpy(msg.packet, packet, packet_size); - msg_size = packet_size; - msg.dlc = (uint16_t)msg_size; - msg_size = (uint16_t)(msg_size + XCPTL_TRANSPORT_LAYER_HEADER_SIZE); - r = sendEthDatagram((uint8_t*)&msg.dlc, msg_size, NULL, 0); - } - mutexUnlock(&gXcpTl.Mutex_Queue); - if (r == 1) return; // ok -#endif // XCPTL_QUEUED_CRM_OPT - - // Queue the response packet - if ((p = XcpTlGetTransmitBuffer(&handle, packet_size)) != NULL) { - memcpy(p, packet, packet_size); - XcpTlCommitTransmitBuffer(handle, TRUE /* flush */); - } - else { // Buffer overflow - // Ignore, handled by tool - } - -#else - - int r; - - // Build XCP CTO message (ctr+dlc+packet) - tXcpCtoMessage p; - p.dlc = (uint16_t)packet_size; - p.ctr = gXcpTl.lastCroCtr++; - memcpy(p.packet, packet, packet_size); - r = sendDatagram((uint8_t*)&p, (uint16_t)(packet_size + XCPTL_TRANSPORT_LAYER_HEADER_SIZE), NULL, 0); - if (r==(-1)) { // Would block - // @@@@ ToDo: Handle this case - } - -#endif -} - -#endif // !defined(XCPTL_QUEUED_CRM) || defined(XCPTL_QUEUED_CRM_OPT) - //------------------------------------------------------------------------------ @@ -367,7 +144,7 @@ void XcpEthTlSendMulticastCrm(const uint8_t* packet, uint16_t packet_size, const p.dlc = (uint16_t)packet_size; p.ctr = 0; memcpy(p.packet, packet, packet_size); - r = sendEthDatagram((uint8_t*)&p, (uint16_t)(packet_size + XCPTL_TRANSPORT_LAYER_HEADER_SIZE),addr,port); + r = XcpEthTlSend((uint8_t*)&p, (uint16_t)(packet_size + XCPTL_TRANSPORT_LAYER_HEADER_SIZE),addr,port); if (r == (-1)) { // Would block // @@@@ ToDo: Handle this case } @@ -473,7 +250,7 @@ BOOL XcpEthTlHandleCommands(uint32_t timeout_ms) { // Listen to incoming TCP connection if not connected if (gXcpTl.Sock == INVALID_SOCKET) { - DBG_PRINT5("CDM thread waiting for TCP connection ...\n"); + DBG_PRINT5("Waiting for TCP connection ...\n"); gXcpTl.Sock = socketAccept(gXcpTl.ListenSock, gXcpTl.MasterAddr); // Wait here for incoming connection if (gXcpTl.Sock == INVALID_SOCKET) { DBG_PRINT_ERROR("ERROR: accept failed!\n"); @@ -686,41 +463,6 @@ void XcpEthTlShutdown() { } -//------------------------------------------------------------------------------------------------------- - -// Wait for outgoing data or timeout after timeout_us -// Return FALSE in case of timeout -BOOL XcpTlWaitForTransmitData(uint32_t timeout_ms) { - - assert(timeout_ms >= 1); - -#if defined(_WIN) // Windows - // Use event triggered for Windows - if (WAIT_OBJECT_0 == WaitForSingleObject(gXcpTl.queue_event, timeout_ms)) { - ResetEvent(gXcpTl.queue_event); - return TRUE; - } - return FALSE; -#elif defined(_LINUX) // Linux - // Use polling for Linux - #define XCPTL_QUEUE_TRANSMIT_POLLING_TIME_MS 1 - uint32_t t = 0; - while (!XcpTlTransmitQueueHasMsg()) { - sleepMs(XCPTL_QUEUE_TRANSMIT_POLLING_TIME_MS); - t = t + XCPTL_QUEUE_TRANSMIT_POLLING_TIME_MS; - if (t >= timeout_ms) return FALSE; - } - return TRUE; -#endif -} - - -//------------------------------------------------------------------------------------------------------- - -// int32_t XcpTlGetLastError() { -// return gXcpTl.lastError; -// } - //------------------------------------------------------------------------------------------------------- diff --git a/xcplib/src/xcpEthTl.h b/xcplib/src/xcpEthTl.h index 01687bd..f8e13fa 100644 --- a/xcplib/src/xcpEthTl.h +++ b/xcplib/src/xcpEthTl.h @@ -14,12 +14,12 @@ extern void XcpEthTlShutdown(); extern void XcpEthTlGetInfo(BOOL* isTCP, uint8_t* mac, uint8_t* addr, uint16_t* port); #endif +/* Transmit a segment (contains multiple XCP DTO or CRO messages */ +int XcpEthTlSend(const uint8_t *data, uint16_t size, const uint8_t* addr, uint16_t port); + /* ETH transport Layer functions called by server */ extern BOOL XcpEthTlHandleCommands(uint32_t timeout_ms); // Handle all incoming XCP commands, (wait for at least timeout_ms) -// All other network specific application functions functions are declared in xcpCanTl.h or xcpEthTl.h -extern int32_t XcpTlHandleTransmitQueue(); // Send all outgoing packets in the transmit queue -extern BOOL XcpTlWaitForTransmitData(uint32_t timeout_ms); // Wait for at least timeout_ms, until packets are pending in the transmit queue /* ETH transport Layer functions called by protocol layer */ #ifdef PLATFORM_ENABLE_GET_LOCAL_ADDR @@ -29,14 +29,5 @@ extern void XcpEthTlSendMulticastCrm(const uint8_t* data, uint16_t n, const uint extern void XcpEthTlSetClusterId(uint16_t clusterId); // Set cluster id for GET_DAQ_CLOCK_MULTICAST reception #endif -extern BOOL notifyTransmitQueueHandler(); - - -// Get last error code -// #define XCPTL_OK 0 -// #define XCPTL_ERROR_WOULD_BLOCK 1 -// #define XCPTL_ERROR_SEND_FAILED 2 -// #define XCPTL_ERROR_INVALID_MASTER 3 -// extern int32_t XcpTlGetLastError(); #endif diff --git a/xcplib/src/xcpLite.c b/xcplib/src/xcpLite.c index e0e33d8..fd0b210 100644 --- a/xcplib/src/xcpLite.c +++ b/xcplib/src/xcpLite.c @@ -118,13 +118,10 @@ #define XCP_MAX_DAQ_COUNT 256 #endif -// Dynamic addressing (ext = XCP_ADDR_EXT_DYN, addr=(event<<16)|offset requires transport layer mode XCPTL_QUEUED_CRM +// Dynamic addressing (ext = XCP_ADDR_EXT_DYN, addr=(event<<16)|offset #if defined(XCP_ENABLE_DYN_ADDRESSING) && !defined(XCP_ADDR_EXT_DYN) #error "Please define XCP_ADDR_EXT_DYN" #endif -#if defined(XCP_ENABLE_DYN_ADDRESSING) && !defined(XCPTL_QUEUED_CRM) -#error "Dynamic address format (ext = XCP_ADDR_EXT_DYN) requires XCPTL_QUEUED_CRM" -#endif /****************************************************************************/ @@ -852,6 +849,7 @@ static void XcpTriggerDaq(uint16_t daq, const uint8_t* base, uint64_t clock) { if (d0 == NULL) { gXcp.DaqOverflowCount++; DaqListState(daq) |= DAQ_STATE_OVERRUN; + DBG_PRINTF4("DAQ queue overrun, daq=%u, odt=%u, overruns=%u\n", daq, odt, gXcp.DaqOverflowCount); return; // Skip rest of this event on queue overrun } @@ -1897,10 +1895,6 @@ void XcpSendEvent(uint8_t ev, uint8_t evc, const uint8_t* d, uint8_t l) #if defined ( XCP_ENABLE_SERV_TEXT ) -#ifndef XCPTL_QUEUED_CRM -#error "XcpPrint is not thread safe, when used without XCPTL_QUEUED_CRM" -#endif - void XcpPrint( const char *str ) { if (!isConnected()) return; @@ -1960,7 +1954,6 @@ void XcpStart() DBG_PRINT3("\nInit XCP protocol layer\n"); DBG_PRINTF3(" Version=%u.%u, MAX_CTO=%u, MAX_DTO=%u, DAQ_MEM=%u, MAX_DAQ=%u, MAX_ODT_ENTRY=%u, MAX_ODT_ENTRYSIZE=%u\n", XCP_PROTOCOL_LAYER_VERSION >> 8, XCP_PROTOCOL_LAYER_VERSION & 0xFF, XCPTL_MAX_CTO_SIZE, XCPTL_MAX_DTO_SIZE, XCP_DAQ_MEM_SIZE, (1 << sizeof(uint16_t) * 8) - 1, (1 << sizeof(uint16_t) * 8) - 1, (1 << (sizeof(uint8_t) * 8)) - 1); DBG_PRINTF3(" %u KiB memory used\n", (unsigned int)sizeof(gXcp) / 1024); - DBG_PRINT3(" Note: These parameters in xcp_cfg.h need to be configured for optimal memory consumption and performance!\n"); DBG_PRINT3(" Options=("); // Print activated XCP protocol options diff --git a/xcplib/src/xcpTl.c b/xcplib/src/xcpTl.c new file mode 100644 index 0000000..a6a5f56 --- /dev/null +++ b/xcplib/src/xcpTl.c @@ -0,0 +1,190 @@ +/*---------------------------------------------------------------------------- +| File: +| xcpTl.c +| +| Description: +| XCP transport layer +| +| Copyright (c) Vector Informatik GmbH. All rights reserved. +| Licensed under the MIT license. See LICENSE file in the project root for details. +| + ----------------------------------------------------------------------------*/ + +#include "main.h" +#include "platform.h" +#include "dbg_print.h" +#include "xcpLite.h" +#include "xcpTlQueue.h" + + +BOOL XcpTlInit() { + + XcpTlInitTransmitQueue(); + + DBG_PRINT3("\nInit XCP transport layer\n"); + DBG_PRINTF3(" MAX_CTO_SIZE=%u\n", XCPTL_MAX_CTO_SIZE); +#ifdef XCPTL_ENABLE_MULTICAST + DBG_PRINT3(" Option ENABLE_MULTICAST (not recommended)\n"); +#endif + +#if defined(_WIN) // Windows + gXcpTl.queue_event = CreateEvent(NULL, TRUE, FALSE, NULL); + assert(gXcpTl.queue_event!=NULL); + gXcpTl.queue_event_time = 0; +#endif + + return TRUE; +} + +void XcpTlShutdown() { + + XcpTlFreeTransmitQueue(); + +#if defined(_WIN) // Windows + CloseHandle(gXcpTl.queue_event); +#endif +} + + +// Queue a response or event packet +// If transmission fails, when queue is full, tool times out, retries or take appropriate action +// Note: CANape cancels measurement, when answer to GET_DAQ_CLOCK times out +void XcpTlSendCrm(const uint8_t* packet, uint16_t packet_size) { + + void* handle = NULL; + uint8_t* p; + + // Queue the response packet + if ((p = XcpTlGetTransmitBuffer(&handle, packet_size)) != NULL) { + memcpy(p, packet, packet_size); + XcpTlCommitTransmitBuffer(handle, TRUE /* flush */); + } + else { // Buffer overflow + DBG_PRINT_WARNING("WARNING: queue overflow\n"); + // Ignore, handled by tool + } +} + + +// Execute XCP command +// Returns XCP error code +uint8_t XcpTlCommand( uint16_t msgLen, const uint8_t* msgBuf) { + + BOOL connected = XcpIsConnected(); + tXcpCtoMessage* p = (tXcpCtoMessage*)msgBuf; + assert(msgLen>=p->dlc+XCPTL_TRANSPORT_LAYER_HEADER_SIZE); + + /* Connected */ + if (connected) { + return XcpCommand((const uint32_t*)&p->packet[0], p->dlc); // Handle command + } + + /* Not connected yet */ + else { + /* Check for CONNECT command ? */ + if (p->dlc == 2 && p->packet[0] == CC_CONNECT) { + XcpTlResetTransmitQueue(); + return XcpCommand((const uint32_t*)&p->packet[0],p->dlc); // Handle CONNECT command + } + else { + DBG_PRINTF_WARNING("WARNING: XcpTlCommand: no valid CONNECT command, dlc=%u, data=%02X\n", p->dlc, p->packet[0]); + return CRC_CMD_SYNTAX; + } + + } +} + + +// Transmit all completed and fully commited UDP frames +// Returns number of bytes sent or -1 on error +int32_t XcpTlHandleTransmitQueue() { + + const uint32_t max_loops = 20; // maximum number of packets to send without sleep(0) + + int32_t n = 0; + const uint8_t *b = NULL; + + for (;;) { + for (uint32_t i = 0; i < max_loops; i++) { + + // Check + uint16_t l = 0; + b = XcpTlTransmitQueuePeekMsg(&l); + if (b == NULL) break; // Ok, queue is empty or not fully commited + + // Send this frame + int r = XcpEthTlSend(b, l, NULL, 0); + if (r == (-1)) { // would block + b = NULL; + break; + } + if (r == 0) { // error + return -1; + } + n += l; + + // Free this buffer when succesfully sent + XcpTlTransmitQueueNextMsg(); + + + } // for (max_loops) + + if (b == NULL) break; // queue is empty + sleepMs(0); + + } // for (ever) + + return n; // Ok, queue empty now +} + + + + +//------------------------------------------------------------------------------------------------------- + +// Notify transmit queue handler thread +BOOL XcpTlNotifyTransmitQueueHandler() { + + // Windows only, Linux version uses polling +#if defined(_WIN) // Windows + // Notify when there is finalized buffer in the queue + // Notify at most every XCPTL_QUEUE_TRANSMIT_CYCLE_TIME to save CPU load + uint64_t clock = clockGetLast(); + if (clock== gXcpTl.queue_event_time) clock = clockGet(); + if (XcpTlTransmitQueueHasMsg() && clock >= gXcpTl.queue_event_time + XCPTL_QUEUE_TRANSMIT_CYCLE_TIME) { + gXcpTl.queue_event_time = clock; + SetEvent(gXcpTl.queue_event); + return TRUE; + } +#endif + return FALSE; +} + +// Wait for outgoing data or timeout after timeout_us +// Return FALSE in case of timeout +BOOL XcpTlWaitForTransmitData(uint32_t timeout_ms) { + +#if defined(_WIN) // Windows + + // Use event triggered for Windows + if (WAIT_OBJECT_0 == WaitForSingleObject(gXcpTl.queue_event, timeout_ms)) { + ResetEvent(gXcpTl.queue_event); + return TRUE; + } + return FALSE; + +#elif defined(_LINUX) // Linux + + // Use polling for Linux + #define XCPTL_QUEUE_TRANSMIT_POLLING_TIME_MS 1 + uint32_t t = 0; + while (!XcpTlTransmitQueueHasMsg()) { + sleepMs(XCPTL_QUEUE_TRANSMIT_POLLING_TIME_MS); + t = t + XCPTL_QUEUE_TRANSMIT_POLLING_TIME_MS; + if (t >= timeout_ms) return FALSE; + } + return TRUE; + +#endif +} + diff --git a/xcplib/src/xcpTl.h b/xcplib/src/xcpTl.h index 3d0a276..59363e6 100644 --- a/xcplib/src/xcpTl.h +++ b/xcplib/src/xcpTl.h @@ -4,19 +4,60 @@ /* Copyright(c) Vector Informatik GmbH.All rights reserved. Licensed under the MIT license.See LICENSE file in the project root for details. */ + + +// Parameter checks +#if XCPTL_TRANSPORT_LAYER_HEADER_SIZE != 4 +#error "Transportlayer supports only 4 byte headers!" +#endif +#if ((XCPTL_MAX_CTO_SIZE&0x07) != 0) +#error "XCPTL_MAX_CTO_SIZE should be aligned to 8!" +#endif +#if ((XCPTL_MAX_DTO_SIZE&0x03) != 0) +#error "XCPTL_MAX_DTO_SIZE should be aligned to 4!" +#endif + +#pragma pack(push, 1) +typedef struct { + uint16_t dlc; // XCP TL header lenght + uint16_t ctr; // XCP TL Header message counter + uint8_t data[]; +} tXcpDtoMessage; +#pragma pack(pop) + +#pragma pack(push, 1) +typedef struct { + uint16_t dlc; + uint16_t ctr; + uint8_t packet[XCPTL_MAX_CTO_SIZE]; +} tXcpCtoMessage; +#pragma pack(pop) + + #define XCPTL_TIMEOUT_INFINITE 0xFFFFFFFF // Infinite timeout (blocking mode) for XcpTlHandleCommands, XcpTlWaitForTransmitData // Transport Layer functions called by protocol layer in XCPlite.c -extern void XcpTlSendCrm(const uint8_t* data, uint16_t n); // Send or queue (depending on XCPTL_QUEUED_CRM) a command response +extern void XcpTlSendCrm(const uint8_t* data, uint16_t n); // Queue a command response extern uint8_t* XcpTlGetTransmitBuffer(void** handle, uint16_t size); // Get a buffer for a message with size extern void XcpTlCommitTransmitBuffer(void* handle, BOOL flush); // Commit a buffer (by handle returned from XcpTlGetTransmitBuffer) extern void XcpTlFlushTransmitBuffer(); // Finalize the current transmit packet (ETH only) extern void XcpTlWaitForTransmitQueueEmpty(); // Wait (sleep) until transmit queue is empty +// Transport layer functions called by the transport layer queue (provider -> consumer event) +extern BOOL XcpTlNotifyTransmitQueueHandler(); + // Transport layer functions called by XCP server extern BOOL XcpTlInit(); // Start generic transport layer extern void XcpTlShutdown(); // Stop generic transport layer extern uint8_t XcpTlCommand(uint16_t msgLen, const uint8_t* msgBuf); // Handle XCP message -extern const uint8_t * XcpTlTransmitQueuePeekMsg( uint16_t* msg_len ); // Check if there is a fully commited message segment buffer in the transmit queue -extern void XcpTlTransmitQueueNextMsg(uint16_t msg_len); // Remove the next transmit queue entry +extern const uint8_t* XcpTlTransmitQueuePeekMsg(uint16_t* msg_len); // Check if there is a fully commited message segment buffer in the transmit queue +extern void XcpTlTransmitQueueNextMsg(); // Remove the next transmit queue entry extern BOOL XcpTlTransmitQueueHasMsg(); // Check if there is enough data in the transmit queue for a transport layer message + +extern int32_t XcpTlHandleTransmitQueue(); // Send all outgoing packets in the transmit queue +extern BOOL XcpTlWaitForTransmitData(uint32_t timeout_ms); // Wait for at least timeout_ms, until packets are pending in the transmit queue + + + + + diff --git a/xcplib/src/xcpTlQueue.c b/xcplib/src/xcpTlQueue.c index 7e0ab76..a0c1e14 100644 --- a/xcplib/src/xcpTlQueue.c +++ b/xcplib/src/xcpTlQueue.c @@ -18,57 +18,67 @@ #include - -// #define USE_SPINLOCK +// Use spinlock instead of mutex for producer lock +//#define USE_SPINLOCK // Queue entry states -#define RESERVED 0 // Reserved for producer +#define RESERVED 0 // Reserved by producer #define COMMITTED 1 // Committed by producer -// Buffer size is one entry larger than the queue size, message data is never wraped around +// Buffer size is one entry larger than the queue size, message data is never wraped around for zero copy #define MPSC_BUFFER_SIZE ((XCPTL_QUEUE_SIZE+1)*(XCPTL_MAX_DTO_SIZE+XCPTL_TRANSPORT_LAYER_HEADER_SIZE)) #define MPSC_QUEUE_SIZE ((XCPTL_QUEUE_SIZE)*(XCPTL_MAX_DTO_SIZE+XCPTL_TRANSPORT_LAYER_HEADER_SIZE)) -#pragma pack(push, 1) -typedef struct { - uint16_t dlc; // XCP TL header lenght - uint16_t ctr; // XCP TL Header message counter - uint8_t data[]; -} tXcpCtoMessage; -#pragma pack(pop) - static struct { char buffer[MPSC_BUFFER_SIZE]; // Preallocated buffer atomic_uint_fast64_t head; // Consumer reads from head atomic_uint_fast64_t tail; // Producers write to tail - uint16_t ctr; // next DTO data transmit message packet counter + uint16_t tail_len; // Length of the next message in the queue (determined by peek) + uint16_t ctr; // Next DTO data transmit message packet counter + uint16_t overruns; // Overrun counter BOOL flush; // There is a packet in the queue which has priority #ifndef USE_SPINLOCK MUTEX mutex; // Mutex for queue producers #endif } gXcpTlQueue; -atomic_flag lock = ATOMIC_FLAG_INIT; - +#ifdef USE_SPINLOCK +static atomic_flag lock = ATOMIC_FLAG_INIT; +#endif void XcpTlInitTransmitQueue() { + + DBG_PRINT3("\nInit XCP transport layer queue\n"); + DBG_PRINTF3(" SEGMENT_SIZE=%u, QUEUE_SIZE=%u, ALIGNMENT=%u, %uKiB queue memory used\n", XCPTL_MAX_SEGMENT_SIZE, XCPTL_QUEUE_SIZE, XCPTL_PACKET_ALIGNMENT, (unsigned int)sizeof(gXcpTlQueue) / 1024); + gXcpTlQueue.overruns = 0; gXcpTlQueue.ctr = 0; gXcpTlQueue.flush = FALSE; +#ifndef USE_SPINLOCK mutexInit(&gXcpTlQueue.mutex, FALSE, 1000); +#endif atomic_store(&gXcpTlQueue.head, 0); atomic_store(&gXcpTlQueue.tail, 0); + gXcpTlQueue.tail_len = 0; +#ifdef USE_SPINLOCK + assert(atomic_is_lock_free(&lock)!=0); +#endif + assert(atomic_is_lock_free(&gXcpTlQueue.head)!=0); } void XcpTlResetTransmitQueue() { + gXcpTlQueue.tail_len = 0; + gXcpTlQueue.overruns = 0; atomic_store(&gXcpTlQueue.head, 0); atomic_store(&gXcpTlQueue.tail, 0); } void XcpTlFreeTransmitQueue() { XcpTlResetTransmitQueue(); +#ifndef USE_SPINLOCK mutexDestroy(&gXcpTlQueue.mutex); +#endif } @@ -77,9 +87,9 @@ void XcpTlFreeTransmitQueue() { // For multiple producers !! // Get a buffer for a message with size -extern uint8_t* XcpTlGetTransmitBuffer(void** handle, uint16_t packet_len) { +uint8_t* XcpTlGetTransmitBuffer(void** handle, uint16_t packet_len) { - tXcpCtoMessage *entry = NULL; + tXcpDtoMessage *entry = NULL; // Align the message length uint16_t msg_len = packet_len + XCPTL_TRANSPORT_LAYER_HEADER_SIZE; @@ -97,32 +107,33 @@ extern uint8_t* XcpTlGetTransmitBuffer(void** handle, uint16_t packet_len) { // Producer lock #ifdef USE_SPINLOCK - // while (!atomic_compare_exchange_weak(&gXcpTlQueue.lock, FALSE, TRUE)); while (atomic_flag_test_and_set(&lock)); #else mutexLock(&gXcpTlQueue.mutex); #endif uint64_t head = atomic_load(&gXcpTlQueue.head); - uint64_t tail = atomic_load(&gXcpTlQueue.tail); - if (MPSC_QUEUE_SIZE - (head-tail) >= msg_len) { - - atomic_store(&gXcpTlQueue.head, head+msg_len); + uint64_t tail = atomic_load_explicit(&gXcpTlQueue.tail,memory_order_relaxed); + if (MPSC_QUEUE_SIZE - (uint32_t)(head-tail) >= msg_len) { // Prepare a new entry // Use the ctr as commmit state uint32_t offset = head % MPSC_QUEUE_SIZE; - entry = (tXcpCtoMessage *)(gXcpTlQueue.buffer + offset); + entry = (tXcpDtoMessage *)(gXcpTlQueue.buffer + offset); entry->ctr = RESERVED; + + atomic_store(&gXcpTlQueue.head, head+msg_len); } #ifdef USE_SPINLOCK - //atomic_store(&gXcpTlQueue.lock, FALSE); atomic_flag_clear(&lock); #else mutexUnlock(&gXcpTlQueue.mutex); #endif - if (entry==NULL) return NULL; + if (entry==NULL) { + gXcpTlQueue.overruns++; + return NULL; + } entry->dlc = msg_len-XCPTL_TRANSPORT_LAYER_HEADER_SIZE; *handle = entry; @@ -132,12 +143,15 @@ extern uint8_t* XcpTlGetTransmitBuffer(void** handle, uint16_t packet_len) { // Commit a buffer (by handle returned from XcpTlGetTransmitBuffer) void XcpTlCommitTransmitBuffer(void* handle, BOOL flush) { - tXcpCtoMessage *entry = (tXcpCtoMessage *)handle; + tXcpDtoMessage *entry = (tXcpDtoMessage *)handle; if (flush) gXcpTlQueue.flush = TRUE; entry->ctr = COMMITTED; - notifyTransmitQueueHandler(); + +#if defined(_WIN) // Windows has event driven transmit queue handler, Linux uses transmit queue polling + XcpTlNotifyTransmitQueueHandler(); +#endif - DBG_PRINTF5("XcpTlCommitTransmitBuffer: dlc=%d, pid=%u, flush=%u\n", entry->dlc,entry->data[0], flush); + DBG_PRINTF5("XcpTlCommitTransmitBuffer: dlc=%d, pid=%u, flush=%u, overruns=%u\n", entry->dlc,entry->data[0], flush, gXcpTlQueue.overruns); } // Empy the queue, even if a message is not completely used @@ -175,7 +189,7 @@ BOOL XcpTlTransmitQueueHasMsg() { uint32_t n = XcpTlGetTransmitQueueLevel(); if (n==0) return FALSE; - DBG_PRINTF5("XcpTlTransmitHasMsg: n=%u, flush=%u\n", n, gXcpTlQueue.flush); + DBG_PRINTF5("XcpTlTransmitHasMsg: level=%u, flush=%u\n", n, gXcpTlQueue.flush); if (gXcpTlQueue.flush) { return TRUE; // High priority data in the queue @@ -186,66 +200,76 @@ BOOL XcpTlTransmitQueueHasMsg() { // Check if there is a fully commited message segment in the transmit queue // Return the message length and a pointer to the message -const uint8_t * XcpTlTransmitQueuePeekMsg( uint16_t* msg_len) { +const uint8_t * XcpTlTransmitQueuePeekMsg( uint16_t* msg_len ) { uint64_t head = atomic_load(&gXcpTlQueue.head); uint64_t tail = atomic_load(&gXcpTlQueue.tail); if (head == tail) return NULL; // Queue is empty - // The producers can not check for overflow, because of the individual atomic operations for head and tail - // In case of overflow (tail-head is too large) all queue data except the uncommited messages will be deleted, because the tail has been overwritten - // It is assumed, that the overwritten part of tail can never reached the uncommited part of the queue - uint32_t size = head-tail; - assert(size <= MPSC_QUEUE_SIZE); // Overrun not handled yet - DBG_PRINTF5("XcpTlTransmitQueuePeekMsg: queue size = %u\n", size ); + uint32_t level = head-tail; + assert(level <= MPSC_QUEUE_SIZE); // Overrun not handled + DBG_PRINTF5("XcpTlTransmitQueuePeekMsg: level = %u, ctr=%u\n", level, gXcpTlQueue.ctr ); uint32_t tail_offset = tail % MPSC_QUEUE_SIZE; - tXcpCtoMessage *entry0 = (tXcpCtoMessage *)(gXcpTlQueue.buffer + tail_offset); - uint16_t ctr = entry0->ctr; // entry ctr may be concurrently changed by producer, when committed - if (ctr==RESERVED) { - DBG_PRINT5("XcpTlTransmitQueuePeekMsg: RESERVED\n"); - return NULL; // Not commited yet - } - assert(ctr==COMMITTED); - entry0->ctr = gXcpTlQueue.ctr++; // Set the transport layer packet count counter - uint16_t len0 = entry0->dlc + XCPTL_TRANSPORT_LAYER_HEADER_SIZE; - - // Check for more packets to concatenate - uint16_t len = len0; - for (;;) { - if (len0==size) break; // Queue is empty - assert(len0=MPSC_QUEUE_SIZE) break; // Can not wrap around - - tXcpCtoMessage *entry = (tXcpCtoMessage *)(gXcpTlQueue.buffer + tail_offset); - uint16_t ctr = entry->ctr; - if (ctr!=COMMITTED) { - assert(ctr==RESERVED); - break; // Not commited yet - } + tXcpDtoMessage *entry = (tXcpDtoMessage *)(gXcpTlQueue.buffer + tail_offset); + + if (gXcpTlQueue.tail_len==0) { + + uint16_t ctr = entry->ctr; // entry ctr may be concurrently changed by producer, when committed + if (ctr==RESERVED) return NULL; // Not commited yet + assert(ctr==COMMITTED); assert(entry->dlc<=XCPTL_MAX_DTO_SIZE); // Max DTO size - len = entry->dlc + XCPTL_TRANSPORT_LAYER_HEADER_SIZE; - if (len0+len > XCPTL_MAX_SEGMENT_SIZE ) break; // Max segment size reached - len0 += len; - entry->ctr = gXcpTlQueue.ctr++; + if (gXcpTlQueue.overruns) { // Add the number of overruns + DBG_PRINTF3("XcpTlTransmitQueuePeekMsg: overruns=%u\n", gXcpTlQueue.overruns); + gXcpTlQueue.ctr += gXcpTlQueue.overruns; + gXcpTlQueue.overruns = 0; + } + + entry->ctr = gXcpTlQueue.ctr++; // Set the transport layer packet counter + uint16_t len = entry->dlc + XCPTL_TRANSPORT_LAYER_HEADER_SIZE; + + // Check for more packets to concatenate in a meassage segment + uint16_t len1 = len; + for (;;) { + if (len==level) break; // Nothing more in queue + assert(len=MPSC_QUEUE_SIZE) break; // Stop, can not wrap around without copying data + + tXcpDtoMessage *entry = (tXcpDtoMessage *)(gXcpTlQueue.buffer + tail_offset); + uint16_t ctr = entry->ctr; + if (ctr==RESERVED) break; + assert(ctr==COMMITTED); + + // Add this entry + assert(entry->dlc<=XCPTL_MAX_DTO_SIZE); // Max DTO size + len1 = entry->dlc + XCPTL_TRANSPORT_LAYER_HEADER_SIZE; + if (len+len1 > XCPTL_MAX_SEGMENT_SIZE ) break; // Max segment size reached + len += len1; + entry->ctr = gXcpTlQueue.ctr++; + } + + gXcpTlQueue.tail_len = len; } - - DBG_PRINTF5("XcpTlTransmitQueuePeekMsg: len = %u\n", len0 ); - *msg_len = len0; - return (uint8_t*)entry0; + else { + assert(0); // @@@@@@@ This may happen, but not observed ever + } + + //DBG_PRINTF5("XcpTlTransmitQueuePeekMsg: msg_len = %u\n", gXcpTlQueue.tail_len ); + *msg_len = gXcpTlQueue.tail_len; + return (uint8_t*)entry; } -// Advance the transmit queue tail -void XcpTlTransmitQueueNextMsg( uint16_t msg_len ) { +// Advance the transmit queue tail by the message lentgh obtained from the last peek +void XcpTlTransmitQueueNextMsg() { - uint64_t tail = atomic_load(&gXcpTlQueue.tail); - tail += msg_len; - atomic_store(&gXcpTlQueue.tail, tail ); - DBG_PRINTF5("XcpTlTransmitQueueNext: new tail offset=%u\n", (uint32_t)(tail % MPSC_QUEUE_SIZE)); + DBG_PRINTF5("XcpTlTransmitQueueNext: msg_len = %u\n", gXcpTlQueue.tail_len ); + if (gXcpTlQueue.tail_len==0) return; + atomic_fetch_add(&gXcpTlQueue.tail,gXcpTlQueue.tail_len); + gXcpTlQueue.tail_len = 0; gXcpTlQueue.flush = FALSE; } diff --git a/xcplib/xcp_cfg.h b/xcplib/xcp_cfg.h index 7ae44fd..cd264f2 100644 --- a/xcplib/xcp_cfg.h +++ b/xcplib/xcp_cfg.h @@ -109,7 +109,7 @@ // #define XCP_ENABLE_PACKED_MODE // Static allocated memory for DAQ tables -#define XCP_DAQ_MEM_SIZE (256*256*5) // Amount of memory for DAQ tables, each ODT entry (e.g. measurement variable) needs 5 bytes +#define XCP_DAQ_MEM_SIZE (10000*5) // Amount of memory for DAQ tables, each ODT entry (e.g. measurement variable) needs 5 bytes // Maximum number of DAQ lists // Numbers smaller than 256 will switch to 2 byte transport layer header DAQ_HDR_ODT_DAQB diff --git a/xcplib/xcptl_cfg.h b/xcplib/xcptl_cfg.h index 20437bc..6db7a88 100644 --- a/xcplib/xcptl_cfg.h +++ b/xcplib/xcptl_cfg.h @@ -29,26 +29,6 @@ #define XCPTL_MULTICAST_PORT 5557 #endif -// Transmit mode -#define XCPTL_QUEUED_CRM // Use transmit queue for command responces -// #define XCPTL_QUEUED_CRM_OPT // Send response immediately, if transmit queue is empty - -/* -Benefits: -- Unique transport layers message counters for CRM and DTO (CANape default transport layer option is "include command response") -- Transmit queue empty before DAQ is stopped (end of measurement consistent for all event channels) -- socketSendTo needs not to be thread safe for a socket -Drawbacks: -- Increased latency for GET_DAQ_CLOCK response during DAQ running, which impacts time sync quality if XCP 1.3 trigger initiator "sampled on reception" is not supported -- Impact on DAQ performance because transport layer packet is flushed for command responses -- DAQ queue overflow can happen on command responses, CANape aborts when response to GET_DAQ_CLOCK is missing -*/ - -#else - -// Transmit mode -#define XCPTL_QUEUED_CRM // Use transmit queue for command responces - #endif // Transport layer header size @@ -59,14 +39,14 @@ // Segment size is the maximum data buffer size given to send/sendTo, for UDP it is the UDP MTU // Jumbo frames are supported, but it might be more efficient to use a smaller segment sizes // #define XCPTL_MAX_SEGMENT_SIZE (OPTION_MTU-20-8) // UDP MTU (MTU - IP-header - UDP-header) -#define XCPTL_MAX_SEGMENT_SIZE (8*900) +#define XCPTL_MAX_SEGMENT_SIZE (7000) #define XCPTL_MAX_DTO_SIZE (XCPTL_MAX_SEGMENT_SIZE-8) // Segment size - XCP transport layer header size, size must be mod 8 #define XCPTL_PACKET_ALIGNMENT 4 // Packet alignment for multiple XCP transport layer packets in a XCP transport layer message // DAQ transmit queue // Transmit queue size in segments, should at least be able to hold all data produced until the next call to HandleTransmitQueue -#define XCPTL_QUEUE_SIZE (1024*8) // Size of the mpsc queue in XCP DTO/CRM packets (not messages as in V1.x) +#define XCPTL_QUEUE_SIZE (256) // Size of the mpsc queue in XCP DTO/CRM packets (not messages as in V1.x) // Maximum queue trigger event rate #define XCPTL_QUEUE_TRANSMIT_CYCLE_TIME (1*CLOCK_TICKS_PER_MS)