ASK: Net Command (HAL)
- Sadmeatball
- Offline
- New Member
Less
More
- Posts: 13
- Thank you received: 1
26 Jul 2021 06:38 #215930
by Sadmeatball
ASK: Net Command (HAL) was created by Sadmeatball
Hi All,
Say I have this in my hal file:
net jog-x-pos halui.axis.x.plus (it mean I have connected jog-x-pos to halui x plus right?)
and I have :
net jog-x-pos input.0.abs-x-is-pos (it mean I have connected jog-x-pos to input from my USB controller?)
This net command below do a same principle as net command above right?
net jog-x-pos halui.axis.x.plus input.0.abs-x-is-pos
Now the question is if I Want to add one more input signal from my USB controller, say input.0.abs-hat0x-is-pos to connect to jog-x-pos:
net jog-x-pos halui.axis.x.plus input.0.abs-x-is-pos input.0.abs-hat0x-is-pos
Can i use this net command?
Thank You ,Always
CB
Say I have this in my hal file:
net jog-x-pos halui.axis.x.plus (it mean I have connected jog-x-pos to halui x plus right?)
and I have :
net jog-x-pos input.0.abs-x-is-pos (it mean I have connected jog-x-pos to input from my USB controller?)
This net command below do a same principle as net command above right?
net jog-x-pos halui.axis.x.plus input.0.abs-x-is-pos
Now the question is if I Want to add one more input signal from my USB controller, say input.0.abs-hat0x-is-pos to connect to jog-x-pos:
net jog-x-pos halui.axis.x.plus input.0.abs-x-is-pos input.0.abs-hat0x-is-pos
Can i use this net command?
Thank You ,Always
CB
Please Log in or Create an account to join the conversation.
26 Jul 2021 08:05 - 26 Jul 2021 08:10 #215933
by Aciera
That won't work since a signal (jog-x-pos in this case) can only have one source. If you want to have two alternative sources to activate halui.axis.x.plus you need to use an OR2 component:
Replied by Aciera on topic ASK: Net Command (HAL)
That's correct.This net command below do a same principle as net command above right?
net jog-x-pos halui.axis.x.plus input.0.abs-x-is-pos
Now the question is if I Want to add one more input signal from my USB controller, say input.0.abs-hat0x-is-pos to connect to jog-x-pos:
net jog-x-pos halui.axis.x.plus input.0.abs-x-is-pos input.0.abs-hat0x-is-pos
That won't work since a signal (jog-x-pos in this case) can only have one source. If you want to have two alternative sources to activate halui.axis.x.plus you need to use an OR2 component:
loadrt or2 names=or.jog-x-pos
addf or.jog-x-pos servo-thread
net jog-x-pos-1 input.0.abs-x-is-pos or.jog-x-pos.in0
net jog-x-pos-2 input.0.abs-hat0-x-is-pos or.jog-x-pos.in1
net jog-x-pos or.jog-x-pos.out halui.axis.x.plus
Last edit: 26 Jul 2021 08:10 by Aciera.
The following user(s) said Thank You: andypugh, Sadmeatball
Please Log in or Create an account to join the conversation.
- Sadmeatball
- Offline
- New Member
Less
More
- Posts: 13
- Thank you received: 1
31 Aug 2021 12:53 #219241
by Sadmeatball
Replied by Sadmeatball on topic ASK: Net Command (HAL)
Hi Aciera
Now i want to control 2 outputs. Output A and Output B.
2 different buttons to turn on Output A and 2 different buttons for Output B
From your last reply you suggested me to use or2. component
Can I ask for help to check if the command I wrote is correct or there is a writing error.
and if you don't mind please show me where I went wrong because it's very important to build my thinking about HAL logic.
Sorry, it took so long to reply
Thank You, Always
CB
loadrt or2 names=or2.jog-x-pos , or2.jog-x-neg , or2.jog-y-pos , or2.jog-y-neg
addf or2.jog-x-pos servo-thread
addf or2.jog-x-neg servo-thread
addf or2.jog-y-pos servo-thread
addf or2.jog-y-neg servo-thread
net jog-x-pos-1 input.0.abs-x-is-pos or2.jog-x-pos.in0
net jog-x-pos-2 input.0.abs-hat0-x-is-pos or2.jog-x-pos.in1
net jog-x-pos or2.jog-x-pos.out halui.axis.x.plus
net jog-x-neg-1 input.0.abs-x-is-neg or2.jog-x-neg.in0
net jog-x-neg-2 input.0.abs-hat0-x-is-neg or2.jog-x-neg.in1
net jog-x-neg or2.jog-x-neg.out halui.axis.x.minus
net jog-y-pos-1 input.0.abs-y-is-pos or2.jog-y-pos.in0
net jog-y-pos-2 input.0.abs-hat0-y-is-pos or2.jog-y-pos.in1
net jog-y-pos or2.jog-y-pos.out halui.axis.y.plus
net jog-y-neg-1 input.0.abs-y-is-neg or2.jog-y-neg.in0
net jog-y-neg-2 input.0.abs-hat0-y-is-neg or2.jog-y-neg.in1
net jog-y-neg or2.jog-y-neg.out halui.axis.y.minus
Now i want to control 2 outputs. Output A and Output B.
2 different buttons to turn on Output A and 2 different buttons for Output B
From your last reply you suggested me to use or2. component
Can I ask for help to check if the command I wrote is correct or there is a writing error.
and if you don't mind please show me where I went wrong because it's very important to build my thinking about HAL logic.
Sorry, it took so long to reply
Thank You, Always
CB
Warning: Spoiler!
loadrt or2 names=or2.jog-x-pos , or2.jog-x-neg , or2.jog-y-pos , or2.jog-y-neg
addf or2.jog-x-pos servo-thread
addf or2.jog-x-neg servo-thread
addf or2.jog-y-pos servo-thread
addf or2.jog-y-neg servo-thread
net jog-x-pos-1 input.0.abs-x-is-pos or2.jog-x-pos.in0
net jog-x-pos-2 input.0.abs-hat0-x-is-pos or2.jog-x-pos.in1
net jog-x-pos or2.jog-x-pos.out halui.axis.x.plus
net jog-x-neg-1 input.0.abs-x-is-neg or2.jog-x-neg.in0
net jog-x-neg-2 input.0.abs-hat0-x-is-neg or2.jog-x-neg.in1
net jog-x-neg or2.jog-x-neg.out halui.axis.x.minus
net jog-y-pos-1 input.0.abs-y-is-pos or2.jog-y-pos.in0
net jog-y-pos-2 input.0.abs-hat0-y-is-pos or2.jog-y-pos.in1
net jog-y-pos or2.jog-y-pos.out halui.axis.y.plus
net jog-y-neg-1 input.0.abs-y-is-neg or2.jog-y-neg.in0
net jog-y-neg-2 input.0.abs-hat0-y-is-neg or2.jog-y-neg.in1
net jog-y-neg or2.jog-y-neg.out halui.axis.y.minus
Please Log in or Create an account to join the conversation.
31 Aug 2021 13:30 - 31 Aug 2021 13:31 #219245
by Aciera
Replied by Aciera on topic ASK: Net Command (HAL)
Don't use whitespaces in the names list, change this:
to this:
Otherwise I think you should be good to go.
loadrt or2 names=or2.jog-x-pos , or2.jog-x-neg , or2.jog-y-pos , or2.jog-y-neg
loadrt or2 names=or2.jog-x-pos,or2.jog-x-neg,or2.jog-y-pos,or2.jog-y-neg
Last edit: 31 Aug 2021 13:31 by Aciera.
Please Log in or Create an account to join the conversation.
Time to create page: 0.066 seconds