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 t

Re: [fpc-pascal] Parallel Port Access with Free Pascal - windows

2016-07-26 Thread ezrashumla
i think it is the ight place i also like to rcv the software for directly controling i/o ports for fpc on wimdows Thank you Ezra -Original Message- From: Bo Berglund To: fpc-pascal Sent: Wed, Jul 27, 2016 1:56 am Subject: Re: [fpc-pascal] Parallel Port Access with Free Pascal

Re: [fpc-pascal] Parallel Port Access with Free Pascal - windows

2016-07-26 Thread Bo Berglund
On Tue, 26 Jul 2016 16:23:12 -0400, ezrashu...@aim.com wrote: >yes thank you You responded to the wrong post... -- Bo Berglund Developer in Sweden ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailm

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 d

Re: [fpc-pascal] Parallel Port Access with Free Pascal - windows

2016-07-26 Thread ezrashumla
yes thank you -Original Message- From: Bo Berglund To: fpc-pascal Sent: Tue, Jul 26, 2016 10:49 pm Subject: Re: [fpc-pascal] Parallel Port Access with Free Pascal - windows On Tue, 26 Jul 2016 11:45:51 +0200, Koenraad Lelong wrote: >FWIW, I ported the library to fpc, together

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] Parallel Port Access with Free Pascal - windows

2016-07-26 Thread Bo Berglund
On Tue, 26 Jul 2016 11:45:51 +0200, Koenraad Lelong wrote: >FWIW, I ported the library to fpc, together with the test/demo software >(x_pigpiod_if2). >The fact that the communication goes via the network opens possibilities >though. I tested my port on my laptop, connected to the pi. So >appli

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 > mailto: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 > str

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 t

Re: [fpc-pascal] Microsecond Delay Suggestions?

2016-07-26 Thread James Richters
I think there may be a solution with this performance counter for my purposes… here’s what I’m trying to accomplish: I’m trying to read a string from a serial port until I get a linefeed, but I don’t want it to get stuck in an endless loop which could happen if: A: nothing is ever received

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 ra

Re: [fpc-pascal] Microsecond Delay Suggestions?

2016-07-26 Thread James Richters
That looks great. I’ll give it a try! Thank you very much for the suggestion and the example From: fpc-pascal-boun...@lists.freepascal.org [mailto:fpc-pascal-boun...@lists.freepascal.org] On Behalf Of Dmitry Boyarintsev Sent: Tuesday, July 26, 2016 11:45 AM To: FPC-Pascal users discussions

Re: [fpc-pascal] Microsecond Delay Suggestions?

2016-07-26 Thread James Richters
I don’t need a 55mS tick, there was a DOS timer that ticked every 55mS, which I used to calibrate a delayloop.. however I can’t use any of that on windows, I can’t even make the DOS function call, and even if I had a way to calibrate my delay loop, it would be meaningless because I have to share

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 els

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 I'

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 _

Re: [fpc-pascal] Weird string behavior

2016-07-26 Thread Michael Van Canneyt
On Tue, 26 Jul 2016, Santiago A. wrote: El 26/07/2016 a las 16:19, Michael Van Canneyt escribió: On Tue, 26 Jul 2016, Santiago A. wrote: El 26/07/2016 a las 12:27, Mattias Gaertner escribió: a3:=a1+a2 => cp = 1252 a3:=a2+a1 => cp = 65001 Is that the expected behavior? IMHO the result s

Re: [fpc-pascal] Weird string behavior

2016-07-26 Thread Santiago A.
El 26/07/2016 a las 16:19, Michael Van Canneyt escribió: > > > On Tue, 26 Jul 2016, Santiago A. wrote: > >> El 26/07/2016 a las 12:27, Mattias Gaertner escribió: >>> a3:=a1+a2 => cp = 1252 >>> a3:=a2+a1 => cp = 65001 >> Is that the expected behavior? >> >> IMHO the result should be the same. And th

Re: [fpc-pascal] Weird string behavior

2016-07-26 Thread Jonas Maebe
Santiago A. wrote on Tue, 26 Jul 2016: El 26/07/2016 a las 12:27, Mattias Gaertner escribió: a3:=a1+a2 => cp = 1252 a3:=a2+a1 => cp = 65001 Is that the expected behavior? IMHO the result should be the same. And the only way is to make it depend on a3, no matter what is in the left side. That

Re: [fpc-pascal] Weird string behavior

2016-07-26 Thread Michael Van Canneyt
On Tue, 26 Jul 2016, Santiago A. wrote: El 26/07/2016 a las 12:27, Mattias Gaertner escribió: a3:=a1+a2 => cp = 1252 a3:=a2+a1 => cp = 65001 Is that the expected behavior? IMHO the result should be the same. And the only way is to make it depend on a3, no matter what is in the left side. Th

Re: [fpc-pascal] Weird string behavior

2016-07-26 Thread Santiago A.
El 26/07/2016 a las 12:27, Mattias Gaertner escribió: > a3:=a1+a2 => cp = 1252 > a3:=a2+a1 => cp = 65001 Is that the expected behavior? IMHO the result should be the same. And the only way is to make it depend on a3, no matter what is in the left side. That's the way things are done in Pascal --

[fpc-pascal] EBusError

2016-07-26 Thread Rainer Stratmann
An unhandled exception occured at $08113310 : EBusError : Bus error or misaligned data access $08113310 $08052EF3 $08078A3E $080540B0 $08054D96 $080551D1 $08055915 Is it likely that there is a problem with my Freepascal program or is it also possible that Linux or the Mainboard causes the

Re: [fpc-pascal] Weird string behavior

2016-07-26 Thread Mattias Gaertner
On Tue, 26 Jul 2016 12:03:21 +0200 Jonas Maebe wrote: > Mattias Gaertner wrote on Tue, 26 Jul 2016: > > > It seems the Delphi rules for non rawbytestrings are: > > - Concatenate two same declared strings: append bytes, copy dyn. cp > > from left operand. Declared cp of result is left operand.

Re: [fpc-pascal] Parallel Port Access with Free Pascal - windows

2016-07-26 Thread Koenraad Lelong
Op 24-07-16 om 16:29 schreef James Richters: Bo, I also have a raspberry pi project.. I got a hifi-berry card for it and it is streaming audio to a central audio system, I'm using VLC media player and an app on my cell phone to control it, I have not made use of the GPIO on them yet, but I woul

Re: [fpc-pascal] Weird string behavior

2016-07-26 Thread Jonas Maebe
Mattias Gaertner wrote on Tue, 26 Jul 2016: It seems the Delphi rules for non rawbytestrings are: - Concatenate two same declared strings: append bytes, copy dyn. cp from left operand. Declared cp of result is left operand. Are you sure it's "append bytes" here and not "append bytes if same

Re: [fpc-pascal] Weird string behavior

2016-07-26 Thread Mattias Gaertner
On Tue, 26 Jul 2016 11:01:28 +0200 Jonas Maebe wrote: >[...] > Could you try the same program with u1 as plain ansistring instead of > utf8string? (with an additional > "setcodepage(rawbytestring(u1),65001,false);" after assigning u1) Sure: {$APPTYPE CONSOLE} type tcp866 = type ansistri

Re: [fpc-pascal] Weird string behavior

2016-07-26 Thread Jonas Maebe
Mattias Gaertner wrote on Tue, 26 Jul 2016: On Mon, 25 Jul 2016 23:23:23 +0200 Jonas Maebe wrote: Thanks. So the rule for concatenation appears to be: * the dynamic code page of the result of a string concatenation is that of the left operand (except if it's an empty string, then it's that o

Re: [fpc-pascal] Textmode IDE splitscreen?

2016-07-26 Thread Tomas Hajny
On Mon, July 25, 2016 21:29, Nikolay Nikolov wrote: . . > have, that has two ISA slots, is a K6-2 and I doubt if > it's possible to configure it to run with two 8-bit ISA > video cards, provided that this is a PCI/AGP era > machine. I haven't tried it yet, but I suspect the BIOS > would scream bl