vachhaninimit
Member
- Joined
- Aug 4, 2010
- Messages
- 5
- Programming Experience
- Beginner
Hello Coders,
I am New to vb.net programming. I am writing a code for rs485 communication. I want my program to send data request command to 5 slave units connected to my computer.
I have added timer control timer1. This control fires every 5 seconds and pools all 5 slave units.
My problem comes here -
1).Apps sends the data request command to first slave.
2).Writing data on commport .
3). After that i use system.threading.thread.sleep(100).
4).Read the no. of bytes available.
5).read the data bytes into a byte() and process the response that i get.
At Step 3 when i use sleep the system freezes and i know its little bad programming from my side. How can i use second timer control to read data after every 100 msecs and then proceede to step 4.
Any help will be appreciated.
Thanks in advance.
I am New to vb.net programming. I am writing a code for rs485 communication. I want my program to send data request command to 5 slave units connected to my computer.
I have added timer control timer1. This control fires every 5 seconds and pools all 5 slave units.
My problem comes here -
1).Apps sends the data request command to first slave.
2).Writing data on commport .
3). After that i use system.threading.thread.sleep(100).
4).Read the no. of bytes available.
5).read the data bytes into a byte() and process the response that i get.
At Step 3 when i use sleep the system freezes and i know its little bad programming from my side. How can i use second timer control to read data after every 100 msecs and then proceede to step 4.
Any help will be appreciated.
Thanks in advance.