Hi,

It works fine for me.
I've made a quick test with a 64 bits var mapped on an RPDO and the var is updated as expected.

Try with my repository:
https://bitbucket.org/Mongo/canfestival-3-asc

But i don't think i have any difference with mainline regarding PDOs.

Regards,

--
F. Beaulier
www.ingelibre.fr

Le 05/09/2015 13:42, canfestival-devel@lists.sourceforge.net a écrit :
Hi ,


I have a slave device with CANfestival and   slave has 1 RPDO .
I want to receive this RPDO's all bytes . 8 of 8bytes.
So , I properly entered the needed value to RPD0s mapping ( that belongs to
a 64 bit variables odindex, subindex ...  )

The problem is ,

When this RPDO is mapped to 16 bit or 32 bit variable , variables properly updated by RPDO.
But , When this RPDO is mapped to 64 bit variable , it is failed.

(The stack has been downloaded from www.canfestival.org <https://blu185.mail.live.com/mail/www.canfestival.org> date : 05/09/2015)

when i debug the code ,the following part of code is updating OD variable . when 64 bit variable is mapped , the conditional at the line 259 is resulted as false .

I put a breakpoint and  added the variables to the watch  at line 259.
Size= 0x04  , offset = 0 , m->Len = 0x04 .
As you see at line 259  ,  m->len shifted left three times.
I thought this was the source of problem.

Shifting left  m->len four times ,looks solves the problem.

But I am suspicious about solution. Is this  sufficient and valid ?


Best regards ...
Fatih






-------------------------------------------------------------------------------------------------
/*!
** @file   pdo.c
** @author Edouard TISSERANT and Francis DUPIN
** @date   Tue Jun  5 09:32:32 2007
**
** @brief
**
**
*/
---------------------------------------------------------------------------------------------------------------------
line 257       /* set variable only if Size != 0 and
line 258        * Size is lower than remaining bits in the PDO */
line 259       if (Size && ((offset + Size) <= (m->len << 3)))
                      {
                        /* copy bit per bit in little endian */
                        CopyBits (Size, (UNS8 *) & m->data[offset >> 3],
                                  offset % 8, 0, ((UNS8 *) tmp), 0, 0);
                        /*1->8 => 1 ; 9->16 =>2, ... */
                        ByteSize = (UNS32)(1 + ((Size - 1) >> 3));

                        objDict =
setODentry (d, (UNS16) ((*pMappingParameter) >> 16), (UNS8) (((*pMappingParameter) >> 8) &
                                              0xFF), tmp, &ByteSize, 0);

                        if (objDict != OD_SUCCESSFUL)
                          {
                            MSG_ERR (0x1938,
"error accessing to the mapped var : ",
                                     numMap + 1);
MSG_WAR (0x2939, " Mapped at index : ",
                                     (*pMappingParameter) >> 16);
                            MSG_WAR (0x2940, " subindex : ",
                                     ((*pMappingParameter) >> 8) & 0xFF);
                            return 0xFF;
                          }

                        MSG_WAR (0x3942,
                                 "Variable updated by PDO cobid : ",
                                 UNS16_LE(m->cob_id));
                        MSG_WAR (0x3943, "         Mapped at index : ",
                                 (*pMappingParameter) >> 16);
                        MSG_WAR (0x3944, " subindex : ",
                                 ((*pMappingParameter) >> 8) & 0xFF);
                        offset += Size;
                      }
------------------------------------------------------------------------------------------------------





------------------------------------------------------------------------------


_______________________________________________
Canfestival-devel mailing list
Canfestival-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/canfestival-devel

------------------------------------------------------------------------------
_______________________________________________
Canfestival-devel mailing list
Canfestival-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/canfestival-devel

Reply via email to