 [ × ]Search in Articles and Diagrams
Search in Products

# Look Ahead. How many lines of gcode does simCNC analyse in advance?

Tags:   #   #   #   #   #

### How many lines of gcode does simCNC analyse in advance?

How many lines look ahead can we set?

This question has no simple answer, but we will try to explain it. Depending on the gcode, simCNC can analyze in advance from 200 segments up to 20000 segments. Regardless of the number of segments analyzed in advance by simCNC, the PC is loaded to the same extent during processing. To understand why the range of the number of analyzed segments is so broad, you need to know the main stages that gcode goes through.

1) The stage of loading the file from gcode to simCNC – This stage consists of two activities:

a) Converting gcode lines into segments
There are two main types of segments, a segment type and an arc type segment.

b) Segment optimization
Optimization involves converting (at one time) up to 100 line segments (occurring one after the other) into a more extensive line or arc segment.

Please note that both the conversion of gcode lines into segments and the optimization of segments – section type are not performed during processing, but much earlier. It is also important that both activities are done using all cores of the PC processor, which significantly speeds up loading the gcode to simCNC.

2) Processing stage.

During machining, simCNC analyzes 200 segments in advance, the original segments and those created at the optimization stage. The following formula can be derived from the above steps:
Number of segments optimized * Number of segments analyzed = Total Number of segments analyzed in advance by simCNC

Substituting the constants into the formula, we get:
Number of segments optimized * 200 = Total Number of segments analyzed in advance by simCNC

Now that you know how it works, let’s consider two extreme situations:

1) When gcode consists of only arcs.

In this situation, optimization cannot take place because the optimization feature only converts segments of the line segment type into larger segments of the line or arc type. Using the above formula we get the following calculation: 1 * 200 = 200

2) When gcode consists of only sections

Optimization will turn all line segments into larger line or arc segments in this situation. Using the above formula we get the following calculation 100 * 200 = 20000

That is why the number of segments analyzed in advance by simCNC is in the range of 200-20000.

[Source:] The text was created by CS-Lab’s Technical Support section for CSMIO/IP users.