Markers

Markers identify specific points on particle trajectories and have these two main purpoes:

  • Displayed as dots on the screen (e.g. showing splat points or intersection points of a particle beam against a Test Plane).
  • Used to trigger Data Recording at those points.

Markers can be created via

  • Data Recording “When” events (on Data Recording screen).
  • Time markers (on Particles tab).
  • mark() command in a workbench user program.

You can Data Record at markers (in addition to markers created by Data Recording itself) by checking “When to Record This Data > All Markers” on the Data Recording screen.

Makers will display red unless the “Marker color” on the Particles tab is set to 15 white (transparent), causing them to be same color as the particles.

User programming

mark() within an other_actions segment draws a marker at the end of the current time-step (beginning of next time-ste).

So, something like this:

function segment.other_actions()
  if ion_px_mm >= 10 and ion_px_mm <= 11 then
    mark()
    ion_px_mm = 20
  end
end

sets the end of the current time-step to x=10 mm and causes a mark to be drawn at x=10 mm. It doesn’t matter the order of the lines “mark()” and “ion_px_mm = 10” since the mark is actually drawn after the other_actions segment is finished.

However, if you disable trajectory image viewing within a time-step, the line betwen the beginning and end of the current time-step is omitted. The marker is only omitted if it occurs at the beginning of the current time-step:

function segment.other_actions()
  if ion_px_mm >= 10 and ion_px_mm <= 11 then
    mark()
    ion_px_mm = 20
    sim_trajectory_image_control = 3 -- No View/Retain
  else
    sim_trajectory_image_control = 0 -- Yes View/Retain
  end
end

In the above, the marker is still drawn because the marker is placed at the end of the current time-step (beginning of next time step, when View/Retain is enabled).

The Marker Data Recording event is always generated even if View/Retain is off.

One special case to consider is if the marker is programmaticaly set on the last time-step:

function segment.other_actions()
  if ion_px_mm >= 10 then
    mark()
    ion_splat = 1
  end
end

A next time-step doesn’t exist, but the marker is still drawn at the end of the current time-step.

Note: mark() within an initialize or terminate segment presently has no effect (and was illegal here in the old PRG language).

Some uses of markers:

See Also