LinuxCNC Documentation

СИНТАКСИС

#include <hal.h>

int hal_init(const char *modname);

АРГУМЕНТИ

modname

Назва цього модуля HAL.

ОПИС

The hal_init() function sets up HAL and RTAPI. It must be called by any module that intends to use the API, before any other RTAPI calls.

The modname argument must point to a string that identifies the module. The string may be no longer than HAL_NAME_LEN characters.

МІРКУВАННЯ В РЕАЛЬНОМУ ЧАСІ

Викликати лише з коду не реального часу або коду ініціалізації/очищення, а не із завдань реального часу.

ПОВЕРНЕНЕ ЗНАЧЕННЯ

Returns a positive non-zero integer component ID on success. The component ID is used for subsequent calls to HAL and rtapi APIs. On failure, returns a negative errno value:

-EINVAL

The name argument was too long.

-EEXIST

The component name already exists.

-EMFILE

Too many modules (rtapi error).

-ENOMEM

Failed to allocate memory for component registration.

-EPROTO

HAL data version mismatch.

ДИВІТЬСЯ ТАКОЖ