![]() ![]() Would not be unusual that a full reset takes much longer than the few instructions you have allowed for. So it seems likely that your device is simply not responding fast enough. The problem is that Read does not wait for the required number of bytes to be available - if there is nothing to be read then Read will return with a count of zero. ![]() But that won't necessarily be the full data stream you are expecting. Your use of Read with a buffer of Byte is correct for receiving that sort of data, and you are reading whatever bytes are available. But when I monitor the read, I don't receive any data. I send the F1 A5 command which by using a Serial Port Monitor, I can verify the command goes through in binary as F1 A5 like required. SerialPort1.Write(Reset, 0, Reset.Length)ĭim numBytes As Integer = SerialPort1.BytesToRead Please select a valid COM Port from the drop down to Continue.") Private Sub connectEcmButton_Click(sender As Object, e As EventArgs) Handles connectEcmButton.Click Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.LoadĬomPorts = IO.() I've been reading every forum and post I could get my hands on for the past 4 hours with no success.ĭelegate Sub SetTextCallBack(ByVal As String) If this is something that has been covered before, I apologize. But im just looking to find a clear understanding of the correct way to call for the data I need so I can test to make sure the response is correct before I move on to sending more I know it has to do with my implementation on the SerialPort.Read command. Monitor, I can verify the command goes through in binary as F1 A5 like required. I send the F1 A5 command which by using a Serial Port Then when they click the connect button, it tests to make sure a COM Port was selected and then opens the COM Port. So this is the code I currently have, I list the COM Ports available in a drop down. ![]() So my first goal is to read and test the response to check if it is correct. I'm expecting a response of 91 27 92 04 xx (xx being the firmware version its not important) I'm having trouble with getting the response. I have a USB device that communicates over serial. I've done a lot of reading and have hit a small wall of slight confusion. Really new to this, as this is my first actual program I've worked on. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |