request information on how to use correctly or2 function

More
19 Jul 2021 08:41 #215294 by sibelius
Hello everyone,

While I was thinking at my Emergency stop hal code, I realize, looking at my hal file, that I did something wrong and incomplete.
The problem is focused on my tool setter that it has a circuit for an over travel safety to avoid crashing it.
So in my understanding this loop can be hooked with an existing signal used for example for an end switch and this is my goal.
This underneath is the hal code that links the virtual circuit to trigger the Z end switch and in this case acting also as a Z home switch.
#net both-home-z     <=  hm2_7i76e.0.7i76.0.0.input-06-not

#net both-home-z     =>  joint.3.home-sw-in
#net both-home-z     =>  joint.3.neg-lim-sw-in
#net both-home-z     =>  joint.3.pos-lim-sw-in
The code above does the job correctly as expected.

Now I create the following signal for the over travel safety loop on pin 13
net over-travel <= hm2_7i76e.0.7i76.0.0.input-13-not
Now what I would like to do is to create a signal that basically when the tool trying to crash the tool setter it act like if the Z switch was trigged.
Basically I need to write a piece of code with an or2.0 function that gets two inputs in and one output accordingly with the or2.0 truth table.
So that's my hal code 
loadrt or2
addf or2.0 servo-thread

net signal-a or2.0.in0 <= hm2_7i76e.0.7i76.0.0.input-06-not

net signal-b or2.0.in1 <= hm2_7i76e.0.7i76.0.0.input-13-not

net a-or-b <= or2.0.out
 
Any help would be great.
Another question that comes to my mind is: the pin 06 need to be unlinked if I use it into an or2.0 function? 
I am a bit confuse all along the way.

Thanks.
V.
 

Please Log in or Create an account to join the conversation.

More
19 Jul 2021 10:03 #215304 by Aciera
Looks ok to me.

Another question that comes to my mind is: the pin 06 need to be unlinked if I use it into an or2.0 function? 

An output can only be connected to one signal. So if you  have this
net both-home-z     <=  hm2_7i76e.0.7i76.0.0.input-06-not
want you want to reuse 'hm2_7i76e.0.7i76.0.0.input-06-not'

Then you would use the signal 'both-home-z':
net both-home-z or2.0.in0 

 
The following user(s) said Thank You: Sadmeatball, sibelius

Please Log in or Create an account to join the conversation.

More
19 Jul 2021 10:53 #215311 by sibelius
Hi Aciera, thanks for your answer,

I think I understood, make sense what you are saying.
So basically I could write 
both-home-z
instead of 
signal-a
and 
over-travel
instead of 
signal-b
.
I need to think a bit more, I am extremely slow when it comes to figure out something.

Thanks again
ciao

Please Log in or Create an account to join the conversation.

Time to create page: 0.108 seconds
Powered by Kunena Forum