HAL File


Pins & Signals

halmeter is a good way to observe the pins & signals.

HAL Commands

See also,


addf

The addf command adds a function to a real-time thread. If the StepConf wizard was used to create the configuration, two threads have been created (“base-thread” and “servo-thread”).
addf adds function functname to thread threadname. Default is to add the function in the order they are in the file. If position is specified, adds the function to that spot in the thread. A negative position indicates the position with respect to the end of the thread. For example 1 is start of thread, -1 is the end of the thread, -3 is third from the end.

loadrt

The command loadrt loads a real time HAL component. Real time component functions need to be added to a thread to be updated at the rate of the thread. You cannot load a non-realtime component into the realtime space.

Syntax and Example

 

 loadrt <component> <options>
 loadrt mux4 count=1


loadusr

The command loadusr loads a non-realtime HAL component. Non-realtime programs are their own separate processes, which optionally talk to other HAL components via pins and parameters. You cannot load realtime components into non-realtime space.

net

The command net creates a connection between a signal and one or more pins. If the signal does not exist net creates the new signal. This replaces the need to use the command newsig. The optional direction arrows <=, => and <=> make it easier to follow the logic when reading a net command line and are not used by the net command. The direction arrows must be separated by a space from the pin names.

Syntax and Example

 

 net signal-name pin-name <optional arrow> <optional second pin-name>
 net home-x joint.0.home-sw-in <= parport.0.pin-11-in

In the above example home-x is the signal name, joint.0.home-sw-in is a Direction IN pin, <= is the optional direction arrow, and parport.0.pin-11-in is a Direction OUT pin. This may seem confusing but the in and out labels for a parallel port pin indicates the physical way the pin works not how it is handled in HAL.
A pin can be connected to a signal if it obeys the following rules
  • An IN pin can always be connected to a signal.
  • An IO pin can be connected unless there’s an OUT pin on the signal.
  • An OUT pin can be connected only if there are no other OUT or IO pins on the signal.
The same signal-name can be used in multiple net commands to connect additional pins, as long as the rules above are obeyed.

setp

The command setp sets the value of a pin or parameter. The valid values will depend on the type of the pin or parameter. It is an error if the data types do not match.
Some components have parameters that need to be set before use. Parameters can be set before use or while running as needed. You cannot use setp on a pin that is connected to a signal.

Syntax and Example

 

 setp <pin/parameter-name> <value>
 setp parport.0.pin-08-out TRUE


sets

The command sets sets the value of a signal.

Syntax and Example

 

 sets <signal-name> <value>
 net mysignal and2.0.in0 pyvcp.my-led
 sets mysignal 1

It is an error if:
  • The signal-name does not exist
  • If the signal already has a writer
  • If value is not the correct type for the signal

unlinkp

The command unlinkp unlinks a pin from the connected signal. If no signal was connected to the pin prior running the command, nothing happens. The unlinkp command is useful for troubleshooting.

Syntax and Example

 

 unlinkp <pin-name>
 unlinkp parport.0.pin-02-out

########## Standard Footer for all pages ##########
spacer line

About the Rose Engine Butler System
Terms of Use

eMail comments to
ColvinTools @ Gmail [period] com -> mailto:ColvinTools [snail] Gmail [period] com