Yes, hm2_7i92.0.write needs to be located in last position.
I removed the toggle to focus on the signal reset.
Here is the HAL corrected I ran including your code :
Code:
loadrt hostmot2
loadrt hm2_eth board_ip="10.10.10.10" config=" num_encoders=1 num_pwmgens=0 num_stepgens=0 sserial_port_0=0000xx"
loadrt threads name1=servo-thread period1=1000000
loadrt not
loadrt tristate_bit
addf hm2_7i92.0.read servo-thread
addf not.0 servo-thread
addf tristate-bit.0 servo-thread
setp tristate-bit.0.in 1
addf hm2_7i92.0.write servo-thread
net enable hm2_7i92.0.encoder.00.index-enable tristate-bit.0.out not.0.in
net reset not.0.out tristate-bit.0.enable
The "reset" signal observations with halscope show unexpected behavior.
I used halscope in Run mode : single and Trigger : normal + force.
I made a first record #1 where we observe that "reset" is raised to 1 but is not set back 0 after one cycle as expected.
Then I made a second record #2 where "reset" remains at 1 except when set back to 0 periodically for one cycle, I guess when the index is detected by 7i92 as i am rotating the rotary shaft.
I checked the code as follow and for me it should work, except some unexpected behavior on index-enable that is input and output for 7i92 or something else I ignored
Code:
First cycle
index-enable = 0
not.0.in = 0
not.0.out = 1
tristate-bit.0.in = 1
tristate-bit.0.enable = 1
tristate-bit.0.out = 1
enable-index = 1
Cycles where 7i92 did not detect index
index-enable = 1
not.0.in = 1
not.0.out = 0
tristate-bit.0.in = 1
tristate-bit.0.enable = 0
tristate-bit.0.out = 1
enable-index = 1
Cycle following 7i92 detected index (exactly identical to First cycle)
index-enable = 0
not.0.in = 0
not.0.out = 1
tristate-bit.0.in = 1
tristate-bit.0.enable = 1
tristate-bit.0.out = 1
enable-index = 1