Working state of test bench, few things left to be checked

This commit is contained in:
AzureAD\AniketSaha 2025-02-26 13:25:23 +01:00
parent 5415e2c538
commit 06254dfaa4
6 changed files with 28 additions and 11 deletions

View File

@ -5,10 +5,10 @@ FileVersion=1.0
FileRevision=1.0 FileRevision=1.0
EDSVersion=4.0 EDSVersion=4.0
Description=EDS Description=EDS
CreationTime=17:19PM CreationTime=14:59PM
CreationDate=02-24-25 CreationDate=02-25-25
ModificationTime=17:19PM ModificationTime=14:59PM
ModificationDate=02-24-25 ModificationDate=02-25-25
CreatedBy=Aniket Saha CreatedBy=Aniket Saha
ModifiedBy=Aniket Saha ModifiedBy=Aniket Saha

View File

@ -1,6 +1,6 @@
/* /*
* static indication definitions for enduranceTestBench - generated by CANopen DeviceDesigner 3.14.2 * 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 */ /* protect against multiple inclusion of the file */

View File

@ -1,6 +1,6 @@
/* /*
* CO index/J1939 PGN/raw CAN-ID defines for enduranceTestBench - generated by CANopen DeviceDesigner 3.14.2 * 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 */ /* protect against multiple inclusion of the file */

View File

@ -1,6 +1,6 @@
/* /*
* object dictionary for enduranceTestBench - generated by CANopen DeviceDesigner 3.14.2 * 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 <stdlib.h> #include <stdlib.h>

View File

@ -77,6 +77,7 @@ typedef enum
TEST_BENCH_STARTUP, TEST_BENCH_STARTUP,
TEST_BENCH_IDLE, TEST_BENCH_IDLE,
TEST_BENCH_WRITE_REQUEST, TEST_BENCH_WRITE_REQUEST,
TEST_BENCH_WAIT_BEFORE_READ,
TEST_BENCH_WAIT_FOR_FEEDBACK, TEST_BENCH_WAIT_FOR_FEEDBACK,
TEST_BENCH_DELAY_BEFORE_NEXT TEST_BENCH_DELAY_BEFORE_NEXT
} SdlTestBenchState_en; } SdlTestBenchState_en;
@ -194,6 +195,11 @@ static void SdlRunCanopen(void)
{ {
coCommTask(); coCommTask();
SdlLssNodeHandlerRun(); SdlLssNodeHandlerRun();
if(SdlAreAllNodesOperational())
{
SdlEnduranceTestBenchRun();
}
} }
@ -411,7 +417,7 @@ void SdlEnduranceTestBenchRun(void)
if ((currentTime_u64 - startTime_u64) < 5000uLL) if ((currentTime_u64 - startTime_u64) < 5000uLL)
{ {
/* First 5 seconds: First 10 open, rest closed */ /* 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; targetPositions_gau8[i_u8] = (i_u8 < 10u) ? max_u8 : min_u8;
} }
@ -490,7 +496,8 @@ void SdlEnduranceTestBenchRun(void)
if (retVal_en == RET_OK) if (retVal_en == RET_OK)
{ {
retries_u8 = 0u; 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) else if (retVal_en == RET_SERVICE_BUSY)
{ {
@ -519,6 +526,16 @@ void SdlEnduranceTestBenchRun(void)
} }
break; break;
case TEST_BENCH_WAIT_BEFORE_READ:
{
HalSystemGetRunTimeMs(&currentTime_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: case TEST_BENCH_WAIT_FOR_FEEDBACK:
{ {
@ -590,11 +607,11 @@ void SdlEnduranceTestBenchRun(void)
*/ */
static bool SdlAreAllNodesOperational(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) 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; return CO_TRUE;