Question about G04 P0 and serial out default values (#109) - DDCSV2.1 - Standalone CNC Motion Controller - Digital Dream Technology support
View: 9849|Reply: 8
Print Previous Topic Next Topic

Question about G04 P0 and serial out default values (#109)

[Copy Link]

9

Threads

44

Posts

343

Credits

Intermediate Member

Rank: 3Rank: 3

Credits
343
Jump to the specified floor
Landlord
Posted at 2018-11-19 20:32:03 | Only Author Replies reward |Descending browser |Read mode
Hi ytliu!

Hope you can help me.

Aa far as I understand DDCSV uses “G04 P0” to switch off buffer look-ahead (as well as M0) and a rescanning of the G-Code from the current position. This may be needed in macros, which use the #1000… serial input values, which may have changed since the last G-code scan. BUT: this G-code rescanning may be a bit slow when used often or having “long” programs. Is there another way to prevent G-code lines from look ahead like using a “G103 P1” “G103” block or even adding a “/” before the line of interest, like the HAAS machines do?

Second question: You wrote, that parameter #109 is used to set the default values for serial output (#1031…). This is not completely true. This value is not only used during startup but also, when no G-Code is running. So, if you use them in a program and the program ends, the values will be reset to the values defined in #109. This is not “nice”, since changes done during a macro only persist as long as the program runs. Of course I can do some “tricks” to expand the “live time” of that values in the receiving device (e.g. coding some escape sequences which trigger a storage of the current values there), but I think a better way would be to be able to define, how long the #109 values should be valid: “when no G code is running” or  “until changed”. May be, you can add a new parameter #110, which defines this behavior..

Kind regards

Josef
Reply

Use props Report

8

Threads

333

Posts

1040

Credits

Super Moderator

Rank: 8Rank: 8

Credits
1040
Sofa
Posted at 2018-11-20 17:00:55 | Only Author
This installation package implements your second requirement.

For the first point you said, I think G04P0 and G103 are a meaning. When the parser encounters the G04P0 instruction, it will prevent prevent G-code lines from look ahead. After all the previous instructions have been run, the parser will continue to work.

install(2018-11-20-105).zip

597.68 KB, Down times: 1342

Reply Support Opposition

Use props Report

9

Threads

44

Posts

343

Credits

Intermediate Member

Rank: 3Rank: 3

Credits
343
Bench
 Author| Posted at 2018-11-20 17:23:41 | Only Author
>This installation package implements your second requirement.

I love you ;-)

About the look ahead:

> After all the previous instructions have been run

I don't understand this. When is look ahead switched on again after a G04P0 found? At the end of a loop, end of a macro, or a second G04P0?
Reply Support Opposition

Use props Report

8

Threads

333

Posts

1040

Credits

Super Moderator

Rank: 8Rank: 8

Credits
1040
Floor
Posted at 2018-11-20 17:53:46 | Only Author
Since G-code parsing and execution are handled in different processes, in order to correctly acquire certain macro variables, such as mechanical coordinate positions or serial input IO data, the G04P0 instruction must be added before reading, otherwise the value read is parsed. The value of the time, not the value after the execution.
Reply Support Opposition

Use props Report

9

Threads

44

Posts

343

Credits

Intermediate Member

Rank: 3Rank: 3

Credits
343
5#
 Author| Posted at 2018-11-20 18:26:36 | Only Author
Yes, I know. And if parsing starts again for the whole file, there is no reason to "switch the G04P0 instruction on and off". Switching it "off" makes only sense, if only parts of the (already parsed) Code is replaced by a newly parsed part. So I assume, that DDCSV always starts a complete reparsing after a G04P0 instruction.


BTW: A big thank you from my side for your work. I think, this kind of support results in much better advertising for your products than the niceses images of some marketing people will ;-)
Reply Support Opposition

Use props Report

8

Threads

333

Posts

1040

Credits

Super Moderator

Rank: 8Rank: 8

Credits
1040
6#
Posted at 2018-11-20 18:59:47 | Only Author
After the G04P0 instruction is encountered, the entire file is not re-parsed, but the subsequent G-code is parsed.
Reply Support Opposition

Use props Report

9

Threads

44

Posts

343

Credits

Intermediate Member

Rank: 3Rank: 3

Credits
343
7#
 Author| Posted at 2018-11-20 19:38:20 | Only Author
Where "subsequent" is "logical" based, not file based. Correct?
(E.g .if G04P0 is coded in a macro at the end of the input file, but this macro is used at the beginning, the file is rescanned from the beginning, right?)
Reply Support Opposition

Use props Report

8

Threads

333

Posts

1040

Credits

Super Moderator

Rank: 8Rank: 8

Credits
1040
8#
Posted at 2018-11-21 06:39:16 | Only Author
No, it is file based, so in order to get the current value of the macro, you need to add G04P0 before it, otherwise the value of the macro may be wrong.
Reply Support Opposition

Use props Report

0

Threads

5

Posts

16

Credits

Newbie Member

Rank: 1

Credits
16
9#
Posted at 2024-6-28 13:24:43 | Only Author
nice.

بادل
Reply Support Opposition

Use props Report

You need to log in before you can reply Login | Register now

This forum Credits Rules

Shenzhen Digital Dream Numerical Technology Co., Ltd. support
Adress:507,A Building,Leibo Industry Zone,No. 22 Jinxiu East Road,Kengzi Street,Pingshan district,Shenzhen City,P.R. of China
Phone:13244704799
E-mail:info@ddcnc.com

TEL

0755-87654321

Wchat

Website designed by DigitalDream Technology Support
Quick Reply Back to top Back to list