Class CStoNumSp
Version 1.0
Modified 08-MAR-2026 11:05:32.00
Code rt_plc_macro_string.h
 Conditional Storage of number of characters in a string attribute.

 Conditional storage of an string value ( parameter,
 input, or output signal) on a specified attribute in a
 local object.
 Conditional is aimed at the con-input, which is
 supposed to be connected.

 The last name segment of the object and the name of the
 parameter will be shown in the right part of the
 CStoNumSp symbol.

 It is not allowed, by means of a function in C or PLC
 programs, to write in any of the inputs.

Example
 It is possible to use CStoNumSp to change the DetectText in
 ASup or DSup objects.

RtBody attributes pwr_sClass_cstonumsp
String80 In VAL The input is connected to an analog signal or left
open. In the latter case the In is considered to be
stored.
Boolean Cond con Specifies whether a storage will be done or not. FALSE
means no storage and TRUE means storage of an analog
value.

DevBody attributes 
AttrRef Object sts Specifies the name of the object where to store the
value.
Int32 ObjectSegments   Specifies how many segments of the actual object name
that is to be displayed in the symbol of the CStoNumSp
object. The segments are counted from behind.
0 and 1 both result in displaying the last segment of
the actual object name.
Int32 NumberOfChar   Specifies number of character to copy.
If the string is shorter than NumberOfChar the string
and the NULL termination is copied. If the lengh of the
string is equal or greater than NumberOfChar, the NULL
termination is not copied. In this case the previous string
in the target attribut should be larger than NumberOfChar. If not,
the NULL termination is lost and the result is undefined.
PlcNode PlcNode  


GraphPlcNode
object_type 272
parameters[0] 2
parameters[1] 0
parameters[2] 0
parameters[3] 0
subwindows 0
graphmethod 15
graphindex 0
default_mask[0] 3
default_mask[1] 0
segname_annotation 0
devbody_annotation 1
compmethod 12
compindex 0
tracemethod 0
traceindex 1
connectmethod 7
executeordermethod 2
objname CStoNumSp
graphname CStoNumSp
debugpar Cond


Template Object
Cond 1


Attributes detail


In Input
Class Input
Type String80
Flags RTVIRTUAL | DEVBODYREF
GraphName VAL
Body RtBody
 The input is connected to an analog signal or left
 open. In the latter case the In is considered to be
 stored.

Cond Input
Class Input
Type Boolean
Flags STATE | RTVIRTUAL | DEVBODYREF | NOEDIT
GraphName con
Body RtBody
 Specifies whether a storage will be done or not. FALSE
 means no storage and TRUE means storage of an analog
 value.

Object Intern
Class Intern
Type AttrRef
Flags
GraphName sts
Body DevBody
 Specifies the name of the object where to store the
 value.

ObjectSegments Intern
Class Intern
Type Int32
Flags
Body DevBody
 Specifies how many segments of the actual object name
 that is to be displayed in the symbol of the CStoNumSp
 object. The segments are counted from behind.
 0 and 1 both result in displaying the last segment of
 the actual object name.

NumberOfChar Intern
Class Intern
Type Int32
Flags
Body DevBody
 Specifies number of character to copy.
 If the string is shorter than NumberOfChar the string
 and the NULL termination is copied. If the lengh of the
 string is equal or greater than NumberOfChar, the NULL
 termination is not copied. In this case the previous string
 in the target attribut should be larger than NumberOfChar. If not,
 the NULL termination is lost and the result is undefined.

PlcNode Buffer
Class Buffer
Type PlcNode
Flags INVISIBLE
Body DevBody