NEWS
LinuxCNC 2.5.2 Release
There are no translations available.

LinuxCNC 2.5.2 Update Released (changelog).
 
LinuxCNC 2.5.1 Release
There are no translations available.

LinuxCNC 2.5.1 Update Released (changelog). If the Package Manager does not prompt you to upgrade see this page.

 
LinuxCNC 2.5.0 Release
There are no translations available.

New major release (changelog). See the instructions to update your system from EMC 2.4 to LinuxCNC 2.5.
 
Home Forum Configuring LinuxCNC Basic Configuration Need to connect pin problem

Welcome, Guest
Username: Password: Remember me

TOPIC: Need to connect pin problem

Re:Need to connect pin problem 01 Jui 2012 08:57 #20571

  • PCW
  • PCW's Avatar
  • OFFLINE
  • Moderator
  • Posts: 1669
  • Thank you received: 87
  • Karma: 116
well if you can't control the pin the first thing I would do is
unlink parport.0.pin-16-out from whatever drives it and see if you can
toggle pin 16 by hand (via the machine show HAL configuration menu in Axis)
that is, type:
setp parport.0.pin-16-out true and
setp parport.0.pin-16-out false
in the HAL command window
The administrator has disabled public write access.

Re:Need to connect pin problem 01 Jui 2012 09:46 #20573

  • BigJohnT
  • BigJohnT's Avatar
  • OFFLINE
  • Administrator
  • Posts: 4960
  • Thank you received: 87
  • Karma: 134
The following will never work and should throw an error as you didn't have a signal name after the word net.

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

Can I suggest again that you read the section on the net command that I linked to you before. Understanding the simple syntax of a net command is paramount to being able to add one to your hal file.

Once you verify that parlallel port 16 actually works as you expect then put the following line in your hal file

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

Back in the machine > show hal configuration window select the watch window and add the two pins from above and the signal from above. Toggle machine power and watch the status of the three things.

John
The administrator has disabled public write access.

Re:Need to connect pin problem Edited 01 Jui 2012 11:17 #20578

  • cwebs
  • cwebs's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 123
  • Karma: 5
Ok you guys. The fish in my picture has more hair left the me.

I did as you told me to do John. Those three lines in hal configuration worked. True, turned the relay on... False, turned the relay off. Then, net machine.is-on halui.machine.is-on => parport.0.pin-16-out , turned it on and off uning the power button in Axis! So what do I need in the .hal file?

Edit. Will I still have to "unlinkp" now we know the pin will work?
After testing with halconf I tried " net machine.is-on halui.machine.is-on => parport.0.pin-16-out " in the .hal file. Did not work. I also tried the "setp parport.0.pin-16-out TRUE and false lines. no help.

Another thing I don't understand is when to use ... and ---. ( dots and dashes), looking more like morse code to me.

PS, The driver power switch in only three steps away and it's begining to look like I might lose weight going back and forth to it.
Last Edit: 01 Jui 2012 12:21 by cwebs.
The administrator has disabled public write access.

Re:Need to connect pin problem Edited 01 Jui 2012 17:52 #20585

  • BigJohnT
  • BigJohnT's Avatar
  • OFFLINE
  • Administrator
  • Posts: 4960
  • Thank you received: 87
  • Karma: 134
cwebs wrote:
Ok you guys. The fish in my picture has more hair left the me.

I did as you told me to do John. Those three lines in hal configuration worked. True, turned the relay on... False, turned the relay off. Then, net machine.is-on halui.machine.is-on => parport.0.pin-16-out , turned it on and off uning the power button in Axis! So what do I need in the .hal file?

Edit. Will I still have to "unlinkp" now we know the pin will work?
After testing with halconf I tried " net machine.is-on halui.machine.is-on => parport.0.pin-16-out " in the .hal file. Did not work. I also tried the "setp parport.0.pin-16-out TRUE and false lines. no help.

Another thing I don't understand is when to use ... and ---. ( dots and dashes), looking more like morse code to me.

PS, The driver power switch in only three steps away and it's begining to look like I might lose weight going back and forth to it.

The only line you should need in your hal file is:

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

unlinkp is a way to unlink a pin usually for testing.

If it worked in show hal configuration it should work in your hal file.
Do you have more than one hal file?
Which file did you add net machine.is-on halui.machine.is-on => parport.0.pin-16-out to?

What does "Did not work." mean? you got an error? nothing changed states?

Help us understand what your seeing...

What is the dots and dashes about?

John
The administrator has disabled public write access.

Re:Need to connect pin problem Edited 01 Jui 2012 23:47 #20586

  • Rick G
  • Rick G's Avatar
  • OFFLINE
  • Moderator
  • Posts: 1072
  • Thank you received: 15
  • Karma: 80
As John said
Back in the machine > show hal configuration window select the watch window and the signal from above. Toggle machine power and watch the status of the three things.

In the watch window you can view what is going on, that is if the pin is changing states.
You will see that halui.machine.is-on will change states when you hit the F2 button (toggle machine power)

In the Show window you can see and confirm what the pin is linked to, which you can use to see if the file was correctly edited or if the pin is linked to something else.

Rick G
The administrator has disabled public write access.

Re:Need to connect pin problem Edited 02 Jui 2012 03:00 #20588

  • cwebs
  • cwebs's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 123
  • Karma: 5
BigJohnT wrote:
cwebs wrote:
Ok you guys. The fish in my picture has more hair left the me.

I did as you told me to do John. Those three lines in hal configuration worked. True, turned the relay on... False, turned the relay off. Then, net machine.is-on halui.machine.is-on => parport.0.pin-16-out , turned it on and off uning the power button in Axis! So what do I need in the .hal file?

Edit. Will I still have to "unlinkp" now we know the pin will work?
After testing with halconf I tried " net machine.is-on halui.machine.is-on => parport.0.pin-16-out " in the .hal file. Did not work. I also tried the "setp parport.0.pin-16-out TRUE and false lines. no help.

Another thing I don't understand is when to use ... and ---. ( dots and dashes), looking more like morse code to me.

PS, The driver power switch in only three steps away and it's begining to look like I might lose weight going back and forth to it.

The only line you should need in your hal file is:

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

unlinkp is a way to unlink a pin usually for testing.

If it worked in show hal configuration it should work in your hal file.
Do you have more than one hal file?
Which file did you add net machine.is-on halui.machine.is-on => parport.0.pin-16-out to?

What does "Did not work." mean? you got an error? nothing changed states?

Help us understand what your seeing...

What is the dots and dashes about?

John
This line works correctly in hal configuration, relay turns on and off buy clicking on the Axis power button. (toggle machine power)


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

I put the line of code in the .hal file. Then toggle machine power. No state change. That's when I pull out more hair from my head.

I have a post gui hal file that has the joypad code. I'll post that when I get to the machine latter today. I looked at that code and "machine.is-on" is NOT used there. "Machine.on" is used.

"What is the dots and dashes about?" LOL. When writing code, I don't understand when I need, periods, or dashes, or spaces.

To sum it up, the line of code WORKS in hal configuration, doesn't in the .hal file. Carl
The administrator has disabled public write access.

Re:Need to connect pin problem Edited 02 Jui 2012 03:59 #20590

  • BigJohnT
  • BigJohnT's Avatar
  • OFFLINE
  • Administrator
  • Posts: 4960
  • Thank you received: 87
  • Karma: 134
Post your hal file to a message so we can look at it.

Pin names must be exactly as you see them in show hal configuration with dots and dashes and underscores in the correct place. There is a guideline for programmers on how to format pin names but that doesn't matter for a user.

Signal names (created by users) iirc can be any combination of letters, numbers, dash, underscore or period.

linuxcnc.org/docview/html/hal/basic_hal....#_net_a_id_sub_net_a

Oh, stop pulling your hair out and pull on the fishes hair then fry them.

John
The administrator has disabled public write access.

Re:Need to connect pin problem Edited 02 Jui 2012 05:46 #20595

  • cwebs
  • cwebs's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 123
  • Karma: 5
Here are the hal files. 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.
The administrator has disabled public write access.

Re:Need to connect pin problem Edited 02 Jui 2012 05:47 #20596

  • cwebs
  • cwebs's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 123
  • Karma: 5
Other one 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.
The administrator has disabled public write access.

Re:Need to connect pin problem Edited 02 Jui 2012 06:50 #20598

  • BigJohnT
  • BigJohnT's Avatar
  • OFFLINE
  • Administrator
  • Posts: 4960
  • Thank you received: 87
  • Karma: 134
I don't see anything wrong in your hal file. I assume that your loading halui in your ini file with

HALUI = halui

linuxcnc.org/docview/html/config/ini_con...id_sub_hal_section_a

Open up a watch window and put the parallel port pin in the watch window and cycle the machine power.

John
The administrator has disabled public write access.
Moderators: Rick G
Time to create page: 1.337 seconds
Powered by Kunena Forum
© 2013 LinuxCNC.org
Joomla! is Free Software released under the GNU General Public License.