NEWS
2.6 Live+Install image
There are no translations available.

Announcing a new Live+Install DVD image for installing LinuxCNC 2.6 on Debian Wheezy. Instructions here.

 
LinuxCNC 2.6.3 is released
There are no translations available.

Several bugs fixed, see the change log.

 
LinuxCNC 2.6.2 Released
There are no translations available.

Bug fix see the change log.

 
Home Forum Configuring LinuxCNC Basic Configuration Need to connect pin problem

Welcome, Guest
Username: Password: Remember me

TOPIC: Need to connect pin problem

Need to connect pin problem 29 Mai 2012 09:31 #20483

  • cwebs
  • cwebs's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 124
  • Karma: 5
I am trying to connect pin 16 of my parport 0 to a SSR relay to turn on the driver board when I turn on the power putton so the driver board is not running all the time. I am not sure I can do it the way I am trying so I need help. This should be easy for you guys. What I have tried is
[ net machine.is-on => parport.0.pin-16-out ]
in the .hal file. Hal meter shows is false with power button on and off. Hal configuration shows , halui.machine.is-on, true and false when clicking the power button on and off. Thanks for any help. Carl
The administrator has disabled public write access.

Re:Need to connect pin problem 29 Mai 2012 12:27 #20491

  • BigJohnT
  • BigJohnT's Avatar
  • OFFLINE
  • Administrator
  • Posts: 5903
  • Thank you received: 258
  • Karma: 158
What you have done is created a signal named "machine.is-on" and connected it to your parallel port pin. That will not do any thing by it self.

Read about the net command here.

The simple way is to add the pin "halui.machine.is-on" to your net.

John
The administrator has disabled public write access.

Re:Need to connect pin problem 29 Mai 2012 15:30 #20497

  • cwebs
  • cwebs's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 124
  • Karma: 5
Sorry John but I don't understand your answer.
Reading the Basic HAL Tutorial gives me the empression that I can't assign a pin because I have a joypad using that signal.

"An OUT pin can be connected only if there are no other OUT or IO pins on the signal."

I have a button on the USB joypad used to turn the power button on.

Still lost , Carl
The administrator has disabled public write access.

Re:Need to connect pin problem 29 Mai 2012 16:54 #20499

  • BigJohnT
  • BigJohnT's Avatar
  • OFFLINE
  • Administrator
  • Posts: 5903
  • Thank you received: 258
  • Karma: 158
A "signal" can be used on more than one line and you can have as many readers as you want but only one speaker so to speak.
net signal-name out-pin in-pin in2-pin
net signal-name in3-pin

If you have two things toggling an input like coolant you need to look at this example. There are a few more examples like that in that section.

So you have your joypad button turning on the power using halui.machine.on? The pin halui.machine.is-on is a different pin... so no conflict there.

Attach your .hal file(s) so we can look at them.

John
The administrator has disabled public write access.

Re:Need to connect pin problem 30 Mai 2012 13:30 #20515

  • cwebs
  • cwebs's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 124
  • Karma: 5
Here is my .hal file. I only have the one entry that I tried last. This attachment is hidden for guests. Please log in or register to see it.
Attachments:
  • Attachment This attachment is hidden for guests. Please log in or register to see it.
Last Edit: 30 Mai 2012 13:32 by cwebs.
The administrator has disabled public write access.

Re:Need to connect pin problem 30 Mai 2012 23:28 #20523

  • ArcEye
  • ArcEye's Avatar
  • OFFLINE
  • Moderator
  • Posts: 2969
  • Thank you received: 507
  • Karma: 169
Hi

halui.machine.is-on is an exported PIN from the halui module

Your entry
#This is the only line I left in after trying a few.
net halui.machine.is-on => parport.0.pin-16-out
is treating it as a SIGNAL, which is why it doesn't work

As John said earlier the syntax needs to be

net SIGNAL PIN [PIN....]

so net powered-up halui.machine.is-on => parport.0.pin-16-out

will create a signal called powered-up which other pins can link to if required and links parport.0.pin-16-out to the boolean halui.machine.is-on value.

I think of signals as pieces of bare wire that physically wrap between pins and connect them.
Another pin cannot connect to the same pins but it can connect to the bare wire and share the same signal.

Hope this analogy helps, once you have it straight in your head the whole thing falls into place.

regards
The administrator has disabled public write access.

Re:Need to connect pin problem 31 Mai 2012 10:57 #20533

  • cwebs
  • cwebs's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 124
  • Karma: 5
Working on understanding the code but I only have to do something like this about twice a year and know nothen about the code. I used the spindle connection I did last year as an example. That worked for me then. Will have to see if I can find other examples to copy and change for my use. Then I get a better understanding of the code. Thanks, Carl
The administrator has disabled public write access.

Re:Need to connect pin problem 31 Mai 2012 13:29 #20536

  • BigJohnT
  • BigJohnT's Avatar
  • OFFLINE
  • Administrator
  • Posts: 5903
  • Thank you received: 258
  • Karma: 158
So the following didn't work for you?

net machine.is-on halui.machine.is-on => parport.0.pin-16-out

John
The administrator has disabled public write access.

Re:Need to connect pin problem 31 Mai 2012 17:08 #20544

  • cwebs
  • cwebs's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 124
  • Karma: 5
Sorry, I was working on other stuff so I'll try it again tomorow. Carl
The administrator has disabled public write access.

Re:Need to connect pin problem 01 Jun 2012 05:47 #20561

  • cwebs
  • cwebs's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 124
  • Karma: 5
Still not able to get it to work. When I start the program Linuxcnc the relay does click on and off during the program startup so I know the relay is wired correctly This is what I tried.


net halui.machine.is-on => parport.0.pin-16-out
net machine.is-on halui.machine.is-on => parport.0.pin-16-out
#net powered-up halui.machine.is-on => parport.0.pin-16-out

I also tried # out net halui.machine.is-on => parport.0.pin-16-out
Using either John's or Arceye's didn't work for me. Carl
The administrator has disabled public write access.
Moderators: Rick G
Time to create page: 0.862 seconds
Powered by Kunena Forum
© 2014 LinuxCNC.org
Joomla! is Free Software released under the GNU General Public License.