Click here to Skip to main content
15,886,258 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Algorithms work Pin
Eddy Vluggen27-May-20 10:17
professionalEddy Vluggen27-May-20 10:17 
GeneralRe: Algorithms work Pin
Eddy Vluggen27-May-20 10:14
professionalEddy Vluggen27-May-20 10:14 
AnswerRe: Algorithms work Pin
Patrice T28-May-20 22:20
mvePatrice T28-May-20 22:20 
Questionalgorithm Pin
Member 1483481216-May-20 23:57
Member 1483481216-May-20 23:57 
AnswerRe: algorithm Pin
Victor Nijegorodov17-May-20 0:02
Victor Nijegorodov17-May-20 0:02 
AnswerRe: algorithm Pin
Richard MacCutchan17-May-20 1:23
mveRichard MacCutchan17-May-20 1:23 
AnswerRe: algorithm Pin
Patrice T20-May-20 15:08
mvePatrice T20-May-20 15:08 
QuestionSerial port takes a long time to respond Pin
Member 1480999628-Apr-20 3:17
Member 1480999628-Apr-20 3:17 
Hi,

Im currently making an app on windows forms trying to program a micro over UART. I can achieve it, although it is taking a long time to carry out the program. I have used stopwatches to determine it is my read function taking up the majority of the time. When i try to read the micros response from each command I have to wait for all of it, which is why im using a while loop in the code below, if the returned message size is not what i expect. What im wondering is, if there is any way to speed up this process. The response from the micro should be pretty fast, its running at a baudrate of 115200, meaning the whole 512 kb file should in theory take just over 30 seconds to complete, at the moment it is more than double that, at 80 seconds.

private string CheckResponse(int mSize)
{
    //ComPort.DataReceived += SerialPortDataReceived;

    string response;
    int intBuffer;
    intBuffer = ComPort.BytesToRead;
    byte[] byteBuffer = new byte[intBuffer];
    ComPort.Read(byteBuffer, 0, intBuffer);

    response = Encoding.ASCII.GetString(byteBuffer);

    while(response.Length != mSize)
    {
        intBuffer = ComPort.BytesToRead;
        byteBuffer = new byte[intBuffer];
        ComPort.Read(byteBuffer, 0, intBuffer);
        response += Encoding.ASCII.GetString(byteBuffer);
    }

    return response;
}


Any help greatly appreciated.

Blair
SuggestionRe: Serial port takes a long time to respond Pin
Greg Utas28-Apr-20 4:52
professionalGreg Utas28-Apr-20 4:52 
AnswerRe: Serial port takes a long time to respond Pin
Gerry Schmitz28-Apr-20 7:06
mveGerry Schmitz28-Apr-20 7:06 
QuestionAlgorithm Pin
Babayomi26-Apr-20 4:48
Babayomi26-Apr-20 4:48 
AnswerRe: Algorithm Pin
Greg Utas26-Apr-20 5:03
professionalGreg Utas26-Apr-20 5:03 
GeneralRe: Algorithm Pin
Babayomi26-Apr-20 12:09
Babayomi26-Apr-20 12:09 
QuestionAlgorithm to divide an array efficiently... to sub groups where each group is smaller than X Pin
fcbman24-Apr-20 4:02
fcbman24-Apr-20 4:02 
AnswerRe: Algorithm to divide an array efficiently... to sub groups where each group is smaller than X Pin
Gerry Schmitz25-Apr-20 11:59
mveGerry Schmitz25-Apr-20 11:59 
QuestionHow to get faster serial port data transfer on windows forms Pin
Member 1480999622-Apr-20 3:15
Member 1480999622-Apr-20 3:15 
AnswerRe: How to get faster serial port data transfer on windows forms Pin
k505422-Apr-20 4:26
mvek505422-Apr-20 4:26 
GeneralRe: How to get faster serial port data transfer on windows forms Pin
Member 1480999623-Apr-20 0:58
Member 1480999623-Apr-20 0:58 
AnswerRe: How to get faster serial port data transfer on windows forms Pin
Gerry Schmitz22-Apr-20 9:05
mveGerry Schmitz22-Apr-20 9:05 
GeneralRe: How to get faster serial port data transfer on windows forms Pin
Member 1480999622-Apr-20 22:32
Member 1480999622-Apr-20 22:32 
QuestionHow to generate a network where nodes have certain number of neighbors on average Pin
Meanwhale7-Apr-20 20:15
Meanwhale7-Apr-20 20:15 
AnswerRe: How to generate a grid where nodes have certain number of neighbors on average Pin
Gerry Schmitz9-Apr-20 11:01
mveGerry Schmitz9-Apr-20 11:01 
GeneralRe: How to generate a grid where nodes have certain number of neighbors on average Pin
Meanwhale9-Apr-20 19:46
Meanwhale9-Apr-20 19:46 
GeneralRe: How to generate a grid where nodes have certain number of neighbors on average Pin
Meanwhale9-Apr-20 19:53
Meanwhale9-Apr-20 19:53 
Question>net Pin
Member 147935355-Apr-20 19:51
Member 147935355-Apr-20 19:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.