Volume 11

Chapter 69

Volume 11 Chapter 69

396 Passing a string to a 'C' DLL- 2017-07-09

As many times that I have done this - that's how many times I have forgotten how to do it. Here is the cheat sheet.

function setSimpleMsgBox(Text: String): boolean;
 type
   TSimpleMsgBoxFunc = function(Text: PAnsiChar): integer; stdCall;
 var
 SimpleMsgBoxFunc: TSimpleMsgBoxFunc;
 begin
  result := false; // preset the result to error
  dllHandle := LoadLibrary('Rotor.DLL');
  if dllHandle <> 0 then
    begin
      @SimpleMsgBoxFunc := GetProcAddress(dllHandle, 'SimpleMsgBox');
      if Assigned(SimpleMsgBoxFunc) then
      if (SimpleMsgBoxFunc(PAnsiChar(AnsiString(Text))) <> 0) then
        result := true
      else
       FreeLibrary(dllHandle);
    end;
 end;

The Type specification can go anywhere of course and the GetProcAddress must match the name of the exported function in the DLL - CASE SENSITIVE.

395 Image Refresh - 2017-06-30

I was having trouble getting the images on the front page to refresh correctly. I could get the page to reload by having the operator press Ctrl+F5 but that seems clumsy. I could get the page to reload from a button and that was better but then JPG or PNG were not updating when a new image is uploaded by the SETI station. A two part solution was needed.

The first part is a simple <div that creates a 'red-box' and contains a button and some text.

for the current Sky Map
<div class="red-box"> 
  <input type="button" 
   value="Refresh" onClick="document.location.reload(true)">   
   for the current Sky Map</div>

The 'onClick' causes the page itself to be reloaded from the server. The 'red-box' needs a link in the header to the CSS as:

<link href="/css/Jim.css" rel="stylesheet" type="text/css">

The second part of the solution adds a date and time variable to the 'img'. Each time the page is access the browser checks the URL part of the image and because the time has changed it assumes that its a new file which causes it to reload from the server.

<img src="status.jpg?v=<?php echo Date("Y.m.d.G.i.s")?>" 
   width="350" class="scalable fancy" height="443" alt=""/> 

394 HackRF One Problem- 2017-06-06

The HackRF is the principal receiver in use at SETI Net. It works great but it has a problem. Right in the middle of the spectrum display is some junk that appears there regardless of tuning of the receiver.
I have contacted the developer of the controlling software (SDR Console) who tells me that its junk coming right from HackRF.

Does anyone have a solution to this problem?

393 Wiring Gauges - 2017-05-22

The is the logic used to run the Elevation gauges on the Antenna module. Lest I forget.

392 Unwinding the Antenna - 2017-05-10

I have been locked in a battle with my own software for several days now. I invented this Antenna control module that allows the Az/El motors on the antenna to be positioned in DEC/Ra and to track a point in the sky as the Earth moves under it.
Then I attempted to make 'just a minor improvement' to the code. It broke and I have been working on it ever since.
I now have it to the point where it works fine in simulation mode and should be able to get the Antenna itself to move correctly without too much more fuss.

You can download this version from the Operations page.

391 - Spectrum Analyzer on the Cheap - 2017-04-14

China has come through again.

For very little money you can buy the components to make a nice spectrum analyzer and noise source that doubles as a synthesizer and covers from 138 MHz to 4.4 gHZ.

This is the lash up I used to characterize a filter I had in my junk box.

Professional looking output.

The modules are:

  • Spectrum Analyzer - Search EBay with '138MHz-4.4GHz'. It should turn up a bunch of listings. - Should be about $70
  • Noise Source - Search EBay with 'Noise Source Simple Spectrum External Generator Tracking Source' - Should be about $20
  • Pad - 20 dB or so attenuator needed otherwise the Noise Source output will swamp the Spectrum analyzer input

The Spec Ana also can be used as a synthesizer. Just the thing for antenna and detection logic testing.

When you get your Spec Ana. Download the software here

390 - Freeze - 2017-03-23

It's freezing.

The damn SpecAna is locking itself up and I am having a very hard time finding out why. I built a logging function into it and run it with EurekaLog to help narrow it down but still no joy.

It appears that the problem centers around the point that I clear buffers to be ready for a new run. I use:

 SetLength(bufFrame, 0);

in TfrmSpecAna.WMsetRun line (about) 778. The problem seems to be that *sometimes* it takes longer than 5 seconds to clear the buffer and reallocate it. Five seconds is the time out when Windows decides that an application is frozen and throws its own exception.

Trying this at the start of Create:

 procedure TfrmSpecAna.FormCreate(Sender: TObject);
var
  DisableProcessWindowsGhostingProc: procedure;
begin
  DisableProcessWindowsGhostingProc := GetProcAddress(GetModuleHandle('user32.dll'), 'DisableProcessWindowsGhosting');
  if Assigned(DisableProcessWindowsGhostingProc) then
    DisableProcessWindowsGhostingProc;

389 - Bad to Worse - 2017-03-15

I got the problem with the SpecAna down to a problem in the 25 MHz reference oscillator. The oscillator is a constant current saturated amplifier who's level is set by a DAC. This is referenced on:

  • Troubleshooting - Section 6.8.4 of Maintenance Manual VI (page 404 of the PDF)
  • Schematic - Maintenance Manual VIII Page 130 of the PDF

The trouble is the DAC itself is not part of the schematics that I could find (click here for a full size schematic).

Then after giving up on this problem, I put the unit back together and found that the +12 Power Supply had quit. So I opened it back up and dissemble it to get down to the power supply. Its buried in the center of four or five layers of circuit boards, cables, jumpers and other stuff (click for full size JPG).

Getting the power supply out of there must be possible (it didn't grow there I'm sure) but I cannot figure out how. Not only that but I do not have a schematic that covers the power supply even if I coule extract is from the unit.

Stuck - Anyone have a power supply schematic?

Reference to power supply capacitor replacements:

388 - Spectrum Analyzer Repair - 2017-03-01

I have a very nice analyzer on loan to me from a local group but it has a problem.

This is what the instrument reports when connected to its Cal Output. It should read -10 dBm and 25 MHz. It does read -40 dBm and 29.107 mHz.

This is an Advantest R3365 but it is from the same line as these other models:

  • Advantest R3265
  • Advantest R3271
  • Advantest R3365 (The one I have)
  • Advantest R3371
  • Advantest R3271

First step is scrounge around the Internet to find the maintenance manuals. After a long search with a lot of dead ends I found a set with all the schematics - without them don't bother to try to fix something this complex. You may download them here.

Note: In order to get the PSU out of the analyze there are two screws hidden under one of the lateral aluminum sheets that connect the front and back panels.

387 - Time for a ToDo- 2017-02-19

In no particular order:

  • Scan chart improvement
  • Add antenna movement to list of discriminators
  • Self test with a noise generator
  • Burn the firmware of HackRF's to update and possible get rid of bug
  • Track ATA