Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Read Networdstream
Message
De
07/01/2012 22:47:56
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Read Networdstream
Versions des environnements
Environment:
VB.NET 1.1
OS:
Windows 7
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01532404
Message ID:
01532404
Vues:
75
Hi,
I get a continues string of HEX data from a port as per sample below
0x55 0x02 0x00 0x0A 0x00 0x01 0x00 0xE1 0xFF 0x00 0x00 0x61 0x61 0x61 0x61 0x61 0x61 0x61 0x61 0x61 0x61 0x61 0x61 0x79 0x06 0xAA 0x61 0x0D 0x0A 0x55 0x02 0x00 0x0A 0x00 0x01 0x00 0xD1 0xFF 0xBE 0x07 0x00 0x00 0xA1 0x5D 0x2C 0x00 0x00 0x00 0xF9 0xFF 0xFF 0xFF 0xC2 0x07 0xAA 0x00 0x0D 0x0A 0x55 0x02 0x00 0x02 0x00 0x01 0x00 0xD1 0x02 0x0B 0x1B 0x00 0x00 0xB8 0x5D 0xFF 0xFF 0xFF 0xFF 0xF9 0xFF 0xFF 0xFF 0x05 0x0A 0xAA 0x00 0x0D 0x0A 0x55 0x02 0x00 0x0B 0x00 0x01 0x00 0xE1 0xFF 0x00 0x00 0x61 0x61 0x61 0x61 0x61 0x61 0x61 0x61 0x61 0x61 0x61 0x61 0x7A 0x06 0xAA 0x61 0x0D 0x0A 0x55 0x02 0x00 0x02 0x00 0x01 0x00 0xD1 0x02 0x0B 0x1B 0x00 0x00 0xB8 0x5D 0xFF 0xFF 0xFF 0xFF 0xF9 0xFF 0xFF 0xFF 0x05 0x0A 0xAA 0x00 0x0D 0x0A 0x55 0x02 0x00 0x0B 0x00 0x01 0x00 0xE1 0xFF 0x00 0x00 0x61 0x61 0x61 0x61 0x61 0x61 0x61 0x61 0x61 0x61 0x61 0x61 0x7A 0x06 0xAA 0x61 0x0D 0x0A :
Each occurance of 0x55 indicates start of string and each 0xAA indicates end of string.
You will notice that there are several occurances of such (dat between obviously differs a bit) strings plus some other garbage as well.
I need to identify each such string within the stream and write it to a database.
I can do the initial comms, the read and the write to database part.
Would appreciate help to identify first string, do the write to DB, then continue and get next valid string.
a Valid first occurance would typically be:
If (inStream(0) = &H55) And (inStream(25) = &HAA)
thanks
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform