11-29-2010 08:30 AM
I have written an application that uses several CAN interfaces and talks to different devices through them using the CANopen library. The application runs on a dual-core PXI system with LabVIEW RT 2009 SP1 and NI-XNET 1.1.1. The application talks with each CAN device using a separate set of code that is spun off as an individual thread. While testing my application, I have noticed my application sometimes locks up. To work around this, I have added semaphores to ensure only one VI from the CANopen library is called at any given time. With the semaphores in place I don't notice the lock ups anymore.
Should I need to single-thread calls to the CANopen library? I don't recall seeing anything in the library documentation warning about this. Has anyone else seen this issue? My application makes fairly thorough use of the CANopen library, including SDOs, PDOs, heartbeats, emergency messages, and sync objects.
11-30-2010 05:46 PM
Hi nickle,
It sounds like your program without the semaphores is running into a deadlocking issue. I mean with the CANopen VI's you shouldn't have to use a semaphore; but, deadlocking seems like a good possibility of occurring depending on how your code is written.