MLEN (lunghezza della stringa)
L'istruzione MLEN calcola la lunghezza di una stringa.
Lingue supportate: Diagramma a blocchi funzione, Diagramma Ladder, Testo strutturato.
Questa istruzione vale per i controllori Micro810, L20E, L50E e L70E.
MLEN

Parametro | Tipo di parametro | Tipo di dati | Descrizione |
|---|---|---|---|
EN | Ingresso | BOOL | Abilitazione istruzioni.
Applicabile alle programmazioni in diagramma ladder. |
IN | Ingresso | STRING | Qualsiasi stringa. |
MLEN | Uscita | DINT | Numero di caratteri nella stringa IN. |
ENO | Uscita | BOOL | Abilita uscita. Applicabile alle programmazioni in diagramma ladder. |
Esempi di MLEN
Esempio di diagramma a blocchi funzionali MLEN

Esempio di diagramma ladder MLEN

Esempio di testo strutturato MLEN

(* ST Equivalence: *) nbchar := MLEN (complete_string); If (nbchar < 3) Then Return; End_if; prefix := LEFT (complete_string, 3); (* this program extracts the 3 characters on the left of the string and puts the result in the prefix string variable. Nothing is done if the string length is less than 3 characters *)
Risultati

Fornire un feedback