How to read from input stream rather than a file?
06 Nov 2011 20:20 #14614
by billooms
How to read from input stream rather than a file? was created by billooms
Is it possible to have EMC read g-code commands continuously from an input stream rather than in batch mode from a file?
What I want to do is have a basic computer running EMC and driving the stepper motors, and have another computer generating g-code. I would like to be able to run this "real-time" rather than in batch mode. That is, I would like to be able to push g-code commands out to a stream and have EMC execute those g-code commands as they come. As it is now, I write a file, copy the file to the Linux machine, open the file with EMC, and press the run button (batch mode).
Any ideas?
What I want to do is have a basic computer running EMC and driving the stepper motors, and have another computer generating g-code. I would like to be able to run this "real-time" rather than in batch mode. That is, I would like to be able to push g-code commands out to a stream and have EMC execute those g-code commands as they come. As it is now, I write a file, copy the file to the Linux machine, open the file with EMC, and press the run button (batch mode).
Any ideas?
Please Log in or Create an account to join the conversation.
07 Nov 2011 08:28 #14626
by ArcEye
Replied by ArcEye on topic Re:How to read from input stream rather than a file?
Hi
There is no 'drip' type facility as such, but you can make one to suit yourself, by either inputting MDI commands to Axis with
axis-remote
linuxcnc.org/docs/html/man/man1/axis-remote.1.html
or
using emcrsh
wiki.linuxcnc.org/emcinfo.pl?Emcrsh
for a full remote comms program that does not require a gui to be running
regards
There is no 'drip' type facility as such, but you can make one to suit yourself, by either inputting MDI commands to Axis with
axis-remote
linuxcnc.org/docs/html/man/man1/axis-remote.1.html
or
using emcrsh
wiki.linuxcnc.org/emcinfo.pl?Emcrsh
for a full remote comms program that does not require a gui to be running
regards
Please Log in or Create an account to join the conversation.
07 Nov 2011 15:02 #14640
by billooms
Replied by billooms on topic Re:How to read from input stream rather than a file?
Thanks for the prompt reply. I'll explore the emcrsh approach to see if that will do what I want.
You mention that you can input MDI commands to Axis with the axis-remote. How do you do that? The documentation indicates that you can reload the currently loaded file with --reload. Is there another command for inputting individual MDI commands?
Thanks,
Bill
You mention that you can input MDI commands to Axis with the axis-remote. How do you do that? The documentation indicates that you can reload the currently loaded file with --reload. Is there another command for inputting individual MDI commands?
Thanks,
Bill
Please Log in or Create an account to join the conversation.
07 Nov 2011 15:08 - 07 Nov 2011 15:14 #14642
by ArcEye
Replied by ArcEye on topic Re:How to read from input stream rather than a file?
$ axis-remote --help
$ axis-remote: cause AXIS to open, reload its opened file, or exit
Usage: axis-remote
axis-remote [-c|-p|-r|-q|-m command]
I am going to have to try it now, just to be sure the docs and man page are wrong and the command is there as per the above.
$ axis-remote: cause AXIS to open, reload its opened file, or exit
Usage: axis-remote
axis-remote [-c|-p|-r|-q|-m command]
I am going to have to try it now, just to be sure the docs and man page are wrong and the command is there as per the above.
Last edit: 07 Nov 2011 15:14 by ArcEye.
Please Log in or Create an account to join the conversation.
07 Nov 2011 15:11 #14643
by billooms
Replied by billooms on topic Re:How to read from input stream rather than a file?
Got it! I see the --mdi command now.
Thanks for the help.
Thanks for the help.
Please Log in or Create an account to join the conversation.
07 Nov 2011 15:41 - 07 Nov 2011 16:15 #14644
by ArcEye
Replied by ArcEye on topic Re:How to read from input stream rather than a file?
Hi
Just tested it to make sure I wasn't going mad and imagining things.
$ axis-remote --mdi 'G00 X0 Y0 Z0'
works fine, but note the enclosure of the command in single quote (apostrophe) charactors to get it to work from a terminal.
regards
PS
If you go the emcrsh route check out this thread first to be forewarned re preventing it hanging.
www.linuxcnc.org/component/option,com_ku...,13940/lang,english/
Just tested it to make sure I wasn't going mad and imagining things.
$ axis-remote --mdi 'G00 X0 Y0 Z0'
works fine, but note the enclosure of the command in single quote (apostrophe) charactors to get it to work from a terminal.
regards
PS
If you go the emcrsh route check out this thread first to be forewarned re preventing it hanging.
www.linuxcnc.org/component/option,com_ku...,13940/lang,english/
Last edit: 07 Nov 2011 16:15 by ArcEye.
Please Log in or Create an account to join the conversation.
07 Nov 2011 17:02 #14653
by billooms
Replied by billooms on topic Re:How to read from input stream rather than a file?
Thanks for the tip on the single quotes.
Since I want to send commands from a different computer, I'll probably need to go the emcrsh approach. I appreciate the link to prevent hanging. It will probably take a bit of time to figure out how to use emcrsh from another computer, but since it uses telnet it should be possible. It will be several days before I get to that point because I need to get a router for the shop to connect the computers together.
Since I want to send commands from a different computer, I'll probably need to go the emcrsh approach. I appreciate the link to prevent hanging. It will probably take a bit of time to figure out how to use emcrsh from another computer, but since it uses telnet it should be possible. It will be several days before I get to that point because I need to get a router for the shop to connect the computers together.
Please Log in or Create an account to join the conversation.
08 Nov 2011 07:18 #14666
by ArcEye
You can of course just ssh -X This email address is being protected from spambots. You need JavaScript enabled to view it. or whatever and use axis-remote --mdi commands from the remote computer.
Linux is very flexible, you will be able to do it whichever way fits best
regards
Replied by ArcEye on topic Re:How to read from input stream rather than a file?
Since I want to send commands from a different computer, I'll probably need to go the emcrsh approach.
You can of course just ssh -X This email address is being protected from spambots. You need JavaScript enabled to view it. or whatever and use axis-remote --mdi commands from the remote computer.
Linux is very flexible, you will be able to do it whichever way fits best
regards
Please Log in or Create an account to join the conversation.
08 Nov 2011 14:30 #14674
by billooms
Replied by billooms on topic Re:How to read from input stream rather than a file?
Thanks for the pointer on using ssh.
The software that is generating the g-code is written in Java and currently writes to a file (currently running on a Mac, although it would be easy to compile for Windows or Ubuntu as well). I would like to modify the Java program to output directly to the remote emc computer which is a much older (slower) PC. I looked on the internet this morning and found a number of ssh libraries that are available for Java, so I'll have to explore how they work. I've not done any programming for communication between computers, so that's all new for me.
Thanks for your help.
The software that is generating the g-code is written in Java and currently writes to a file (currently running on a Mac, although it would be easy to compile for Windows or Ubuntu as well). I would like to modify the Java program to output directly to the remote emc computer which is a much older (slower) PC. I looked on the internet this morning and found a number of ssh libraries that are available for Java, so I'll have to explore how they work. I've not done any programming for communication between computers, so that's all new for me.
Thanks for your help.
Please Log in or Create an account to join the conversation.
Time to create page: 0.156 seconds