Programming Information for WiNRADiO RCU-100 Rotator Control Unit

The WR-RCU-100 API SDK is implemented as 32-bit dynamic library WRRCU100API.dll. It provides object-oriented interface to control the WR-RCU-100 device. The API is accessible in object-oriented languages, such as C++, C# and Object Pascal (Delphi) but also in non object-oriented languages, such as C.

The WRRCU100API.dll exports only one function that allows to create two objects and returns interface to them. The first object provides enumeration of available WR-RCU-100 devices and the second one is used to control the selected WR-RCU-100 device.

Note that these objects can be created in any user thread, but each object can be used and freed only in the thread in which was created.

C/C++ header file WRRCU100API.h and Pascal unit WRRCU100API.pas are provided as part of the SDK. The API can be used by any 32-bit application under Microsoft Windows 98, Me, 2000, XP, Vista and 7, and by 32-bit applications under 64-bit Microsoft Windows XP, Vista and 7.

Using WiNRADiO RCU-100 API

Loading API

The WRRCU100API.dll library can be loaded by two Microsoft Windows API functions. The first one is LoadLibrary and the other one is LoadLibraryEx. After the library is loaded, it is required to get address of the exported function CreateInstance. When the API is no longer needed in the memory, the FreeLibrary function can be used to unload the API. Before FreeLibrary is called, all the objects created by the CreateInstance function must be freed using the Release method of their interfaces, otherwise the application that relies on the API may behave unpredictably.
The following source code in C/C++ shows how to load the API:

#include <stdio.h>
#include "WRRCU100API.h"

void main(void)
{
 CREATE_INSTANCE CreateInstance;
 HMODULE hAPI;

    hAPI=LoadLibrary("WRRCU100API.dll");

    if(hAPI!=NULL)
    {
        CreateInstance=(CREATE_INSTANCE)GetProcAddress(hAPI,"CreateInstance");

        //Here place code that uses the API

        FreeLibrary(hAPI);
    }
    else
    {
        printf("Failed to load WRRCU100API.dll.\n");
    }
}

Enumerating available RCU-100 devices

To enumerate available WR-RCU-100 devices, the API provides an enumeration object. The object has to be created by the CreateInstance function. The following source code in C++ produces a list of serial numbers of available WR-RCU-100 devices:

#include <stdio.h>
#include "WRRCU100API.h"

void main(void)
{
 CREATE_INSTANCE CreateInstance;
 HMODULE hAPI;
 IWRRCU100DeviceList *DeviceList;
 WRRCU100_DEVICE_INFO DeviceInfo;
 int Index;

    hAPI=LoadLibrary("WRRCU100API.dll");

    if(hAPI!=NULL)
    {
        CreateInstance=(CREATE_INSTANCE)GetProcAddress(hAPI,"CreateInstance");

        if(CreateInstance(WRRCU100_CLASS_ID_DEVICE_LIST,(void**)&DeviceList))
        {
            Index=0;
            printf("List of available WR-RCU-100 devices:\n");

            DeviceList->BeginEnumeration();

            while(DeviceList->Next(&DeviceInfo))
            {
                printf("%d. SN: %s\n",++Index,DeviceInfo.SerialNumber);
            }

            DeviceList->EndEnumeration();

            printf("%d devices found\n",Index);

            DeviceList->Release();
        }
        else
        {
            printf("Failed to create device list object.\n");
        }

        FreeLibrary(hAPI);
    }
    else
    {
        printf("Failed to load WRRCU100API.dll.\n");
    }

    printf("Press enter to exit\n");
    getchar();
}

Opening a WR-RCU-100 device

The API provides an object to work with the WR-RCU-100 device. Before the device is open, the object has to be created by the CreateInstance function. The following source code shows how to open the first available WR-RCU-100 device:

#include <stdio.h>
#include "WRRCU100API.h"

void main(void)
{
 CREATE_INSTANCE CreateInstance;
 HMODULE hAPI;
 IWRRCU100DeviceList *DeviceList;
 WRRCU100_DEVICE_INFO DeviceInfo;
 IWRRCU100 *Device;

    hAPI=LoadLibrary("WRRCU100API.dll");

    if(hAPI!=NULL)
    {
        CreateInstance=(CREATE_INSTANCE)GetProcAddress(hAPI,"CreateInstance");

        if(CreateInstance(WRRCU100_CLASS_ID_DEVICE_LIST,(void**)&DeviceList))
        {
            Device=NULL;

            DeviceList->BeginEnumberation();

            if(DeviceList->Next(&DeviceInfo))
            {
                if(!CreateInstance(WRRCU100_CLASS_ID_DEVICE,(void**)&Device))
                {
                    printf("Failed to create device object.\n");
                }
            }
            else
            {
                printf("No available WR-RCU-100 device found.\n");
            }

            DeviceList->EndEnumeration();

            DeviceList->Release();

            if(Device!=NULL)
            {
                if(Device->Open(DeviceInfo.Id))
                {
                    //Here place code that works with the open device

                    Device->Close();
                }
                else
                {
                    printf("Failed to open device.\n");
                }

                Device->Release();
            }
        }
        else
        {
            printf("Failed to create device list object.\n");
        }

        FreeLibrary(hAPI);
    }
    else
    {
        printf("Failed to load WRRCU100API.dll.\n");
    }
}

CreateInstance

Creates single object of the specified class and returns interface pointer to the object.

C/C++ declaration

BOOL __stdcall CreateInstance(UINT32 ClassId,void **Intf);

Parameters

ClassId
[in] Class identifier of the object to be created. This parameter must be one of the following values.

ValueMeaning
WRRCU100_CLASS_ID_DEVICE_LISTClass identifier of the device list object. When the function finished successfully, IWRRCU100DeviceList interface pointer is stored to Intf.
WRRCU100_CLASS_ID_DEVICEClass identifier of the device object. When the function finished successfully, IWRRCU100Device interface pointer is stored to Intf.
Intf
[out] Address of a pointer variable that receives the interface pointer of the object requested in ClassId. Upon successful return, *Intf contains the interface pointer. Upon failure, *Intf contains NULL.

Return Value

If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.

IWRRCU100DeviceList interface

IWRRCU100DeviceList interface is an interface to a device list object that is created by the CreateInstance function and that provides an enumeration mechanism of available WR-RCU-100 devices.

IWRRCU100DeviceList::GetCount

Returns number of the available WR-RCU-100 devices.

C/C++ declaration

UINT32 __stdcall GetCount(void);

Parameters

None

Return Value

This method returns number of the available WR-RCU-100 devices. It returns zero if no available device found.

IWRRCU100DeviceList::BeginEnumeration

Enumerates available WR-RCU-100 devices, prepares an internal list of devices and resets the list pointer to the beginning.

C/C++ declaration

BOOL __stdcall BeginEnumeration(void);

Parameters

None

Return Value

If This method succeeds, the return value is non-zero.
If This method fails, the return value is zero. To get an extended error information, call GetLastError.

IWRRCU100DeviceList::Next

Stores information about available WR-RCU-100 device to a user specified buffer and moves internal list pointer to the next item.

C/C++ declaration

BOOL __stdcall Next(WRRCU100_DEVICE_INFO *Info);

Parameters

Info
[out] Pointer to a WRRCU100_DEVICE_INFO data structure that the function fills with a device information.

Return Value

If This method succeeds, the return value is non-zero.
If This method fails or the internal list pointer is at the end of the list, the return value is zero. To obtain ant extended error information, call GetLastError.

Remarks

Before this method is called, the BeginEnumeration method must be called. Otherwise the Next method will fail.

IWRRCU100DeviceList::EndEnumeration

Frees resources allocated by the BeginEnumeration method.

C/C++ declaration

BOOL __stdcall EndEnumeration(void);

Parameters

None

Return Value

If This method succeeds, the return value is nonzero.
If This method fails, the return value is zero. To get an extended error information, call GetLastError.

Remarks

After this method is called, the Next method must not be called. To start a new device enumeration, use BeginEnumeration again.

IWRRCU100DeviceList::Release

Frees the memory claimed by the object and all the resources allocated by the object.

C/C++ declaration

void __stdcall Release(void);

Parameters

None

Return Value

No return value.

Remarks

Call this method when the object is no longer needed.

IWRRCU100Device interface

IWRRCU100Device interface is an interface to a device object that is created by the CreateInstance function and that allows to control selected WR-RCU-100 device.

IWRRCU100Device::Open

Opens WR-RCU-100 device specified by its identifier and associate the device with the object given by interface pointer.

C/C++ declaration

BOOL __stdcall Open(LONG Id);

Parameters

Id
[in] Identifier of the WR-RCU-100 device to open. The device identifier is a value of Id member of WRRCU100_DEVICE_INFO data structure filled by the IWRRCU100DeviceList::Next method of device list object.

Return Value

If This method succeeds, the return value is non-zero.
If This method fails, the return value is zero. To get an extended error information, call GetLastError.

IWRRCU100Device::Close

Closes the open device and frees all the object resources allocated by the Open method, or other method of the IWRRCU100Device interface.

C/C++ declaration

BOOL __stdcall Close(void);

Parameters

None

Return Value

If This method succeeds, the return value is non-zero.
If This method fails, the return value is zero. To get an extended error information, call GetLastError.

Remarks

If the object specified by its interface pointer is not associated with open WR-RCU-100 device, this method does nothing and returns a non-zero value.

IWRRCU100Device::IsOpen

Returns a value indicating whether the object specified by its interface pointer is associated with an open WR-RCU-100 device or not.

C/C++ declaration

BOOL __stdcall IsOpen(void);

Parameters

None

Return Value

If the device object is associated with an open WR-RCU-100 device, This method returns a non-zero value, otherwise it returns zero.

IWRRCU100Device::GetFirmwareVersion

This method obtains the firmware version information of open WR-RCU-100 device associated with the object.

C/C++ declaration

BOOL __stdcall GetFirmwareVersion(char *Buffer,UINT32 BufferSize);

Parameters

Buffer
[out] Pointer to a buffer to receive the null-terminated string containing firmware version of the open device. This parameter cannot be NULL.
BufferSize
[in] Size of the buffer pointed to by Buffer in bytes.

Return Value

If This method succeeds, the return value is non-zero.
If This method fails, the return value is zero. To get an extended error information, call GetLastError.

Remarks

If the size of the supplied buffer is not large enough, This method fails with ERROR_INSUFFICIENT_BUFFER error code. Typically 16 bytes long buffer is enough. If the device object is not associated with an open WR-RCU-100 device, This method fails with ERROR_INVALID_HANDLE.

IWRRCU100Device::GetSerialNumber

This method obtains the serial number of an open WR-RCU-100 device associated with the object.

C/C++ declaration

BOOL __stdcall GetSerialNumber(char *Buffer,UINT32 BufferSize);

Parameters

Buffer
[out] Pointer to a buffer to receive the null-terminated string containing the serial number. This parameter cannot be NULL.
BufferSize
[in] Size of the buffer pointed to by Buffer in bytes.

Return Value

If This method succeeds, the return value is non-zero.
If This method fails, the return value is zero. To get an extended error information, call GetLastError.

Remarks

If the size of the supplied buffer is not large enough, This method fails with ERROR_INSUFFICIENT_BUFFER error code. Typically 9 bytes long buffer is enough. If the device object is not associated with an open WR-RCU-100 device, This method fails with ERROR_INVALID_HANDLE.

IWRRCU100Device::GetState

This method obtains the state of an open WR-RCU-100 device associated with to the device object.

C/C++ declaration

BOOL __stdcall GetState(UINT32 *State);

Parameters

State
[out] Pointer to a buffer that receives the state of the open device associated with the device object. This parameter cannot be NULL. The received state can be combination of the following values.

ValueMeaning
WRRCU100_STATE_DISCONNECTEDThe associated open WR-RCU-100 device is disconnected. The power button has been turned off or USB cable has been unplugged.
WRRCU100_STATE_HIGH_TEMPERATUREHigh internal temperature.
WRRCU100_STATE_LOW_VOLTAGELow voltage of the device power.
WRRCU100_STATE_OVERLOAD_AZAzimuth motor overload.
WRRCU100_STATE_OVERLOAD_ELElevation motor overload.
WRRCU100_STATE_AZ_IS_NOT_MOVINGAzimuth is not moving.
WRRCU100_STATE_EL_IS_NOT_MOVINGElevation is not moving.
WRRCU100_STATE_MECHANICAL_RANGES_UNKNOWNMechanical ranges of the connected rotator is unknown. Calibration is required to measure full azimuth and elevation ranges.
WRRCU100_STATE_CALIBRATION_REQUIREDCalibration is required. See the StartCalibration.
WRRCU100_STATE_CALIBRATION_IN_PROGRESSCalibration is in progress.

Return Value

If This method succeeds, the return value is non-zero.
If This method fails, the return value is zero. To get an extended error information, call GetLastError.

Remark

If no open WR-RCU-100 device is associated with the object, This method fails with ERROR_INVALID_HANDLE.

IWRRCU100Device::GetPosition

This method obtains the current azimuth and elevation positions of an open WR-RCU-100 device associated with the device object.

C/C++ declaration

BOOL __stdcall GetPosition(INT32 *Azimuth,INT32 *Elevation);

Parameters

Azimuth
[out] Pointer to a buffer that receives current azimuth position in degrees. This parameter cannot be NULL.
Elevation
[out] Pointer to a buffer that receives the current elevation position in degrees. This parameter cannot be NULL.

Return Value

If This method succeeds, the return value is non-zero.
If This method fails, the return value is zero. To get an extended error information, call GetLastError.

Remark

The received values of the azimuth and elevation are relative distances from azimuth and elevation zero points. The values can be negative. The azimuth and elevation zero points can be affected by the SetOffsets method.

If no open WR-RCU-100 device is associated with the object, This method fails with ERROR_INVALID_HANDLE. If the device is not connected, This method fails with ERROR_DEVICE_NOT_CONNECTED. If the calibration is in progress, This method fails with ERROR_BUSY. If the device needs to be calibrated, This method fails with ERROR_INVALID_DATA.

IWRRCU100Device::SetPosition

This method sets new destination azimuth and elevation positions of an open WR-RCU-100 device associated with the device object to a specified position and gets the azimuth/elevation motors moving.

C/C++ declaration

BOOL __stdcall SetPosition(INT32 Azimuth,INT32 Elevation);

Parameters

Azimuth
[in] New destination azimuth position in degrees.
Elevation
[in] New destination elevation position in degrees.

Return Value

If This method succeeds, the return value is non-zero.
If This method fails, the return value is zero. To get an extended error information, call GetLastError.

Remark

The specified values of azimuth and elevation are relative distances from zero points of the azimuth and elevation. They have to be within the range received by the GetAzimuthRange and GetElevationRange methods.

If no open WR-RCU-100 device is associated with the object, This method fails with ERROR_INVALID_HANDLE. If the device is not connected, This method fails with ERROR_DEVICE_NOT_CONNECTED. If the calibration is in progress, This method fails with ERROR_BUSY. If the device needs to be calibrated, This method fails with ERROR_INVALID_DATA.

IWRRCU100Device::Stop

This method stops azimuth and elevation moving.

C/C++ declaration

BOOL __stdcall Stop(void);

Parameters

None

Return Value

If This method succeeds, the return value is non-zero.
If This method fails, the return value is zero. To get an extended error information, call GetLastError.

Remark

If no open WR-RCU-100 device is associated with the object, This method fails with ERROR_INVALID_HANDLE. If the device is not connected, This method fails with ERROR_DEVICE_NOT_CONNECTED. If the calibration is in progress, This method fails with ERROR_BUSY. If the device needs to be calibrated, This method fails with ERROR_INVALID_DATA.

IWRRCU100Device::SetOffsets

This method makes it possible to establish zero positions for azimuth and elevation.

C/C++ declaration

BOOL __stdcall SetOffsets(INT32 Azimuth,INT32 Elevation);

Parameters

Azimuth
[in] New azimuth offset in degrees.
Elevation
[in] New elevation offset in degrees.

Return Value

If This method succeeds, the return value is non-zero.
If This method fails, the return value is zero. To get an extended error information, call GetLastError.

Remark

Using this method, it is possible to compensate small deviations in mechanical position of the rotator unit. If the azimuth or elevation offset is not zero, the destination position is calculated as follows real destination position = required destination position + offset. For example, if the azimuth offset is 4 degrees and the destination position specified by the SetPosition method is 10 degrees, the azimuth is moved to 10 + 4 = 14 degrees. The specified azimuth and elevation offsets have to be within the range received by the GetAzimuthOffsetRange and GetElevationOffsetRange methods.

If no open WR-RCU-100 device is associated with the object, This method fails with ERROR_INVALID_HANDLE. If the device is not connected, This method fails with ERROR_DEVICE_NOT_CONNECTED. If the calibration is in progress, This method fails with ERROR_BUSY. If the device needs to be calibrated to determine maximum mechanical azimuth and elevation ranges, This method fails with ERROR_INVALID_DATA.

IWRRCU100Device::GetOffsets

This method retrieves azimuth and elevation offsets previously specified by the SetOffsets method.

C/C++ declaration

BOOL __stdcall GetOffsets(INT32 *Azimuth,INT32 *Elevation);

Parameters

Azimuth
[out] Pointer to a buffer that receives current azimuth offset in degrees. This parameter cannot be NULL.
Elevation
[out] Pointer to a buffer that receives current elevation offset in degrees. This parameter cannot be NULL.

Return Value

If This method succeeds, the return value is non-zero.
If This method fails, the return value is zero. To get an extended error information, call GetLastError.

Remark

If no open WR-RCU-100 device is associated with the object, This method fails with ERROR_INVALID_HANDLE. If the calibration is in progress, This method fails with ERROR_BUSY. If the device needs to be calibrated to determine maximum mechanical azimuth and elevation ranges, This method fails with ERROR_INVALID_DATA.

IWRRCU100Device::GetAzimuthOffsetRange

This method retrieves azimuth offset range.

C/C++ declaration

BOOL __stdcall GetAzimuthOffsetRange(INT32 *MinOffset,INT32 *MaxOffset);

Parameters

MinOffset
[out] Pointer to a buffer that receives minimum possible azimuth offset in degrees that can be passed to the SetOffsets method. This parameter cannot be NULL.
MaxOffset
[out] Pointer to a buffer that receives maximum possible azimuth offset in degrees that can be passed to the SetOffsets method. This parameter cannot be NULL.

Return Value

If This method succeeds, the return value is non-zero.
If This method fails, the return value is zero. To get an extended error information, call GetLastError.

Remark

The azimuth offset range depends on the maximum mechanical azimuth range.

If no open WR-RCU-100 device is associated with the object, This method fails with ERROR_INVALID_HANDLE. If the calibration is in progress, This method fails with ERROR_BUSY. If the device needs to be calibrated to determine maximum mechanical azimuth range, This method fails with ERROR_INVALID_DATA.

IWRRCU100Device::GetElevationOffsetRange

This method retrieves elevation offset range.

C/C++ declaration

BOOL __stdcall GetElevationOffsetRange(INT32 *MinOffset,INT32 *MaxOffset);

Parameters

MinOffset
[out] Pointer to a buffer that receives minimum possible elevation offset in degrees that can be passed to the SetOffsets method. This parameter cannot be NULL.
MaxOffset
[out] Pointer to a buffer that receives maximum possible elevation offset in degrees that can be passed to the SetOffsets method. This parameter cannot be NULL.

Return Value

If This method succeeds, the return value is non-zero.
If This method fails, the return value is zero. To get an extended error information, call GetLastError.

Remark

The elevation offset range depends on the maximum mechanical elevation range.

If no open WR-RCU-100 device is associated with the object, This method fails with ERROR_INVALID_HANDLE. If the calibration is in progress, This method fails with ERROR_BUSY. If the device needs to be calibrated to determine maximum mechanical elevation range, This method fails with ERROR_INVALID_DATA.

IWRRCU100Device::GetAzimuthRange

This method retrieves azimuth range of open WR-RCU-100 device associated with the object.

C/C++ declaration

BOOL __stdcall GetAzimuthRange(INT32 *MinAzimuth,INT32 *MaxAzimuth);

Parameters

MinAzimuth
[out] Pointer to a buffer that receives minimum possible azimuth in degrees that can be passed to the SetPosition method. This parameter cannot be NULL.
MaxAzimuth
[out] Pointer to a buffer that receives maximum possible azimuth in degrees that can be passed to the SetPosition method. This parameter cannot be NULL.

Return Value

If This method succeeds, the return value is non-zero.
If This method fails, the return value is zero. To get an extended error information, call GetLastError.

Remark

The azimuth range depends on the maximum mechanical azimuth range and azimuth offset specified by the SetOffsets method.

If no open WR-RCU-100 device is associated with the object, This method fails with ERROR_INVALID_HANDLE. If the device needs to be calibrated to determine maximum mechanical azimuth range, This method fails with ERROR_INVALID_DATA.

IWRRCU100Device::GetElevationRange

This method retrieves elevation range of open WR-RCU-100 device associated with the object.

C/C++ declaration

BOOL __stdcall GetElevationRange(INT32 *MinElevation,INT32 *MaxElevation);

Parameters

MinElevation
[out] Pointer to a buffer that receives minimum possible elevation in degrees that can be passed to the SetPosition method. This parameter cannot be NULL.
MaxElevation
[out] Pointer to a buffer that receives maximum possible elevation in degrees that can be passed to the SetPosition method. This parameter cannot be NULL.

Return Value

If This method succeeds, the return value is non-zero.
If This method fails, the return value is zero. To get an extended error information, call GetLastError.

Remark

The azimuth range depends on the maximum mechanical elevation range and elevation offset specified by the SetOffsets method.

If no open WR-RCU-100 device is associated with the object, This method fails with ERROR_INVALID_HANDLE. If the device needs to be calibrated to determine maximum mechanical azimuth range, This method fails with ERROR_INVALID_DATA.

IWRRCU100Device::StartCalibration

This method starts calibration of open WR-RCU-100 device associated with the object.

C/C++ declaration

BOOL __stdcall StartCalibration(BOOL ForceToDetermineMechanicalRanges);

Parameters

ForceToDetermineMechanicalRanges
[in] Specifies whether maximum mechanical azimuth and elevation ranges will be measured or it will be not. Non-zero if yes, zero if no. If the mechanical ranges of the connected device have not been measured yet, this parameter is ignored and the mechanical ranges are automatically measured.

Return Value

If This method succeeds, the return value is non-zero.
If This method fails, the return value is zero. To get an extended error information, call GetLastError.

Remark

The calibration locates the mechanical azimuth and elevation zero points and determines the maximum azimuth and elevation ranges (depends on ForceToDetermineMechanicalRanges parameter). The calibration has to be done when a rotator connected to the rotator control unit is changed or if device state retrieved by the GetState method contains WRRCU100_STATE_CALIBRATION_REQUIRED value.


If no open WR-RCU-100 device is associated with the object, This method fails with ERROR_INVALID_HANDLE. If the device is not connected, This method fails with ERROR_DEVICE_NOT_CONNECTED.

IWRRCU100Device::StopCalibration

This method stops calibration of open WR-RCU-100 device associated with the object, previously started by the StartCalibration.

C/C++ declaration

void __stdcall StopCalibration(void);

Parameters

None

Return Value

No return value.

Remark

This method stops calibration previously started by the StartCalibration method. If the calibration is not in progress, This method does nothing.

IWRRCU100Device::SetLED

This method allows to specify WR-RCU-100 device's front panel LED behaviour.

C/C++ declaration

BOOL __stdcall SetLED(UINT32 LED);

Parameters

LED
[in] Specifies front panel LED behaviour. The value can be one of the following.

ValueMeaning
WRRCU100_LED_GREEN_ON_FLASH_RED_ONThe LED is normally solid green, flashing green when rotator moves, and solid red when error occurs.
WRRCU100_LED_GREEN_ON_RED_ONThe LED is normally solid green, changes to solid red when error occurs.
WRRCU100_LED_GREEN_OFF_RED_ONThe LED is normally off, changes to solid red when error occurs.
WRRCU100_LED_GREEN_ON_RED_OFFThe LED is normally solid green, error state is not indicated.
WRRCU100_LED_GREEN_OFF_RED_OFFThe LED is always off.

Return Value

If This method succeeds, the return value is non-zero.
If This method fails, the return value is zero. To get an extended error information, call GetLastError.

Remark

If no open WR-RCU-100 device is associated with the object, This method fails with ERROR_INVALID_HANDLE. If the device is not connected, This method fails with ERROR_DEVICE_NOT_CONNECTED.

IWRRCU100Device::GetLED

This method retrieves the control code of WR-RCU-100 device front panel LED.

C/C++ declaration

BOOL __stdcall GetLED(UINT32 *LED);

Parameters

LED
[out] Pointer to a buffer that receives the front panel LED control code previously specified by the SetLED method. This parameter cannot be NULL. See SetLED for information about possible values.

Return Value

If This method succeeds, the return value is non-zero.
If This method fails, the return value is zero. To get an extended error information, call GetLastError.

Remark

If no open WR-RCU-100 device is associated with the object, This method fails with ERROR_INVALID_HANDLE.

IWRRCU100Device::RegisterNotification

This method registers an application specified notification object which will receive WR-RCU-100 device notifications.

C/C++ declaration

BOOL __stdcall RegisterNotification(IWRRCU100Notification *Notification);

Parameters

Notification
[in] Interface pointer of an application specified object that implements methods of the IWRRCU100Notification interface.

Return Value

If This method succeeds, the return value is non-zero.
If This method fails, the return value is zero. To get an extended error information, call GetLastError.

Remark

If the interface pointer of notification object is already registered, This method does nothing.

IWRRCU100Device::UnregisterNotification

This method unregisters an application-specified notification object previously registered by the RegisterNotification method.

C/C++ declaration

BOOL __stdcall UnregisterNotification(IWRRCU100Notification *Notification);

Parameters

Notification
[in] Interface pointer of an application specified object that implements methods of the IWRRCU100Notification interface.

Return Value

If This method succeeds, the return value is non-zero.
If This method fails, the return value is zero. To get an extended error information, call GetLastError.

Remark

If the interface pointer of a notification object has not been previously registered by the RegisterNotification, This method does nothing.

IWRRCU100Device::Release

Frees memory claimed by the object and all the resources allocated by the object. If the object is associated with an open WR-RCU-100 device, the device is closed.

C/C++ declaration

void __stdcall Release(void);

Parameters

None

Return Value

No return value.

Remarks

Call this method when the object is no longer needed.


IWRRCU100Notification interface

IWRRCU100Notification interface is an interface of application defined object that implements methods of the interface. The object is used to receive notifications of WR-RCU-100 device object. See IWRRCU100Device::RegisterNotification. The device object calls method of this interface in the user thread in which the device object is created using the CreateInstance function. It is important the application has to have message loop using GetMessage and DispatchMessage of Microsoft Windows API.

IWRRCU100Notification::PositionChanged

This method is called by the device object that is associated with an open WR-RCU-100 device when current position of the azimuth or elevation is changed.

C/C++ declaration

void __stdcall PositionChanged(IWRRCU100Device *Device,INT32 Azimuth,INT32 Elevation);

Parameters

Device
Interface pointer of device object that called this method.
Azimuth
Current azimuth position in degrees.
Elevation
Current elevation position in degrees.

Return Value

No return value.

Remarks

The IWRRCU100Device::RegisterNotification and IWRRCU100Device::UnregisterNotification methods must not be called when this method is executing.

IWRRCU100Notification::StateChanged

This method is called by the device object that is associated with an open WR-RCU-100 device when device state is changed.

C/C++ declaration

void __stdcall StateChanged(IWRRCU100Device *Device,UINT32 State);

Parameters

Device
Interface pointer of device object that called this method.
State
New device state. For more information about possible values see the IWRRCU100Device::GetState method.

Return Value

No return value.

Remarks

The IWRRCU100Device::RegisterNotification and IWRRCU100Device::UnregisterNotification methods must not be called when this method is executing.


WRRCU100_DEVICE_INFO structure

This structure is used in WR-RCU-100 enumeration process using device list object. See IWRRCU100DeviceList::BeginEnumeration, IWRRCU100DeviceList::Next and IWRRCU100DeviceList::EndEnumeration.

C/C++ declaration

#pragma pack(push,1)

typedef struct
{
    char SerialNumber[9];
    LONG Id;
} WRRCU100_DEVICE_INFO;

#pragma pack(pop)

Members

SerialNumber
Serial number of WR-RCU-100 device
Id
WR-RCU-100 device indentifier that is used as parameter of IWRRCU100Device::Open method.