- Posts: 8
- Thank you received: 0
Comment utiliser le signal d'un capteur
1 year 6 months ago #326072
by jelost
Comment utiliser le signal d'un capteur was created by jelost
Bonjour,
J'ai câblé un switch sur le pin d'entrée n° 11 de ma carte d'axes.
Je voudrais exploiter cette entrée dans un programme avec la condition if.
Comment faire pour affecter cette entrée à une variable utilisateur, par exemple 40 ?
La ligne pour cette entrée dans le fichier hal :
net din-01 <= parport.0.pin-11-in
La ligne du programme avec if
o100 if [#40 EQ 1]
Merci d'avance
J'ai câblé un switch sur le pin d'entrée n° 11 de ma carte d'axes.
Je voudrais exploiter cette entrée dans un programme avec la condition if.
Comment faire pour affecter cette entrée à une variable utilisateur, par exemple 40 ?
La ligne pour cette entrée dans le fichier hal :
net din-01 <= parport.0.pin-11-in
La ligne du programme avec if
o100 if [#40 EQ 1]
Merci d'avance
Please Log in to join the conversation.
1 year 6 months ago #326125
by Grotius
Replied by Grotius on topic Comment utiliser le signal d'un capteur
Hi,
I think this is what you are looking for:
www.linuxcnc.org/docs/html/gcode/m-code.html#mcode:m66
Reference:
forum.linuxcnc.org/20-g-code/28990-setti...pin-from-gcode#56985
I think this is what you are looking for:
www.linuxcnc.org/docs/html/gcode/m-code.html#mcode:m66
Reference:
forum.linuxcnc.org/20-g-code/28990-setti...pin-from-gcode#56985
Please Log in to join the conversation.
1 year 6 months ago #326155
by jelost
Replied by jelost on topic Comment utiliser le signal d'un capteur
Hi Grotius,
Thank you very much for your help !!
Now my problem is solved
The new line in the hal file :
net signal-name motion.digital-in-01 <= parport.0.pin-11-in
And the lines of my program :
M66 P1 L0
o100 if [#5399 EQ 1]
Thank you very much for your help !!
Now my problem is solved
The new line in the hal file :
net signal-name motion.digital-in-01 <= parport.0.pin-11-in
And the lines of my program :
M66 P1 L0
o100 if [#5399 EQ 1]
Please Log in to join the conversation.
Time to create page: 0.073 seconds
