![]() |
![]() |
![]() |
![]() |
5 ERROR MESSAGES AND RECOVERY
5.1 Error Checking
The driver performs a number of checks that the correct conditions are fulfilled and reports an error if this is not the case. This section specifies the conditions the driver checks before or after the execution of an ioctl control command.
An open request in exclusive read/write mode is rejected if the device is open to any other process in exclusive or shared read/write mode.
An open request in shared read/write mode is rejected if the device is open to any other process in exclusive read/write mode.
An open request in test read/write mode is rejected if the device is open to any other process in test read/write mode.
The driver performs the following sequence on a call of the ioctl() function. If a check fails or a timeout is exceeded, then the function is aborted and it returns an error:
1. Check if the command is known to the driver. Because the driver can be used with several controller version, this check does not necessarily mean that the command is supported by the controller.
3. If the command is declared as `protected', then the driver tries to get exclusive access to the controller board, to ensure that no other task is executing any driver request on the same controller board. Steps 4 to 9 will then be executed exclusively by this task. The driver waits up to the specified timeout. Additionally a timer will be started to check the total command execution time. Up to four times the specified timeout value is allowed. However, this is only to check for a command-timeout condition and inform the caller, not to break the command on a timeout.
4. Then the command is put into the controller's command queue, if it is not full. This access is independently protected against simultaneous access by other tasks. Checks for legal parameter values are done by the controller, not by the driver.
5. The driver waits for the reply from the controller for the specified device, up to the specified timeout.
6. The reply is fetched from the controller's reply queue, which is again independently protected against simultaneous access by other tasks.
8. If the controller detected an error condition which has to be acknowledged, then an automatic CLEAR command is appended. This will also clear the error status flags of the controller.
10. If the command is declared as `protected', then the driver releases the board-wide protection now and checks the timer for a timeout-condition.
5.2 Command-dependent Behaviour
Several `behaviour-flags' are defined for each command, which define ...
· if a task shall have mutual exclusive access to the controller board (`protected'). This is the case for all commands, except for:
· if an automatic EXECUTE shall be appended to the command in order to activate the changes immediately. This is the case only for:
· if a command is executed by a special routine. This is true for commands which are handled completely inside the driver:
These flags cannot be changed.
5.3 Hints for Error Recovery
The controller rejects a command if it would move the axis in positive direction and it is already on the upper software limit or on the upper hardware limit or if positive motion is inhibited or if it would move the axis in negative direction and it is already on the lower software limit or on the lower hardware limit or if negative motion is inhibited.
To go out of limit, enable the axis and move into the negative direction if the axis is on the upper limit, or in the positive direction if the axis is on the lower limit.
Some parameters can only be set in specific modes. More information can be found in the controller manuals ([2]).
5.4 Error Messages
The following list shows all possible errors which can be returned by the mcon Driver. There are three types of errors:
The errors are shown in alphabetical order by their literals as defined in mconErrors.h (mcon specific errors with prefix mcon) and lcudrvErrors.h (common errors with prefix lcudrv) together with a description of their meaning and reason. Errors corresponding to each function are depicted in section 3.3.
Note: additional errors, not described here, can be returned when the VxWorks I/O system rejects a call before invoking the driver.
5.4.1 Common Driver Errors
The following list shows all common driver errors as defined in [10].
· lcudrvERROR_ACCESS_CONFLICT
The open mode conflicts with the open modes of already existing channels or the requested action is not allowed with this open mode.
· lcudrvERROR_TIMEOUT
The call is timed-out because access to the device was pending for longer than the driver timeout parameter.
5.4.2 MCON Specific Errors
· mconERROR_COMMAND_TIMEOUT
Timeout on command execution. The driver internal watchdog timer has detected that the execution time of a command exceeded the pre-defined limit. However, the command has not been cancelled by the driver.
· mconERROR_NO_REPLY
Failed to read reply from the controller reply-queue, although the controller indicated via interrupt that a reply is available.
· mconERROR_QUEUE_FULL
failed to send command to the controller because the controller's command queue was full.
· mconERROR_STATUS_COMM
Controller detected a communication error, i.e. a controller watchdog timeout.
· mconERROR_STATUS_DRIVE_FAULT
The controller detected that the drive-fault signal is active (e.g. amplifier not in normal-mode)
· mconERROR_STATUS_FOLLOWING_ERROR
Controller detected that the maximum following error was exceeded.
· mconERROR_STATUS_PARAM_RANGE
controller detected invalid parameter, e.g. value/position out of limits.
· mconERROR_STATUS_UNEXP_COMMAND
Controller detected unexpected command, e.g. wrong sequence in initialisation.
· mconERROR_SYNC_TIMEOUT
Timeout on waiting for the controller's reply to a command. That means that no interrupt was given by the controller within the specified timeout. This is a severe error because the reply-queue can get into an inconsistent state. When the controller actually gives the reply at later time, a `dead' reply entry is in the queue which will confuse the driver. This situation can only be solved by the command mconCMD_FLUSH_QUEUE. When switching the `On-Fly' mode off, the timeout-value should be high enough, otherwise this error will occur.
![]() Quadralay Corporation http://www.webworks.com Voice: (512) 719-3399 Fax: (512) 719-3606 sales@webworks.com |
![]() |
![]() |
![]() |
![]() |