Click here to Skip to main content
15,887,175 members
Home / Discussions / C#
   

C#

 
AnswerRe: Application requires Microsoft.Vbe.Interop Ver .... installed in GAC Pin
jschell16-Jan-14 8:33
jschell16-Jan-14 8:33 
GeneralRe: Application requires Microsoft.Vbe.Interop Ver .... installed in GAC Pin
emma.sun.sts16-Jan-14 23:03
emma.sun.sts16-Jan-14 23:03 
GeneralRe: Application requires Microsoft.Vbe.Interop Ver .... installed in GAC Pin
jschell17-Jan-14 12:59
jschell17-Jan-14 12:59 
Questionhow to Create video Conference Application Pin
Member 1052727315-Jan-14 21:41
professionalMember 1052727315-Jan-14 21:41 
AnswerRe: video recording Pin
Richard MacCutchan15-Jan-14 21:48
mveRichard MacCutchan15-Jan-14 21:48 
Questionrepeater in c# Pin
ptvce15-Jan-14 20:40
ptvce15-Jan-14 20:40 
AnswerRe: repeater in c# Pin
Simon_Whale15-Jan-14 22:12
Simon_Whale15-Jan-14 22:12 
QuestionPerform exact function in timer tick after a specific time Pin
CodingHell15-Jan-14 20:33
CodingHell15-Jan-14 20:33 
I'm working on a project in which I'm working with my serial ports. When I open my serial port after that I'll have to send 4 requests. SO for sending request my code is:

private string ByteArrayToHexString(byte[] data)
       {
           StringBuilder sb = new StringBuilder(data.Length * 3);
           foreach (byte b in data)
               sb.Append(Convert.ToString(b, 16).PadLeft(2, '0').PadRight(3, ' '));
           return sb.ToString().ToUpper();
       }

       private void senddata1(String str)
       {

               // Convert the user's string of hex digits (ex: B4 CA E2) to a byte array
               byte[] data = HexStringToByteArray(str);

               // Send the binary data out the port
               comport.Write(data, 0, data.Length);



       }


This function will create a method to send data. On timer tick event I'm sending this Data:

 private void timer1_Tick(object sender, EventArgs e)
        {
//here I'm sending my data in a timer
 senddata1(s1);
 senddata1(s2);
 senddata1(s3);
 senddata1(s4);

}

Note:after every senddata1() function system will get a response.

So the problem is When I'm sending data I'm not getting the response because system is unable to read all senddata. I want to manage my program in a way so that I can send data after every 250 mili second. Like this:
SendData1(s1);
get response from the system
senddata1(s2);
get response from the system

get response is being handled in like this:
comport.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived);

So is there a way I can manage my program. Please share your opinions.

modified 16-Jan-14 4:46am.

AnswerRe: Perform exact function in timer tick after a specific time Pin
Bernhard Hiller15-Jan-14 21:07
Bernhard Hiller15-Jan-14 21:07 
AnswerRe: Perform exact function in timer tick after a specific time Pin
BillWoodruff15-Jan-14 22:12
professionalBillWoodruff15-Jan-14 22:12 
Question@Utility.ConvertToDateTime Pin
JunjieC15-Jan-14 18:00
JunjieC15-Jan-14 18:00 
AnswerRe: @Utility.ConvertToDateTime Pin
Mycroft Holmes15-Jan-14 18:32
professionalMycroft Holmes15-Jan-14 18:32 
AnswerRe: @Utility.ConvertToDateTime Pin
Jameel VM15-Jan-14 18:43
Jameel VM15-Jan-14 18:43 
Questionsproxy.exe Web Service Proxy Generator download from where? Pin
Swab.Jat15-Jan-14 14:20
Swab.Jat15-Jan-14 14:20 
AnswerRe: sproxy.exe Web Service Proxy Generator download from where? Pin
Garth J Lancaster15-Jan-14 14:55
professionalGarth J Lancaster15-Jan-14 14:55 
AnswerRe: sproxy.exe Web Service Proxy Generator download from where? Pin
Dave Kreskowiak15-Jan-14 16:38
mveDave Kreskowiak15-Jan-14 16:38 
QuestionHOLA Pin
Giuliano Gonzales15-Jan-14 11:50
professionalGiuliano Gonzales15-Jan-14 11:50 
AnswerRe: HOLA Pin
Ron Beyer15-Jan-14 12:16
professionalRon Beyer15-Jan-14 12:16 
GeneralRe: HOLA Pin
Mycroft Holmes15-Jan-14 13:09
professionalMycroft Holmes15-Jan-14 13:09 
AnswerRe: HOLA Pin
Bernhard Hiller15-Jan-14 21:05
Bernhard Hiller15-Jan-14 21:05 
AnswerRe: HOLA Pin
Rahul VB31-Jan-14 23:16
professionalRahul VB31-Jan-14 23:16 
GeneralInterfacing Machines with LIS from Scratch Pin
max carter15-Jan-14 2:30
max carter15-Jan-14 2:30 
GeneralRe: Interfacing Machines with LIS from Scratch Pin
Pete O'Hanlon15-Jan-14 3:22
mvePete O'Hanlon15-Jan-14 3:22 
GeneralRe: Interfacing Machines with LIS from Scratch Pin
max carter15-Jan-14 3:25
max carter15-Jan-14 3:25 
GeneralRe: Interfacing Machines with LIS from Scratch Pin
Dave Kreskowiak15-Jan-14 3:33
mveDave Kreskowiak15-Jan-14 3:33 

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.