ASK: Net Command (HAL)

More
26 Jul 2021 06:38 #215930 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

 

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

More
26 Jul 2021 08:05 - 26 Jul 2021 08:10 #215933 by Aciera
Replied by Aciera on topic ASK: Net Command (HAL)

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

That's correct.

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.

More
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
Warning: Spoiler!

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

More
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:
loadrt or2 names=or2.jog-x-pos , or2.jog-x-neg , or2.jog-y-pos , or2.jog-y-neg
to this:
loadrt or2 names=or2.jog-x-pos,or2.jog-x-neg,or2.jog-y-pos,or2.jog-y-neg
Otherwise I think you should be good to go.
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.089 seconds
Powered by Kunena Forum