# Earthworm Modules:
PsnAdSend for Earthworm 7.x Overview

Updated: October 3, 2012

### Introduction:

> PsnAdSend is a digitizing module similar to ADsend for Earthworm. This module runs under Windows (2000, XP, Vista or Win7) or Linux and produces demultiplexed data to one of the transport data rings. This program was designed to work with the Webtronics' 16-Bit 8-Channel PSN-ADC-SERIAL or PSN-ADC-USB Analog to Digital boards, PSN-ACCEL (our new strong motion board) as well as the VolksMeter Sensor. The 16-Bit ADC board can record 1 to 8 channels at sample rates of 10, 20, 50, 100, 200, 250 or 500 sample per second. At 500 SPS the maximum number of channels the board can digitize is 4. To use the board you will need one free RS-232 Comm port or use the USB version of the board. If the system only has USB ports, a USB to RS-232 converter can be used between the computer and the PSN-ADC-SERIAL board. Adapters based on the FTDI chip set are recommended. The PSN-ACCEL board has both RS-232 and USB ports and can record up to 4 channels at 15, 25, 30, 50, 60, 100, 120 or 200 samples per second.

> The Windows version of the module was built using Microsoft Visual C++ 8.0 (Visual Studio 2005) and the Linux version is build and tested using OpenSuse 11.4. The program (PsnAdSend.exe) has been tested using Earthworm version 7.5. The PsnAdSend program uses the PSNADBoard.dll to interface between the program and the ADC board. See this page for more information on the DLL / Linux library. Under Windows this file must be in the same bin directory as PsnAdSend.exe and be DLL version 4.1 or higher. The Linux version does not need any other files other then the PsnAdSend executable.

### Addition Configuration File Information:

> PsnAdSend Version 2 has some additional configuration file parameters;

> The ConsoleDisplay parameter is only used under Windows and controls how PsnAdSend displays status information on the screen. If set to 1, the program will clear the screen, reposition the cursor to the top of the window and display the status information. When ConsoleDisplay = 0, status information will be appended to the end of the screen buffer.

> The ControlCExit parameter controls how the module handles console event signals like Control-C. If the parameter = 1, PsnAdSend will exit, if 0, the program will ignore Control-C keyboard input.

> The RefreshTime parameter is used to automatically display the module status on the screen. The number entered is in seconds. If the user enters 0 (zero) for this parameter no status information will be displayed on the screen.

> CheckStdin is another Windows only feature. If set to 1, the program will pole the STDIN buffer using kbhit() for any user input. Currently only the 'c' key is used to clear the packet received counter, all other input will redisplay the module status information.

> The Station/Component/Network/Location (SCNL) channel line format has been changed and the need for Nchan has been removed. The number of channels that the ADC board will record is now controlled by how many SCNL channel lines are found in the configuration file. Older versions of PsnAdSend required a index parameter per Channel line, this is no longer needed. The new SCNL line format looks like this:

> > >          # Stat Comp Net Loc Bits Gain FltrDly Invert Send DcOffset
> > >          # ---- ---- --- --- ---- ---- ------- ------ ---- --------
> > >     Chan   CH1  SHZ  PN  01   16    1     20      N     Y     0
> > >     Chan   CH2  SHN  PN  02   16    1     20      N     Y     0

> > - CH1 = Station ID; Can be 1 to 5 characters
> > - SHZ = Component Name; Must be 3 characters
> > - PN = Network ID; Must be 2 characters
> > - 01 = Location code; Must be 2 characters
> > - 16 = Number of bits to use from the ADC channel. See Note 1 for more information
> > - 1 = ADC Channel Gain; Must be 1 for 16-Bit digitizer boards, can be 1,2,4,8,16,32 or 64 for SDR24 Board
> > - 20 = Low-Pass Filter Delay in Milliseconds; Can be a + or - . See Note 2 for more information
> > - N = Invert data; Can be (Y)es or (N)o
> > - Y = Send to ring; Can be (Y)es or (N)o
> > - 0 = DC Offset added to the incoming ADC data; Can be a + or - integer number.

> Note #1: This parameter controls how many converter bits will be used from the ADC channel. For 16 bit boards this parameter can be in the range of 12 to 16. The VolksMeter and SDR24 boards use a 24 bit converter, so the range can be 12 to 24.

> Note #2: The Filter Delay parameter is used to compensate for the propagation delay of the signal through the low-pass filter connected between the sensor and the A/D card. This is done by subtracting time from the packet start time before sending the data to the EW ring.

### Additional Derived Channels:

> Version 2.x of the PsnAdSend Module has a new feature that allows the user to create additional channels from one of the real ADC channels. This can be used with the new built in digital filters (see below for more information) to send both the filtered data and raw data to EW. The SCNL line is similar to the normal channel SCNL control line.

> > >     #       AdcCh Stat Comp Net Loc Bits FltrDly Invert Send DcOffset
> > >     #       ----- ---- ---- --- --- ---- ------- ------ ---- --------
> > >     AddChan   1    CH9  BHN  NC  02  16     0      N     Y     0

> > - 1 = Raw or physical ADC channel number
> > - CH9 = Station ID; Can be 1 to 5 characters
> > - BHZ = Component Name; Must be 3 characters
> > - NC = Network ID; Must be 2 characters
> > - 02 = Location code; Must be 2 characters
> > - 16 = Number of bits to use from the ADC channel
> > - 20 = Filter Delay in Milliseconds; Can be a + or - integer number
> > - N = Invert data; Can be (Y)es or (N)o
> > - Y = Send to ring; Can be (Y)es or (N)o
> > - 0 = DC Offset added to the incoming ADC data; Can be a + or - integer number

### Data Time Stamping:

> The PSN-ADC-SERIAL/PSN-ADC-USB boards and the PSNADBoard.dll can use various methods to time stamp the data. The most accurate timing (< 3 milliseconds) can be achieved using a GPS receiver connected to the digitizer. Currently the board supports the Garmin GPS 16, Garmin GPS 18x LVC Sensors or the older and now obsolete Motorola ONCORE receiver series. If the system is running a program like the NTP, the user can expect an overall accuracy of around +-50 milliseconds. DLL/Linux Library version 2.0 and some of our ADC boards now support the Sure Electronics GPS Evaluation board. To use this GPS receiver the user must solder a wire from the GPS' 1-PPS signal to pin 1 of the RS-232 connector. To power the receiver from the ADC board the user can solder another wire from pin 5 of the RS-232 connector to the +5VDC buss on the GPS evaluation board.

### Built-in Digital Filters:

> The PsnAdSend module now has some basic digital filtering. Each channel, including the derived channels, can have one or more of the of the following filter types:

> > - Low-Pass
> > - High-Pass
> > - Inverse or Period Extending Filter

> See http://www.seismicnet.com/epf/ for more information on the inverse filter. The Inverse Period Extending Software filter is based on work by Bob McClure.

### TCP/IP Connection to ADC Board:

> Version 2.x of the PsnAdSend now supports a TCP/IP connection to the ADC board through a TCP/IP to RS-232 bridge. This can be either wired or wireless based on the adapter type. We have been experimenting with WiFi adapter that seems to work Ok. To use this feature set the "TcpMode" parameter in the PsnAdASend.d file to 1, set the "CommPortTcpHost" to the host IP address or host name of the adapter and "TcpPort" to the adapters port number. The RS-232 bridge must be configured as a server and listen for a connection from the host computer running PsnAdSend.

### Additional Information:

- PSN-ADC-SERIAL and PSN-ADC-USB Board Information
- Anti-aliasing filter Filter Board
- FTDI USB Driver - The USB version of the ADC board used the FTDI FT232RL USB chip. Both Windows and Linux are supported.

#### [ Top ] [ Commands ]