[][src]Function linuxcnc_hal_sys::hal_signal_new

pub unsafe extern "C" fn hal_signal_new(
    name: *const c_char,
    type_: hal_type_t
) -> c_int

'hal_signal_new()' creates a new signal object. Once a signal has been created, pins can be linked to it with hal_link(). The signal object contains the actual storage for the signal data. Pin objects linked to the signal have pointers that point to the data. 'name' is the name of the new signal. It must be no longer than HAL_NAME_LEN. If there is already a signal with the same name the call will fail. 'type' is the data type handled by the signal. Pins can only be linked to a signal of the same type. Note that the actual address of the data storage for the signal is not accessible. The data can be accessed only by linking a pin to the signal. Also note that signals, unlike pins, do not have 'owners'. Once created, a signal remains in place until either it is deleted, or the last HAL component exits. If successful, 'hal_signal_new() returns 0. On failure it returns a negative error code.