5- 93 5- 93
5 MELSEC FUNCTIONS
5.18.11 Floating-point natural logarithm operation LOG_E_MD
The base e logarithm (natural logarithm) of the specified value is operated.
Function definition
BOOL LOG_E_MD (BOOL EN, REAL S1, REAL D);
Argument Name
IN/OUT
Description
EN IN
Execution condition (Function is executed only when the
result is TRUE)
S1 IN
Data to be operated (only positive value can be
specified) (real number data)
D OUT
Operation result (log
e
S1) (real number data)
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, the base e logarithm (natural logarithm) *)
(* of the value specified in rData is operated, and the result is stored into Result. *)
LOG_E_MD (X0, rData, Result);
Corresponding MELSEC command
LOG (Natural logarithm operation on floating-point data (Single precision))
5.18.12 Random number generation RND_M
Random numbers of 0 to 32767 are generated.
Function definition
BOOL RND_M (BOOL EN, ANY16 D);
Argument Name
IN/OUT
Description
EN IN
Execution condition (Function is executed only when the
result is TRUE)
D
OUT
Random number generation result (BIN 16-bit data)
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, random numbers of 0 to 32767 are *)
(* generated and stored into Result.
*)
RND_M (X0, Result);
Corresponding MELSEC command
RND (Random number generation)
For the usable data type, refer to "3.2.2
About ANY type".
Содержание MELSEC L series
Страница 1: ...Programming Manual Structured Text ...
Страница 2: ......
Страница 73: ...4 33 4 33 4 ST PROGRAM EXPRESSIONS MEMO ...
Страница 297: ......