Siemens SIMATIC S7-SCL V5.3 Manual página 308

Tabla de contenido

Publicidad

Funciones estándar de S7-SCL
//inicialización de las variables temporales
texto := '';
generador_de_textos := true;
Case unit of
1..5 : case status of
1..5 : text := concat( in1 := textos_mensajes.HW[unit],
else generador_de_textos:= false;
end_case;
else generador_de_textos:= false;
end_case;
i := textos_mensajes.index;
textos_mensajes.buferdetexto[i] := texto;
textos_mensajes.index := (i+1) mod 20;
END_FUNCTION
////////////////////////////////////////////////////////////////////
//La función se llamará en el programa cíclico cuando se cambie
//de flanco en %M10.0 y registrará un mensaje una sola vez,
//si cambia un parámetro.
////////////////////////////////////////////////////////////////////
Organization_block Ciclo
Var_temp
Besy_ifx : array [0..20] of byte;
error: BOOL;
End_var;
////////////////////////////////////////////////////////////////////
//La siguiente llamada causa la entrada "Motor 12 arrancado" en
//el búfer de textos del DB Textos de mensaje, teniendo que
//transmitirse a //través de %MW0 un 1, a través de %EW2 el 12
//y a través de %MW2 se debe transmitir un 2. *)
////////////////////////////////////////////////////////////////////
if %M10.0 <> %M10.1 then
error:= generador_de_textos (unit
%M10.1:=M10.0;
end_if;
end_organization_block
14-22
text := concat( in1 := text,
in2 := textos_mensajes.stati[status]);
valor if <> 0 then
text := concat( in1 := texto,
in2 := I_STRNG(valor));
end_if;
in2 := right(l:=2,in:=I_STRNG(nr)));
:= word_to_int(%MW0),
nr
:= word_to_int(%EW2),
status := word_to_int(%MW2),
valor
:= 0);
//
//
//
//
//
//
//
S7-SCL V5.3 para S7-300/400
A5E00324652-01

Publicidad

Tabla de contenido
loading

Tabla de contenido