fix NMTstartup handling - update README and default values

This commit is contained in:
Janez 2020-01-16 08:06:16 +01:00
parent 2fb8dfd223
commit 06a0493c78
4 changed files with 21 additions and 12 deletions

View File

@ -149,7 +149,7 @@
#endif
#endif
/* These declarations here are needed in the case the switches for the project
/* These declarations here are needed in the case the switches for the project
change the visibility in the headers in a way that the compiler doesn't see an declaration anymore */
#if CO_NO_LSS_SERVER == 0 /* LSS Server means LSS slave */
@ -224,7 +224,7 @@ CO_ReturnError_t CO_init(
{
return error;
}
}
#endif
@ -365,7 +365,7 @@ CO_ReturnError_t CO_new(void)
#if CO_NO_SYNC == 1
+ sizeof(CO_SYNC_t)
#endif
#if CO_NO_TIME == 1
#if CO_NO_TIME == 1
+ sizeof(CO_TIME_t)
#endif
+ sizeof(CO_RPDO_t) * CO_NO_RPDO
@ -403,7 +403,7 @@ CO_ReturnError_t CO_new(void)
#if CO_NO_SYNC == 1
if(CO->SYNC == NULL) errCnt++;
#endif
#if CO_NO_TIME == 1
#if CO_NO_TIME == 1
if(CO->TIME == NULL) errCnt++;
#endif
for(i=0; i<CO_NO_RPDO; i++){
@ -863,11 +863,7 @@ CO_NMT_reset_cmd_t CO_process(
co->NMT,
timeDifference_ms,
OD_producerHeartbeatTime,
#if (CO_NO_NMT_MASTER == 1) && defined(OD_NMTStartup)
OD_NMTStartup,
#else
0U,
#endif
OD_errorRegister,
OD_errorBehavior,
timerNext_ms);
@ -932,7 +928,7 @@ void CO_process_TPDO(
/* Verify PDO Change Of State and process PDOs */
for(i=0; i<CO_NO_TPDO; i++){
if(!co->TPDO[i]->sendRequest)
if(!co->TPDO[i]->sendRequest)
co->TPDO[i]->sendRequest = CO_TPDOisCOS(co->TPDO[i]);
CO_TPDO_process(co->TPDO[i], syncWas, timeDifference_us);
}

View File

@ -37,6 +37,19 @@ CANopen Features
RTR (remote transmission request) is a feature of CAN bus. Usage of RTR
is not recommended for CANopen and it is not implemented in CANopenNode.
### Self start
Object **0x1F80** from Object Dictionary enables the NMT slaves to start
automatically or allows it to start the whole network. It is specified in
DSP302-2 standard. Standard allows two values for slaves for object 0x1F80:
- Object 0x1F80, value = **0x8** - "NMT slave shall enter the NMT state
Operational after the NMT state Initialization autonomously (self starting)"
- Object 0x1F80, value = **0x2** - "NMT slave shall execute the NMT service
start remote node with node-ID set to 0"
Note: When node is stated (in NMT operational state), it is allowed to send or
receive Process Data Objects (PDO). If Error Register (object 0x1001) is set,
then NMT operational state is not allowed.
Usage of the CANopenNode
------------------------

View File

@ -113,7 +113,7 @@ struct sCO_OD_EEPROM CO_OD_EEPROM = {
/*1A01*/ {0x0, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L},
/*1A02*/ {0x0, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L},
/*1A03*/ {0x0, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L}},
/*1F80*/ 0x0L,
/*1F80*/ 0x00000008L,
/*2101*/ 0x30,
/*2102*/ 0xFA,
/*2111*/ {1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L},

View File

@ -546,7 +546,7 @@ bit 16-31: index from OD</description>
<CANopenSubObject subIndex="07" name="mapped object 7" objectType="7" dataType="07" accessType="rw" PDOmapping="no" defaultValue="0x00000000"/>
<CANopenSubObject subIndex="08" name="mapped object 8" objectType="7" dataType="07" accessType="rw" PDOmapping="no" defaultValue="0x00000000"/>
</CANopenObject>
<CANopenObject index="1F80" name="NMT startup" objectType="7" memoryType="ROM" dataType="07" accessType="rw" PDOmapping="no" defaultValue="0x00000000">
<CANopenObject index="1F80" name="NMT startup" objectType="7" memoryType="ROM" dataType="07" accessType="rw" PDOmapping="no" defaultValue="0x00000008">
<label lang="en">NMT Startup</label>
<description lang="en">Only bit 2 is implemented.
@ -794,7 +794,7 @@ Name - name of the trace as a string (informative).
Color - color of the trace as a string (informative).
Map - Map to variable in object dictionary, similar as PDO map(two bytes of index, one byte of subindex and 1 byte of bitlength. It's value will be copied to trace.value in case index and subindex are correct. If map index and subindex is zero, RPDO may be mapped to trace.value, for example. Valid values of map.bitlength is 08, 10 or 20 or 00, which indicates 8-bit, 16bit, 32-bit or default-size variable. Trace must be disabled, if mapping is written (Axis no set to 0).
Map - Map to variable in object dictionary, similar as PDO map(two bytes of index, one byte of subindex and 1 byte of bitlength. It's value will be copied to trace.value in case index and subindex are correct. If map index and subindex is zero, RPDO may be mapped to trace.value, for example. Valid values of map.bitlength is 08, 10 or 20 or 00, which indicates 8-bit, 16bit, 32-bit or default-size variable. Trace must be disabled, if mapping is written (Axis no set to 0).
Format - If first bit is zero, then value is used as signed integer otherwise as unsigned integer. If format is 0 or 1, text points are generated for time and value: "123;321\n140;345\n..." If format is 2 or 3, binary data is generated: 4-byte timestamp and 4-byte value. If format is 4 or 5, SVG path is generated: "M123,321H140V345...".