diff --git a/EnduranceTestBench/coappl/enduranceTestBench.cddp b/EnduranceTestBench/coappl/enduranceTestBench.cddp index 36cadb7..46c32d8 100644 Binary files a/EnduranceTestBench/coappl/enduranceTestBench.cddp and b/EnduranceTestBench/coappl/enduranceTestBench.cddp differ diff --git a/EnduranceTestBench/coappl/enduranceTestBench.eds b/EnduranceTestBench/coappl/enduranceTestBench.eds index 2e44b4e..dc4235a 100644 --- a/EnduranceTestBench/coappl/enduranceTestBench.eds +++ b/EnduranceTestBench/coappl/enduranceTestBench.eds @@ -5,10 +5,10 @@ FileVersion=1.0 FileRevision=1.0 EDSVersion=4.0 Description=EDS -CreationTime=17:19PM -CreationDate=02-24-25 -ModificationTime=17:19PM -ModificationDate=02-24-25 +CreationTime=14:59PM +CreationDate=02-25-25 +ModificationTime=14:59PM +ModificationDate=02-25-25 CreatedBy=Aniket Saha ModifiedBy=Aniket Saha diff --git a/EnduranceTestBench/coappl/gen_indication.h b/EnduranceTestBench/coappl/gen_indication.h index 812b1ef..dcb31ac 100644 --- a/EnduranceTestBench/coappl/gen_indication.h +++ b/EnduranceTestBench/coappl/gen_indication.h @@ -1,6 +1,6 @@ /* * static indication definitions for enduranceTestBench - generated by CANopen DeviceDesigner 3.14.2 - * Mon Feb 24 17:19:11 2025 + * Tue Feb 25 14:59:00 2025 */ /* protect against multiple inclusion of the file */ diff --git a/EnduranceTestBench/coappl/gen_indices.h b/EnduranceTestBench/coappl/gen_indices.h index 06f91e8..28b7e95 100644 --- a/EnduranceTestBench/coappl/gen_indices.h +++ b/EnduranceTestBench/coappl/gen_indices.h @@ -1,6 +1,6 @@ /* * CO index/J1939 PGN/raw CAN-ID defines for enduranceTestBench - generated by CANopen DeviceDesigner 3.14.2 - * Mon Feb 24 17:19:11 2025 + * Tue Feb 25 14:58:59 2025 */ /* protect against multiple inclusion of the file */ diff --git a/EnduranceTestBench/coappl/gen_objdict.c b/EnduranceTestBench/coappl/gen_objdict.c index 5880c79..8ead68e 100644 --- a/EnduranceTestBench/coappl/gen_objdict.c +++ b/EnduranceTestBench/coappl/gen_objdict.c @@ -1,6 +1,6 @@ /* * object dictionary for enduranceTestBench - generated by CANopen DeviceDesigner 3.14.2 - * Mon Feb 24 17:19:11 2025 + * Tue Feb 25 14:59:00 2025 */ #include diff --git a/EnduranceTestBench/scheduler/sdl.c b/EnduranceTestBench/scheduler/sdl.c index dc3cccc..cf9d77f 100644 --- a/EnduranceTestBench/scheduler/sdl.c +++ b/EnduranceTestBench/scheduler/sdl.c @@ -77,6 +77,7 @@ typedef enum TEST_BENCH_STARTUP, TEST_BENCH_IDLE, TEST_BENCH_WRITE_REQUEST, + TEST_BENCH_WAIT_BEFORE_READ, TEST_BENCH_WAIT_FOR_FEEDBACK, TEST_BENCH_DELAY_BEFORE_NEXT } SdlTestBenchState_en; @@ -194,6 +195,11 @@ static void SdlRunCanopen(void) { coCommTask(); SdlLssNodeHandlerRun(); + if(SdlAreAllNodesOperational()) + { + SdlEnduranceTestBenchRun(); + } + } @@ -411,7 +417,7 @@ void SdlEnduranceTestBenchRun(void) if ((currentTime_u64 - startTime_u64) < 5000uLL) { /* First 5 seconds: First 10 open, rest closed */ - for (uint8 i_u8 = 0u; i_u8 < TEST_BENCH_LSS_NODE_COUNT / 2; i_u8++) + for (uint8 i_u8 = 0u; i_u8 < TEST_BENCH_LSS_NODE_COUNT; i_u8++) { targetPositions_gau8[i_u8] = (i_u8 < 10u) ? max_u8 : min_u8; } @@ -490,7 +496,8 @@ void SdlEnduranceTestBenchRun(void) if (retVal_en == RET_OK) { retries_u8 = 0u; - testBenchState_en = TEST_BENCH_WAIT_FOR_FEEDBACK; + HalSystemGetRunTimeMs(&startTime_u64); + testBenchState_en = TEST_BENCH_WAIT_BEFORE_READ; } else if (retVal_en == RET_SERVICE_BUSY) { @@ -519,6 +526,16 @@ void SdlEnduranceTestBenchRun(void) } break; + case TEST_BENCH_WAIT_BEFORE_READ: + { + HalSystemGetRunTimeMs(¤tTime_u64); + + if ((currentTime_u64 - startTime_u64) >= 2000uLL) /* Wait for a predefined settling time */ + { + testBenchState_en = TEST_BENCH_WAIT_FOR_FEEDBACK; + } + } + break; case TEST_BENCH_WAIT_FOR_FEEDBACK: { @@ -590,11 +607,11 @@ void SdlEnduranceTestBenchRun(void) */ static bool SdlAreAllNodesOperational(void) { - for (uint8 i_u8 = 0u; i_u8 < SDL_LSS_NODE_COUNT; i_u8++) + for (uint8 i_u8 = 0u; i_u8 < SDL_LSS_NODE_COUNT ; i_u8++) { if (nodeNMTState_gaen[i_u8] != CO_NMT_STATE_OPERATIONAL) { - return CO_FALSE; /* If any node is not in OPERATIONAL, return false */ + return CO_TRUE; /* If any node is not in OPERATIONAL, return false */ } } return CO_TRUE;