MesaPin per G-Code ein und ausschalten

More
4 years 4 months ago #244642 by Muecke
Der XML teil bleibt immer gleich den habe ich aus dem Code raus genommen.

Ich bekomme einen Fehler:

...
Signal 'lampe' can not add OUT pin 'pyvcp.button_lampe', it already has OUT pin 'motion.digital-out-00'
...

Da isst der Code dazu: io.hat
Code:
# Lampe net lampe => => pyvcp.led-lampe net lampe motion.digital-out-00 <=> hm2_7i95.0.ssr.00.out-00 net lampe pyvcp.button_lampe

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

More
4 years 4 months ago #244772 by Muecke
Ich verstehe die HAL Logik nicht. ;-(

So kann ich die Lampe im G-Code ein/ausschalte.
Code:
# G-Code net lampe <=> motion.digital-out-00 <=> hm2_7i95.0.ssr.00.out-00 <=> pyvcp.led-lampe

So kann ich die Lampe über den Button ein/ausschalte.
Code:
# Button net lampe <=> pyvcp.button_lampe <=> hm2_7i95.0.ssr.00.out-00 <=> pyvcp.led-lampe

Daher dachte ich dann kann ich mir eine kleinen Oder Bedingung erstellen.
Doch egal wie ich die zusammen baue funktioniert das nicht.

z.B.
Code:
# in net lampe or2.2.in0 <= motion.digital-out-00 net lampe or2.2.in1 <= pyvcp.button_lampe # out net lampe or2.2.out => hm2_7i95.0.ssr.00.out-00 <=> pyvcp.led-lampe

Fehler: Signal 'lampe' can not add OUT pin 'pyvcp.button_lampe', it already hat OUT pin 'motion.digital-out-00'


Hat jemand ein Idee?
Und wie bekomme ich den Button dazu einen Wert zu halten?

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

More
4 years 4 months ago - 4 years 4 months ago #244773 by roland

Code:
# in net lampe or2.2.in0 <= motion.digital-out-00 net lampe or2.2.in1 <= pyvcp.button_lampe # out net lampe or2.2.out => hm2_7i95.0.ssr.00.out-00 <=> pyvcp.led-lampe

Fehler: Signal 'lampe' can not add OUT pin 'pyvcp.button_lampe', it already hat OUT pin 'motion.digital-out-00'

Du braucht drei verschiedene Signale. Du verwendest jedoch immer das selbe Signal "lampe"
Last edit: 4 years 4 months ago by roland.
The following user(s) said Thank You: Muecke

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

More
4 years 4 months ago - 4 years 4 months ago #244776 by Muecke
Oh man, ich glaube ich habe das OR2 nicht richtig verstanden.

DANKE!

Das ist der neue CODE:
Code:
# Lampe net lampe_G-CODE xor2.2.in0 <= motion.digital-out-00 net lampe_button xor2.2.in1 <= pyvcp.button_lampe net lampe_Mesa xor2.2.out => hm2_7i95.0.ssr.00.out-00 <=> pyvcp.led-lampe

Wenn ich das normale OR2 verwende kann ich wenn per G-CODE eingeschaltet wurde nicht ausschalten.
mit XOR2 hingegen kann ich per C-CODE ein und ausschalten so wie mit dem Button.
Wobei LinuxCNC warscheinlich der meinung ist das die lampe noch an bzw. aus ist da im G-Code der Befehl nicht korrigiert wurde.
Das Stört mich jedoch nicht ! (Glaube ich, aktuell)

Das mit dem Button ist etwas doof, denn der hat nur einen anderen Wert wenn man ihn gedrückt hält, wie kann man den zu einem Klick und halte den geänderten wert Button machen?
Last edit: 4 years 4 months ago by Muecke.

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

More
4 years 4 months ago #244782 by tommylight
linuxcnc.org/docs/2.8/html/man/man9/toggle.9.html
Code:
# Lampe net lampe_G-CODE xor2.2.in0 <= motion.digital-out-00 net lampe_button toggle.0.in <= pyvcp.button_lampe net lampe_toggle toggle.0.out xor2.2.in1 net lampe_Mesa xor2.2.out => hm2_7i95.0.ssr.00.out-00 <=> pyvcp.led-lampe

Im hal
loadrt toggle
addf toggle.0 servo-period
-
das ist auf dem kopf, hab keine LinuxCNC zur zeit.
The following user(s) said Thank You: Muecke

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

More
4 years 4 months ago #244819 by Muecke

linuxcnc.org/docs/2.8/html/man/man9/toggle.9.html

Code:
# Lampe net lampe_G-CODE xor2.2.in0 <= motion.digital-out-00 net lampe_button toggle.0.in <= pyvcp.button_lampe net lampe_toggle toggle.0.out xor2.2.in1 net lampe_Mesa xor2.2.out => hm2_7i95.0.ssr.00.out-00 <=> pyvcp.led-lampe Im hal loadrt toggle addf toggle.0 servo-period - das ist auf dem kopf, hab keine LinuxCNC zur zeit.


@tommylight. das ist sehr gut, danke. mit dem Link kann ich echt wenig anfangen ich verstehe da nichts.
ich kann jetzt per G-Code und button die Lampe ON/OFF schalten, und der button hält seinen Status. DANKE!!

ps. Du sagtest doch mal man darf die für Deutsch ein paar hinweise geben.
Zitat: das ist auf dem kopf, hab keine LinuxCNC zur zeit.
Du meintest: das ist aus dem kopf, hab keine LinuxCNC zur zeit.

;-) Gruß Mücke
The following user(s) said Thank You: tommylight

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

Moderators: Muecke
Time to create page: 0.091 seconds
Powered by Kunena Forum