MesaPin per G-Code ein und ausschalten

More
4 years 4 months ago #244640 by Muecke
Nach langen Hin und Her habe ich die Lösung immer noch nicht.

Versuch 1: (G-Code: JA // GUI: NEIN)
Code:
# Lampe (io.hat) net lampe => => pyvcp.led-lampe net lampe motion.digital-out-00 <=> hm2_7i95.0.ssr.00.out-00 <!-- 7i95.xml --> <labelframe text="Lampe"> <hbox> <button halpin = "button_lampe" text = "ON / OFF" width = "6" /> <label text=""/> <led halpin = "led-lampe" size = "25" on_color = "green" off_color = "black" /> </hbox> </labelframe>
 
Ich kann über den G-Code den Ausgang Ein-/Ausschalten, doch nicht über die GUI


Versuch 2: (G-Code: NEIN // GUI: JA und Nein)
Code:
# Lampe (gui.hal) # Kabel Name GUI-Knopf Mesa-PIN GUI-LED net mesa_OUT_00 pyvcp.button_lampe hm2_7i95.0.ssr.00.out-00 pyvcp.led-lampe <!-- 7i95.xml --> <labelframe text="Lampe"> <hbox> <button halpin = "button_lampe" text = "ON / OFF" width = "6" /> <label text=""/> <led halpin = "led-lampe" size = "25" on_color = "green" off_color = "black" /> </hbox> </labelframe>
Per G-Code kann der Ausgang nicht Ein-Aus geschaltet werden.
Per GUI kann der Ausgang solange der Knopf gedrückt wird eingeschaltet werden. Der Status wird nicht gehalten.
Wie kann ich den Status halten? ist das ein andere Knopf den ich verbauen muss?

Und wie bekomme ich Versuch 1 und 2 Kombiniert?


gruß Mücke

Please Log in to join the conversation.

More
4 years 4 months ago #244641 by tommylight
Can nicht zur zeit testen, aber
die drite NET linie einfungen
Code:
# Lampe (io.hat) net lampe => => pyvcp.led-lampe net lampe motion.digital-out-00 <=> hm2_7i95.0.ssr.00.out-00 net lampe pyvcp.button_lampe <!-- 7i95.xml --> <labelframe text="Lampe"> <hbox> <button halpin = "button_lampe" text = "ON / OFF" width = "6" /> <label text=""/> <led halpin = "led-lampe" size = "25" on_color = "green" off_color = "black" /> </hbox> </labelframe>

Please Log in to join the conversation.

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 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 to join the conversation.

More
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"

Please Log in to join the conversation.

More
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?

Please Log in 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.

Please Log in 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

Please Log in to join the conversation.

More
4 years 4 months ago #244827 by tommylight

ps. Du sagtest doch mal man darf die für Deutsch ein paar hinweise geben.
Ja, bitte, ich will nicht die Deutche schprache vergesen.
Nur einz fehler? :)

Please Log in to join the conversation.

More
4 years 4 months ago #244855 by Muecke

Ja, bitte, ich will nicht die Deutche schprache vergesen.
Nur einz fehler? :)
Einer der mir aufgefallen ist, ich bin Deutscher, habe jedoch Probleme beim lesen und Schreiben :-(.

ich finde dein deutsch Gut!

gruß Mücke

Please Log in to join the conversation.

Time to create page: 0.057 seconds
Powered by Kunena Forum