Reload Program Through Pin

More
05 Apr 2016 19:16 #72794 by bogie6040
andy wrote:

Where did you save the file? (ie, the Python file here:

I placed the newly created file in /usr/bin with all permissions and executable.

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

More
05 Apr 2016 19:34 - 05 Apr 2016 19:35 #72797 by andypugh
Replied by andypugh on topic Reload Program Through Pin
Does it run from the command line?

Is it possible that the #! does not point to your version of Python?
Last edit: 05 Apr 2016 19:35 by andypugh.

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

More
05 Apr 2016 19:41 #72799 by bogie6040
jake@debian-test:/usr/bin$ pwd
/usr/bin
jake@debian-test:/usr/bin$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
jake@debian-test:/usr/bin$ ls -l update
-rwxrwxrwx 1 root root 319 Apr 4 14:44 update
jake@debian-test:/usr/bin$ halrun
.
halcmd: loadusr update
halcmd: show pin
Component Pins:
Owner Type Dir Value Name
5 bit IN FALSE update.trigger

halcmd: exit
jake@debian-test:/usr/bin$ cd /home/jake/linuxcnc
jake@debian-test:~/linuxcnc$ pwd
/home/jake/linuxcnc
jake@debian-test:~/linuxcnc$ halrun
.
halcmd: loadusr update
halcmd: show pin
Component Pins:
Owner Type Dir Value Name
5 bit IN FALSE update.trigger

halcmd: exit

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

More
05 Apr 2016 19:43 - 05 Apr 2016 19:48 #72800 by bogie6040
Don't know if this means anything but.......\


jake@debian-test:/usr/bin$ python update
RTAPI: ERROR: could not open shared memory (No such file or directory)
HAL: ERROR: could not initialize RTAPI
Traceback (most recent call last):
File "update", line 4, in <module>
h = hal.component("update")
hal.error: Invalid argument
jake@debian-test:/usr/bin$
Attachments:
Last edit: 05 Apr 2016 19:48 by bogie6040. Reason: Here is the file as it sits in /usr/bin Remove .txt of course

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

More
05 Apr 2016 19:46 #72801 by andypugh
Replied by andypugh on topic Reload Program Through Pin
I think I have given misleading advice.

There is no "update" function as the component is a user-space program, not a realtime component.

Ignore the "addf" line, it will never work. But the component itself ought to have the desired effect if you toggle the update.trigger pin.

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

More
05 Apr 2016 19:56 #72803 by bogie6040
test_postgui.hal contains:

loadusr update count=1
# addf update servo-thread
net jake-update-backplot update.trigger <= pyvcp.update-button

I still get this:

Debug file information:
inifile: warning: File contains DOS-style line endings.
inifile: warning: File contains DOS-style line endings.
inifile: warning: File contains DOS-style line endings.
inifile: warning: File contains DOS-style line endings.
.
inifile: warning: File contains DOS-style line endings.
inifile: warning: File contains DOS-style line endings.
inifile: warning: File contains DOS-style line endings.
inifile: warning: File contains DOS-style line endings.
inifile: warning: File contains DOS-style line endings.
test_postgui.hal:3: Pin 'update.trigger' does not exist
22738
PID TTY STAT TIME COMMAND
22792
PID TTY STAT TIME COMMAND
Stopping realtime threads
Unloading hal components

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

More
05 Apr 2016 22:08 #72815 by andypugh
Replied by andypugh on topic Reload Program Through Pin
First, get rid of the DOS-style line endings.

The pin existed before:
halcmd: loadusr update
halcmd: show pin
Component Pins:
Owner Type Dir Value Name
5 bit IN FALSE update.trigger

There it is....

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

More
06 Apr 2016 14:37 #72850 by bogie6040
DOS style endings.... I have seen this in other posts, I have yet to see a definitive answer on what they look like or how to find them....
I assume the warning is talking about the configurations main .ini file (in this case axis.ini which is attached) I have looked all through the file and I don't see anything out of the ordinary.

The pin existed before:

halcmd: loadusr update
halcmd: show pin
Component Pins:
Owner Type Dir Value Name
5 bit IN FALSE update.trigger


There it is....


I don't understand what your getting at here....
Attachments:

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

More
06 Apr 2016 14:45 - 06 Apr 2016 14:45 #72852 by andypugh
Replied by andypugh on topic Reload Program Through Pin

DOS style endings.... I have seen this in other posts, I have yet to see a definitive answer on what they look like or how to find them.


There is a (CR) at the end of the line "# EMBED_TAB_COMMAND = python camview.py -w {XID}"
I found it by turning on line-ending visibility in Notepad++
I think that there is a similar feature in gedit.

I don't understand what your getting at here....


You loaded the component. The pin existed then. what has changed since if the pin does not exist now after you load the component?
Last edit: 06 Apr 2016 14:45 by andypugh.

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

More
06 Apr 2016 19:25 #72867 by bogie6040
OK, got rid of the dos style ending..... It's really nice it doesn't tell you where it found the dos style ending - it's like an easter egg hunt after finding a text editor that will display the hidden characters.......
Why does it care anyway just ignore them.....

I also got the error to go away but it still doesn't work, so this won't work with a pyvcp type hal pin??

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

Time to create page: 0.124 seconds
Powered by Kunena Forum