This documentation is no longer maintained. For documentation of the current version of emc2, please see http://www.linuxcnc.org/docview/html

hal_signal_new

NAME
SYNTAX
ARGUMENTS
DESCRIPTION
RETURN VALUE
SEE ALSO

NAME

hal_signal_new, hal_signal_delete, hal_link − Manipulate HAL signals

SYNTAX

int hal_signal_new(char *signal_name, hal_type_t type)

int hal_signal_delete(char *signal_name)

int hal_link(char *pin_name, char *signal_name)

ARGUMENTS

signal_name

The name of the signal

pin_name

The name of the pin

type

The type of the signal, as specified in hal_type_t(3hal).

DESCRIPTION

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. If longer than HAL_NAME_LEN it will be truncated. If there is already a signal with the same name the call will fail.

hal_link links a pin to a signal. If the pin is already linked to a signal, the old link is broken. If the signal already has other pins linked to it, they are unaffected - one signal can be linked to many pins, but a pin can be linked to only one signal. ’pin_name’ and ’sig_name’ are strings containing the pin and signal names. If ’sig_name’ is NULL, then the pin will be unlinked (linked to a dummy variable).

hal_signal_delete deletes a signal object. Any pins linked to the object are unlinked.

RETURN VALUE

Returns a HAL status code.

SEE ALSO

hal_type_t(3hal)