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, orUSING Standard.Timer;for a namespace that does not exist; - INTERNAL: an element declared
FUNCTION INTERNAL, orFUNCTION_BLOCK INTERNAL, is seen only inside its own namespace; the public elements of aNAMESPACE INTERNALare 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); USINGof 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.