Some fo the examples need a running office instance listening on a port. If this is necessary you will get further. Some of the examples which create a component have no run target. In these cases a document is provided which instantiates and runs the component (see the makefile output). Also the Basic examples provide.

Serial Port Component For Lazarus Department

14 Feb 17, I went back to Synapse, having been away for a while. (I wasn't using a different package, I just hadn't been doing any TCP/IP programming for a while.) I was using a freshly installed Lazarus version 1.6.2 (2016-11-12) on a 64-bit Windows 7 computer. (I have not had good luck with the 64 bit Lazarus in the past, and tend to use the 32-bit compiler. For a start, I want things I write to work on a variety of machines. I don't want to maintain two versions.) It had a tab on the components bar 'SynEdit' which is, I believe, nothing to do with the Synapse TCP/IP package. Ditto a tab 'IPro'.

Both were present in a freshly installed Lazarus. I don't think the computer concerned had ever had Synapse on it. ((Sidebar:)) Oddly enough, although I don't think this machine ever had Synapse on it, something I wrote a while ago (which uses Synapse) compiled quite happily on this 'Synapse-less' machine. I believe this was because of the Synapse.pas files I had in the folder with the sourcecode for my project. There were 8 files in the folder which I believe came from Synapse. Osiris Windows. I say 'came from'.

I think I just used the ordinary Windows file handling utility to copy those files into the folder from. (Another machine I'd installed Synapse on? It turns out I'd downloaded the package three years ago, in 2014. Apparently that time I just copied files from it. Didn't 'install'.) Oh. RTFM'd (after I'd worried about the above for a while, and found.

Installation can be as simple as simply copying over all files to your application directory and adding the relevant Synapse units to your uses clause. A more elegant and recommended way is compiling the laz_synapse.lpk package so you can use the same units in all your projects. Having used the first solution in the past, and found it a pain to figure out WHICH files were needed, I thought that this time I'd try the alternative. (Figuring out which files are needed is a funny thing.

Serial Port Component For Lazarus Department

An error message will say you need file 'x'. So you copy that to the project folder, and try to compile again.

But file 'x' needs files 'y' and 'z'. So you copy them. But the first DOES work. (You just have to deal with a number of 'Could not find such-and-such file' complaints. Once per project.) So I set off to conquer the second approach. I got it working. You now tell it where to look for the 'missing' files (the.pas files supplied by Synapse) in the Project/ Project Options page.

There must be a way to tell your Lazarus that you want that particular folder ((MyDocs) Lazarus ThirdPtry Synapse source lib, if you set things up as I did) in YOUR default project options. I haven't found it yet. But it is worth using the 'set Lazarus to look in the extra place' trick!

The only downside is that an archive of the project won't include ALL of the files used to compile it. If the archive is moved to another machine, besides setting up Lazarus, the Synapse.pas files that project uses will also have to be made available. (I don't think this is a deal breaker.) ((end sidebar)) Much against my general wish for the quiet life, for you, dear reader, I embarked upon a Lazarus update prior to starting the Synapse tutorial I sat down to write. See, if the information is of interest.

Install Synapse Happy discovery! Synapse not only gives you access to TCP/IP, but I think it has some stuff for using the computer's serial port. Not sure if that includes simulated serial, as provided by some USB devices. (If Synapse doesn't offer this, a package with serial support is available from the same source. (See the download page.) Just before we start, with the hope that I can put you in the right frame of mind: Here's a useful and informative note from.

Synapse is NOT a set of components. It is only library of units with code and classes. It cannot be installed, it does not need to be installed!

To use Synapse, you simply copy all the necessary Synapse units to your project directory (or to your library search path) and in your project add a USES line listing the needed Synapse units. Slightly worrying. The most recent (at 14 Feb 17) latest full release was from 2012. And there was talk about the program needing a Win 32 operating system. The latter not, I hope, an issue for me, because I use the 32-bit Lazarus, even on my 64-bit machine. But maybe it will matter to others? Clicked 'Download'.

It went VERY quickly. Under three seconds on my rather slow connection.

But I had a.zip file of 899kb. The download page said it included 'demos and documentation'. And simple investigation, again with the normal Windows file management utility, made it seem that this was true. Take a moment to read the short 'README.txt' inside the distribution.zip.

Hoist by my own petard! Synapse 'installs' the way my own software installs. No messing with the registry. No 'click the magic button and it will all be done for you (how we want to do it.)' So you have options.

Here's how I 'installed' the program on my system. Start by setting up a temporary folder for the contents of the Synapse.zip file, and unzip everything into it. I like to keep third party things where I can see them for what they are. I have, in 'MyDocs', a 'Lazarus' folder which is where I keep the sourcecode, etc, of my projects. (In sub-folders, one per project) That seemed a good place to put the Synapse stuff.

(I'd already learned from the README.txt file that there's a way to let Lazarus know where to look.) So, I created (MyDocs) Lazarus ThirdPrty Synapse (I've learned that with software which is also happy on Macs and Linux, it is best to avoid spaces in names, and to remember that THisNAme and thisname are sometimes seen as DIFFERENT. (Which of course they are NOT in Windows.) So I try to be consistent about the case of letters in a name.) It seemed best to put ALL of the Synapse files in one place. A shortcut to.

Lazarus ThirdPtry Synapse docs help index.htm can go where I want it, for every day access, in due course. 'Synapse installed'.

But my Lazarus IDE doesn't yet know it! Showing Lazarus where to find the Synase material Fire up Lazarus. I'm going to show you how I use third party materials.

I only make them available on a project- by- project basis. Install them globally, and it is too easy to begin to think of something as part of the basic Lazarus. There probably is a way to make something available 'for all time'. But you'll have to look elsewhere for that. To say to Lazarus, 'for this project, you should use.'

You first go into a specific project. Either open an old one you want to extend, or start a new one.

Use 'Project/ Project Options/ Compiler Options/ Paths/.' Once you've gone that far, there will be a panel to the right, with multiple edit boxes. If you 'installed' Synapse on your system as described earlier.

Unzipped all they offer, someplace sensible, but haven't made those files GENERALLY available to your Lazarus work, then you continue as follows. (If you haven't, go back and do that!) Click the ellipsis (.) to the right of the edit box for 'Other Unit Files (-Fu):', and the 'Path Editor' should open. (That name is in title bar.) Click the folder icon. Drill to the relevant folder. In this case. Synapse source lib.

I have to admit, my Lazarus was a bit flaky while I was trying to do this. Especially if I clicked the 'Test' button.

It didn't crash when I hit 'Test', but it did shortly after, and then during the next re-launch, and THEN it settled down. But I still like it!! (I was using ver 1.6.2 on a Win 7 machine, 23 Oct 17) Onward! Once Lazarus can find the Synapse.pas files it needs, try running some of the examples which come with Synapse.

Or go straight to some of my tutorials. Or powered by Site search Web search BEWARE: There is stuff at my other two sites that the search above won't reveal. Go to either site (see links below) and use that site's FreeFind search button.

BEWARE: The search above only visits a selection of my stuff. Go to either of my other sites (see links below) and use that site's FreeFind search button, if you haven't found something you 'know is there'.

In addition to the tutorials for which this page serves as Table of Contents, I have other sites with material you might find useful. My other sites.

And some links to specific pages within them you might want. - LOTS of fun, for not much money. And beginner (intelligent beginner) friendly. And good pursuit for kids. Combine programming and electronics!

The KiCad way. Long established. PCB-fab houses take native KiCad files. This discusses a worthwhile, fun (if presented intelligently) activity for kids, which can be undertaken on many levels. A simple 20 minutes, or weeks of engaging activity. Road Map Europe Free Download. (Also known to divert susceptible adults.) Ad from page's editor: Yes.

I do enjoy compiling these things for you. Hope they are helpful.

This doesn't pay my bills!!! If you find this stuff useful, please at least help me with Facebook links, etc (buttons at top of page). If you run an MS-DOS or Windows PC, please visit my freeware and shareware page, try something? Links on your page to this page would also be appreciated, of course! Here is the way to, Tom Boyd. Page WILL BE tested for compliance with INDUSTRY (not MS-only) standards, using the free, publicly accessible validator.

(Mostly passes. A few problems caused by Google+ and Delicious code.) If this page causes a script to run, why?

Because of things like Google panels, and the code for the search button. Why do I mention scripts? Be sure you know all you need to.

The most critical phase in serial communications programming is configuring the port settings with the structure. Erroneously initializing the DCB structure is a common problem. When a serial communications function does not produce the expected results, the DCB structure might be in err. A call to the CreateFile function opens a serial port with default port settings.

Usually, the application needs to change the defaults. Use the function to retrieve the default settings and use the function to make port settings. Also, port configuration involves using the structure to set the timeout values for read/write operations.

When a timeout occurs, the ReadFile or WriteFile function returns the specific number of characters successfully transferred. To configure a serial port • Initialize the DCBlength member of the DCB structure to the size of the structure. This is required before passing the member as a variable to a function. • Call the GetCommState function to retrieve the default settings for the port opened with the CreateFile function.

To identify the port, specify in the hPort parameter the handle that CreateFile returns. • Modify DCB members as required. The following are DCB structure members. Member Description DCBlength Before calling the GetCommState function, set this member to the length of the DCB structure.

Neglecting to do this can cause a failure or return erroneous data. BaudRate Specifies the device communication rate. Assigns an actual baud rate or an index by specifying a CBR_ constant.

FBinary Specifies if binary mode is enabled. The Microsoft® Win32® API does not support nonbinary mode transfers, so this member must be TRUE. Using FALSE does not work. FParity Specifies if parity checking is enabled.

If this member is TRUE, parity checking is performed and errors are reported fOutxCtsFlow Turns the CTS flow control on and off. To use RTS/CTS flow control, specify TRUE for this member and RTS_CONTROL_HANDSHAKE for the fRtsControl member. FOutxDsrFlow Turns the DSR flow control on and off. DSR flow control is rarely used.

A typical port configuration is to set this member to FALSE, while enabling the DTR line. FDtrControl Specifies the DTR flow control. DTR_CONTROL_ENABLE turns on the DTR line during the connection. DTR_CONTROL_HANDSHAKE turns on DTR handshaking. DTR_CONTROL_DISABLE turns off the DTR line.

FDsrSensitivity Specifies if the communications driver is sensitive to the state of the DSR signal. If this member is TRUE, the driver ignores any bytes received, unless the DSR modem input line is high.

FTXContinueOnXoff Specifies if transmission stops when the input buffer is full and the driver has transmitted the XoffChar character. If this member is TRUE, transmission continues after the input buffer has come within XoffLim bytes of being full and the driver has transmitted the XoffChar character to stop receiving bytes. If this member is FALSE, transmission does not continue until the input buffer is within XonLim bytes of being empty and the driver has transmitted the XonChar character to resume reception.

FOutX Specifies if XON/XOFF flow control is used during transmission. If this member is TRUE, transmission stops when the XoffChar character is received and starts again when the XonChar character is received. FInX Specifies if XON/XOFF flow control is used during reception. If this member is TRUE, the XoffChar character is sent when the input buffer comes within XoffLim bytes of being full, and the XonChar character is sent when the input buffer comes within XonLim bytes of being empty. FErrorChar Specifies if bytes received with parity errors are replaced with the character specified by the ErrorChar member. If this member is TRUE and the fParity member is TRUE, replacement occurs. FNull Specifies if null bytes are discarded.

If this member is TRUE, null bytes are discarded when received. FRtsControl Turns the RTS flow control on and off. RTS_CONTROL_ENABLE turns on the RTS line during the connection.

RTS_CONTROL_HANDSHAKE turns on RTS handshaking. RTS_CONTROL_DISABLE turns off the RTS line. RTS_CONTROL_TOGGLE Specifies that the RTS line is high if bytes are available for transmission. After all buffered bytes have been sent, the RTS line is low. FAbortOnError Specifies if read and write operations are terminated when an error occurs.

If this member is TRUE, the driver terminates read and write operations with an error status when an error occurs. The driver does not accept further communications operations until the application has acknowledged the error by calling the ClearCommError function. FDummy2 Reserved; do not use. WReserved Not used; set to zero.

XonLim Specifies the maximum number of bytes allowed in the queue. The XON character is sent if the number of bytes in the queue falls below this number.

XoffLim Specifies the maximum number of bytes accepted in the input buffer before the XOFF character is sent. The maximum number of bytes accepted is calculated by subtracting this value from the size, in bytes, of the input buffer. ByteSize Specifies the bits per byte transmitted and received. Parity Specifies the parity scheme.

Do not confuse this member with the fParity member, which turns parity on or off. Because parity is rarely used, this member can usually be NOPARITY. StopBits Specifies the number of stop bits. ONESTOPBIT is the most common setting. XonChar Specifies the value of the XON character for both transmission and reception.

XoffChar Specifies the value of the XOFF character for both transmission and reception. ErrorChar Specifies the value of the character used to replace bytes received with a parity error. EofChar Specifies the value of the character used to signal the end of data. EvtChar Specifies the value of the character used to signal an event. WReserved1 Reserved, do not use. • Call the SetCommState function to set the port settings.

The following code example shows how to use the GetCommState and SetCommState functions to configure a serial port.