Skip navigation.
Home
The QNX Community Portal

View topic - Can not add antyhing to my software

Can not add antyhing to my software

For discussion of realtime and/or embedded programming.

Can not add antyhing to my software

Postby squall315 » Tue Jan 13, 2015 8:17 am

Hello to you all,

First I want to apologize because I know that I will give a poor description of my problem but any idea to solve it (or things to check) would be greatly appreciated.
I am currently developping a software in QNX 6.6.0 in C++ to move several motors in real time using Ethercat and it was going great until recently.

Since a few days, each time I add anything to my soft, it compiles perfectly fine and does not show any problem during execution (the log file is perfect indicating that all the loops occur at the correct moment and all the threads are executing) but the motors do not move anymore. It seems to indicate that the part of the code where I send the data using Ethercat is not really executed but if I add a printf, it shows that the function is executed.

Which is even weirder is that the same thing happen regardless of what I add to my code and where.
I tried to use the tools to detect memory leak and trace the CPU usage and the threads but everything seems normal.

I am not sure my problem is very clear but I would appreciate any insight that could give me ideas to test because I am currently stuck.

Best regards,
Fabien
squall315
New Member
 
Posts: 4
Joined: Mon Jan 12, 2015 5:27 pm

Re: Can not add antyhing to my software

Postby maschoen » Tue Jan 13, 2015 12:52 pm

If your printf verifies that the code sending commands to Ethercat is working, but the motors are not turning, I would suggest the following are possible.

1) The Ethercat software is not working
2) The hardware is not working
maschoen
QNX Master
 
Posts: 2644
Joined: Wed Jun 25, 2003 5:18 pm

Re: Can not add antyhing to my software

Postby Tim » Tue Jan 13, 2015 2:54 pm

3) The commands you are sending over Ethercat are mangled / wrong.

Tim

P.S. You didn't mention whether a prior build of your software still works (drives the motors). If a prior build still drives the motors it would indicate that my suggestion is probably the problem. If a prior build doesn't drive the motors Maschoen's suggestion is probably the problem.
Tim
Senior Member
 
Posts: 1392
Joined: Wed Mar 10, 2004 12:28 am

Re: Can not add antyhing to my software

Postby squall315 » Wed Jan 14, 2015 2:20 pm

Thank you both for your answers,

To answer to Tim, yes a prior build of the software works which indicates that the hardware is working properly and, as I do not modify the Ethercat part, it seems indeed that the commands are somehow wrong but the datalog shows that the variables have the correct values so I do not see how it could be wrong.

Besides, this appears regardless of the part where I add something to my software. For example, if I add anything to the interface or the part of the code which is in charge of an IMU module which both have a specific thread and therefore have no impact on the commands sent through Ethercat, I still see the same phenomenon that everything seems fine but my motors are not moving anymore.

I suspect something is mixed up in the memory or is not behaving as expected in terms of real time or multithreading but I have no idea where I should look or what I can do.

Fabien
squall315
New Member
 
Posts: 4
Joined: Mon Jan 12, 2015 5:27 pm

Re: Can not add antyhing to my software

Postby squall315 » Wed Jan 14, 2015 4:28 pm

Thank you both for your answers.

To answer to Tim, an old version of the software still works showing that the hardware is ok and, as nothing has changed in the Ethercat library, this part should be fine too.

So I guess something is wrong in the data i send to the Ethercat slaves but the variables are saved in a datalog file and they are ok there.

Besides, I do not understand how when I add anything to my code even in completely different threads (like the one in charge of the interface or the communication with an IMU module), I affect the commands that are sent to the various motors through Ethercat.

I suspect I am doing something wrong with the way I handle the memory or the multithreading and the scheduling of my tasks but I did not find anything yet and everything I can see from the tools of Momentics seems fine.

Please do not hesitate if you know any test I could perform that could help.

Fabien
squall315
New Member
 
Posts: 4
Joined: Mon Jan 12, 2015 5:27 pm

Re: Can not add antyhing to my software

Postby Tim » Thu Jan 22, 2015 3:49 pm

Fabien,

A question about your 'old' version of software. Are you re-compiling this old version or simply using existing binaries? The reason I ask is that I wonder if you are somehow using a different compiler or linking to different libraries. That could explain why whenever you add *anything* to your code the Ethercat stops working. If you are simply using old binaries I would try recompiling the old source and make sure that newly build binaries from old source still works.

The next thing I would do would be to install tcpdump on your QNX machine. Then run tcpdump and capture packet data (both in/out) from the working version and the non-working version and confirm that they contain identical data. The answer to that will tell you if you have a timing issue or a data issue.

Tim
Tim
Senior Member
 
Posts: 1392
Joined: Wed Mar 10, 2004 12:28 am

Re: Can not add antyhing to my software

Postby squall315 » Fri Feb 06, 2015 5:28 pm

Hello Tim,

Thank you for your reply. I had the same problem indeed even when i recompiled the sources of the previous version.

I currently can not make my problem appear as I compiled a new QNX kernel as tcpdump was not available on the previous one and I do not have the same error on the new kernel.
I have not figured out what was wrong though.

Thank you anyway for your kind help,

Best regards,

Fabien
squall315
New Member
 
Posts: 4
Joined: Mon Jan 12, 2015 5:27 pm


Return to Realtime and Embedded

Who is online

Users browsing this forum: No registered users and 1 guest