Click here to Skip to main content
15,927,055 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: how to print billings using visual basic Pin
Christian Graus20-Nov-06 21:53
protectorChristian Graus20-Nov-06 21:53 
AnswerRe: how to print billings using visual basic Pin
nsurendran21-Nov-06 21:59
nsurendran21-Nov-06 21:59 
GeneralRe: how to print billings using visual basic Pin
shazzney22-Nov-06 20:53
shazzney22-Nov-06 20:53 
Questionparallel input with less windows dependency Pin
vidante20-Nov-06 17:55
vidante20-Nov-06 17:55 
AnswerRe: parallel input with less windows dependency Pin
Christian Graus20-Nov-06 19:42
protectorChristian Graus20-Nov-06 19:42 
GeneralRe: parallel input with less windows dependency Pin
vidante21-Nov-06 19:15
vidante21-Nov-06 19:15 
GeneralRe: parallel input with less windows dependency Pin
Christian Graus21-Nov-06 19:27
protectorChristian Graus21-Nov-06 19:27 
AnswerRe: parallel input with less windows dependency Pin
Dave Kreskowiak21-Nov-06 6:47
mveDave Kreskowiak21-Nov-06 6:47 
Well, part of your problem is that your polling the port. You're using a Timer that fires every 10 milliseconds and the PortIn function looks at the status of the port at that moment in time. If the switch is not making contact at that instant, it'll come back as not contacted. The port will not "buffer" the fact that, between polls, the contact was made and broken. In order to make sure the correct value is read, in your case, the switch must be held and making contact for at least 10ms (actually, even longer than that!), so that there is a wait for the next polling period.

The reason I say longer than 10ms is because your using a Form-based Timer, which is event driven. It fires an event approximately every 10ms, but that event can stay queued up in your applications message pump for much longer than 10ms, waiting for your code to get around to processing that event.

You'd be better off using one of the a thread-based timer and/or an A/D board for monitoring the switch. An A/D board would be a much better bet if your counting the number of times the switch is made and released on a per second basis, like counting RPM's of an axle...





Dave Kreskowiak
Microsoft MVP - Visual Basic


GeneralRe: parallel input with less windows dependency Pin
vidante21-Nov-06 19:06
vidante21-Nov-06 19:06 
GeneralRe: parallel input with less windows dependency Pin
Dave Kreskowiak22-Nov-06 10:55
mveDave Kreskowiak22-Nov-06 10:55 
Questionformating date and time in a datagrid Pin
steve_rm20-Nov-06 17:41
steve_rm20-Nov-06 17:41 
QuestionRe: formating date and time in a datagrid [modified] Pin
Are Jay20-Nov-06 19:15
Are Jay20-Nov-06 19:15 
GeneralRe: formating date and time in a datagrid Pin
steve_rm20-Nov-06 19:19
steve_rm20-Nov-06 19:19 
GeneralRe: formating date and time in a datagrid Pin
Are Jay20-Nov-06 20:04
Are Jay20-Nov-06 20:04 
GeneralRe: formating date and time in a datagrid Pin
steve_rm20-Nov-06 20:09
steve_rm20-Nov-06 20:09 
Questionbutton related actions Pin
tirumal123120-Nov-06 17:00
tirumal123120-Nov-06 17:00 
AnswerRe: button related actions Pin
Christian Graus20-Nov-06 17:33
protectorChristian Graus20-Nov-06 17:33 
GeneralRe: button related actions Pin
tirumal123120-Nov-06 19:29
tirumal123120-Nov-06 19:29 
GeneralRe: button related actions Pin
Christian Graus20-Nov-06 19:41
protectorChristian Graus20-Nov-06 19:41 
GeneralRe: button related actions Pin
tirumal123120-Nov-06 21:12
tirumal123120-Nov-06 21:12 
QuestionSession call from a .vb class Pin
ONeil Tomlinson20-Nov-06 11:55
ONeil Tomlinson20-Nov-06 11:55 
AnswerRe: Session call from a .vb class Pin
Christian Graus20-Nov-06 13:59
protectorChristian Graus20-Nov-06 13:59 
QuestionAuto Complete Online Form Pin
shepa00620-Nov-06 11:30
shepa00620-Nov-06 11:30 
QuestionRe: Auto Complete Online Form Pin
Are Jay20-Nov-06 19:22
Are Jay20-Nov-06 19:22 
QuestionHow to get the Index of control which is on Panel control ? Pin
kindman_nb20-Nov-06 10:30
kindman_nb20-Nov-06 10:30 

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.