//RAZ STRING D ETAT ETAPES
"DB570_SEQ_COM_FTP".SEQ.NOM_ETAPE := ' ';
"DB570_SEQ_COM_FTP".SEQ.DESCRIP_TRANSITION := ' ';
REGION INITIALISATION
//RAZ DES VARIABLES
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 0 THEN
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;"DB570_SEQ_COM_FTP".SEQ.CMD01_00 := 0; // DDe de transfert
"DB570_SEQ_COM_FTP".SEQ.CMD01_01 := 0; // Transfert done
"DB570_SEQ_COM_FTP".SEQ.CMD01_02 := 0; // Transfert busy
"DB570_SEQ_COM_FTP".SEQ.CMD01_03 := 0; // Transfert erreur
"DB570_SEQ_COM_FTP".SEQ.CMD01_04 := 0; //
"DB570_SEQ_COM_FTP".SEQ.CMD01_05 := 0; //
"DB570_SEQ_COM_FTP".SEQ.CMD01_06 := 0; //
"DB570_SEQ_COM_FTP".SEQ.CMD01_07 := 0; //
"DB570_SEQ_COM_FTP".SEQ.CMD01_08 := 0; //
"DB570_SEQ_COM_FTP".SEQ.CMD01_09 := 0; //
"DB570_SEQ_COM_FTP".SEQ.CMD01_10 := 0; //
"DB570_SEQ_COM_FTP".SEQ.CMD01_11 := 0; //
"DB570_SEQ_COM_FTP".SEQ.CMD01_12 := 0; //
"DB570_SEQ_COM_FTP".SEQ.CMD01_13 := 0; //
"DB570_SEQ_COM_FTP".SEQ.CMD01_14 := 0; //
"DB570_SEQ_COM_FTP".SEQ.CMD01_15 := 0; //"DB570_SEQ_COM_FTP".SEQ.CMD02_00 := 0; //
"DB570_SEQ_COM_FTP".SEQ.CMD02_01 := 0; //
"DB570_SEQ_COM_FTP".SEQ.CMD02_02 := 0; //
"DB570_SEQ_COM_FTP".SEQ.CMD02_03 := 0; //
"DB570_SEQ_COM_FTP".SEQ.CMD02_04 := 0; //
"DB570_SEQ_COM_FTP".SEQ.CMD02_05 := 0; //
"DB570_SEQ_COM_FTP".SEQ.CMD02_06 := 0; //
"DB570_SEQ_COM_FTP".SEQ.CMD02_07 := 0; //
"DB570_SEQ_COM_FTP".SEQ.CMD02_08 := 0; //
"DB570_SEQ_COM_FTP".SEQ.CMD02_09 := 0; //
"DB570_SEQ_COM_FTP".SEQ.CMD02_10 := 0; //
"DB570_SEQ_COM_FTP".SEQ.CMD02_11 := 0; //
"DB570_SEQ_COM_FTP".SEQ.CMD02_12 := 0; //
"DB570_SEQ_COM_FTP".SEQ.CMD02_13 := 0; //
"DB570_SEQ_COM_FTP".SEQ.CMD02_14 := 0; //
"DB570_SEQ_COM_FTP".SEQ.CMD02_15 := 0; //(*"DB570_SEQ_COM_FTP".SEQ.INT01 := 0;*) //Export CSV ETAT
"DB570_SEQ_COM_FTP".SEQ.INT02 := 0; //Compteur tentative connexion serveur FTP
"DB570_SEQ_COM_FTP".SEQ.INT03 := 0; //Compteur erreur communiquée FTP
"DB570_SEQ_COM_FTP".SEQ.INT04 := 0; //Memorisation etape erreur
"DB570_SEQ_COM_FTP".SEQ.INT05 := 0; // Code erreurEND_IF;
//SAUT SI AU POUR FIGER SEQUENCE
IF "Tjrs_0" THEN
GOTO L999;
END_IF;//DEMARRAGE DE LA SEQUENCE
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 0 AND "REPRISE_API_OK" THEN
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 10;
END_IF;//INCREMENTATION TEMPO
IF "BIT_100ms" AND "DB570_SEQ_COM_FTP".SEQ.T_100MS < 32766 THEN
"DB570_SEQ_COM_FTP".SEQ.T_100MS := "DB570_SEQ_COM_FTP".SEQ.T_100MS + 1;
END_IF;
IF "BIT_1s" AND "DB570_SEQ_COM_FTP".SEQ.T_1S < 32766 THEN
"DB570_SEQ_COM_FTP".SEQ.T_1S := "DB570_SEQ_COM_FTP".SEQ.T_1S + 1;
END_IF;
END_REGIONREGION GESTION FONCTIONNEMENT COM LINA
//
//-----------------------------------------------------------------------------
//Détection perte de Com
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 10 THEN"DB570_SEQ_COM_FTP".SEQ.CMD01_00 := 0; // DDe de transfert
"DB570_SEQ_COM_FTP".SEQ.NOM_ETAPE := 'Attente detection de defaut com Lina';
"DB570_SEQ_COM_FTP".SEQ.DESCRIP_TRANSITION := 'Defaut de com Lina actif';IF "DB50_DEF_GEN".DEF_0033 THEN
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 20;
END_IF;
END_IF;// Retour de la com
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 20 THENIF NOT "DB50_DEF_GEN".DEF_0033 THEN
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 30;
END_IF;
END_IF;(*ATTENTE DEMANDE DE SYNCHRO EXPORT STP*)
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 30 AND "DB568_SEQ_ARCHIVAGE".SEQ.NUM_ETAPE = 5000 THEN
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 35;
END_IF;
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 35 AND "DB568_SEQ_ARCHIVAGE".SEQ.NUM_ETAPE <> 5000 THEN
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 100;
END_IF;//Etape d'attente avant relance si defaut serveur FTP
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 50 THENIF "DB570_SEQ_COM_FTP".SEQ.T_1S > 30 THEN
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 100;
END_IF;
END_IF;
END_REGIONREGION TRAITEMENT / ENVOI DES FICHIERS
// Ecriture des paramètres du serveur FTP
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 100 THEN"DB570_SEQ_COM_FTP".SEQ.INT01 := 0; // Export CSV OK
// Adresse serveur FTP, nom d'utilisateur et mot de passe
"DB571_PARAM_SEQ_COM_FTP".Server.paramServer.ipAddress.ip1 := "DB571_PARAM_SEQ_COM_FTP".Addr_IP_FTP_1;
"DB571_PARAM_SEQ_COM_FTP".Server.paramServer.ipAddress.ip2 := "DB571_PARAM_SEQ_COM_FTP".Addr_IP_FTP_2;
"DB571_PARAM_SEQ_COM_FTP".Server.paramServer.ipAddress.ip3 := "DB571_PARAM_SEQ_COM_FTP".Addr_IP_FTP_3;
"DB571_PARAM_SEQ_COM_FTP".Server.paramServer.ipAddress.ip4 := "DB571_PARAM_SEQ_COM_FTP".Addr_IP_FTP_4;
"DB571_PARAM_SEQ_COM_FTP".Server.paramServer.username := "DB571_PARAM_SEQ_COM_FTP".User_FTP;
"DB571_PARAM_SEQ_COM_FTP".Server.paramServer.password := "DB571_PARAM_SEQ_COM_FTP".Password_FTP;// Adresse de l'automate ( A voir lors d'une évolution pour récup depuis la config matériel )
"DB571_PARAM_SEQ_COM_FTP".Client.paramClient.ipAddress.ip1 := "DB571_PARAM_SEQ_COM_FTP".Addr_IP_API_1;
"DB571_PARAM_SEQ_COM_FTP".Client.paramClient.ipAddress.ip2 := "DB571_PARAM_SEQ_COM_FTP".Addr_IP_API_2;
"DB571_PARAM_SEQ_COM_FTP".Client.paramClient.ipAddress.ip3 := "DB571_PARAM_SEQ_COM_FTP".Addr_IP_API_3;
"DB571_PARAM_SEQ_COM_FTP".Client.paramClient.ipAddress.ip4 := "DB571_PARAM_SEQ_COM_FTP".Addr_IP_API_4;
"DB571_PARAM_SEQ_COM_FTP".Client.paramClient.portStartAddress := 1500;"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 200;
END_IF;// Paramètre fichier n°1
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 200 THEN"DB571_PARAM_SEQ_COM_FTP".filename := 'Remonte_param_02.csv'; // Nom du fichier dans le serveur FTP
"DB571_PARAM_SEQ_COM_FTP".num_db := 400; // Numéro du DB (non optimisé)
"DB571_PARAM_SEQ_COM_FTP".index_debut := 16; // Index de la première valeur dans le DB à exporter
"DB571_PARAM_SEQ_COM_FTP"."int/reel" := true; // Valeur dans le DB en entier ou en réel(réel ici)
"DB571_PARAM_SEQ_COM_FTP".nbre_decimale := 2; // Nombre de décimale dans le fichier csv
"DB571_PARAM_SEQ_COM_FTP".nbre_points := "DB569_PARAM_SEQ_ARCHIVAGE".index - 1; // Nombre de valeurs à exporter
"DB571_PARAM_SEQ_COM_FTP".echantillonage := "DB580_ARCHIVAGE_PARAM_02".Echantillonage; // Temps d'échantillonage entre 2 points ( permet de stocker que l'heure de début)
"DB571_PARAM_SEQ_COM_FTP".DTL_debut := "DB580_ARCHIVAGE_PARAM_02".Heure_debut - "DB569_PARAM_SEQ_ARCHIVAGE".Tps_Echantillonnage; // Heure de début"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 210;
END_IF;// Demande envoi fichier n°1
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 210 THEN"DB570_SEQ_COM_FTP".SEQ.CMD01_00 := 1; // DDe de transfert
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 220;
END_IF;// Attente détection communication en cours
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 220 THEN(*Memorisation erreur*)
"DB570_SEQ_COM_FTP".SEQ.INT04 := 220;IF "DB570_SEQ_COM_FTP".SEQ.CMD01_02 = true THEN // Com en cours
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 230;
END_IF;
IF "DB570_SEQ_COM_FTP".SEQ.T_1S > 20 THEN
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 2000;
END_IF;
END_IF;// Communication terminée
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 230 THEN(*Memorisation erreur*)
"DB570_SEQ_COM_FTP".SEQ.INT04 := 230;IF "DB570_SEQ_COM_FTP".SEQ.CMD01_02 = false THEN // Com finie
IF "DB570_SEQ_COM_FTP".SEQ.CMD01_01 = true THEN // Com OK
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 240;
END_IF;
IF "DB570_SEQ_COM_FTP".SEQ.CMD01_03 = true THEN // Com erreur
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 3000;
END_IF;
END_IF;
END_IF;// Envoi fichier n°1 OK
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 240 THEN(*Memorisation erreur*)
"DB570_SEQ_COM_FTP".SEQ.INT04 := 0;"DB570_SEQ_COM_FTP".SEQ.CMD01_00 := 0; // DDe de transfert
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 250;
GOTO L999;
END_IF;// Paramètre top_fichier n°1
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 250 THEN"DB571_PARAM_SEQ_COM_FTP".filename := 'top_Remonte_02.csv'; // Nom du fichier dans le serveur FTP
"DB571_PARAM_SEQ_COM_FTP".num_db := 400; // Numéro du DB (non optimisé)
"DB571_PARAM_SEQ_COM_FTP".index_debut := 16; // Index de la première valeur dans le DB à exporter
"DB571_PARAM_SEQ_COM_FTP"."int/reel" := true; // Valeur dans le DB en entier ou en réel(réel ici)
"DB571_PARAM_SEQ_COM_FTP".nbre_decimale := 2; // Nombre de décimale dans le fichier csv
"DB571_PARAM_SEQ_COM_FTP".nbre_points := 1; // Nombre de valeurs à exporter
"DB571_PARAM_SEQ_COM_FTP".echantillonage := "DB580_ARCHIVAGE_PARAM_02".Echantillonage; // Temps d'échantillonage entre 2 points ( permet de stocker que l'heure de début)
"DB571_PARAM_SEQ_COM_FTP".DTL_debut := "DB580_ARCHIVAGE_PARAM_02".Heure_debut - "DB569_PARAM_SEQ_ARCHIVAGE".Tps_Echantillonnage; // Heure de début"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 260;
END_IF;// Demande envoi top_fichier n°1
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 260 THEN"DB570_SEQ_COM_FTP".SEQ.CMD01_00 := 1; // DDe de transfert
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 270;
END_IF;// Attente détection communication en cours
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 270 THENIF "DB570_SEQ_COM_FTP".SEQ.CMD01_02 = true THEN // Com en cours
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 280;
END_IF;
END_IF;// Communication terminée
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 280 THEN(*Memorisation erreur*)
"DB570_SEQ_COM_FTP".SEQ.INT04 := 280;IF "DB570_SEQ_COM_FTP".SEQ.CMD01_02 = false THEN // Com finie
IF "DB570_SEQ_COM_FTP".SEQ.CMD01_01 = true THEN // Com OK
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 290;
END_IF;
IF "DB570_SEQ_COM_FTP".SEQ.CMD01_03 = true THEN // Com erreur
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 3000;
END_IF;
END_IF;
END_IF;// Envoi top_fichier n°1 OK
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 290 THEN(*Memorisation erreur*)
"DB570_SEQ_COM_FTP".SEQ.INT04 := 0;"DB570_SEQ_COM_FTP".SEQ.CMD01_00 := 0; // DDe de transfert
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 300;
GOTO L999;
END_IF;// Paramètre fichier n°2
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 300 THEN"DB571_PARAM_SEQ_COM_FTP".filename := 'Remonte_param_04.csv'; // Nom du fichier dans le serveur FTP
"DB571_PARAM_SEQ_COM_FTP".num_db := 401; // Numéro du DB (non optimisé)
"DB571_PARAM_SEQ_COM_FTP".index_debut := 16; // Index de la première valeur dans le DB à exporter
"DB571_PARAM_SEQ_COM_FTP"."int/reel" := true; // Valeur dans le DB en entier ou en réel(réel ici)
"DB571_PARAM_SEQ_COM_FTP".nbre_decimale := 2; // Nombre de décimale dans le fichier csv
"DB571_PARAM_SEQ_COM_FTP".nbre_points := "DB569_PARAM_SEQ_ARCHIVAGE".index - 1; // Nombre de valeurs à exporter
"DB571_PARAM_SEQ_COM_FTP".echantillonage := "DB581_ARCHIVAGE_PARAM_04".Echantillonage; // Temps d'échantillonage entre 2 points ( permet de stocker que l'heure de début)
"DB571_PARAM_SEQ_COM_FTP".DTL_debut := "DB581_ARCHIVAGE_PARAM_04".Heure_debut - "DB569_PARAM_SEQ_ARCHIVAGE".Tps_Echantillonnage; // Heure de début"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 310;END_IF;
// Demande envoi fichier n°2
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 310 THEN"DB570_SEQ_COM_FTP".SEQ.CMD01_00 := 1; // DDe de transfert
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 320;
END_IF;// Attente détection communication en cours
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 320 THENIF "DB570_SEQ_COM_FTP".SEQ.CMD01_02 = true THEN // Com en cours
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 330;
END_IF;
END_IF;// Communication terminée
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 330 THEN(*Memorisation erreur*)
"DB570_SEQ_COM_FTP".SEQ.INT04 := 330;IF "DB570_SEQ_COM_FTP".SEQ.CMD01_02 = false THEN // Com finie
IF "DB570_SEQ_COM_FTP".SEQ.CMD01_01 = true THEN // Com OK
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 340;
END_IF;
IF "DB570_SEQ_COM_FTP".SEQ.CMD01_03 = true THEN // Com erreur
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 3000;
END_IF;
END_IF;
END_IF;// Envoi fichier n°2 OK
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 340 THEN(*Memorisation erreur*)
"DB570_SEQ_COM_FTP".SEQ.INT04 := 0;"DB570_SEQ_COM_FTP".SEQ.CMD01_00 := 0; // DDe de transfert
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 350;
GOTO L999;END_IF;
// Paramètre top_fichier n°2
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 350 THEN"DB571_PARAM_SEQ_COM_FTP".filename := 'top_Remonte_04.csv'; // Nom du fichier dans le serveur FTP
"DB571_PARAM_SEQ_COM_FTP".num_db := 401; // Numéro du DB (non optimisé)
"DB571_PARAM_SEQ_COM_FTP".index_debut := 16; // Index de la première valeur dans le DB à exporter
"DB571_PARAM_SEQ_COM_FTP"."int/reel" := true; // Valeur dans le DB en entier ou en réel(réel ici)
"DB571_PARAM_SEQ_COM_FTP".nbre_decimale := 2; // Nombre de décimale dans le fichier csv
"DB571_PARAM_SEQ_COM_FTP".nbre_points := 1; // Nombre de valeurs à exporter
"DB571_PARAM_SEQ_COM_FTP".echantillonage := "DB581_ARCHIVAGE_PARAM_04".Echantillonage; // Temps d'échantillonage entre 2 points ( permet de stocker que l'heure de début)
"DB571_PARAM_SEQ_COM_FTP".DTL_debut := "DB581_ARCHIVAGE_PARAM_04".Heure_debut - "DB569_PARAM_SEQ_ARCHIVAGE".Tps_Echantillonnage; // Heure de début"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 360;END_IF;
// Demande envoi top_fichier n°2
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 360 THEN"DB570_SEQ_COM_FTP".SEQ.CMD01_00 := 1; // DDe de transfert
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 370;
END_IF;// Attente détection communication en cours
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 370 THENIF "DB570_SEQ_COM_FTP".SEQ.CMD01_02 = true THEN // Com en cours
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 380;
END_IF;
END_IF;// Communication terminée
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 380 THEN(*Memorisation erreur*)
"DB570_SEQ_COM_FTP".SEQ.INT04 := 380;IF "DB570_SEQ_COM_FTP".SEQ.CMD01_02 = false THEN // Com finie
IF "DB570_SEQ_COM_FTP".SEQ.CMD01_01 = true THEN // Com OK
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 390;
END_IF;
IF "DB570_SEQ_COM_FTP".SEQ.CMD01_03 = true THEN // Com erreur
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 3000;
END_IF;
END_IF;
END_IF;// Envoi top_fichier n°2 OK
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 390 THEN(*Memorisation erreur*)
"DB570_SEQ_COM_FTP".SEQ.INT04 := 0;"DB570_SEQ_COM_FTP".SEQ.CMD01_00 := 0; // DDe de transfert
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 1000;
GOTO L999;
END_IF;
END_REGIONREGION ENVOI OK
// Tous les fichier OK
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 1000 THEN"DB570_SEQ_COM_FTP".SEQ.INT01 := 1; // Export CSV OK
(*"DB569_PARAM_SEQ_ARCHIVAGE".index := 1;*)
(*"DB569_PARAM_SEQ_ARCHIVAGE".Tempo_prise_echantillon := 0;*)"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 1010;
END_IF;(*DEMANDE DE SYNCHRO FIN EXPORT FTP*)
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 1010 AND "DB568_SEQ_ARCHIVAGE".SEQ.NUM_ETAPE = 5015 THEN
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 1015;
END_IF;
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 1015 AND "DB568_SEQ_ARCHIVAGE".SEQ.NUM_ETAPE <> 5015 THEN
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 0;
END_IF;(*DEBLOCAGE DE LA SEQUENCE SI LA SYNCHRO NE PASSE PAS*)
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 1010 AND "DB570_SEQ_COM_FTP".SEQ.T_1S > 10 THEN
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 0;
END_IF;
END_REGIONREGION COM FTP NON ACCESSIBLE
//LECTURE NOMBRE TENTATIVE
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 2000 THEN"DB570_SEQ_COM_FTP".SEQ.INT02 := "DB570_SEQ_COM_FTP".SEQ.INT02 + 1;
//AUTORISATION NOUVELLE TENTATIVE
IF "DB570_SEQ_COM_FTP".SEQ.INT02 < 5 THEN
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 50;
END_IF;
//COM FTP NON ACCESSIBLE
IF "DB570_SEQ_COM_FTP".SEQ.INT02 > 5 THEN
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 2010;
END_IF;
END_IF;//COM FTP NON ACCESSIBLE
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 2010 THEN//COM FTP NON ACCESSIBLE
"DB570_SEQ_COM_FTP".SEQ.INT01 := 2;IF "Tjrs_1" THEN
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 1010;
END_IF;
END_IF;
END_REGIONREGION COM FTP REMONTE ERREUR
//LECTURE NOMBRE TENTATIVE
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 3000 THEN"DB570_SEQ_COM_FTP".SEQ.INT03 := "DB570_SEQ_COM_FTP".SEQ.INT03 + 1;
//AUTORISATION NOUVELLE TENTATIVE
IF"DB570_SEQ_COM_FTP".SEQ.INT03 < 5 THEN
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 50;
END_IF;
//COM FTP REMONTE ERREUR
IF "DB570_SEQ_COM_FTP".SEQ.INT03 > 5 THEN
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 3010;
END_IF;
END_IF;//COM FTP REMONTE ERREUR
IF "DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE = 3010 THEN//COM FTP REMONTE ERREUR
"DB570_SEQ_COM_FTP".SEQ.INT01 := 3;IF "Tjrs_1" THEN
"DB570_SEQ_COM_FTP".SEQ.T_100MS := 0;
"DB570_SEQ_COM_FTP".SEQ.T_1S := 0;
"DB570_SEQ_COM_FTP".SEQ.NUM_ETAPE := 1010;
END_IF;
END_IF;
END_REGION//*****************************************************************************
L999:;"DB5681_SEND_DATA"(sendReq := "DB570_SEQ_COM_FTP".SEQ.CMD01_00 OR "REARM_DEF",
"DB571_PARAM_SEQ_COM_FTP".FTP_TEL.ftpHeader.actLength := "DB5681_SEND_DATA".Long_chaine;
filename := "DB571_PARAM_SEQ_COM_FTP".filename,
Num_DB := "DB571_PARAM_SEQ_COM_FTP".num_db,
Index_debut := "DB571_PARAM_SEQ_COM_FTP".index_debut,
"Int/reel" := "DB571_PARAM_SEQ_COM_FTP"."int/reel",
Nbre_decimale := "DB571_PARAM_SEQ_COM_FTP".nbre_decimale,
Nombre_points := "DB571_PARAM_SEQ_COM_FTP".nbre_points,
Tps_echantillon := "DB571_PARAM_SEQ_COM_FTP".echantillonage,
Heure_debut := "DB571_PARAM_SEQ_COM_FTP".DTL_debut,
clientParam := "DB571_PARAM_SEQ_COM_FTP".Client,
serverParam := "DB571_PARAM_SEQ_COM_FTP".Server,
mode := true,
id := 1,
appeStore := true,
done => "DB570_SEQ_COM_FTP".SEQ.CMD01_01,
busy => "DB570_SEQ_COM_FTP".SEQ.CMD01_02,
error => "DB570_SEQ_COM_FTP".SEQ.CMD01_03,
status => "DB570_SEQ_COM_FTP".SEQ.INT05,
ftpHeader := "DB571_PARAM_SEQ_COM_FTP".FTP_TEL.ftpHeader);
Tutoriel - Lina Procédé - 05/2024