two pause / resume inputs

More
25 Jul 2023 18:45 - 25 Jul 2023 19:38 #276246 by Kasper-001
hello 

is there a simple way to add one more input to this setup


# --- Toggle button stuff ---

loadrt toggle count=3
loadrt toggle2nist count=3

addf toggle.0 servo-thread
addf toggle.1 servo-thread
addf toggle.2 servo-thread

addf toggle2nist.0 servo-thread
addf toggle2nist.1 servo-thread
addf toggle2nist.2 servo-thread

loadrt and2 count=2
loadrt or2 count=2

addf and2.0 servo-thread
addf and2.1 servo-thread 
addf or2.0 servo-thread

# --- Toggle machine on button ---


net btn-pwr toggle.1.in <= hm2_7i92.0.7i76.0.0.input-24  # Machine on Button
net pwr-btn toggle2nist.1.in <= toggle.1.out
net tog-on toggle2nist.1.is-on <=  halui.machine.is-on
net pwr-on halui.machine.on <= toggle2nist.1.on
net pwr-off halui.machine.off <= toggle2nist.1.off

# External Program Pause/Resume Button

net pause-resume-btn and2.0.in0 and2.1.in0 <= hm2_7i92.0.7i76.0.0.input-23 
net pause-on toggle2nist.0.is-on and2.0.in1 <= halui.program.is-paused
net run-on and2.1.in1 <= halui.program.is-running
net pause-sig or2.0.in0 <= and2.0.out
net resume-sig or2.0.in1 <= and2.1.out
net toggle-ok toggle.0.in <= or2.0.out
net togglesig toggle2nist.0.in <= toggle.0.out
net toggleon halui.program.pause <= toggle2nist.0.on
net toggleoff halui.program.resume <= toggle2nist.0.off

i like to use   input.0.btn-mode  on my ps3 controller

 
Last edit: 25 Jul 2023 19:38 by Kasper-001.

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

More
25 Jul 2023 19:05 #276249 by PCW
Replied by PCW on topic two pause / resume inputs
You can make wider "AND" and "OR" gates with the logic component

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

More
25 Jul 2023 19:30 #276253 by Kasper-001
sorry but i can´t see how its done,  

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

More
25 Jul 2023 19:35 #276254 by PCW
Replied by PCW on topic two pause / resume inputs
I don't totally understand the logic but it seems like you might need
say a 3 input "OR" gate, and that is something the logic component can do...

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

More
25 Jul 2023 19:44 #276257 by Kasper-001
and i dont know how to build it, or where to put in   input.0.btn-mode
 

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

More
25 Jul 2023 19:55 - 25 Jul 2023 19:57 #276258 by PCW
Replied by PCW on topic two pause / resume inputs
Nothing to build, the logic component is part of LinuxCNC

Here's an example of creating a 3 input "or" gate:

halcmd: loadrt logic personality=0x203
halcmd: addf logic.0 servo-thread

And the pins it creates:

halcmd: show pin logic
Component Pins:
Owner Type Dir Value Name
51 bit IN FALSE logic.0.in-00
51 bit IN FALSE logic.0.in-01
51 bit IN FALSE logic.0.in-02
51 bit OUT FALSE logic.0.or
51 s32 OUT 164 logic.0.time

( The "logic.0.or" pin is the output )

"man logic" for details
Last edit: 25 Jul 2023 19:57 by PCW.

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

More
25 Jul 2023 20:06 - 25 Jul 2023 20:07 #276260 by Kasper-001
51 bit IN FALSE logic.0.in-00 input.0.btn-mode
51 bit IN FALSE logic.0.in-01 hm2_7i92.0.7i76.0.0.input-23
51 bit IN FALSE logic.0.in-02
51 bit OUT FALSE logic.0.or
51 s32 OUT 164 logic.0.time  

so i have to delete all this then ?
net pause-resume-btn and2.0.in0 and2.1.in0 <= hm2_7i92.0.7i76.0.0.input-23 
net pause-on toggle2nist.0.is-on and2.0.in1 <= halui.program.is-paused
net run-on and2.1.in1 <= halui.program.is-running
net pause-sig or2.0.in0 <= and2.0.out
net resume-sig or2.0.in1 <= and2.1.out
net toggle-ok toggle.0.in <= or2.0.out
net togglesig toggle2nist.0.in <= toggle.0.out
net toggleon halui.program.pause <= toggle2nist.0.on
net toggleoff halui.program.resume <= toggle2nist.0.off
Last edit: 25 Jul 2023 20:07 by Kasper-001.

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

More
25 Jul 2023 20:14 #276261 by PCW
Replied by PCW on topic two pause / resume inputs
No, just suggesting a way to get wider than 2 input gate

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

More
25 Jul 2023 20:20 #276263 by Kasper-001
okay, but i dont know how to set it, can´t see it 

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

Time to create page: 0.257 seconds
Powered by Kunena Forum