Special functions

This page highlights several notable functions that can be utilized throughout the development and use of symbols.

Symbol editor

Table 1. Variables with certain properties recognized by PsxCad in the symbol editor
Syntax Description

CV_VALUE

Refers to the value of the tag of the symbol itself.

CV_SCREEN

Toggles a boolean value when the popup is opened or closed (true = opened, false = closed).

CV_BNR_yy

Reference to a bit within the binary number of the integer value. Refers to the tag of the symbol itself and "yy" is a number refers to yet another bit in the binary structure of the integer.

CV_xx_BNR_yy

Reference to a bit within the binary number of the integer value. "xx" refers to the tag of the integer and "yy" is a number refers to yet another bit in the binary structure of the integer. If "xx_" is omitted then it refers to a bit within integer value of the tag of the symbol itself.

LC_Changed

This boolean indicates whether the logic content of the symbol does not match the corresponding symbol in the library. Usually the symbol is colored yellow in this case.

Error

This boolean indicates that the logic symbol is in error, due to a data type conflict, for example. Usually the symbol is colored red in this case.

Table 2. Functions with certain properties recognized by PsxCad in the symbol editor
Syntax Description

#B#

Prefix followed by a logical sentence which will result in a boolean value

#I#

Prefix followed by a logical sentence which will result in a integer value

#D#

Prefix followed by a logical sentence which will result in a double value

$$PULSE_0 up to $$PULSE_15

Sets en reset itself with a pulse within a certain amount of time. The frequency is adjustable with the number.

$$RT

True in runtime mode and false in editor’s mode

#LC#Opr

Runs an operation on logic content.
"IN_SIZE" will return the amount of inputs on the symbol. "OUT_SIZE" will return the amount of outputs on the symbol. "IV_SIZE" will return the amount of internal variables on the symbol.

#LC#Tag%Opr%

Runs an operation on a tag in the logic content. The Tag reference must begin without '$' sign.
"INIT" of "INIT_VALUE" shows initial value of tag. Even when not in runtime. "CT" or "CONNECTED TAG" will reference to connected tag. This operation followed by %NOT EMPTY or "%EMPTY" will return a boolean, that let’s you know the connected tag is there or not. "TYPE_STRING" will return the datatype of the tag as a string. "HW_IO" or "HARDWARE_IO" will return the PLC adress of the tag.

#TEXT#TextTarget#SearchType#TextSearchTherm#X

This is a text based search function. It will return a true or false. Actual text or a reference to a string can be used on the places TextTarget and TextSearchTherm. Searchtypes: STARTSWITH, ENDSWITH, CONTAINS, EQUALS, NOT EQUALS

#TEXT#TextTarget#SearchType#X

This is a text based search function, that doesn’t need a search therm. It will return a true or false. Actual text or a reference to a string can be used on TextTarget. Search types: EMPTY, NOT EMPTY

Examples:

#LC#T_VALUE%INIT%
#TEXT#$TEXT0#NOT_EMPTY#X
#TEXT#$TEXT0#STARTSWITH#$TEXT1#X
Table 3. References with certain properties recognized by PsxCad in the symbol editor and symbol parameters
Syntax Description

{DBF; LookupValue; ResultVector

Look up function for the database. Looks value up in de column for ID tags within database.

{DBF; LookupValue; LookupVector; ResultVector

Look up function for the database. One kan use a combination with "+" sign and an other ResultVector to combine the results.

#PRJ: Reference

Prefix used in combination with a reference form the list at Project  project description in the menu, will return corresponding text from that reference

# ColorTableReference

References to a color in the color table at Edit  Color table in the menu

Examples:

{DBF;{ID_TXT};ID;DESCRIPTION
#PRJ:PROJECT_NR

Edit symbol ID window (G key)

This window is also editable within the symbol editor. Changes here will make it default.

Table 4. Functions and references
Syntax Field Description

{ID_TXT}

any

Reference to the ID tag of the symbol

{SCREEN}

any

Reference to the screen name

{NAV_1}

Runtime navigation

Uses the navigation table at Runtime  Navigation table in the menu to lookup referenced sheet. The number can be varied.

#PSX#INLINEVALUE

popup name

Calls up input field, where the user can enter a value or string. If the special parameter field is empty, it will write the value of the symbol’s tag. If the special parameter field in filled with a symbol parameter, it will write the value of the tag that is connected through that parameter. The parameter should start with "CV_".

any tag

ID text (commands)

With "Runtime user cmd (11)" and/or "Runtime user cmd (12)" activated, the value in the field next to it is fired to the tag value when the command is given.

&KEY&2 up to &KEY&260

ID text (commands)

Calls a key function, go to Runtime  Parameters in the menu, look under "Mouse/Keyboard" tab and press mouse / key action wizard for a list of all key functions with their indexed value

&KEY&261

ID text (commands)

Send commands for controlling simulation, based on ID tag. CMDs like RUN SIMULATION ; PAUSE ; -1 ; -10 ; +1 ; +10

Examples:

#PSX#INLINEVALUE

Other

Table 5. Functions to be added to text fields of the basic symbol TEXT in the symbol editor or symbol parameters
Syntax Description

textArray:

Beginning with this function enables the use of functions, like the other functions in this table

<br>

New line