STAR-Link™ Reference Manual
STAR-Link™ Reference Manual
STAR-Link™ REFERENCE MANUAL
DATALOGIC S.p.A. Via Candini 2 40012 - Lippo di Calderara di Reno Bologna - Italy STAR-Link™ Ed.: 07/2003 This manual refers to software version 1.40 and later ALL RIGHTS RESERVED Datalogic reserves the right to make modifications and improvements without prior notification. Datalogic shall not be liable for technical or editorial errors or omissions contained herein, nor for incidental or consequential damages resulting from the use of this material.
DATALOGIC S.p.A. Software License Agreement This legal document is an agreement between you, the end user and DATALOGIC S.p.A. BY INSTALLING THE SOFTWARE, YOU ARE AGREEING TO BECOME BOUND BY THE TERMS OF THIS AGREEMENT, which includes the SOFTWARE LICENSE, LIMITED WARRANTY and ACKNOWLEDGMENT. GRANT OF LICENSE. DATALOGIC grants to you the right to use one copy of the enclosed DATALOGIC S.p.A., program (the "SOFTWARE") on a single terminal connected to a single computer (i.e.; with a single CPU).
CONTENTS 1 1.1 1.2 1.3 1.4 1.5 1.6 GENERAL INFORMATION .......................................................................... 1 Definition of the System ................................................................................ 1 Minimum Configuration Required.................................................................. 1 STAR-Link™ Contents.................................................................................. 2 Installing STAR-Link™ ..............................................
3.3 Events ......................................................................................................... 37 Event AliveEvent ....................................................................................... 37 Event DataEvent ........................................................................................ 38 Event DeviceInfoEvent .............................................................................. 40 Event ErrorEvent ......................................................
6.2 7 7.1 7.2 Property PreambleLength ......................................................................... 68 Property RFMaxProtocolVersion .............................................................. 68 Property RFMinProtocolVersion............................................................... 70 Property RxFree, RxTotal, TxFree, TxTotal.............................................. 71 Property SatID ............................................................................................
A.5 STAR-Link™ Delphi 6 EXAMPLE ............................................................. 112 B CONTROL INTERFACE...........................................................................
viii
GENERAL INFORMATION 1 1.1 1 GENERAL INFORMATION DEFINITION OF THE SYSTEM Datalogic STAR-System™ provides a modern and flexible RF Narrow Band Solution for Mobile applications, exploiting one of the widest product range available on the market, including Hand-Held Readers and Portable Terminals.
STAR-LINK™ 1 1.3 STAR-Link™ CONTENTS STAR-Link™ installation is available in the STAR-System Tools CD-ROM. It contains the following programs: − STAR-Link™ ActiveX and Network Manager DLL; − Examples based on STAR-Link™ ActiveX and developed in Excel 97, Access 97, Visual Basic 6.0, C++Builder 5.0 and Delphi 6.0 applications; their relative source files are provided, too; refer to the example developed in Visual Basic applications for a complete management of methods, properties and events; − DL.
GENERAL INFORMATION 1.4 1 INSTALLING STAR-Link™ Once the CD-ROM is inserted, launch the Windows software STAR-Link™ x.xx.exe for WIN 95/98/NT/ME/2000/XP where "x.xx" corresponds to the software release. Then, click the Setup button from the opening window.
STAR-LINK™ 1 1.6 CONVENTIONS The term "base station" indicates a base access point, while "device" indicates a generic reader or data collector of the radio network. The terms "Satellite", "Satellite object", "Satellite collection" and "SatID" refer respectively to " Base station", "Base station software descriptor", "Base station collection" and "Base station address". The term "DevID" refers to the device address. The terms "STAR-Link™ ActiveX" and "STAR-Link™ control" refer to the NRFCCTL.dll file.
USE AND FUNCTIONING 2 2 USE AND FUNCTIONING 2.1 USING STAR-Link™ ActiveX The software component is an Automation COM object implementing a dual interface (it is possible to use it with Visual Basic and Office application). It contains two kinds of object collection: • Base stations collection • Device collection The collection of the base stations (Base stations) consists of single object base stations (Base station), while the collection of devices (Devices) is composed of single object devices.
STAR-LINK™ 2 2.2 BROADCAST AND FACTORY-LOADED ADDRESSES The Datalogic base stations have a factory-loaded address (2000) to be changed in the range 0-1999, since the network is only activated when all base station addresses are within this range of values. The broadcast address (2047) can be sent to a base station through the PC serial interface.
USE AND FUNCTIONING 2 Once the network initialization has been completed, the RF device registration occurs during the first data transaction: − HHR device (ex.: Gryphon™ M): the network initialization occurs each time a new configuration parameter is set; − PDC device (ex.: F734-E/RF): the network initialization occurs using the corresponding library function (see the DS for Formula manual).
STAR-LINK™ 2 2.4 COMPONENT CLASS OVERVIEW The following is the UML class diagram of STAR-Link™ ActiveX where the boxes represent the classes and the lines indicate the relationship between them.
USE AND FUNCTIONING 2.4.
2 STAR-LINK™ Control Events Event AliveEvent DataEvent DeviceInfoEvent ErrorEvent LostFrameEvent SatCfgEvent SleepSat StatusEvent 10 Description Answers to the ALIVE command sent from a base station.
USE AND FUNCTIONING 2.4.2 2 Base Station Collections Base Station Collection Properties Property Count Item Satellite Description Gives the number of base station objects in the collection Retrieves a single base station object in the collection by the index Retrieves a single base station object in the collection by the ID Base Station Collection Methods Method Add Clear Remove 2.4.
STAR-LINK™ 2 2.4.4 Base Station Object A base station object belongs to the collection of base stations and has defined properties typical of the radio protocol.
USE AND FUNCTIONING 2.4.5 2 Device Object A device object belongs to the collection of devices. It also has some properties strictly depending on the radio protocol.
STAR-LINK™ 3 3 MAIN CONTROL OBJECT An example written in Visual Basic is provided for all the properties and methods. In these examples we assume the control is named RFNCCTL. 3.1 PROPERTIES PROPERTY BAUDRATE PURPOSE Communication port baud rate. DESCRIPTION This property sets or gets the transmission speed to be used in the network.
MAIN CONTROL OBJECT 3 PROPERTY COMMPORT PURPOSE Communication port selection. DESCRIPTION This property sets or gets the communication port number of the PC. IDL [propget, id(6), helpstring("property CommPort")] HRESULT CommPort([out, retval] BSTR *pVal); [propput, id(6), helpstring("property CommPort")] HRESULT CommPort([in] BSTR newVal); DATA TYPE String POSSIBLE VALUES The control accepts only these values: from COM1 to COM32 The default value is COM1 EXAMPLE ... Dim CommPort as String ... RFNCCTL.
3 STAR-LINK™ PROPRTY DEVICES PURPOSE Gets a device collection object. DESCRIPTION This property allows the developer to manage the device collection. It returns the object devices. IDL [propget, id(3), helpstring("property Devices")] HRESULT Devices([out, retval] Idevices* *pVal); DATA TYPE Object devices POSSIBLE VALUES Read only property EXAMPLE ... Dim DevicesObject as Devices ... Set DevicesObject = RFNCCTL.Devices ‘ Add device to the collection DevicesObject.
MAIN CONTROL OBJECT 3 PROPERTY MODE PURPOSE Defines the way to interpret data received from a device. If the transaction is in 2way mode (see DataEvent event) it also defines the way to write data to be sent to a device.
3 STAR-LINK™ Example A. Displaying a text containing the word "Françoise" If sending data by setting the PropertyMode to "text mode", it may occur that a character different from "ç" will be displayed on the device screen. This is due to the fact that the device uses an OEM set of characters, while the Windows program uses the ANSI one. By setting the PropertyMode to "text mode with OEM-ANSI character conversion for data to device only" it is possible to display the desired character. B.
MAIN CONTROL OBJECT 3 POSSIBLE VALUES The control accepts only these values: 0 for text mode, 1 for binary mode, 2 for text mode with OEM-ANSI character conversion for data to and from device, 3 for text mode with OEM-ANSI character conversion for data from device to application only, 4 for text mode with OEM-ANSI character conversion for data to device only. The default value is 0 EXAMPLE ... Public Const MODE_TEXT = 0 Public Const MODE_BINARY = 1 Dim mode As Integer ... RFNCCTL.Mode = MODE_BINARY ...
STAR-LINK™ 3 PROPERTY NETWORKSTATUS PURPOSE Returns the network status. DESCRIPTION This read only property returns the network status. IDL [propget, id(13), helpstring("property NetworkStatus")] HRESULT NetworkStatus([out, retval] short *pVal); DATA TYPE Short POSSIBLE VALUES The control return only these values: NRF_IDLE = 0 NRF_LINE_OPEN = 1 NRF_NET_OPEN = 2 NRF_NET_CLOSE = 3 EXAMPLE ...
MAIN CONTROL OBJECT 3 PROPERTY SATELLITES PURPOSE Gets a base station collection object. DESCRIPTION This property allows the developer to manage the base station collection. It returns the object base stations. IDL [propget, id(2), helpstring("property Satellites")] HRESULT Satellites([out, retval] ISats* *pVal); DATA TYPE Object base stations POSSIBLE VALUES Read only property EXAMPLE ... Dim SatellitesObject as Satellites ... Set SatellitesObject = RFNCCTL.
3 STAR-LINK™ PROPERTY SYNCHRO PURPOSE Way to send data to the container. DESCRIPTION This property allows choosing between synchronized or asynchronous data events. In the first case the control notifies the container the data event, and waits until the application has proceeded the message. In the second case, the ActiveX sends the event and goes on. The first mode is implemented by SendMessage(….), the second mode by PostMessage( … ).
MAIN CONTROL OBJECT 3 PROPERTY TIMEOUT PURPOSE Communication port timeout on received frames. DESCRIPTION This property sets or gets the communication port timeout, which is the maximum waiting time after that we assume the frame does not arrive.
3 STAR-LINK™ PROPERTY TIMER PURPOSE Time between two consecutive data events. DESCRIPTION When you select the Asynchro operating mode, this property allows selecting the minimum time between two consecutive data events sent from the ActiveX to the container.
MAIN CONTROL OBJECT 3.2 3 METHODS METHOD CLOSELINE PURPOSE Closes the serial line. DESCRIPTION Closes the serial line. This is the last operation the developer must do before terminating the application. For this reason, when the CloseLine method is preceded by the CloseNetwork one, it is advised to verify that the data collection has been completed correctly. Proceed by checking the NetworkStatus property value.
3 STAR-LINK™ METHOD CLOSENETWORK PURPOSE Stops the data collection. DESCRIPTION This method allows stopping the data collection from base stations. It is necessary to close the network before terminating the application. This method closes the serial line too, and frees all the opened handles. IDL [id(5), helpstring("method CloseNetwork")] HRESULT CloseNetwork(); INPUT PARAMETERS None OUTPUT VALUE None EXAMPLE ...
MAIN CONTROL OBJECT 3 METHOD GETCONTROLVERSION PURPOSE Retrieves the NRFCCTL.DLL version. DESCRIPTION Retrieves the string indicating the NRFCCTL.DLL version. IDL [id(17),helpstring("method GetControlVersion")] ([out,retval] BSTR *Version); HRESULT GetControlVersion INPUT PARAMETERS None OUTPUT VALUE Version as a String EXAMPLE ... ‘ Show Control Version MsgBox RFNCCTL.GetControlVersion, vbExclamation, “CTL Version” ...
STAR-LINK™ 3 METHOD GETDLLVERSION PURPOSE Retrieves the RFNCLI32.DLL version. DESCRIPTION Retrieves the string indicating the RFNCLI32.DLL version. IDL [id(14),helpstring("method GetDLLVersion")] HRESULT GetDLLVersion([out,retval] BSTR *Version); INPUT PARAMETERS None OUTPUT VALUE The version as a String EXAMPLE ... ‘ Show DLL Version MsgBox RFNCCTL.GetDLLVersion, Version” ...
MAIN CONTROL OBJECT 3 METHOD GETLOSTFRAMEBEHAVIOUR PURPOSE Gets the parameters of the Lost Frame Behaviour DESCRIPTION See SetLostFrameBehaviour on page 34 for details. IDL [id(19), helpstring("method GetLostFrameBehaviour")] HRESULT GetLostFrameBehaviour([out]VARIANT_BOOL *Send2PC, [out]short* TimeNotify, [out]short* TimeGoingOn); INPUT PARAMETERS None OUTPUT VALUE Send2PC as Boolean TimeNotify as short TimeGoingOn as short EXAMPLE ...
3 STAR-LINK™ METHOD LOAD PURPOSE Loads the control configuration parameters. DESCRIPTION This method allows loading the control configuration parameters from the Hard Disk. This method (with the Save method) implements a kind of persistence of the control. All the control properties and both the Device and Base station collection are stored on the Hard Disk.
MAIN CONTROL OBJECT 3 METHOD LOSTFRAME PURPOSE Defines the lost frame management. DESCRIPTION Called when a LostFrameEvent has occurred, it defines the way to manage the lost frame. See SetLostFrameBehaviour on page 34 for details. IDL [id(20), helpstring("method LostFrame")] HRESULT LostFrame([in]VARIANT_BOOL Send2PC, [out,retval]VARIANT_BOOL* retVal); INPUT PARAMETERS Send2PC as BOOL OUTPUT VALUE RetVal as BOOL EXAMPLE ... ‘ Call the Lost Frame Method if Not RFNCCTL.
3 STAR-LINK™ METHOD OPENLINE PURPOSE Opens the serial line. DESCRIPTION Opens the serial line. This is the first operation the developer must do. You can send all the base station commands, like Alive, GetStatus ecc. after opening the serial line. It is not necessary the network data collection is started. IDL [id(8), helpstring("method OpenLine")] HRESULT OpenLine(); INPUT PARAMETERS None OUTPUT VALUE None EXAMPLE ... ‘ Set the serial line and open it RFNCCTL.CommPort = “COM2” RFNCCTL.
MAIN CONTROL OBJECT 3 METHOD OPENNETWORK PURPOSE Starts the data collection. DESCRIPTION This method allows starting the data collection from base stations. It is necessary to open the serial line before calling this method, otherwise the control returns an error. After opening the network the collected data is sent to the application. IDL [id(4), helpstring("method OpenNetwork")] HRESULT OpenNetwork(); INPUT PARAMETERS None OUTPUT VALUE None EXAMPLE ... ‘ Set the serial line and open it RFNCCTL.
3 STAR-LINK™ METHOD SAVE PURPOSE Saves the control parameters to the Hard Disk. DESCRIPTION This method allows saving to the Hard Disk the control configuration parameters. This method (with the Load method) implements a kind of persistence of the control. You can save more than one configuration file, and then load the correct file you need.
MAIN CONTROL OBJECT 3 METHOD SETLOSTFRAMEBEHAVIOUR PURPOSE Sets the parameters managing the lost frames. Even if data frames are numbered, they might be sent to the host PC in a wrong order due to roaming (see chapter 4 in STARGATE™ installation manual for more details about the RF system). One of the main tasks of STAR-Link™ is to sort frames so that they are correctly sent to the application program. Example STAR-Link™ waits for the frame number 5 from the RF device with address 1.
3 STAR-LINK™ IDL [id(18), helpstring("method SetLostFrameBehaviour")] HRESULT SetLostFrameBehaviour(VARIANT_BOOL Send2PC, short TimeNotify, short TimeGoingOn); INPUT PARAMETERS Send2PC as Boolean TimeNotify as short TimeGoingOn as short Default parameters are: SendtoPC = TRUE TimeNotify = 1 TimeGoingOn = 10 OUTPUT VALUE None EXAMPLE ... ‘ Set Lost Frame Behaviour RFNCCTL.SetLostFrameBehaviour True, 0, 10 ...
MAIN CONTROL OBJECT 3.3 3 EVENTS EVENT ALIVEEVENT PURPOSE Alive answer. DESCRIPTION This event notifies the container when a base station answers to an alive command sent from the application. The base station answers with a string having the following format: “DL STARGATE x.y” where x.y is the base station application version.
3 STAR-LINK™ EVENT DATAEVENT PURPOSE Data received DESCRIPTION This event notifies the container when data has arrived.
MAIN CONTROL OBJECT 3 EXAMPLE ... Public Const MODE_TEXT = 0 Public Const MODE_BINARY = 1 ... Private Sub RFNCCTL_DataEvent(ByVal SatID DevID As Integer, ByVal Kind As Boolean) On Error Resume Next Dim Dim Dim Dim Dim Dim Dim As Integer, ByVal item As ListItem sDevice As Device strAnswer As String vaData As Variant strData As String byteData As Byte i As Integer Set sDevice = OCX.Devices.Devices(DevID) vaData = sDevice.DeviceData ' 'Data interpretation ' strData = "" If OCX.
3 STAR-LINK™ EVENT DEVICEINFOEVENT PURPOSE Device coming into the network. DESCRIPTION This event will be sent from the control to the application when a new device becomes active in the network. The device must link to the network before sending data. In this way it is possible to capture the particular frame and communicate it to the application.
MAIN CONTROL OBJECT 3 EVENT ERROREVENT PURPOSE An error has occurred. DESCRIPTION This event notifies the container when an error has occurred. IDL [id(1), helpstring("method ErrorEvent")] HRESULT ErrorEvent(short ErrorID, BSTR ErrorDesc); INPUT PARAMETERS None OUTPUT VALUE ErrorID as short with the ID of the error occurred ErrorDesc as String containing the error description EXAMPLE ...
3 STAR-LINK™ EVENT LOSTFRAMEEVENT PURPOSE Device lost frame. DESCRIPTION This event will be sent from the control to the application when the PC notices that at least one frame of a device has been lost. See SetLostFrameBehaviour method on page 34 for details.
MAIN CONTROL OBJECT 3 EVENT SATCFGEVENT PURPOSE Base station configuration answer. DESCRIPTION This event will be sent from the control to the application when a base station answers to a GetConfiguration command. Before sending this event the control sets all the related properties. IDL [id(4), helpstring("method SatCfgEvent")] HRESULT SatCfgEvent(short SatID); INPUT PARAMETERS None OUTPUT VALUE SatID as short with the ID of the base station sending the configuration answer. EXAMPLE ...
3 STAR-LINK™ EVENT SLEEPSATEVENT PURPOSE Base station sleeping. DESCRIPTION This event will be sent from the control to the application when a base station does not answer to the data collection requested by the PC for a certain number of times. This means the base station might be broken or the serial line (RS 232 or RS 485) might break off.
MAIN CONTROL OBJECT 3 EXAMPLE ... Private Const SAT_ON = 1 Private Const SAT_OFF = 2 Private Const SAT_SLEEP = 3 ...
3 STAR-LINK™ EVENT STATUSEVENT PURPOSE Base station status answer. DESCRIPTION This event will be sent from the control to the application when a base station answers to a GetStatus command. Before sending this event, the control sets all the related properties. IDL [id(5), helpstring("method StatusEvent")] HRESULT StatusEvent(short SatID); INPUT PARAMETERS None OUTPUT VALUE SatID as short with the ID of the base station sending the Get Status answer EXAMPLE ...
BASE STATION COLLECTION OBJECT 4 4 BASE STATION COLLECTION OBJECT 4.1 PROPERTIES PROPERTY COUNT PURPOSE Gets the total number of base stations. DESCRIPTION This property gives the number of base stations stored in the collection. IDL [propget, id(3), helpstring("property Count")] HRESULT Count([out, retval] long *pVal) DATA TYPE LONG POSSIBLE VALUES Read only property EXAMPLE ... Dim SatellitesObject as Sats Dim NumSats as Long ... Set SatelliteObject = RFNCCTL.Satellites NumSats = SatelliteObject.
STAR-LINK™ 4 PROPERTY ITEM PURPOSE Gets a base station object from the collection. DESCRIPTION This property retrieves a base station object from the collection. You must set an index representing the offset in the array used to store all the base station objects (the array is 0-based). IDL [propget, id(DISPID_VALUE)] HRESULT Item([in]long Index, [out, retval] VARIANT *pVal) INPUT PARAMETERS Index : Long The index of the array element used to store the collection of base stations.
BASE STATION COLLECTION OBJECT 4 PROPERTY SATELLITE PURPOSE Gets a base station object from the collection. DESCRIPTION This property retrieves a base station object from the collection. You must set the SatID of the desired base station. IDL [propget, id(4)] HRESULT Satellite([in]VARIANT SatID, [out, retval] ISat **pVal); INPUT PARAMETERS SatID : Short The ID of the desired base station object. DATA TYPE Pointer to dispatch the object interface. POSSIBLE VALUES Read only property EXAMPLE ...
STAR-LINK™ 4 4.2 METHODS METHOD ADD PURPOSE Adds a base station object. DESCRIPTION This method adds a base station object to the collection. You can add base stations with their ID between 0 and 1999. IDL [id(1), helpstring("method Add")] HRESULT Add([in]VARIANT SatID, [out, retval] ISat **pVal); INPUT PARAMETERS SatID: Short The ID of the base station object to be added. OUTPUT VALUE Pointer to dispatch the interface of the object just added. EXAMPLE ... Dim SatObject as Sat ...
BASE STATION COLLECTION OBJECT 4 METHOD CLEAR PURPOSE Clears the collection. DESCRIPTION This method removes all the base stations from the collection. IDL [id(5), helpstring("method Clear")] HRESULT Clear(); INPUT PARAMETERS None OUTPUT VALUE None EXAMPLE ... ‘ Remove all base stations from the collection RFNCCTL.Satellites.Clear ...
4 STAR-LINK™ METHOD REMOVE PURPOSE Removes a base station object. DESCRIPTION This method removes a base station object from the collection. If the base station does not exist, the function fails. IDL [id(2), helpstring("method Remove")] HRESULT Remove([in]VARIANT SatID); INPUT PARAMETERS SatID: Short The ID of base station object to be removed. OUTPUT VALUE None EXAMPLE ... Dim SatObject as Sat ... Set SatObject = RFNCCTL.Satellites.Add(1500) SatObject.GetConfiguration ...
DEVICE COLLECTION OBJECT 5 5 DEVICE COLLECTION OBJECT 5.1 PROPERTIES PROPERTY COUNT PURPOSE Gets the total number of devices. DESCRIPTION This property gets the number of devices stored in the collection. IDL [propget, id(3), helpstring("property Count")] HRESULT Count([out, retval] long *pVal); DATA TYPE LONG POSSIBLE VALUES Read only property EXAMPLE ... Dim DevicesObject as Devices Dim NumDevs as Long ... Set DevicesObject = RFNCCTL.Devices NumDevs = DevicesObject.Count ... NumDevs = RFNCCTL.
5 STAR-LINK™ PROPERTY DATALEN PURPOSE Gets the length in bytes of data set in DeviceData property. DESCRIPTION This property may be only read and provides the length in bytes of data sent from a device. This property is allowed only when working in the DataEvent handler.
DEVICE COLLECTION OBJECT 5 EXAMPLE ... Private Sub RFNCCTL_DataEvent(ByVal SatID DevID As Integer, ByVal Kind As Boolean) On Error Resume Next Dim item As ListItem Dim sDevice As Device Dim strAnswer As String Dim vaData As Variant Dim strData As String Dim byteData As Byte Dim i As Integer As Integer, ByVal Set sDevice = OCX.Devices.Device(DevID) vaData = sDevice.DeviceData ' 'Data interpretation ' strData = "" If OCX.
5 STAR-LINK™ PROPERTY DEVICE PURPOSE Gets a device object from the collection. DESCRIPTION This property gets a device object from the collection. You must set the DevID of the desired device. IDL [propget, id(4)] HRESULT Device([in]VARIANT DevID, [out, retval] IDevice **pVal); INPUT PARAMETERS SatID : Short The ID of desired device object. DATA TYPE Pointer to dispatch the object interface. POSSIBLE VALUES Read only property EXAMPLE ... Dim DevicesObject as Devices Dim DevObject as Device ...
DEVICE COLLECTION OBJECT 5 PROPERTY DEVICEDATA PURPOSE Gets data from a device. DESCRIPTION This property may be only read and represents data received from a device. This property is allowed only when working in the DataEvent handler.
STAR-LINK™ 5 EXAMPLE ... Private Sub RFNCCTL_DataEvent(ByVal SatID DevID As Integer, ByVal Kind As Boolean) On Error Resume Next Dim item As ListItem Dim sDevice As Device Dim strAnswer As String Dim vaData As Variant Dim strData As String Dim byteData As Byte Dim i As Integer As Integer, ByVal Set sDevice = OCX.Devices.Device(DevID) vaData = sDevice.DeviceData ' 'Data interpretation ' strData = "" If OCX.
DEVICE COLLECTION OBJECT 5 PROPERTY ITEM PURPOSE Gets a device object from the collection. DESCRIPTION This property gets a device object from the collection. You must set an index representing the offset in the array used to store all the device objects (the array is 0-based). IDL [propget, id(DISPID_VALUE)] HRESULT Item([in]long Index, [out, retval] VARIANT *pVal); INPUT PARAMETERS Index : Long The index of the array element used to store the collection of devices.
STAR-LINK™ 5 5.2 METHODS METHOD ADD PURPOSE Adds a device object. DESCRIPTION This method adds a device object to the collection. You may add devices with their ID between 0 and 1999. IDL [id(1), helpstring("method Add")] HRESULT Add(VARIANT DevID, [out, retval] IDevice **pVal) INPUT PARAMETERS DevID: Short The ID of device object to be added. OUTPUT VALUE Pointer to dispatch the interface of the object just added. EXAMPLE ... Dim DevObject as Device ...
DEVICE COLLECTION OBJECT 5 METHOD CLEAR PURPOSE Clears the collection. DESCRIPTION This method removes all the devices from the collection. IDL [id(5), helpstring("method Clear")] HRESULT Clear(); INPUT PARAMETERS None OUTPUT VALUE None EXAMPLE ... ‘ Remove all devices from the collection RFNCCTL.Devices.Clear ...
5 STAR-LINK™ METHOD REMOVE PURPOSE Removes a device object. DESCRIPTION This method removes a device object from the collection. If the device does not exist, the function fails. IDL [id(2), helpstring("method Remove")] HRESULT Remove([in]VARIANT SatID); INPUT PARAMETERS SatID: Short The ID of device object to be removed. OUTPUT VALUE None EXAMPLE ... Dim DevObject as Sat ... Set DevObject = RFNCCTL.Device.Add(1500) DevObject.DataWrite “foo string data” ...
BASE STATION OBJECT 6 6 BASE STATION OBJECT 6.1 PROPERTIES PROPERTY BAUDRATERF PURPOSE Indicates the radio baud rate. DESCRIPTION This property sets the radio baud rate value between the base station and the device.
6 STAR-LINK™ PROPERTY BAUDRATERS PURPOSE Indicates the serial communication baud rate. DESCRIPTION This property sets the RS232 and RS485 baud rate between the base station and the host PC. IDL [propget, id(6), helpstring("property BaudRateRS")] HRESULT BaudRateRS([out, retval] long *pVal); [propput, id(6), helpstring("property BaudRateRS")] HRESULT BaudRateRS([in] long newVal); DATA TYPE LONG POSSIBLE VALUES 300; 600; 1200; 2400; 9600; 19200; 38400; 57600; 115200 EXAMPLE ...
BASE STATION OBJECT 6 PROPERTY DIRECT This property is reserved. PROPERTY ENABLED PURPOSE Enables/disables the base station. DESCRIPTION This property enables or disables the base station. When the base station is disabled, it enters a particular state (OFF state) and is not polled by the network control thread. This property is useful during the network data collection, since at polling start up all base stations should be already enabled (Enable = TRUE).
6 STAR-LINK™ PROPERTY FRAMELIFE This property is reserved. PROPERTY INTERFACE PURPOSE Indicates the base station function mode. DESCRIPTION This property sets the RS232 or RS485 interface. If it is set to 0 the RS485 interface is selected; while the 1 value selects the RS232 one.
BASE STATION OBJECT 6 PROPERTY MAXBACKOFF This property is reserved. PROPERTY MINBACKOFF This property is reserved. PROPERTY PID PURPOSE Product ID DESCRIPTION This property is set from the DLL network manager and represents an ID of the product. Each Datalogic RF product has a different ID.
6 STAR-LINK™ PROPERTY POWERSAVE This property is reserved. PROPERTY PREAMBLELENGTH This property is reserved. PROPERTY RFMAXPROTOCOLVERSION PURPOSE RF Version. DESCRIPTION This property is set from the DLL network manager and represents the major version of the RF protocol.
BASE STATION OBJECT 6 EXAMPLE ... Dim SatObject as Sat Dim strProperties as String ... ‘ Show the base station properties Set SatObject = RFNCCTL.Satellites.Satellite(1500) StrProperties = strProperties & “SatID = “& _ CStr(SatObject.SatID) StrProperties = strProperties & “PID = “ & CStr(SatObject.PID) StrProperties = strProperties & “RF Version = “ &_ CStr(SatObject.RFMaxProtocolVersion) & “.”& _ CStr(SatObject.RFMinProtocolVersion) ...
6 STAR-LINK™ PROPERTY RFMINPROTOCOLVERSION PURPOSE RF Version. DESCRIPTION This property is set from the DLL network manager and represents the minor version of the RF protocol. IDL [propget, id(5), helpstring("property RFMinProtocolVersion")] RFMinProtocolVersion([out, retval] short *pVal); [propput, id(5), helpstring("property RFMinProtocolVersion")] RFMinProtocolVersion([in] short newVal); HRESULT HRESULT DATA TYPE SHORT POSSIBLE VALUES Greater than 0 EXAMPLE ...
BASE STATION OBJECT 6 PROPERTY RXFREE, RXTOTAL, TXFREE, TXTOTAL PURPOSE Gets the size of free receiving buffer on STARGATE™. DESCRIPTION This property is set from the DLL network manager with data sent by STARGATE™.
6 STAR-LINK™ EXAMPLE ... Dim SatObject as Sat ... ‘ Get base station configuration Set SatObject = RFNCCTL.Satellites.Satellite(1500) SatObject.GetStatus ... ‘ ‘ Get Status Event Handler ‘ Private Sub RFNCCTL_StatusEvent(ByVal SatID As Integer) On Error GoTo ErrStatus Dim sSat As Sat Dim strMsg As String Set sSat = RFNCCTL.Satellites.Satellite(SatID) StrMsg = "" strMsg = strMsg & "Rx Free : " & sSat.RxFree & Chr(10) strMsg = strMsg & "Tx Free : " & sSat.
BASE STATION OBJECT 6 PROPERTY SATID PURPOSE Gets the base station ID. DESCRIPTION This property gets and sets the base station ID. It is very important, since the network data collection involves only the base stations having an ID. IDL [propget, id(1), helpstring("property SatID")] HRESULT SatID([out, retval] short *pVal); [propput, id(1), helpstring("property SatID")] HRESULT SatID([in] short newVal); DATA TYPE SHORT POSSIBLE VALUES 0 .. 1999 EXAMPLE ...
6 STAR-LINK™ PROPERTY NEWSATID PURPOSE Indicates the new ID to be assigned to a base station. DESCRIPTION This property sets the new ID to assign to the base station. This ID will be active after calling the SetConfiguration() method. IDL [propget, id(24), helpstring("property NewSatID")] HRESULT NewSatID([out, retval] short *pVal); [propput, id(24), helpstring("property NewSatID")] HRESULT NewSatID([in] short newVal); DATA TYPE SHORT POSSIBLE VALUES 0 .. 1999 EXAMPLE ...
BASE STATION OBJECT 6.2 6 METHODS METHOD ALIVE PURPOSE Calls a base station. DESCRIPTION This method calls a base station to know if it is alive or not. When sending an alive command to a base station present and operating in the network, it will answer with a particular string. This command is totally asynchronous and managed through a secondary thread which causes the STAR-Link™ ActiveX to answer with an event called AliveEvent containing the base station string information.
6 STAR-LINK™ METHOD GETCONFIGURATION PURPOSE Gets a base station configuration. DESCRIPTION This method asks for the base station configuration. When sending this command to an alive base station, it will answer with its configuration based on the related property. This command (like Alive command and next command) is totally asynchronous, managed through a secondary thread which causes the STAR-Link™ ActiveX to answer with an event called SatCfgEvent.
BASE STATION OBJECT 6 EXAMPLE ... Dim SatObject as Sat ... ‘ Get base station configuration Set SatObject = RFNCCTL.Satellites.Satellite(1500) SatObject.GetConfiguration ... ‘ ‘ Get Configuration Event Handler ‘ Private Sub RFNCCTL_ SatCfgEvent(ByVal SatID As Integer) On Error Resume Next Dim StrCfg as String Dim SatelliteObject as Sat StrCfg = “” StrCfg = StrCfg & “Satellite ID “ & CStr(SatID) & Chr$(10) Set SatObject = RFNCCTL.Satellites.Satellite(SatID) StrCfg = StrCfg & “PID“ & CStr(SatObject.
6 STAR-LINK™ METHOD GETSTATUS PURPOSE Gets the base station status. DESCRIPTION This method asks for the base station input/output buffer state. If this command is sent to an alive base station, it will answer by setting the four properties RxFree, TxFree, RxTotal and TxTotal containing the number of bytes free and the total number of the two base station buffers. This command is totally asynchronous (like the others) and the STAR-Link™ ActiveX answers with an event called StatusEvent.
BASE STATION OBJECT 6 EXAMPLE ... Dim SatObject as Sat ... ‘ Get base station configuration Set SatObject = RFNCCTL.Satellites.Satellite(1500) SatObject.GetStatus ... ‘ ‘ Get Status Event Handler ‘ Private Sub RFNCCTL_StatusEvent(ByVal SatID As Integer) On Error GoTo ErrStatus Dim sSat As Sat Dim strMsg As String Set sSat = RFNCCTL.Satellites.Satellite(SatID) StrMsg = "" strMsg = strMsg & "Rx Free : " & sSat.RxFree & Chr(10) strMsg = strMsg & "Tx Free : " & sSat.
6 STAR-LINK™ METHOD SETCONFIGURATION PURPOSE Sets the base station configuration. DESCRIPTION This method sets new configuration parameters. Be careful while setting the parameters because a wrong configuration causes an incorrect operation of the base station. Since the SetConfiguration method updates all the base station parameters, it is advised to follow the given procedure to change or update some of the base station properties: 1.
DEVICE OBJECT 7 7.1 7 DEVICE OBJECT PROPERTIES PROPERTY BUFFERSIZE This property is reserved. PROPERTY DEVID PURPOSE Gets or sets the device ID. DESCRIPTION This property gets or sets the device ID. IDL [propget, id(1), helpstring("property DevID")] HRESULT DevID([out, retval] short *pVal); [propput, id(1), helpstring("property DevID")] HRESULT DevID([in] short newVal); DATA TYPE SHORT POSSIBLE VALUES Greater than 1 EXAMPLE ... Dim DevObject as Device Set DevObject = RFNCCTL.Devices.Add(1500) ...
7 STAR-LINK™ PROPERTY ENABLED PURPOSE Enables or disables the device. DESCRIPTION By setting off a device, it does not send any data event to the container. The network thread keeps on receiving the device data, but it does not process it.
DEVICE OBJECT 7 PROPERTY PID PURPOSE Product ID. DESCRIPTION This property is set from the DLL network manager and represents an ID of the product. Each Datalogic RF product has a different ID.
7 STAR-LINK™ PROPERTY RFMAXPROTOCOLVERSION PURPOSE RF Version. DESCRIPTION This property is set from the DLL network manager and represents the major version of the RF protocol. IDL [propget, id(4), helpstring("property RFMaxProtocolVersion")] RFMaxProtocolVersion([out, retval] short *pVal); [propput, id(4), helpstring("property RFMaxProtocolVersion")] RFMaxProtocolVersion([in] short newVal); HRESULT HRESULT DATA TYPE SHORT POSSIBLE VALUES Greater than 1 EXAMPLE ...
DEVICE OBJECT 7 PROPERTY RFMINPROTOCOLVERSION PURPOSE RF Version. DESCRIPTION This property is set from the DLL and represents the minor version of the RF protocol. IDL [propget, id(4), helpstring("property RFMaxProtocolVersion")] RFMaxProtocolVersion([out, retval] short *pVal); [propput, id(4), helpstring("property RFMaxProtocolVersion")] RFMaxProtocolVersion([in] short newVal); HRESULT HRESULT DATA TYPE SHORT POSSIBLE VALUES Greater than 1 EXAMPLE ...
STAR-LINK™ 7 7.2 METHOD METHOD DATAWRITE PURPOSE Sends data to a device. DESCRIPTION This method sends data as a string to a particular device. This operation is allowed only when working in the DataEvent handler. If the DataWrite command is not right, the control sends an error event (ErrorEvent). The possible values for the vt data parameter of this method are: VT_BSTR, VT_UI1, VT_I2, VT_I4, VT_R4, VT_R8.
DEVICE OBJECT 7 EXAMPLE ... ... ‘ ‘ Data Event Handler In this example if kind value is TRUE ‘ the frame is two ways, so ‘ the device is waiting for a response from the PC ‘ Private Sub RFNCCTL _DataEvent(ByVal SatID As Integer, ByVal DevID As Integer, ByVal Kind As Boolean) On Error Resume Next Dim item As ListItem Dim sDevice As Device Dim vaData As Variant Dim strData As String …… Set sDevice = OCX.Devices.Device(DevID) vaData = sDevice.
STAR-LINK™ 8 8 ERROR CODES 8.
ERROR CODES 8.
STAR-LINK™ 8 8.3 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 8.
PROPERTY PAGES 9 9.1 9 PROPERTY PAGES GENERAL CONTROL PROPERTIES This folder allows setting the communication parameters.
STAR-LINK™ 9 9.2 COLLECTION PROPERTIES This folder allows defining the number of base stations or devices of each collection. Adding and removing a base station or a device requires to click on the Apply button in order to update the collections.
PROGRAMMING EXAMPLES A PROGRAMMING EXAMPLES A.1 STAR-Link™ VISUAL BASIC 6.0 EXAMPLE A This example is a simple program based on STAR-Link™ ActiveX, that allows to: − configure an RS485 base station network or a single base station in RS232 − save/load a network configuration from file (file RFNCCTL.CFG) − start/stop PC/base station data collection − collect data in a list − write the main network events in a log file (file NRFCCTL.
STAR-LINK™ A The Load and Save features may be also enabled manually either by selecting the corresponding options from the Settings menu (see par. A.1.2 for details) or by enabling the DeviceInfoEvent() each time a new device is registered within the network (see par. 2.3).
PROGRAMMING EXAMPLES A A.1.1 Network Menu The Network menu provides the following options: − Open: starts the PC/base station data collection displayed in the data sheet. It icon. Before starting the collection a can be also chosen by clicking on the dialog box appears allowing to load a system configuration previously saved. − Close: ends the PC/base station data collection. It can be also chosen by icon.
STAR-LINK™ A A.1.2 Settings Menu Before starting the data collection, configure the network by means of the menu options as follows: − Set the address and the interface (RS-232 or RS-485) of each base station; − Set the address of each device sending data packets to the base stations; − Set the serial port parameters; − Save/Load the network configuration and parameters, if desired.
PROGRAMMING EXAMPLES A Add button: adds a new base station in the network once its address (SatID) has been inserted in the edit box positioned on the upper right side of the dialog box (in Figure 7 the base station ID is 1500). Remove button: removes one or more specific base stations or the first one from the list if no base station has been selected. It possible to selected the base station(s) to be removed by ticking the corresponding check box. Clear button: removes all base stations from the list.
STAR-LINK™ A Status button: shows the state of the receiving and transmission buffer of the selected base station (or the first one of the list if no base station has been selected). Exit button: closes the dialog and saves the network configuration for the current session. It is possible to save the configuration to file by selecting the Save Configuration option from the Settings menu.
PROGRAMMING EXAMPLES A Exit button: saves changes for the current session and closes the dialog box. It is possible to save the configuration to file by selecting the Save Configuration option from the Settings menu. PID and RF Version provide information the program gets from the first frame sent by the device to the network. − Load configuration: gets the network configuration from the RFNCCTL.CFG icon. The corresponding file.
STAR-LINK™ A This option can be also chosen by clicking on the icon. Figure 11 - Control settings Apply button: saves changes before closing the dialog. OK button: saves and closes the dialog. − 100 Configuration path: sets the RFNCCTL.CFG path. Load and Save commands search for the RFNCCTL.CFG in the indicated path.
PROGRAMMING EXAMPLES A A.1.3 Action Menu The Action menu provides the following options: − Show log: opens the NRFCCTL.LOG file reporting the most important network actions. − Background data collection: reduces the running program to an icon on the Windows toolbar. − Always on top: causes the program window to be always in foreground. − Show long code (PDF417): opens a dialog box showing data of codes read by a Gryphon™ M200 including those containing more than 240 characters (ex.
STAR-LINK™ A Example of message reconstruction from Gryphon™ M200 This is a simple example providing the RF device and radio protocol configuration to reconstruct a message containing more than 240 characters and split into different data packets. Since the data packets transmitted during each transaction consist of a maximum of 240 characters, it is necessary to split the original message into several data packets when reading a code having more than 240 characters.
PROGRAMMING EXAMPLES A A.1.5 Warning Messages In the following cases a warning dialog box to be set by the user appears: 1. if some data packets have been lost, the program opens a dialog box asking if the data collected in the base station after the loss should be sent to the PC or be deleted. For more details see par. 3.2 and par. 3.3, in particular tLostFrameBehaviour, GetLostFrameBehaviour, LostFrame method and LostFrameEvent event. Figure 13 - Lost frame warning 2.
STAR-LINK™ A A.2 STAR-Link™ EXCEL 97 EXAMPLE This is a simple example of configuration and data collection based on STAR-Link™ ActiveX. A VBA macro uses OpenNetwork, CloseNetwork, Network Status methods, Device DataWrite method, DataEvent and ErrorEvent exported by STAR-Link™ ActiveX (see pars. 3.1, 3.2, 3.3 and 7.2 ). To open the Excel sheet implementing the example click on the "Enable Macros" button of the opening dialog box.
PROGRAMMING EXAMPLES A On the right side there are four buttons and an edit box: − Network Status button: shows if the network data collection is in progress or not (idle); − Clear Data button: removes all data frames collected in the Data column; − Open Network button: starts the base station data collection; − Close Network button: stops the base station data collection. − Answer two way mode edit box: contains the string to be sent back to each device waiting for an answer from the PC. A.2.
STAR-LINK™ A Once the Visual Basic Application project has been opened, the following window appears: Design mode icon Custom icon Figure 17 - Application project 106
PROGRAMMING EXAMPLES A By double-clicking on the Custom item of the ActiveX object in the project, the following dialog box appears: Figure 18 - Property window These property pages (base stations and device collections, general properties) allow setting the network configuration, which can be saved by proceeding as follow: − Click on the Apply button; − Close the VBA; − Return to the Excel data sheet; − Save the configuration by selecting the Save option from the File menu; − Activate the macro
STAR-LINK™ A A.3 STAR-Link™ ACCESS 97 EXAMPLE The example is a simple Access program based on STAR-Link™ ActiveX. It allows configuring the base station and device network and collecting data and quantity.
PROGRAMMING EXAMPLES A A.3.
A STAR-LINK™ A.3.2 Other Masks By choosing DataCollect or Product from the mask folder and clicking on the Open button, you get the following information: − Data Collected: it is a database consisting of data packets and device information sent by the devices. The progressive ID, DevID, Data, Quantity, Date fields are displayed on the left side of the MainFrom window. The Quantity field is incremented every time a device sends the same data packet.
PROGRAMMING EXAMPLES A.4 A STAR-Link™ C++ BUILDER 5 EXAMPLE The example is a simple program based on STAR-Link™ ActiveX, that allows to: − configure an RS485 base station network or a single base station in RS232 − save/load a network configuration from file (file RFNCCTL.CFG) − start/stop PC/Base station data collection − collect data in a list − write the main network events in a log file (file NRFCCTL.
STAR-LINK™ A A.5 STAR-Link™ DELPHI 6 EXAMPLE The example is a simple program based on STAR-Link™ ActiveX, that allows to: − add base stations and devices to the network − save/load a network configuration from file (file RFNCCTL.CFG) − start/stop PC/Base station data collection − collect data in a list − write the main network events in a log file (file NRFCCTL.LOG) The main STAR-Link™ ActiveX events implemented in this example are: DataEvent, ErrorEvent, AliveEvent.
CONTROL INTERFACE B B CONTROL INTERFACE This .idl file provides an integral interface exposed from the control in IDL notation. /****************************************** * Name ......................... NRFCCTLControl.idl * -----------------------------------------------------------* Author ....................... bFM * Date ......................... 12/04/02 * Description .................. IDL source for NRFCCTLControl.
STAR-LINK™ B [propget, id(7), helpstring("property TimeOut")] HRESULT TimeOut([out, retval] short *pVal); [propput, id(7), helpstring("property TimeOut")] HRESULT TimeOut([in] short newVal); [id(8), helpstring("method OpenLine")] HRESULT OpenLine([out, retval] VARIANT_BOOL *retVal); [id(9), helpstring("method CloseLine")] HRESULT CloseLine([out, retval] VARIANT_BOOL *retVal); [id(11), helpstring("method Load")] HRESULT Load([optional]VARIANT Path,[out, retval] VARIANT_BOOL *retVal); [id(12), helpstring("m
CONTROL INTERFACE B [id(6), helpstring("method SleepSatEvent")] HRESULT SleepSatEvent(short SatID, short Status); [id(7), helpstring("method LostFrameEvent")] HRESULT LostFrameEvent(short DevID, long NumLostFrame); [id(8), helpstring("method DeviceInfoEvent")] HRESULT DeviceInfoEvent(short DevID); }; [ object, uuid(CF802152-0D60-11D5-A274-005004C31B96), dual, helpstring("ISats Interface"), pointer_default(unique) ] interface ISats : IDispatch { [propget, id(DISPID_NEWENUM)] HRESULT _NewEnum([out, retval]
STAR-LINK™ B [propput, id(8), helpstring("property BufferSize")] HRESULT BufferSize([in] short newVal); [propget, id(9), helpstring("property BufferThreshold")] HRESULT BufferThreshold([out, retval] short *pVal); [propput, id(9), helpstring("property BufferThreshold")] HRESULT BufferThreshold([in] short newVal); [propget, id(10), helpstring("property Direct")] HRESULT Direct([out, retval] BOOL *pVal); [propput, id(10), helpstring("property Direct")] HRESULT Direct([in] BOOL newVal); [propget, id(11), help
CONTROL INTERFACE B ] interface IDevices : IDispatch { [propget, id(DISPID_NEWENUM)] HRESULT _NewEnum([out, retval] LPUNKNOWN *pUnk); [propget, id(DISPID_VALUE)] HRESULT Item([in]long Index, [out, retval] VARIANT *pVal); [id(1), helpstring("method Add")] HRESULT Add(VARIANT DevID, [out, retval] IDevice **pVal); [id(2), helpstring("method Remove")] HRESULT Remove(VARIANT DevID); [propget, id(3), helpstring("property Count")] HRESULT Count([out, retval] long *pVal); [propget, id(4)] HRESULT Device([in]VARIA
STAR-LINK™ B }; [ uuid(CF802153-0D60-11D5-A274-005004C31B96), helpstring("Sats Class") ] coclass Sats { [default] interface ISats; }; [ uuid(CF802155-0D60-11D5-A274-005004C31B96), helpstring("Sat Class") ] coclass Sat { [default] interface ISat; }; [ uuid(5950285C-0E22-11D5-A274-005004C31B96), helpstring("Devices Class") ] coclass Devices { [default] interface IDevices; }; [ uuid(5950285E-0E22-11D5-A274-005004C31B96), helpstring("Device Class") ] coclass Device { [default] interface IDevice; }; [ uuid(AF00