If your existing hal files and the new hal file both load the same component, then you will need to renumber the new hal file so that they can coexist. For instance, if file1.hal has these lines:
loadrt and2 count=2and refers to and.0 and and.1, and file2.hal has these lines:
loadrt and2 count=1and refers to and.0, you will have to change file1 to loadrt and2 count=3, and change references to and2.0 in file2.hal to and2.2 so that each hal file has its own and blocks to use. The loadrt and2 line in file2.hal is removed.
halrun example.hal(to shut down hal when the .hal script finishes) or
halrun -I example.hal(to show the halcmd prompt when the .hal script finishes). If the .hal file is not in the current directory, then use a path, such as:
halrun -I /home/yourname/Desktop?/example.hal
Compatability: 2.3
loadrt pluto_servo test_encoder=1 loadrt threads name1=thread period1=200000 loadrt siggen loadrt sim_encoder loadrt tristate_bit setp sim-encoder.0.ppr 2540 setp pluto-servo.encoder.0.scale 10160 setp pluto-servo.pwm.0.enable 1 setp sim-encoder.0.speed 5 setp tristate-bit.0.in 1 addf tristate-bit.0 thread addf pluto-servo.read thread addf siggen.0.update thread addf sim-encoder.update-speed thread addf sim-encoder.make-pulses thread addf pluto-servo.write thread net sine siggen.0.sine => pluto-servo.pwm.0.value net index tristate-bit.0.out => pluto-servo.encoder.0.index-enable net phA sim-encoder.0.phase-A => pluto-servo.dout.00 net phB sim-encoder.0.phase-B => pluto-servo.dout.01 net phZ sim-encoder.0.phase-Z => pluto-servo.dout.02 start