Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

StrToValue

  • Last UpdatedJul 18, 2023
  • 1 minute read

Converts a string into a floating-point number. This function is similar to the StrToReal() function except that the function halts if it is passed an invalid string. The function will search the string for the first non-blank character, and then start converting until it finds the end of the string or a non-numeric character. If the first non-blank character is not a numeric character (0-9), a space, a decimal point, a " + " or a " - " sign, the function will halt.

Use this function to check keyboard input from the operator by setting control points (for example, it minimizes the likelihood of a setpoint being set to 0 if the operator presses ENTER or enters invalid data by mistake).

Syntax

StrToValue(String)

String:

The string to convert.

Return Value

A floating-point number (converted from String).

StrToReal, StrToInt

Example

System Keyboard

Key Sequence

F3 ######## Enter

Command

SP123 = StrToValue(Arg1);

Comment

Set setpoint 123 to value unless value is invalid

Note: If value is invalid the Cicode is halted. Any other Cicode after the StrToValue() function will not execute.

See Also

String Functions

Using the Caret Escape Sequence Character

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in