hal interface value logic inversion
12 Sep 2021 02:17 #220275
by wang
hal interface value logic inversion was created by wang
Because my limit signal switch is in NPN mode, it is always in a high level state, so I want to reverse the signal acquisition value in the hal file and then match it to joint.0.pos-lim-sw-in
I don't know if hal provides such a method, or how I should invert the signal in hal.
E.g:
net Zpos_limit lcec.0.2.DIin-16 => joint.2.pos-lim-sw-in
I want to reverse the value of lcec.0.2.DIin-16 and then =>joint.2.pos-li-sw-in
Who can help me solve this problem, thank you all
I don't know if hal provides such a method, or how I should invert the signal in hal.
E.g:
net Zpos_limit lcec.0.2.DIin-16 => joint.2.pos-lim-sw-in
I want to reverse the value of lcec.0.2.DIin-16 and then =>joint.2.pos-li-sw-in
Who can help me solve this problem, thank you all
Please Log in or Create an account to join the conversation.
12 Sep 2021 03:44 #220276
by PCW
Replied by PCW on topic hal interface value logic inversion
You can use the "not" component to invert a bit type hal signal
loadrt not count=3
addf not.0 servo-thread
addf not.1 servo-thread
addf not.2 servo-thread
net signal some_pin_you_need_inverted not.0.in
net not_signal un-inverted_pin not.0.out
loadrt not count=3
addf not.0 servo-thread
addf not.1 servo-thread
addf not.2 servo-thread
net signal some_pin_you_need_inverted not.0.in
net not_signal un-inverted_pin not.0.out
The following user(s) said Thank You: wang
Please Log in or Create an account to join the conversation.
Time to create page: 0.062 seconds