Need to connect pin problem

More
01 Jun 2012 13:44 #20564 by PCW
Replied by PCW on topic Re:Need to connect pin problem
Note that the "#" in the first column means that the line becomes a comment (so its disabled)

Is the output polarity correct? if not you might try this pair of lines:

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

Please Log in or Create an account to join the conversation.

More
01 Jun 2012 15:22 #20569 by cwebs
I used the "#" to comment out one line at a time to try different the differant lines that John and ArcEye gave me because they are differant. If the polarity was backwards wouldn't the relay still work? The relay is only spst and NO when no signel NC when 5 volts are applied to the signel in. The pin 16 is still low/not connected. Tested pin 16 with volt meter also with no HIGH. I will try the invert and see what happens. Thanks. Carl

Please Log in or Create an account to join the conversation.

More
01 Jun 2012 15:57 #20571 by PCW
Replied by PCW on topic Re:Need to connect pin problem
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

Please Log in or Create an account to join the conversation.

More
01 Jun 2012 16:46 #20573 by BigJohnT
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

Please Log in or Create an account to join the conversation.

More
01 Jun 2012 18:17 - 01 Jun 2012 19:21 #20578 by cwebs
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 Jun 2012 19:21 by cwebs.

Please Log in or Create an account to join the conversation.

More
02 Jun 2012 00:52 #20585 by BigJohnT
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

Please Log in or Create an account to join the conversation.

More
02 Jun 2012 06:47 #20586 by Rick G
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

Please Log in or Create an account to join the conversation.

More
02 Jun 2012 10:00 #20588 by cwebs
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

Please Log in or Create an account to join the conversation.

More
02 Jun 2012 10:59 #20590 by BigJohnT
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

Please Log in or Create an account to join the conversation.

More
02 Jun 2012 12:46 #20595 by cwebs
Here are the hal files.

File Attachment:

File Name: custom_pos...ba67.hal
File Size:2 KB
Attachments:

Please Log in or Create an account to join the conversation.

Time to create page: 0.091 seconds
Powered by Kunena Forum