LOGIC(9) | HAL Component | LOGIC(9) |
logic - LinuxCNC HAL component providing configurable logic functions
loadrt logic [count=N|names=name1[,name2...]] personality=0xXXXX[,0xXXXX...]
General `logic function' component. Can perform `and', `or', `nand', `nor' and `xor' of up to 16 inputs.
Determine the proper value for `personality' by adding the inputs and outputs then convert to hex:
Outputs can be combined, for example 2 + 256 + 1024 = 1282 converted to hex would be 0x502 and would have two inputs and have both `xor' and `and' outputs.
This is an OR circuit connected to three different signals, two inputs named sig-in-0 and sig-in-1, and one output named sig-out. First the circuit is defined, then its function is connected to the servo real time thread, last, its pins are connected to the wanted signals.
loadrt logic count=1 personality=0x202 addf logic.0 servo-thread net sig-in-0 => logic.0.in-00 net sig-in-1 => logic.0.in-01 net sig-out <= logic.0.or
This is a named AND circuit with two inputs and one output.
loadrt logic names=both personality=0x102 addf both servo-thread net sig-in-0 => both.in-00 net sig-in-1 => both.in-01 net sig-out <= both.and
Jeff Epler
GPL
2023-02-10 | LinuxCNC Documentation |