|
-
Jul 2nd, 2019, 06:09 PM
#1
Thread Starter
Member
[RESOLVED] VB 2010 - It's possible translate HEX text into a binary file?
Hi friends! I hope you're all well.
I discovered a wonderful project that dump the Atari 2600 ROMs from a cartridge, using the Arduino Uno.
Summarizing the process, Arduino extracts several lines of hexadecimal data text, between the "Start" and "End" tags in Serial Monitor. After the extraction, you can copy and paste these lines.
I'm creating a program in VB 2010, which simulates an Arduino serial monitor in a textbox. The Arduino dump process, appears in this textbox.
The author of the project, made available a script in Ruby that does this process. And the script, works as follow: It looks for the START/END tags, verifies that each line contains 16 bytes, each address increments by 16, and writes those bytes into a binary file.
And I want to create an converter process in VB.Net like the Ruby script. The user clicks a button and this process happens.
Is it possible to create this process in VB.NET?
if so, how could I do it?
This is the code of my project, but, without the function of converting the text of the textbox into a binary file, because I do not know how to do it.
Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Windows.Forms.Control.CheckForIllegalCrossThreadCalls = False
Try
For Each port As String In SerialPort.GetPortNames()
comboxCOMport.Items.Add(port)
Next
comboxCOMport.SelectedIndex = 0
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
SerialPort1.BaudRate = "9600"
SerialPort1.PortName = comboxCOMport.SelectedItem
Try
SerialPort1.Open()
MsgBox("Connected! now, go to the Dump button!", MsgBoxStyle.Information)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub SerialPort1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
txtboxserialmonitor.Text = SerialPort1.ReadExisting()
End Sub
Thank you in advance.
Last edited by vbnewbieuser; Jul 3rd, 2019 at 10:25 AM.
Reason: errors
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|