Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi all,

I have a module which serve with test program to run it. The events views the ENQ send and ACK2 return. But using the supplied program, when I click any command, it will process very fast. When I code with same flow (send ENQ, wait ACK, send CMD, wait ACK2) but the time it get to finish any command take a time. Let say when running using supplied program, I click read status, it will give the result for just like 1second. If I run my development program in VB, it took almost 7seconds to give the result..

Why? I ask my colleague, he said maybe it affect the baudrate. The documentation state 9600, same with program but different timing when I run.

Need advice from this as this affect the customer patient for long time to give status to front app

** I'm running a cash dispenser module which interact directly through comport..
Posted
Comments
[no name] 11-May-13 14:50pm    
"Why?", how could we possibly know when you do not show us your code?

Does it take 7 seconds in a release build also? Profile your code and see what is taking so long.
Luiey Ichigo 13-May-13 8:49am    
Sample of my code are here http://www.codeproject.com/Questions/586785/Hardwareplusprogrammingplus-comport

everytime I send a command until it return ack2 data, it take times..the manufacturer prgram does not provide with source code because my current project is d-level programming.i need to refer to all of their documentation. That's why, the code is build with logic from document..
Ezra Neil 13-May-13 21:51pm    
You should post the current code for us to see. What you could try is using the comport event instead. Instead of keep pooling the comport for data, why don't just subscribe to the comport data received event? Try and see if it changes anything.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900