IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

VB.NET Discussion :

CAN Bootloader Interface


Sujet :

VB.NET

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Nouveau candidat au Club
    Homme Profil pro
    Ingénieur développement matériel électronique
    Inscrit en
    Novembre 2011
    Messages
    1
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Suisse

    Informations professionnelles :
    Activité : Ingénieur développement matériel électronique
    Secteur : High Tech - Électronique et micro-électronique

    Informations forums :
    Inscription : Novembre 2011
    Messages : 1
    Par défaut CAN Bootloader Interface
    Bonjour

    Je sollicite votre aide pour ce projet qui consiste à télécharger une application dans un microcontroller via CANUSB.

    Le fichier compilé par CODE COMPOSER est fichier binaire que j'ouvre avec VB ensuite l'envoyer par paket de 8 Byte via CANUSB.

    Mon probleme c'est de l'envoyer. Je l'ouvre avec ce petit code:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
     Private Sub BT_Load_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoadFile.Click
     
            Dim ArrayHold() As Byte
            Dim Index As Integer = 0
            Dim Str As New StringBuilder
            Dim tStr As String = ""
            Dim tempStr As String = ""
            Dim IndexEnd As Integer = 0
            Dim InputString As String = ""
            Dim openFileDialog1 As New OpenFileDialog()
     
     
     
            openFileDialog1.Filter = "All Files|*.*"
            If openFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
                ' ArrayHold = My.Computer.FileSystem.ReadAllBytes(OpenDia.FileName)
                '==============================================================
                Dim myStreamReader As StreamReader = Nothing
     
                ' Ensure that the creation of the new StreamReader is wrapped in a 
                '   Try-Catch block, since an invalid filename could have been used.
                ' Create a StreamReader using a Shared (static) File class.
                myStreamReader = File.OpenText(openFileDialog1.FileName)
                ' Read the entire file in one pass, and add the contents to 
                '   txtFileText text box.
                InputString = myStreamReader.ReadToEnd()
                'Convert string to byte and copy to byte array
                ArrayHold = Encoding.Default.GetBytes(InputString)
     
                '=================================================================
                'ArrayHold = FileSystem.ReadAllBytes(OpenDia.FileName)
                Do
                    IndexEnd = Index + 9
                    For x As Integer = Index To IndexEnd
                        If x > UBound(ArrayHold) Then
                            Str.Append("    ")
                            tempStr = tempStr & "  "
                        Else
                            tStr = UCase(Convert.ToString(ArrayHold(x), 16))
                            If tStr.Length < 2 Then tStr = "0" & tStr
                            Str.Append(tStr & "  ")
                            If ArrayHold(x) < 32 Then
                                tempStr = tempStr & ". "
                            Else
                                tempStr = tempStr & Chr(ArrayHold(x)) & " "
                            End If
                        End If
                    Next
                    Str.Append("    |    " & tempStr & vbCrLf)
                    tempStr = ""
                    Index = Index + 10
                Loop While IndexEnd < UBound(ArrayHold)
                DispalyHex.Text = Str.ToString
            End If
     
        End Sub
    Il l'affiche sur TextBox1 mais ce n'est pas le but.

    Comment je peux scanner ce fichier binaire afin de telecharger l'application avec le protocole annexé

    Merci d'avance de votre contribution
    Images attachées Images attachées

Discussions similaires

  1. Interface avec bus CAN
    Par Bayard dans le forum Bibliothèques tierces
    Réponses: 4
    Dernier message: 08/06/2012, 09h37
  2. [VB6] [Interface] ComboBox à plusieurs colonnes
    Par mtl dans le forum VB 6 et antérieur
    Réponses: 7
    Dernier message: 30/03/2004, 17h35
  3. [VB6] [Interface] Horloge 7 segments
    Par selenay dans le forum VB 6 et antérieur
    Réponses: 11
    Dernier message: 07/10/2002, 16h15
  4. interface utilisateur avec OpenGL
    Par demis20 dans le forum OpenGL
    Réponses: 6
    Dernier message: 03/10/2002, 12h27
  5. [VB6] [Interface] Icones de boutons de barre d'outils
    Par elifqaoui dans le forum VB 6 et antérieur
    Réponses: 9
    Dernier message: 13/09/2002, 15h50

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo