Re: [fpc-pascal] Microsecond Delay Suggestions?

2016-07-27 Thread James Richters
>Look at synaser, its TBlockSerial class has a RecvTerminated method that does just that. >http://synapse.ararat.cz/doc/help/synaser.TBlockSerial.html#RecvTerminated >https://sourceforge.net/p/synalist/code/HEAD/tree/trunk/ >Bye >-- >Luca Thank you for the suggestion and the links, that does look

Re: [fpc-pascal] Microsecond Delay Suggestions?

2016-07-26 Thread Luca Olivetti
On 26/07/16 13:58, James Richters wrote: but I don’t want it to get stuck in an endless loop which could happen if: A: nothing is ever received B: garbage is being received due to bad connection or baudrate mismatch.. etc.. Look at synaser, its TBlockSerial class has a RecvTerminated method

Re: [fpc-pascal] Microsecond Delay Suggestions?

2016-07-26 Thread James Richters
Thank You I found the sleep procedure Thank you for explaining that it was looking for a pointer, that was helpful. A little cutting and pasting and now I have 3 more ways to sleep... Sleep_S will probably be sufficient and is the most flexible, because if you have 1,000,000,000 seconds you

Re: [fpc-pascal] Microsecond Delay Suggestions?

2016-07-26 Thread Sven Barth
On 26.07.2016 21:52, James Richters wrote: >> An alternative would be NtDelayExecution from unit jwanative. Its interval > argument is in multiples of 100ns >> and is essentially what Windows' Sleep() uses internally. >> Note: The first argument "Alertable" determines whether the function can be >

Re: [fpc-pascal] Microsecond Delay Suggestions?

2016-07-26 Thread James Richters
>An alternative would be NtDelayExecution from unit jwanative. Its interval argument is in multiples of 100ns >and is essentially what Windows' Sleep() uses internally. >Note: The first argument "Alertable" determines whether the function can be interrupted by NtAlertThread >(and whatever Windows

Re: [fpc-pascal] Microsecond Delay Suggestions?

2016-07-26 Thread Sven Barth
On 26.07.2016 19:05, Dmitry Boyarintsev wrote: > On Tue, Jul 26, 2016 at 12:38 PM, James Richters > > > wrote: > > What I need is a timer that I can specify in microseconds, a > millisecond is too long. I am using it

Re: [fpc-pascal] Microsecond Delay Suggestions?

2016-07-26 Thread Dmitry Boyarintsev
On Tue, Jul 26, 2016 at 1:58 PM, James Richters < ja...@productionautomation.net> wrote: > I think there may be a solution with this performance counter for my > purposes… here’s what I’m trying to accomplish: > Well, Windows provides a different means of waiting (and waiting with time out) for

Re: [fpc-pascal] Microsecond Delay Suggestions?

2016-07-26 Thread James Richters
...@lists.freepascal.org [mailto:fpc-pascal-boun...@lists.freepascal.org] On Behalf Of Dmitry Boyarintsev Sent: Tuesday, July 26, 2016 1:05 PM To: FPC-Pascal users discussions <fpc-pascal@lists.freepascal.org> Subject: Re: [fpc-pascal] Microsecond Delay Suggestions? On Tue, Jul 26, 2016 at

Re: [fpc-pascal] Microsecond Delay Suggestions?

2016-07-26 Thread Dmitry Boyarintsev
On Tue, Jul 26, 2016 at 12:38 PM, James Richters < ja...@productionautomation.net> wrote: > What I need is a timer that I can specify in microseconds, a millisecond > is too long. I am using it for timing to read in a string on a serial > connection. My fastest baudrate is 25, so at that

Re: [fpc-pascal] Microsecond Delay Suggestions?

2016-07-26 Thread James Richters
discussions <fpc-pascal@lists.freepascal.org> Subject: Re: [fpc-pascal] Microsecond Delay Suggestions? On Tue, Jul 26, 2016 at 11:21 AM, Dmitry Boyarintsev <skalogryz.li...@gmail.com <mailto:skalogryz.li...@gmail.com> > wrote: Maybe you want to look into QueryPerform

Re: [fpc-pascal] Microsecond Delay Suggestions?

2016-07-26 Thread James Richters
[mailto:fpc-pascal-boun...@lists.freepascal.org] On Behalf Of Dmitry Boyarintsev Sent: Tuesday, July 26, 2016 11:19 AM To: FPC-Pascal users discussions <fpc-pascal@lists.freepascal.org> Subject: Re: [fpc-pascal] Microsecond Delay Suggestions? On Tue, Jul 26, 2016 at 11:16 AM, James Richter

Re: [fpc-pascal] Microsecond Delay Suggestions?

2016-07-26 Thread Dmitry Boyarintsev
On Tue, Jul 26, 2016 at 11:21 AM, Dmitry Boyarintsev < skalogryz.li...@gmail.com> wrote: > Maybe you want to look into QueryPerformanceCounter. > > https://msdn.microsoft.com/en-us/library/windows/desktop/ms644904(v=vs.85).aspx > > Here's an example: {$mode objfpc}{$H+} uses Windows; const

[fpc-pascal] Microsecond Delay Suggestions?

2016-07-26 Thread James Richters
Any Suggestions for a microsecond delay? I had a scheme in my old dos program where I would run a massive loop at the beginning of my program and time it with DOS 55mS ticks, then do the math and figure out how many times I needed to loop for a given delay.. worked great on DOS with nothing

Re: [fpc-pascal] Microsecond Delay Suggestions?

2016-07-26 Thread Dmitry Boyarintsev
On Tue, Jul 26, 2016 at 11:19 AM, Dmitry Boyarintsev < skalogryz.li...@gmail.com> wrote: > On Tue, Jul 26, 2016 at 11:16 AM, James Richters < > ja...@productionautomation.net> wrote: > >> Any suggestions on how to do this on windows with a console application? >> > > I don't have an answer, but

Re: [fpc-pascal] Microsecond Delay Suggestions?

2016-07-26 Thread Dmitry Boyarintsev
On Tue, Jul 26, 2016 at 11:16 AM, James Richters < ja...@productionautomation.net> wrote: > Any suggestions on how to do this on windows with a console application? > I don't have an answer, but I'm wondering what kind of task is that? Why do you need this 55mS tick? thanks, Dmitry