Home |  Products |  Download |  Contact |  Support |  Orders |  Partners |  Links |   
www.ea4tx.com
 
 
In This Section

Products Home
Antenna Rotator System
Developers Area
ARSWIN API
ARS for DOS API
Download Area


Developers Area - Windows API

Introduction

With ARSWIN V1.5k two API's are available:

ARSWIN includes a DDE Server, so any 16 or 32 bit program can interface with it as a DDE Client. Similar for Windows Messaging, however this interface has being simplified and supports only two commands: Move the Azimuth or Elevation of antenna to an angle.

I recommend the DDE Method, however depending on the Language you are using, how many commands, or type of control you need, Windows Messaging may be easier to develop and support.

DDE API

DDE is a standard method developed by Microsoft that allows interface between two programs.

ARSWIN DDE INTERFACE

COMMANDS

SAMPLES

 

ARSWIN DDE Interface

If you want your Application to interface with ARSWIN via DDE, you must load the ARSWIN Application, before trying to connect to the ARS Server. It is recommended to check if the ARSWIN program is running before you call it.
For instance, you can use the SDK Function called:
    ret=GetModuleHandle("ARSWIN")
If "ret" is equal to 0, it means the "ARSWIN" Application is not running, so you cannot use the DDE method.

If you know how the DDE Interface works - what is a TOPIC, ITEM, and so on, continue to read this document.  If not, I recommend you read in your Language Reference Manual the information about the DDE specification.

To continue, I assume that you have experience using the DDE Interface.

For connecting to ARSWIN you must enter the following parameters:

Application: ARSWIN
Topic: RCI
Item: AZIMUTH

In Visual Basic, the code is as follows:

LinkTopic = "ARSWIN|RCI"
LinkItem = "AZIMUTH"

When you have connected to the ARSWIN DDE-Server, data exchange can begin – this is called a "conversation".

When the conversation is open, you can send COMMANDS to ARSWIN, or receive RESPONSES.

Every command will be returned with a response. However, each time the heading is changed (i.e., you are manually positioning your control unit) ARSWIN will return the new heading.

COMMANDS

Eight (8) Commands/Responses are supported:

- Read Azimuth Position, "RA:"
- Read Elevation Position, "RE:"
- Read Digital Azimuth ADC, "DA:"
- Read Digital Elevation ADC, "DE:"

- Turn the Azim. rotor to a point, "GA:new_AZ_angle_value"
- Turn the Elev. rotor to a point, "GE:new_EL_angle_value"

- Get the RCI Status, "ST:"

- Active any Relay Manually, "AR:relay_value"

1) Read Azimuth Position.- (RA:)

Used every time you want to know the antenna heading (Azimuth). You can send the command "RA:" and ARSWIN will return the antenna Azimuth angle. For instance: "RA:33" means the antenna is at 33 Degrees.

VB example: (we assume there is a TEXTBOX called: "TxtCommand")

COMMAND: Your_Application ----> ARSWIN

TxtCommand.Text = "RA:"
TxtCommand.LinkPoke

RESPONSE: ARSWIN ----> Your_Application

ARSWIN writes in the TxtCommand.Text the value = "RA:33"

(Back)

2) Read Elevation Position.- (RE:)

Used every time you want to know the antenna heading (El). You can send the command "RA:" and ARSWIN will return the antenna Elevation angle. For instance: "RE:45" means the antenna is at 45 Degrees.

VB example: (we assume there is a TEXTBOX called: "TxtCommand"

COMMAND: Your_Application ----> ARSWIN

TxtCommand.Text = "RE:"
TxtCommand.LinkPoke

RESPONSE: ARSWIN ----> Your_Application

ARSWIN writes in the TxtCommand.Text the value = "RA:45"

(Back)


3) Read Azimuth ADC.- (DA:)

Used every time you want the Azimuth ADC value. You can send the command "DA:" and ARSWIN will return the antenna Azimuth ADC value. It should be a value between 0-255 for an 8 bit ADC (standard) or between 0-4095 for a 12 Bit ADC.

VB example: (we assume there is a TEXTBOX called: "TxtCommand"

COMMAND: Your_Application ----> ARSWIN

TxtCommand.Text = "DA:"
TxtCommand.LinkPoke

RESPONSE: ARSWIN ----> Your_Application

ARSWIN writes in the TxtCommand.Text the value = "RA:242"

(Back)

4) Read Elevation ADC.- (DE:)

Used every time you want the Elevation ADC value. You can send the command "DA:" and ARSWIN will return the antenna Azimuth ADC value. It should be a value between 0-255 for an 8 bit ADC (standard) or between 0-4095 for a 12 Bit ADC.

VB example: (we assume there is a TEXTBOX called: "TxtCommand"

COMMAND: Your_Application ----> ARSWIN

TxtCommand.Text = "DE:"
TxtCommand.LinkPoke

RESPONSE: ARSWIN ----> Your_Application

ARSWIN writes in the TxtCommand.Text the value = "RA:192"

(Back)

5) Turn the rotor to an Azimuth specific point.- (GA:XXX)

If you want to position your rotor through ARSWIN to an Azimuth angle (GA) you will send this command: GA:XXX, where XXX means the Azimuth angle you wish to position the rotor to. 
For instance: "GA:90", means you wish to turn the antenna to 90 degrees.

COMMAND: Your_Application ----> ARSWIN

TxtCommand.Text = "GA:90"
TxtCommand.LinkPoke

RESPONSE: ARSWIN ----> Your_Application

No response is expected.

(Back)

6) Turn the elevator to an Elevation specific point.- (GE:XX)

If you want to position your elevator through ARSWIN to an Elevation angle (GE) you will send this command: GE:XX, where XX means the Elevation angle you wish to position the elevator to. 
For instance: "GE:50", means you wish to elevate the antenna 50 degrees. For proper operation, this angle should be between 0-90 degrees.

There is no reason for making the Elevation setup over 90 degrees.

COMMAND: Your_Application ----> ARSWIN

TxtCommand.Text = "GE:50"
TxtCommand.LinkPoke

RESPONSE: ARSWIN ----> Your_Application

No response is expected.

(Back)

7) Get the RCI Status.- (ST:)

If you wish to know if any relay is active, the "ST:" command will return the response: "ST:Y" Where Y is the relay value.

 "Y" value can be:

0 = All relays are stopped.
1 = The Brake relay is active
2 = The Left relay is active
4 = The Right relay is active.
16= The Up relay is active
48= The Down relay is active.
Any combination can be accepted: 1+16 = Brake relay + Up

COMMAND: Your_Application ----> ARSWIN

TxtCommand.Text = "ST:"
TxtCommand.LinkPoke

RESPONSE: ARSWIN ----> Your_Application

For example, ARSWIN writes into TxtCommand.Text the relay value = "ST:16" - the Up relay is active.

(Back)

8) Activate any Relay Manually.- (AR:Z)

If you want your application to activate/deactivate any relay. 
It's not recommended to use this command!
If you want to activate the Left or Right Relay, it's not necessary to first activate the Brake and later the Left relay, just activate the Left or Right relay, and ARSWIN will activate the Brake relay automatically.


The command is as follows: "AR:Z"

Where Z is equal to:

0 = All Azimuth relays will be stopped.
2 = The Left and Brake relays will be active
4 = The Right and Brake relays will be active.
7 = All Elevation relays will be stopped.
6 = The Up relay will be active.
8 = The Down relay will be active.

COMMAND: Your_Application ----> ARSWIN

TxtCommand.Text = "AR:2" ' Left turn 
TxtCommand.LinkPoke

RESPONSE: ARSWIN ----> Your_Application

No response is expected.

(Back)

SAMPLES:

I have included two samples with the source code (VB).

ARSCLI:

This program is included with the product. It's a simple sample where you can see how the ARSCLI and ARSWIN are linked using DDE.

You can download the source: HERE

ARSTRACK

I developed this program because Conrad G0RUZ wanted to use the TRACKER program (by W7GJ) for his EME station. This program writes every minute to the file AZEL.DAT - the "UTC" Time, the Azimuth value, and the Elevation value.  The ARSTRACK reads at beginning of each minute this file and sends via DDE to ARSWIN those values. Later, David GM4JJJ and Paul N1BUG used the same formula to interface between his EME program (MoonSked) and ARSWIN.

You can download the source: HERE

I would appreciate if you inform me when you have developed something!

 WINDOWS MESSAGING API

Windows Messaging is a very simple method for interfacing with ARSWIN.

Just a few commands will be used:

·        FindWindow - for locating the ARSWIN window handler

·        RegisterWindowMessage - for registering the Message

·        PostMessage or SendMessage - for sending commands.

AZIMUTH COMMAND:

The Register Window Name will be "AZIMUTH"

The first parameter will be the ANGLE and the second will be "0" (Zero).

  • If ANGLE = -1 then the Azimuth Rotor will STOP

ELEVATION COMMAND:

The Register Window Name will be "AZIMUTH"

The first parameter will be the ANGLE and the second will be "1" (One).

  • If ANGLE = -1 then the Elevation Rotor will STOP

EXAMPLE:

// Find the ARSWIN windows handler
lpClassName = "ThunderForm" ;
pCaption = "ARSWIN" ;

hWndARS = FindWindow(lpClassName, lpCaption) ;

// Register the AZIMUTH window message

lpClassName = "AZIMUTH" ;

MsgARSAz = RegisterWindowMessage(lpClassName) ;

// Send a message to the ARS to turn Azimuth to any angle
// Angle --> any value between 0-360

// Example: Turn Azimuth to 200 degrees
Angle = 200
;
Rotor_Type
= 0 ;    // Azimuth

ret = PostMessage(hWndARS, MsgARSAz, Angle, Rotor_Type ) ;

// Example: Turn Elevation to 45 degrees
Angle = 45

Rotor_Type
= 1 ;    // Elevation

ret = PostMessage(hWndARS, MsgARSAz, Angle, Rotor_Type ) ;

// Example: STOP Azimuth
Angle = -1
;
Rotor_Type
= 0 ;    // Azimuth

ret = PostMessage(hWndARS, MsgARSAz, Angle, Rotor_Type ) ;

// NOTE>: POSTMESSAGE will be better than SENDMESSAGE