- Thank you received: 0
request information on how to use correctly or2 function
- sibelius
- Topic Author
- New Member
-
Less
More
5 years 3 months ago #215294
by sibelius
request information on how to use correctly or2 function was created 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.
The code above does the job correctly as expected.
Now I create the following signal for the over travel safety loop on pin 13
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
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.
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.
Code:
#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
Now I create the following signal for the over travel safety loop on pin 13
Code:
net over-travel <= hm2_7i76e.0.7i76.0.0.input-13-not
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
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 to join the conversation.
5 years 3 months ago #215304
by Aciera
Replied by Aciera on topic request information on how to use correctly or2 function
Looks ok to me.
want you want to reuse 'hm2_7i76e.0.7i76.0.0.input-06-not'
Then you would use the signal 'both-home-z':
An output can only be connected to one signal. So if you have thisAnother question that comes to my mind is: the pin 06 need to be unlinked if I use it into an or2.0 function?
Code:
net both-home-z <= hm2_7i76e.0.7i76.0.0.input-06-not
Then you would use the signal 'both-home-z':
Code:
net both-home-z or2.0.in0
Please Log in to join the conversation.
- sibelius
- Topic Author
- New Member
-
Less
More
- Thank you received: 0
5 years 3 months ago #215311
by sibelius
Replied by sibelius on topic request information on how to use correctly or2 function
Hi Aciera, thanks for your answer,
I think I understood, make sense what you are saying.
So basically I could write
instead of
and
instead of
.
I need to think a bit more, I am extremely slow when it comes to figure out something.
Thanks again
ciao
I think I understood, make sense what you are saying.
So basically I could write
Code:
both-home-z
Code:
signal-a
Code:
over-travel
Code:
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 to join the conversation.
Time to create page: 0.088 seconds
