View Single Post
  #2   Spotlight this post!  
Unread 27-10-2013, 10:10
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,169
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: VxWorks exception handling and division by zero

The reaction to an internal exception in VxWorks is customizable (so NI might have changed it). One can register signal handlers to trap exceptions and implement behaviours other than the default.

Even though the NI tasks and our robot application code are running in kernel space or context, the kernel context supports multiple tasks. The default reaction to an internal exception is to suspend the offending task, store some data in a special area of memory (so it can be examined after a warm reboot) and log a message. It is the exception handler task that implements this behaviour and the log message task that prints the message.

I am not sure about the 1/0 statement. My first guess is that would create an exception. Perhaps C++ traps that somehow or perhaps NI is trapping it somehow. Maybe the C pre-processor resolves 1/0 as a constant and the PowerPC never sees the statement. Try using 1.0/0.0 or using a variable (set to zero) in the denominator - that will probably create the exception more reliably.

HTH
__________________
Fast, cheap or working - pick any two!

Last edited by wireties : 27-10-2013 at 10:13.
Reply With Quote