INCLUDE rtcu.inc
VAR_INPUT
input : BOOL R_EDGE;
END_VAR;
VAR_OUTPUT
Connected : BOOL;
END_VAR;
VAR
edge_no : INT := 0;
message_to_send : STRING;
END_VAR;
PROGRAM Send_SMS;
gsmPower(power := ON);
BEGIN
Connected := gsmConnected();
IF input THEN
edge_no := edge_no + 1;
message_to_send:=strFormat(format:="\1 leading edges detected",
v1:=edge_no);
gsmSendSMS(phonenumber:="+44 1234 5678",
message:=message_to_send);
END_IF;
END;
END_PROGRAM;
|