Volume 11
Chapter 68
386 - MySQL Multiple Table Joins - 2017-02-18
On the web page that reports 'Hits on a Sky Map' I needed to collect various values from several different dB table using MySQL. The structure was difficult to get in sight but I finally got it to work. Here it is:
$result = mysql_query( "SELECT hits.hit_id,hits.date_time,hits.freq,hits.declination,hits.right_ascension, scans.grid_square,hits.falsified,targets.name AS target_name,constellations.name AS const_name FROM setine5_seti.hits,setine5_seti.constellations,setine5_seti.targets JOIN scans WHERE ( scans.scan_id=hits.scan_id) AND (scans.target_id=targets.target_id) AND (targets.const_id=constellations.const_id) ); while($row = mysql_fetch_array($result )") { $Hit_ID = $row['hit_id']; $Hit_Const = $row['const_name']; $Hit_target_name = $row['target_name']; $Ra = $row['right_ascension']; $grid_square =$row['grid_square']; $DEC = $row['declination']; $Freq = $row['freq']; $Freq = $Freq/1000000; $Hit_grid_square = $row['grid_square']; $Hit_date_time = $row['date_time']; $hitStatus = $row['falsified']; if ($hitStatus == 0) $open_hit[] = " [$Ra,$DEC,$Freq] "; if ($hitStatus == 1) $false_hit[] = " [$Ra,$DEC,$Freq] "; $hitInfo[] = "[$Ra,$DEC,$Freq,$Hit_ID,$Hit_Const,$Hit_target_name,$Hit_grid_square,$Hit_date_time,$hitStatus]; }
385 - SDR Console I/Q Cancellation Problem - 2017-02-10
I switched to SDR Console as the software of choice because of its superior bandwidth control and its ability to be controlled via CAT. It works great except for a serious problem with both my HackRF receivers (I have two). I don't know if this is a software problem, a hardware problem or a little of both.
An example of this is shown in these two screen grabs 1 GHz apart. Same junk right in the center of the screen in each. This is the case at all tuned frequencies.
The full screen grabs and 1 minute of recording can be downloaded here:
- 25 MHz 1.5 Meg PNG file
- 1025 MHz - 1.5 Meg PNG file
- Recording from SDR Console - 45 Meg (Change its extension to .WAV after downloading. Then it can be played back in SDR Console.
384 - How to 'Un-Mangle' a C++ DLL For Delphi - 2017-02-07
The newest SETI network station, Scott Carter at EN92gp, is trying to build a C++ DLL to control his antenna actuators from the SETI Net Antenna software. This has to be done via a DLL written in C++.
The problem is that the Visual Studio C++ compiler 'Mangles' the exported function name - why is beyond me but it does. So a simple function call on the C++ side looks like:
BECALIBRARY_API int Functions::GetVersion(char* ptrVersionString)Comes out in the DLL like:
?GetVersion@Functions@BecaLibrary@@SAHPAD@Z
In the DLL itself. To sort this requires the addition of a pragma for each function (shown below):
#pragma comment(linker, "/EXPORT:GetVersion=?GetVersion@Functions@BecaLibrary@@SAHPAD@Z") BECALIBRARY_API int Functions::GetVersion(char* ptrVersionString) { char * Version; Version = "Test 555"; strcpy_s(ptrVersionString, strlen(Version) + 1, Version); return strlen(Version); }
The mangled name, the part after the '=', can be retrieved using 'Dependance Walker'. It generates something like this:
The pragma also generates a second exported function name 'GetVersion' in the DLL.
Delphi can now refer to the function by any of these:
- Ordinal 1- "function getVersion; external 'BecaLibrary.dll' index 1;"
- Ordinal 21- "function getVersion; external 'BecaLibrary.dll' index 21;"
- Mangled name - function getVersion; external 'BecaLibrary.dll' name '?GetVersion@Functions@BecaLibrary@@SAHPAD@Z';
- Un-Manged name -function getVersion; external 'BecaLibrary.dll' name 'GetVersion';
383 - SDR Console Setup For SETI - 2017-01-27
The linkage between the SDR Console and SETI Search Control is completed by two paths; one for audio and a second for control. This is shown in the following figure.
The current setup for SETI Net Station DM12jw (the Mother Ship) is:
- SDR Hardware - HackRF 1 MHz to 6 GHz receiver
- SDR Console - Version V3 Preview 5 Jan 8 2017
- Virtual Audio Cable - VB-Audio Supplies audio to the SpecAna
- Virtual Serial Ports - Com4 and Com2 sets frequency of the receiver
- SDR Console Controller - Latest Version
- SETI Search Control - Latest Version
The SDR Console setup and the audio path are detailed in item 382 below. The control path is setup as follows:
- Download and install the Virtual Serial Port driver.
- Create two connected virtual serial ports. I use Com2 and Com4 simply because thats the next assignment. This setup up is shown below
- Start SDR Console and select View | More Options Select | Show All Options (at bottom).
- The Controllers | CAT (serial Port) | Port Selection. Check Com4 . This is shown in the bottom figure.
This completes the connection between the SDR Console and the first Virtual Serial Port. The connection to the second Virtual Serial Port and the SDR Console Controller is TBD.
382 - SDR Console Setup For SETI - 2017-01-26
I am moving away from SDR Sharp (SDR#) and to SDR Console for control of the SETI receivers. I am doing this for several reasons.
- SDR# has become captive of a commercial company.
- SDR Console has a superior bandwidth control
- SDR Console has the ability to be controlled from and external application (SETI Net)
The setup of SDR Console for SETI operation is shown below.
The interface between the SDR Console (or SDR#) and the SETI Spectrum Analyzer is via VB-Cable. Setup your audio system with VB-Cable as shown in item 373 in the Engineering Notebook
The interface between SDR Console and the SETI Net Control Panel will be via CAT which is a Hamlib interface that is TBD. Until it is complete use the SDR# Ear-To-Oak setup item 367 of the engineering notebook.
I generally set the initial frequency from the SDR (SDR# or SDR Console) application.
381 - Delphi Threads by Martin Harvey - 2017-01-25
Martin has contacted my with a request to remove his tutorial on Delphi Threads from my server and create a pointer to his new material. I am very glad to do that.
Thank you Martin.
380 - Creating a DLL in C++ - 2017-01-20
It will be necessary to interface with other SETI Network stations using other than Delphi. For this Microsoft's Visual Studio and it's C++ (or 'C') development system will be used.
This is a walk through for building a DLL, in C++ that can be used by Delphi.
The walkthrough is maintained by Microsoft and is complete and well written. It works for VS 2015.
The complete set of files, both from VS 2015 and Delphi Seattle are contained in this RAR.
379 - Latest Software Release - 2017-01-13
I reworked a lot of the software over the last couple of days.
- Changed all times to UTC to accommodate other stations in the network
- Moved the station Lat/Lon definition to the Mount module
- File Manager now rational (I hope) with SML loaded automatically when started
- Redid the SETI Clock to make the Sky Map more logical
- Many other changes
378 - Interfacing SDR Console with SETI - 2017-01-09
I've contacted Simon Brown and explained what I need to do for his fine software to be usable with SETI Net. He gave me some hints on how it can be done. This is so I don't loose the keys to this again.
377 - I AM DOM'ed - 2017-01-01
I have been working with the Microsoft Document Object Model (DOM) trying to get the File Manager sorted out. I am about to give up.
I create the SML schema with Atova XMLSpy then create the Delphi bindings using the RAD Studio binding wizard as described here. Then I go back and attempt to write code that sets up the File Manager user interface according to the SML and changes the SML according to changes in the user interface. Its a bitch.
I have the help of Scott Carter (SETI Network station EN92gp) and he is doing a great job keeping me sane but still...
I finally managed to tame the DOM. Its not nearly as bad as is rumored.