top of page
Search
nikitavorontsov309

Franson Serial Port Tools: The Ultimate Solution for Serial Port Management and Emulation



Hard & Software has joined withFranson Technology AB, a software company located in Stockholm, Sweden to offer the Franson line of programming tools for applications using serial communications and GPS/GIS. These includeSerialTools, GPSGate, and GPSTools.


SerialTools version 2.0 provides full control of the serial port and adds the ability to create a Virtual Serial Port (VSP). Your application now may be used to communicate with external programs that normally would use a physical serial port to communicate with hardware devices. Virtual Serial Ports can be vital in the world of updating legacy software and hardware systems to interoperate via LANs, the Internet, or by using various wireless RF technologies. A VSP emulates a physical serial (RS-232 or other standard) in software. Your program creates a VSP that may then be transparently employed by another application as though connected to actual serial hardware. An example of a VSP in action is shown on my LocalComm/RemoteComm ActiveX controls with Virtual Serial Port page. Thus, it is practical to communicate over a wired or wireless network connection with a remote computer and to use a serial port on that remote PC just as though that port was physically connected to the local PC.




Franson Serial Port Tools



SerialTools StandardUse for normal serial port access (class Serial.Port).SerialTools Standard Source CodeSource code to SerialTools Standard .NET (not ActiveX).SerialTools WebNormal serial port access from Internet Explorer (class Serial.Port).NEW! DevPak - Everything included developer license!One year developer license and improved support for all Franson products (including SerialTools).


Free 30 Day Trial Download! Complete the requested form and a evaluation license will be returned to you by email so that you can determine suitability for your applications using fully functional components. Contact me when you are ready to order or for consultation. Easy access to GPS position, speed and satellite information from Visual Basic, C# or Internet Explorer. Using the examples provided you will be up and running within minutes! Supports NMEA-0183. Vector map support for your applications. Draw polygons, polylines and ESRI shapefiles.Raster map support for your applications. Draw icons, lines, etc. on the map using geographic coordinates. Connect GPS to map. Zoom and rotate map. Draw objects on multiple layers. Use blank maps. Object oriented interface to the GPS. With GpsTools you get access to GPS position, satellites, speed and parsed NMEA 0183 datawithout needing to learn any low level serial protocol.Accessing the GPS is as easy as using any COM or .NET component.Automatic detection of GPS receivers connected via RS232 (serial port), Compact Flash, USB or Bluetooth. Platforms: GpsTools runs on Windows XP/2000/NT/ME/9x and Pocket PC/Windows CE.Both ActiveX and .NET is supported. Convert positions between different coordinate systems. Using the new custom grid and custom datum feature, almost all geographic coordinate system on Earth are supported!UTM, WGS84, NAD27, NAD83 and many national grids are predefined and very easy to use.Return to Software Downloads Return to Hard & Software


However, it will be a few weeks before the hardware is available for development and testing, so I was wondering how I could simulate communication to/from the serial port so that I can start developing my app?


Abstract away your serial port comms behind an interface so that you can code your app against the interface and then test with a 'fake' implementation. When you've got the hardware for the real thing, you can code up the 'real' implementation of the interface and swap out the fake one.


Despite the cheesy name, it is actually quite useful. Note that you should have it stop listening to your port if you go to unplug a USB-to-Serial converter. Otherwise it can crash (well... wait indefinitely on exit, which is annoying). It doesn't have to put itself in the middle of a serial connection to sniff data. It monitors the IO using the Win32 API.


I like David's answer above but if your looking to do integration tests and actually test your serial port communication I have used and application called ViN soft virtual serial cable in the past to basically create 2 serial ports on your machine that are connected by a virtual cable.


Also if you have a serial port on your development machine you could use it to connect to another machine that has a serial port and write an application that will basically simulate the communication of the PLC.


Very old but still might be useful to some. Instead of relying on COM interaction, just use the SerialPort.BaseStream to communicate with the port. This allows you to simply use a standard stream interface for communication, in other words, doesn't matter if you use serial ports, TCP connections, or even file streams. Perfect for simulation.


Franson SerialTools RunTime is a free addin for SerialTools.SerialTools is the easiest way to include serial port support in your application!Many samples, easy guides to get started and a very straight forward API makes SerialTools simple to use even for a novice programmer. For the more advanced developer all features are in place for complete control of the serial port.


2. Multiple virtual serial ports means that you can have more than one program receiving data from your GPS. With USB, or with a single real serial port for that matter, only one program can receive data from the GPS at a time.


Click OK, and if Windows warns you about a duplicate, ignore the warning and click Yes. Click OK and then OK to the port settings. Then close the Device Manager window. If you want to confirm the port change has indeed been made, click on Device Manager again and check the listed Ports. Now close the System Properties window. At this point, you are ready to use the virtual COM port in any application! Note that, if you unplug the USB device and plug it back in later, Windows will still remember the COM port assignment, so you won't need to go through this procedure again. However, there is a known Windows issue that affects most applications. The virtual COM port will be removed from the device manager when the USB cable is unplugged, even if an application has the virtual COM port open. The virtual COM port will not be accessible even after the virtual serial device is reconnected unless the virtual COM port is released by the application prior to the reconnection, which may require closing the application first. It is therefore recommended that the application be closed before the USB device is unplugged.


Seeing that my application connects to another mobile device through a serial port, and the serial ports used for Bluetooth communications differ from one device to another, I used the SettingsForm form class in order to set the COM ports for the communication (you can find those by going to Settings->Connections->Bluetooth->Services, then you select the Serial Port service and click Advanced). The Settings form looks like this:


First, I instantiate the two variables that represent the serial ports (you need two: one for incoming and one for ongoing). I also set timeout values so that the application can exit gracefully when required. I will talk about this later.


Now is the time to explain why I set the timeout values for the serial port variables. The ReadLine() method of the SerialPort class blocks until a message is retrieved. In order for the application to process the disconnect and close requests, it needs to execute the lines of code after ReadLine(). By setting the timeout values to 1000ms, after every second of waiting without receiving a message, the function throws an exception and a new iteration of the while loop is started. This gives the application the chance to check the two variables and possibly exit the loop.


I use a BT dongle on my laptop to communicate with a GPS unit. When settingit up the connection creates a BT serial port. It takes a little while todetermine the correct ports but it works fine.HTHMike Osbourn


I have tried using Bluetooth on my laptop(s) for a couple of purposes.One of these was to connect bluetooth GPS units and happy to report that on a Sony with built in bluetooth, and on a Dell with two different bluetooth adapters I had no problems. In all cases the bluetooth adapters came with software drivers that allowed serial devices like the GPS units to be seen.I think XP service pack 2 is even better as it has built in bluetooth drivers. However I tried with original XP and with service pack 2 and both worked fine.RegardsBob


The setup program will also write several files to the system directory (usuallyC:\WINDOWS\SYSTEM32). These files are:"NSCEPictureBox.ocx", which provides graphics support tools."NSBComDlg.dll", which contains file management and other common Windowstools."NSBControls.dll", which contains the "listbox", used here for theon-screen logging."MSCEFILE.DLL", also contains file management tools."SerialXP.dll", which provides enhanced serial port support."cswskax5.ocx", which provides TCP/IP support functions.


You can select four different serial channels. NMEA data can be accepted from both ports. Note the AutoStart checkbox. When this is selected, NavMonPc will attempt to connect to the selected ports automatically at program start.


If the connection to these serial ports is lost, for example if a Bluetooth serial interface is disrupted, the program will attempt to reconnect until either the connection is restored or the user clicks the Disconnect button.


Rev 0.30 Changes: Added two more serial port interfaces, added "DPT" NMEA depth sentence. Minor change to debug display of NMEA sentences. Rev 0.29 Changes: Fixed problem with serial port data display that was consuming huge amounts of CPU cycles. The problem exists in Rev 0.25 through Rev 0.28 but wasn't discovered until now. Rev 0.28 Changes: Now decodes NMEA sentence "MWV" (windspeed and direction). Rev 0.27 Changes:Added work-around code so parsing of NMEA numbers, which use a "." (period) for a decimal point, still works when the Windows system "Locale" is set to a region that expects "," (comma) as a decimal seperator. Had to change some display code as well, since some number formatting was broken by the comma thing. Rev 0.26 Changes:Fixed bug in spreadsheet (.csv) log Rev 0.25 Changes:Fixed bug in saving/restoring Virtual Port configuration options. Rev 0.24 Changes:User Interface compatibility quick patch, removing the offending horizontal "fat bars" Rev 0.23 Changes:User Interface improved (?) Rev 0.22 Changes: Fixed port echo, fixed "VHW" heading decoding, serial port now accepts or line termination, timestamps on input data are stripped, added Anchor Watch, added "Own Vessel" track display. Rev 0.21 Changes: Fixed serial port parity configuration error, fixed "close button" [X] hot-spot problem. Rev 0.20 Changes: Even more improved "Spreadsheet Log" header, added "Local Time / GPS Time" autolog option. Configuration is now written to the default file when the program closes (as it should be). Rev 0.19 Changes: Improved "Spreadsheet Log" header, program now (really!) wakes up monitor when in power-save mode. Rev 0.18 Changes: Added "Spreadsheet Log" (see File/Logging), program now wakes up monitor when in power-save mode. Rev 0.17 Changes: Bugfixes, now saves options properly Rev 0.16 Changes: Bugfixes, Window pops up on alarm, added "Deep Water alarm" (click on Depth dial or Options/Depth Alarm to Set depth alarm) Rev 0.15 Changes: Bugfixes, added "Invert RTS" control (see File/Serial Port) Rev 0.14 Changes: Bugfixes, added Depth alarm (click on Depth dial or Options/Depth Alarm to Set depth alarm) Rev 0.13 Changes: Fixed sluggish response when playing alarm sound, added MOB function (drive Port A CTS high to activate Rev 0.12 Changes: Added water temperature/depth stripchart. I haven't yet completed the stripchart options storage, so selected scale values aren't preserved on shutdown. Rev 0.11 Changes: Now correctly decodes AIS Class-B, fixed a bug in serial port operation, added "autolog" and "RMC priority" options. See "NavMonConfig.txt" for option configuration information. Rev 0.10 Changes:Added virtual (serial) output ports, SOG filtering option, COG/SOG Stripchart, more Stripchart scale ranges, more options saved in config file, bug fixes. Rev 0.7 Changes: More flexible AIS guard-zone configuration. Rev 0.5 Changes: Improved File Playback. 2ff7e9595c


0 views0 comments

Recent Posts

See All

Comments


bottom of page