First steps with 6i25+7i77 : how to read a home switch ?
- JC10
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 45
- Thank you received: 0
20 Nov 2018 14:10 - 20 Nov 2018 14:12 #121054
by JC10
First steps with 6i25+7i77 : how to read a home switch ? was created by JC10
Hello,
I am starting with LinuxCNC and MESA boards.
Reading various posts on the forum, I managed to connect all and supply the field power with 24v DC.
I started with what andypugh showed in this topic : forum.linuxcnc.org/9-installing-linuxcnc...nuxcnc-configuration
I am able to see all my I/O from the 7i77 :
Using again andypugh suggestion from this topic : forum.linuxcnc.org/38-general-linuxcnc-q...-done-init-mesa-6i25
I played with the two leds first.
Now I would like to read a home limit switch. I read from the 7i77 manual that I have to wire my switch to power field and to an input terminal of the 7i77, I am ready to do this.
Keeping andypugh hal instructions here above, is "addf hm2_5i25.0.read thread1 " suitable to read such a home limit switch input in case of a 7i77 ?
My plan is to observe from Halscope the changing state when toggling the switch.
Thank you for help.
My machine rebuilt can be seen at : here
I am starting with LinuxCNC and MESA boards.
Reading various posts on the forum, I managed to connect all and supply the field power with 24v DC.
I started with what andypugh showed in this topic : forum.linuxcnc.org/9-installing-linuxcnc...nuxcnc-configuration
Open a terminal window and type:sudo dmesg -c halrun loadrt hostmot2 loadrt hm2_pci show pin *5i25* exit dmesg
The "show pin" displays all the HAL pins created by the firmware on the card.
I am able to see all my I/O from the 7i77 :
user@LINUXCNC:~/Downloads/5i25/configs/hostmot2$ halrun
halcmd: loadrt hostmot2
halcmd: loadrt hm2_pci
halcmd: show pin *7i77*
Component Pins:
Owner Type Dir Value Name
5 bit OUT FALSE hm2_5i25.0.7i77.0.0.input-00
5 bit OUT FALSE hm2_5i25.0.7i77.0.0.input-00-not
...
5 bit OUT FALSE hm2_5i25.0.7i77.0.0.input-31
5 bit OUT FALSE hm2_5i25.0.7i77.0.0.input-31-not
5 bit IN FALSE hm2_5i25.0.7i77.0.0.output-00
....
5 bit IN FALSE hm2_5i25.0.7i77.0.0.output-15
5 bit IN FALSE hm2_5i25.0.7i77.0.1.analogena
5 float IN 0 hm2_5i25.0.7i77.0.1.analogout0
....
5 float IN 0 hm2_5i25.0.7i77.0.1.analogout5
5 bit IN FALSE hm2_5i25.0.7i77.0.1.spinena
Using again andypugh suggestion from this topic : forum.linuxcnc.org/38-general-linuxcnc-q...-done-init-mesa-6i25
Just type this at the terminal:
(Nothing happens with the card without being attached to a real-time thread)halrun loadrt hostmot2 loadrt hm2_pci(I am guessing the next pin name, but it will appear in the list created by the command above, and you can use tab-completion to do most of the typing)loadrt thtreads addf hm2_5i25.0.read thread1 addf hm2_5i25.0.write thread1 start show pinShould turn an LED onsetp hm2_5i25.0.led.cr0 1Should turn it offsetp hm2_5i25.0.led.cr0 0
I played with the two leds first.
Now I would like to read a home limit switch. I read from the 7i77 manual that I have to wire my switch to power field and to an input terminal of the 7i77, I am ready to do this.
Keeping andypugh hal instructions here above, is "addf hm2_5i25.0.read thread1 " suitable to read such a home limit switch input in case of a 7i77 ?
My plan is to observe from Halscope the changing state when toggling the switch.
Thank you for help.
My machine rebuilt can be seen at : here
Last edit: 20 Nov 2018 14:12 by JC10. Reason: Typo
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23310
- Thank you received: 4858
20 Nov 2018 15:09 - 20 Nov 2018 15:09 #121062
by andypugh
Replied by andypugh on topic First steps with 6i25+7i77 : how to read a home switch ?
Yes, you need to load the driver and add the read function to a thread.
To monitor the output you might like to try:
(you can repeat this command to open as many halmeters as you need).
To test outputs (which need the write function added to a thread) you can either use "setp" as you did with the LEDs orlinuxcnc.org/docs/2.7/html/man/man1/sim_pin.1.html
To monitor the output you might like to try:
loadusr halmeter
(you can repeat this command to open as many halmeters as you need).
To test outputs (which need the write function added to a thread) you can either use "setp" as you did with the LEDs or
loadusr sim_pin hm2_5i25.0.gpio.00-out
Last edit: 20 Nov 2018 15:09 by andypugh.
Please Log in or Create an account to join the conversation.
- JC10
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 45
- Thank you received: 0
20 Nov 2018 20:57 #121087
by JC10
Replied by JC10 on topic First steps with 6i25+7i77 : how to read a home switch ?
Please Log in or Create an account to join the conversation.
Moderators: PCW, jmelson
Time to create page: 0.055 seconds