How to real-time display a number from a running log file or terminal [on hold]
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
0
down vote
favorite
I have a CNC and the software runs from a terminal. I would like to catch the current Z axis depth in real-time to display it.
The information I need is shown in the terminal as well as in the log file during the run (G1 Z-0.05) however this might be in the middle of the line with other information. Is there a way to catch the latest Z depth? I think I can manage the display part, so I'm interested in how I can catch the changing Z to always have the current value.
Thanks in advance.
The software is started with python main.py. In the GUI i run the cut. The commands sent to an arduino are visible in the terminal and also written to a log.txt. Can I intercept the terminal or is it easier to tail the log?
Sample output From the terminal: "Sending: G0 Z0.5" From the logfile: Sent: G1 Z-0.05 F30
What I would like to catch is the values behind Z/z positive and negatine
terminal logs real-time
put on hold as too broad by DopeGhoti, schily, Rui F Ribeiro, slm⦠Aug 4 at 0:41
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |Â
up vote
0
down vote
favorite
I have a CNC and the software runs from a terminal. I would like to catch the current Z axis depth in real-time to display it.
The information I need is shown in the terminal as well as in the log file during the run (G1 Z-0.05) however this might be in the middle of the line with other information. Is there a way to catch the latest Z depth? I think I can manage the display part, so I'm interested in how I can catch the changing Z to always have the current value.
Thanks in advance.
The software is started with python main.py. In the GUI i run the cut. The commands sent to an arduino are visible in the terminal and also written to a log.txt. Can I intercept the terminal or is it easier to tail the log?
Sample output From the terminal: "Sending: G0 Z0.5" From the logfile: Sent: G1 Z-0.05 F30
What I would like to catch is the values behind Z/z positive and negatine
terminal logs real-time
put on hold as too broad by DopeGhoti, schily, Rui F Ribeiro, slm⦠Aug 4 at 0:41
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
Please post some sample output and specify the part you want to capture. Do you run a command to start your CNC?
â Jesse_b
Aug 3 at 21:47
The software is started with python main.py. In the GUI i run the cut. The commands sent to an arduino are visible in the terminal and also written to a log.txt. Can I intercept the terminal or is it easier to tail the log?
â Gero
Aug 3 at 21:51
You can probably do either but in order for us to help you need to post some sample output.
â Jesse_b
Aug 3 at 21:51
From the terminal: "Sending: G0 Z0.5" From the logfile: Sent: G1 Z-0.05 F30
â Gero
Aug 3 at 21:53
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a CNC and the software runs from a terminal. I would like to catch the current Z axis depth in real-time to display it.
The information I need is shown in the terminal as well as in the log file during the run (G1 Z-0.05) however this might be in the middle of the line with other information. Is there a way to catch the latest Z depth? I think I can manage the display part, so I'm interested in how I can catch the changing Z to always have the current value.
Thanks in advance.
The software is started with python main.py. In the GUI i run the cut. The commands sent to an arduino are visible in the terminal and also written to a log.txt. Can I intercept the terminal or is it easier to tail the log?
Sample output From the terminal: "Sending: G0 Z0.5" From the logfile: Sent: G1 Z-0.05 F30
What I would like to catch is the values behind Z/z positive and negatine
terminal logs real-time
I have a CNC and the software runs from a terminal. I would like to catch the current Z axis depth in real-time to display it.
The information I need is shown in the terminal as well as in the log file during the run (G1 Z-0.05) however this might be in the middle of the line with other information. Is there a way to catch the latest Z depth? I think I can manage the display part, so I'm interested in how I can catch the changing Z to always have the current value.
Thanks in advance.
The software is started with python main.py. In the GUI i run the cut. The commands sent to an arduino are visible in the terminal and also written to a log.txt. Can I intercept the terminal or is it easier to tail the log?
Sample output From the terminal: "Sending: G0 Z0.5" From the logfile: Sent: G1 Z-0.05 F30
What I would like to catch is the values behind Z/z positive and negatine
terminal logs real-time
edited Aug 3 at 21:58
asked Aug 3 at 21:46
Gero
61
61
put on hold as too broad by DopeGhoti, schily, Rui F Ribeiro, slm⦠Aug 4 at 0:41
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
put on hold as too broad by DopeGhoti, schily, Rui F Ribeiro, slm⦠Aug 4 at 0:41
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
Please post some sample output and specify the part you want to capture. Do you run a command to start your CNC?
â Jesse_b
Aug 3 at 21:47
The software is started with python main.py. In the GUI i run the cut. The commands sent to an arduino are visible in the terminal and also written to a log.txt. Can I intercept the terminal or is it easier to tail the log?
â Gero
Aug 3 at 21:51
You can probably do either but in order for us to help you need to post some sample output.
â Jesse_b
Aug 3 at 21:51
From the terminal: "Sending: G0 Z0.5" From the logfile: Sent: G1 Z-0.05 F30
â Gero
Aug 3 at 21:53
add a comment |Â
Please post some sample output and specify the part you want to capture. Do you run a command to start your CNC?
â Jesse_b
Aug 3 at 21:47
The software is started with python main.py. In the GUI i run the cut. The commands sent to an arduino are visible in the terminal and also written to a log.txt. Can I intercept the terminal or is it easier to tail the log?
â Gero
Aug 3 at 21:51
You can probably do either but in order for us to help you need to post some sample output.
â Jesse_b
Aug 3 at 21:51
From the terminal: "Sending: G0 Z0.5" From the logfile: Sent: G1 Z-0.05 F30
â Gero
Aug 3 at 21:53
Please post some sample output and specify the part you want to capture. Do you run a command to start your CNC?
â Jesse_b
Aug 3 at 21:47
Please post some sample output and specify the part you want to capture. Do you run a command to start your CNC?
â Jesse_b
Aug 3 at 21:47
The software is started with python main.py. In the GUI i run the cut. The commands sent to an arduino are visible in the terminal and also written to a log.txt. Can I intercept the terminal or is it easier to tail the log?
â Gero
Aug 3 at 21:51
The software is started with python main.py. In the GUI i run the cut. The commands sent to an arduino are visible in the terminal and also written to a log.txt. Can I intercept the terminal or is it easier to tail the log?
â Gero
Aug 3 at 21:51
You can probably do either but in order for us to help you need to post some sample output.
â Jesse_b
Aug 3 at 21:51
You can probably do either but in order for us to help you need to post some sample output.
â Jesse_b
Aug 3 at 21:51
From the terminal: "Sending: G0 Z0.5" From the logfile: Sent: G1 Z-0.05 F30
â Gero
Aug 3 at 21:53
From the terminal: "Sending: G0 Z0.5" From the logfile: Sent: G1 Z-0.05 F30
â Gero
Aug 3 at 21:53
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
Given example input of:
Sent: G1 Z-0.05 F30
This should capture the information you desire:
grep -o 'Z[^ ]*' inputfile
Z-0.05
Or, to capture in real-time:
tail -f inputfile | grep -o 'Z[^ ]*'
grep --line-buffered
for faster response.
â Jasen
2 days ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
Given example input of:
Sent: G1 Z-0.05 F30
This should capture the information you desire:
grep -o 'Z[^ ]*' inputfile
Z-0.05
Or, to capture in real-time:
tail -f inputfile | grep -o 'Z[^ ]*'
grep --line-buffered
for faster response.
â Jasen
2 days ago
add a comment |Â
up vote
2
down vote
Given example input of:
Sent: G1 Z-0.05 F30
This should capture the information you desire:
grep -o 'Z[^ ]*' inputfile
Z-0.05
Or, to capture in real-time:
tail -f inputfile | grep -o 'Z[^ ]*'
grep --line-buffered
for faster response.
â Jasen
2 days ago
add a comment |Â
up vote
2
down vote
up vote
2
down vote
Given example input of:
Sent: G1 Z-0.05 F30
This should capture the information you desire:
grep -o 'Z[^ ]*' inputfile
Z-0.05
Or, to capture in real-time:
tail -f inputfile | grep -o 'Z[^ ]*'
Given example input of:
Sent: G1 Z-0.05 F30
This should capture the information you desire:
grep -o 'Z[^ ]*' inputfile
Z-0.05
Or, to capture in real-time:
tail -f inputfile | grep -o 'Z[^ ]*'
edited Aug 3 at 22:14
answered Aug 3 at 22:04
DopeGhoti
39.5k54679
39.5k54679
grep --line-buffered
for faster response.
â Jasen
2 days ago
add a comment |Â
grep --line-buffered
for faster response.
â Jasen
2 days ago
grep --line-buffered
for faster response.â Jasen
2 days ago
grep --line-buffered
for faster response.â Jasen
2 days ago
add a comment |Â
Please post some sample output and specify the part you want to capture. Do you run a command to start your CNC?
â Jesse_b
Aug 3 at 21:47
The software is started with python main.py. In the GUI i run the cut. The commands sent to an arduino are visible in the terminal and also written to a log.txt. Can I intercept the terminal or is it easier to tail the log?
â Gero
Aug 3 at 21:51
You can probably do either but in order for us to help you need to post some sample output.
â Jesse_b
Aug 3 at 21:51
From the terminal: "Sending: G0 Z0.5" From the logfile: Sent: G1 Z-0.05 F30
â Gero
Aug 3 at 21:53