Skip to main content.
Mauston, WI, USA
Updated: 9/2/2010    10:06:51 AM

NSLog.exe

Version 1.13

NSLog is a small utility program that reads the NexStorm™ Flashgate IPC memory area and then creates files suitable for enabling javascript updates of web pages as well as the creation of graphs. It also has the option to upload several files at user-defined rates, which will then be accelerated when a user-defined level of lightning activity is reached. Files are only uploaded if they are newer than the previous copy uploaded, thus saving bandwidth to be better used when there is high activity. A great example of what can be done with this data is the NSDisplay script by Henkka Roblom.  The program was written using C++ Builder 6 and is based on the code provided by Astrogenic Systems (Relko) and included on the NexStorm™ distribution disk.

If you find this program useful and you wish to help defray the cost of the compiler, please feel free to use this link.  

Install/Uninstall - Download and unzip NSLog.zip, then place the NSLog folder anywhere on the hard drive of the computer running NexStorm™. To uninstall, simply delete the NSLog folder.

NSLog.zip contents - The NSLog folder contains:

1) NSLog.exe
2) nsFtp.exe
3) readme.txt

Operation - Simply run NSLog.exe and it will begin reading NexStorm™ data from the Flashgate IPC. Upon running the program for the first time, there will be a NSLog.cfg file (and backup) created to maintain your configuration data. There will also be a "hidden" \nslupload\ folder created which will contain the most recent copies of the files that are uploaded. Please don't set NSLog to create any of it's files in this folder! There is a command line switch "m" available to start NSLog minimized to the system tray (nslog m).


Many Thanks to Henkka Roblom and Brad Holcomb who cheerfully helped beta test this program.

NexStorm™ is a product of Astrogenic Systems.

Menus

File - Clear Screen - Clears the scrolling screen display.

File - Minimize to Tray - Minimizes the program to the system tray. Clicking on the "-" in the upper right corner of the program will do the same.

File - Exit - Exits the program and saves the current configuration. The red x in the upper right corner of the program screen will do the same.

View - View xxxx File - Opens Notepad and displays the various files..

Config - See Config Tab.

Help - Online Help - Will open your default browser and bring you to this page.

Help - About - Displays the About screen which has version and contact information.

Config - General Tab - This screen has several options for configuring the program.

Screen On - Controls whether the data is written to the screen. If you're having trouble and have a very slow computer, you may want to experiment with turning this off.

Show in Miles/Km - Allows you to select the units that are displayed as well as logged.

Show Heartbeats & Noises - Controls whether these are written to the display screen.

Show Status Area - Show or hide the lower strike and upload information.

Log FTP Transfers - Will create a log with information about each of the transfers. Use this only when necessary because the log file can grow very large in a hurry.

Log Raw Data - Controls whether the raw data is logged.

Include Heartbeats & Noises - Not normally used, but available should they be needed.

Archive Raw Daily - With this checked a new file is created each day at midnight. Files are named yyyymmddNSRaw.txt.

Append Recap - If checked, a short recap of the day's activity will be appended to the end of NSRaw.txt when it is archived.

Archive Folder - Allows you to designate where the archived file will be placed. If nothing is selected the file will be created in the folder where NSLog is located.

Close Stike Limit - The distance that defines which strikes will be counted as "Close".

High Activity Threshold - The number of "Close" strikes per minute that will trigger the High Activity Uploads.

X Minute Strike Recording - Allows you to select the interval for the second set of counters. This can be anything from 2 to 60 minutes.

Confirm Red X Shutdowns - Whether you want to confirm program exit when clicking the "Red X".

Processor Priority - Allows you to increase the priority that your processor gives NSLog. In testing, using realtime has resulted in an over 50% reduction of missed events during medium and high activity storms. If you notice any sluggishness of your mouse cursor or any other issues, you should leave this in normal. I haven't noticed any problems with slow downs or with any of the many weather programs that are running on my computer.

Realtime Tab

Create Realtime File - Allows you to select whether this file is created or not.

Realtime File Folder - Default is in the folder that contains the NSLog.exe program, but the file can be placed elsewhere. Do not select the \nslupload\ folder.

FTP The Realtime File - Allows you to select whether the file will be uploaded or not.

Normal Rate - The rate at which the file is uploaded when High Activity is not sensed.

Accelerated Rate - The rate at which the file is uploaded when High Activity is sensed as determined by the close strike configuration on the general tab.

Login - Standard.

Server - In this example I'm uploading to the /web/ folder on my site which happens to be the root.

Password- Standard.

Passive - Passive if checked, active if not.

File Rename - The file is uploaded with a different file name and then renamed once the transfer is complete. It is recommended to use this if your server allows.

Port - The standard is 21, but you can change to something different if you need to.

Clone Button - While NSLog is designed to allow you to upload files to different servers and different folders, many users will be sending their files to the same place. This button copies the FTP info as entered on the Realtime tab to all the others to make initial setup a bit easier.

Strikes Tab - Just like the Realtime Tab except:

File Length - Allows you to select how minutes of data are stored in NSStrikes.txt. The range is from 1 to 1440 (24 hours).


Graph Tab - Just like the Realtime Tab except:

Log Interval - Allows you to select how often the current strike data is written to the log file.

Max Lines in Log - Limits the size of the file so it doesn't eat up too much space.

Upload 1 - 5 Tabs

These work just like the Realtime and Graph file uploads, and allow you to upload up to 5 additional files which can be sent to different locations. File times are checked on these files and they will not be uploaded unless they are newer. If you select 0 Minutes in the Accelerated Rate box, NSLog will check your Upload 1-5's every 15 seconds when in High Activity mode. You'll want to select Binary on these if your file is a graphic or other binary file format.

Troubleshooting Uploads

The upload times on the NSLog main screen indicate when NSLog last asked nsFtp to upload the files. Because nsFtp is a "Fire and Forget" program, NSLog doesn't know whether the uploads were successful or not. When NSLog determines it is time for an upload, it checks the file time of the target file and compares that with the most recently uploaded copy of that file. If the file is newer, a copy is placed in the nslupload folder and nsFtp is asked to upload it. By observing the file times in the nslupload folder, you can determine how often each of the files is being created and uploaded. The nslupload folder is created as a hidden folder within the same folder that contains NSLog.exe. In order to see it, you may have to enable "Show hidden files and folders" in Windows Explorer.

Show Hidden

Should you notice that a file is not being updated in the nslupload folder, First make sure that all of the server information is correct on the tab for that particular file. Also check that the file is actually being created in the location that you have specified. If that all checks out, look in Task Manager and see if there is an instance of nsFTP.exe there that isn't closing because it may have that file "locked". nsFtp has a timing feature where it will "kill" itself after a period of time, but that may be several minutes. You can right click and end that process if you wish without causing any harm. It has also been noted that some antivirus programs can at times cause a locked file in the nslupload folder, so if you experience that set your antivirus program to exclude the entire NSLog folder from scans and see if that improves things.

You may choose to have NSLog upload your NexStorm and Wasp2 images and data if you want to let NSLog control the rate of the uploads. The following settings will allow creation of the files on your hard disk without NexStorm or Wasp2 uploading them.

NS Data Export  NS Screenshot  Wasp2 FTP

If all of the above checks out, you may try enabling ftp logging on the Configuration-General tab. This can reveal several possible errors. Some servers cannot handle 3-5 second uploads of the Realtime.txt file, but will handle 10-15 seconds just fine. Be sure to turn ftp logging off when you are done because the file can grow quite large in a short period of time. Also, you may delete the log file at any time and it will be re-created by NSLog when necessary.

nslog2grlevel.php

GRLevel3 owners may be interested in trying this out. Tom Chaplin from Carterlake.org originally released this code in the GRLevelX owners forum in 2006. This version has been modified to read the NSStrikes.txt file and display your lightning data in GRLevel3 just as his original script did with the Weather Display produced data. The .zip file contains the script that creates the placefile, an icon file and the Xara Xtreme file that created the .png icon file. You can download it here. The placefile produced can be seen here and to see it in action, add that same URL to your placefile manager and select either LaCrosse (ARX) or one of the other radars in the area.

 

nslog2kmz.php

Once again leveraging Tom's code above, this script produces a .kmz file that Google Earth can read. Users need to select Add-Network Link in Google Earth and then paste http://yoursite.org/NSStrikes.kml in the Link field and give it an appropriate name. Nothing else is required of them. NSStrikes.kml creates a network link that will periodically call nslog2kmz.php which then delivers the compressed data to Google Earth for display. You can download it here.

I've begun using the Google Earth view of my lightning to better calibrate my system and am very happy with the information that it provides.  It has a great ruler to measure distances with, but I found myself wishing I had range rings that matched the distances in segmented ranging.  So, I figured out a way to put together a .kml file to do that and later added another to displays the radials. The package can be downloaded here.

Google Earth

 

NSGMap.php

Mike Stelmat has released a system of PHP and javascript named NSGMap which reads the NSLog NSStrikes.txt file and creates a .kml file that places your lightning strikes on a Google Map of your area. There are many options such as update rate, range rings and overlays of weather Radar images. You can see it operate on Mike's site at http://weather.stormctr.com/bocafalls/NSGMap/NSGMap.php.  Current status of the project can be found at http://forum.astrogenic.com/viewtopic.php?t=694 and the script can be downloaded from Mike's Site.

 

nsFtp.exe

This small little FTP program was developed to support NSLog.exe because there didn't seem to be any free command line programs that would support both long filenames and the server rename function. If you wish, this program can be used for uploading other files via batch files. The syntax to use with one space between each parameter is:

nsFtp.exe logit fullpath filename login password server passive binary rename port

logit - Whether to log the transaction or not, T or F. NSFtpLog.txt will be created if T selected.

fullpath - Full path to the file to be uploaded. If the path contains a long filename, or a name with spaces, enclose this in quotes. In fact, quotes shouldn't hurt anything in either case.

filename - The name you want for your file when it's on your server.

login - The login that you use for your server.

password - Your password.

server - Where you want your file.

passive - T for passive and F for active.

binary - T to upload in binary mode and F for ASCII. Text files should be uploaded in ASCII mode and graphics in binary.

rename - T to upload with a ".tmp" extension followed by a quick rename to your desired name. If your server doesn't support rename, use F.

port - Normally 21, but you can change to something else here.

Examples:

nsFtp.exe T C:\NSLog\Testbat\seo.txt newname.txt jmcmurry mypassword jcweather.us/web/ T F T 21

nsFtp.exe F "C:\Documents and Settings\jmcmurry\Desktop\seo.txt" newname.txt jmcmurry mypassword jcweather.us/web/ T F T 21

 

Strikes JpGraphs

These JpGraph files use the data from NSGraph.txt to plot lightning activity.

strikes.php

strikes.png

strikes2.php

strikes2.png

JpGraph is available at http://www.aditus.nu/jpgraph/jpdownload.php and the strikes files can be downloaded here.

The NSLog created datafile structures:

NSRaw.txt - Comma Delimited - Updated with each Strike - This is the exact data as read from the Flashgate IPC. This is the same structure used in NSStrikes.txt which is suitable for data needed covering the last xx minutes such as nslog2grlevel.php above.

Position Type Name Description
0 int Count All Events
1 int Year yyyy
2 int Month mm
3 int Day dd
4 int Time Stamp Seconds since Midnight
5 int Bearing 0-3600
6 int Distance km
7 int Raw Bearing 0-3600
8 int Raw Distance km
9 int TRAC X 0-1000
10 int TRAC Y 0-1000
11 int Raw X 0-1000
12 int Raw Y 0-1000
13 int Strike Type 0-CG, 1-IC
14 int Strike Polarity 0-Pos, 1-Neg
 

NSRealtime.txt - Comma Delimited - Updated with each Strike - Suitable for rapid uploads to be used by javascript routines.

Position Type Name Description
0 int Year yyyy
1 int Month mm
2 int Day dd
3 int Hour hh
4 int Minute mm
5 int Second ss
6 int Bearing Degrees
7 int Distance Km or Mi as Selected
8 int TRAC X  
9 int TRAC Y  
10 string Strike Type +CG, -CG, +IC, -IC
11 int +CG 1-Yes, 0-No
12 int -CG 1-Yes, 0-No
13 int +IC 1-Yes, 0-No
14 int -IC 1-Yes, 0-No
15 int Strikes Since Midnight  
16 int Noises Since Midnight  
17 int Close Since Midnight  
18 int CG+ Since Midnight  
19 int CG- Since Midnight  
20 int IC+ Since Midnight  
21 int IC- Since Midnight  
22 int Peak Rate  Per Min Since Midnight
23 string Peak Rate Time hh:mm:ss
24 int Strikes /Min  
25 int Noises /Min  
26 int Close /Min  
27 int +CG /Min  
28 int -CG /Min  
29 int +IC /Min  
30 int -IC /Min  
31 int Current Rate Minutes - X below
32 int X Min Strikes User Selectable counter
33 int X Min Noises 2 Min - 60 Min
34 int X Min Close  
35 int X Min +CG  
36 int X Min -CG  
37 int X Min +IC  
38 int X Min -IC  
39 string Upload Rate Normal or High
40 string Up Time hh:mm:ss (154:08:23 )
41 string Last Strike Time hh:mm:ss
42 int Days Ave Bearing Degrees
43 int Day's Ave Distance Km or Mi as Selected
44 int 1 Min Ave Bearing  
45 int 1 Min Ave Distance  
46 int X Min Ave Bearing  
47 int X Min Ave Distance  
48 int Peak Burst Rate Per Sec Since Midnight
49 string Peak Burst Time hh:mm:ss

NSGraph.txt - Comma Delimited - User Selectable Log Interval and File Length - Suitable for JpGraph, GraphWeather and other charts.

Position Type Name Description
0 int Year yyyy
1 int Month mm
2 int Day dd
3 int Hour hh
4 int Minute mm
5 int Second ss
6 int Strikes Since Midnight  
7 int Noises Since Midnight  
8 int Close Since Midnight  
9 int Strikes /Min  
10 int Noises /Min  
11 int Close /Min  
12 int +CG /Min  
13 int -CG /Min  
14 int +IC /Min  
15 int -IC /Min  
16 int Current Rate Minutes - X below
17 int X Min Strikes User Selectable counter
18 int X Min Noises 2 Min - 60 Min
19 int X Min Close  
20 int X Min +CG  
21 int X Min -CG  
22 int X Min +IC  
23 int X Min -IC  

Revisions

Version    1.0   3/21/09   Initial Release
  1.01   5/23/09   Modification to enable the LD-250
  1.02   7/7/09   Changed midnight and counter routines
  1.03   7/16/09   Changes to save config and NSStrikes midnight code
  1.04   7/19/09   Command line switch added to start minimized (nslog m)
          nsFtp will now kill itself if not done in 120 seconds
          More tweaks to the NSStrikes midnight code
  1.05   7/27/09   Added compression to nsFtp and tweaked some of the settings
          More work on the NSStrikes midnight code
          "Loosened" the strike filters to hopefully take care of the occasional "brain dead" condition
  1.06   8/6/09   Modified the strike capture thread (again)
          Another change to NSStrikes midnight code & added a range check to the times
          Changes to ftp timing to reduce "collisions"
  1.07   11/6/09   One last change to NSStrikes management
          Another improvement to strikes capture
          Changes to improve peak rate and time
          Added code to prevent user selection of the \nslupload\ folder for storing files
          Removed the message box from "red x" exit. It Was holding up re-boots for some
  1.08   3/26/10   Code change for Strikes file existence
          Added back the red x message box but made it optional
          Changed code where selecting files for upload
          Changes for a locked file issue
          Change to server determination code in nsFtp & added an extra kill attempt
  1.081   3/28/10   Added low level abort code to nsFtp
  1.09   4/25/10   Added Average strike distance and direction.
          Highlighted the last strike type
  1.1   7/17/10   Moved strikes.txt pruning call
          Some minor display tweaks
          Changed the strike type determination code
          Found & fixed a variable that could contribute to incomplete strike data (Risd)
          Fixed a bug where raw logging was unchecked but heartbeats & noises was checked
          Added Peak Burst (strikes/sec)
          Added a backup of the NSLog.cfg that is used if this file goes missing
          Hopefully found the cause of the "brain dead" condition that happens very occasionally
          Fixed a long standing bug in the filename date when archiving NSRaw.txt at the end of the month
          Added the option to increase the processor priority of NSLog.exe
          Added an additional low level abort call to nsFtp that was previously overlooked
  1.11   7/19/10   Fixed where the new processor priority box was not visible on the config tab
          Improved new event filter
  1.12   7/19/10   Fixed bad bug in the "improved" new event filter
  1.13   8/31/10   Re-adjusted thread priorities - big improvement!
          Moved ftp processing into a thread
          Fixed bug where NexStorm is restarted while NSLog stayed running
          More work on the acquisition filter
          Added an immediate refresh of the screen when coming out of minimize
          Added strike type percentage meters