Hello,
Le lien vers le code du programme vbscript de génération de trames de tests semble ne pas fonctionner.
Voici le code
Modifier les constantes en début de programme en fonction de vos besoins.

' ' Génération et envoi de trames téléinfo SMBA38 02/2017 ' ' Trois trames différentes sont créées dans trois fichiers trame1.txt, trames2.txt et trame3.txt ' Un fichier trames.bat est créé, ce fichier .bat boucle sur l'envoi successif des trois trames sur PORTCOM ' Avec un délai DELAIMS entre chaque trame (en millisecondes) ' ' NBENVOICOM=n permet d’envoyer n fois les trames sur PORTCOM directement depuis ce programme. ' Si NBENVOICOM=0 pas d’envoi sur PORTCOM ' ' '---- Constantes à modifier en fonction des besoins const PORTCOM="COM9" ' A changer en fonction du port à utiliser const DELAIMS=2000 ' delai entre l'envoi de deux trames (en millisecondes). const NBENVOICOM=0 ' nb fois à envoyer les trames sur le port PORTCOM (si=0 pas d'envoi via PORTCOM) '-----Fin constantes const CONFIGPORT="baud=1200 data=7 parity=e stop=1" ' paramètres du PORTCOM pour téléinfo const ForWriting=2 nbpings=1 ' pour simuler un delai utilisation d'un ping nb fois if DELAIMS >0 then nbpings=int(DELAIMS/1000) ' environ une seconde par ping if nbpings <1 then nbpings=1 ' nbpings=nombre entier end if Set fso = CreateObject("Scripting.FileSystemObject") Set ficho = fso.OpenTextFile("trames.bat", forwriting,true) ' ' Fichier .bat d'envoi de trames contenues dans les fichier trame1.txt, trame2.txt, trame3.txt ' ficho.writeline "mode " & PORTCOM & ": " & CONFIGPORT ficho.writeline ":boucle" ficho.writeline "type trames1.txt >" & PORTCOM ficho.writeline "ping -n " & nbpings & " 127.0.0.1" ' pour simuler une attente entre deux trames ficho.writeline "type trames2.txt >" & PORTCOM ficho.writeline "ping -n " & nbpings & " 127.0.0.1" ' pour simuler une attente entre deux trames ficho.writeline "type trames3.txt >" & PORTCOM ficho.writeline "ping -n " & nbpings & " 127.0.0.1" ' pour simuler une attente entre deux trames ficho.writeline "goto boucle" ' boucle infinie ficho.close buf1="" 'trame1 buf1=buf1 & crc("ADCO 012345678901") 'F buf1=buf1 & crc("OPTARIF HC..") '< buf1=buf1 & crc("ISOUSC 20") '8 buf1=buf1 & crc("HCHC 036424518") '' buf1=buf1 & crc("HCHP 026582379") '= buf1=buf1 & crc("PTEC HP..") ' buf1=buf1 & crc("IINST1 003") 'K buf1=buf1 & crc("IINST2 002") 'I buf1=buf1 & crc("IINST3 001") 'K buf1=buf1 & crc("IMAX1 019") ': buf1=buf1 & crc("IMAX2 020") '3 buf1=buf1 & crc("IMAX3 018") '; buf1=buf1 & crc("PMAX 08380") '9 buf1=buf1 & crc("PAPP 00970") '1 buf1=buf1 & crc("HHPHC E") '0 buf1=buf1 & crc("OTDETAT 000000") '0 buf1=buf1 & crc("PPOT 00") '# Set ficho = fso.OpenTextFile("trames1.txt", forwriting,true) ficho.writeline(chr(02) & buf1 & chr(03))' début trame & contenu trame & fin trame ficho.close buf2="" 'trame 2 avec quelques changements buf2=buf2 & crc("ADCO 012345678902") 'F buf2=buf2 & crc("OPTARIF HC..") '< buf2=buf2 & crc("ISOUSC 20") '8 buf2=buf2 & crc("HCHC 036424518") '' buf2=buf2 & crc("HCHP 026582379") '= buf2=buf2 & crc("PTEC HP..") ' buf2=buf2 & crc("IINST1 004") 'K buf2=buf2 & crc("IINST2 001") 'I buf2=buf2 & crc("IINST3 002") 'K buf2=buf2 & crc("IMAX1 019") ': buf2=buf2 & crc("IMAX2 020") '3 buf2=buf2 & crc("IMAX3 018") '; buf2=buf2 & crc("PMAX 08380") '9 buf2=buf2 & crc("PAPP 00970") '1 buf2=buf2 & crc("HHPHC E") '0 buf2=buf2 & crc("OTDETAT 000000") '0 buf2=buf2 & crc("PPOT 00") '# Set ficho = fso.OpenTextFile("trames2.txt", forwriting,true) ficho.writeline(chr(02) & buf2 & chr(03))' début trame & contenu trame & fin trame ficho.close buf3="" ' trame3 (trame partielle) buf3=buf3 & crc("IINST1 002") 'K buf3=buf3 & crc("IINST2 000") ' I buf3=buf3 & crc("IINST3 001") 'K buf3=buf3 & crc("IMAX1 012") ': buf3=buf3 & crc("IMAX2 014") '3 buf3=buf3 & crc("IMAX3 014") '; Set ficho = fso.OpenTextFile("trames3.txt", forwriting,true) ficho.writeline(chr(02) & buf3 & chr(03))' début trame & contenu trame & fin trame ficho.close ' ' envoi trames sur PORTCOM ' if NBENVOICOM>0 then Set oShell = CreateObject("Wscript.Shell") oShell.Run "mode " & PORTCOM & ": " & CONFIGPORT ,0,1 ' conviguration port via CMD ' car PB pour configure les paramètres du port via OpenTextFile on error resume next Set comObj = fso.OpenTextFile(PORTCOM , forwriting) ' ouverture port COM configuré via CMD If Err.Number <> 0 Then msgbox " Erreur sur ouverture port de communications série " & PORTCOM err.clear wscript.quit End If On error goto 0 Wscript.sleep(2000) ' comObj.writeline(string(100,chr(0))) for i=1 to NBENVOICOM comObj.writeline(chr(02) & buf1 & chr(03)) ' trame1 wscript.sleep(DELAIMS) comObj.writeline(chr(02) & buf2 & chr(03)) ' trame2 wscript.sleep(DELAIMS) comObj.writeline(chr(02) & buf3 & chr(03)) ' trame3 wscript.sleep(DELAIMS) next comOBJ.Close msgbox "fin envoi trames: " & NBENVOICOM & " fois avec un délai de " & DELAIMS & " millisecondes" else msgbox "Fin génération des fichiers trame1.txt, trames.txt, trame3.txt et trames.bat" end if wscript.quit '-------------------------- ' ' calcul CRC ajout entête LF (0x0A) et ajout fin de ligne CR (OX0D) ' function crc( chaine_crc ) icrc=0 for i=1 to len(chaine_crc) icrc=icrc+asc(mid(chaine_crc,i,1)) next icrc=(icrc and 63) + 32 ' sum = sum & 0x3F + 0x20 crc= chr(10) & chaine_crc & " " & chr(icrc) & chr(13) ' le blanc avant le CRC ne fait pas partie du calcul du CRC end function