Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

E0028: a name a namespace does not have, or does not let this code see

A name written with its namespaces in front, Standard.Timers.TON, or a short one a USING brings in, has to name an element the namespace has, and one this code may see (Ed.3 6.9, Figure 29):

  • not there: Standard.Timers.TOM, or USING Standard.Timer; for a namespace that does not exist;
  • INTERNAL: an element declared FUNCTION INTERNAL, or FUNCTION_BLOCK INTERNAL, is seen only inside its own namespace; the public elements of a NAMESPACE INTERNAL are seen only in the namespace one level above it;
  • a namespace where something else is meant: as a type (t : Standard.Timers;), as a function, or with a variable after it (Standard.x): a namespace holds types, functions, function blocks and programs, no variables (Ed.3 6.9.2; NAMESPACES.md D7);
  • USING of what is not a namespace: USING names namespaces (Ed.3 6.9.4);
  • _. for the global namespace without --extension global-namespace (extensions).
NAMESPACE Timers
    FUNCTION INTERNAL tick : DINT
        tick := 1;
    END_FUNCTION
END_NAMESPACE

PROGRAM main
VAR n : DINT; END_VAR
n := Timers.tick();      (* E0028: tick is INTERNAL to Timers *)
END_PROGRAM

Declare it without INTERNAL to call it from outside its namespace, or call it from inside.