Synel Industries Ltd.

Synel Industries Ltd.
DLL Manual
Synel Industries Ltd.
15/6/08
Catalogue number: 660002
Document number: SYNDLL-222-06
SynDLL
1.
About the DLL Interface
The Synel SY terminal series has the capability of interacting with the PC via a local port. This port is
connected either via modem, TCP/IP or UDP, the data transfer is software configurable.
The Syndll.dll is intended to simplify the handling of the communication protocols. A DLL is a library
consisting of software functions that can be loaded and used by a program running on your Windows
computer. The dll can be used to quickly create applications from within a wide variety of
programming environments.
1.1.
int
word
string
1.2.
Conventions
- 32 bits (32 bits platform)
- 16 bits (unsigned short)
- null terminated C-style array of characters
Programming with the DLL Overview
Synel’s terminals can be interfaced using applications which were developed under Microsoft
Windows 95, 98,2000 or NT environment. The interfacing is accomplished by linking an application
with the Dynamic Link Library (DLL) and Communicating with the terminal. The following
paragraphs give some examples of how to incorporate the dll functions within different programming
environments. The dll was created in C++ language calls are provided to aid the programmer in the
development of software.
1.3.
Loading DLL
To install it, just drop the MODEMFUN.DLL and SYNDLL.DLL into a folder on your hard drive.
Load only the SYNDLL.DLL, when the DLL is needed. It is called for by a running application and
are loaded to provide additional functionality.
1.3.1. Visual Fox Pro (VFP)
The method of accessing the functions from the DLL under Fox. In this case, you need to define
functions:
SET LIBRARY TO foxtools.fll ADDITIVE
If File("syndll.dll") = .t.
DECLARE INTEGER DLL_Init IN syndll.dll INTEGER __yes,;
STRING @datafile
DECLARE INTEGER SetLocalPort IN syndll.dll;
INTEGER PortNum,;
STRING @setpar,INTEGER retry,INTEGER timeout
DECLARE INTEGER SetTCPPort IN syndll.dll INTEGER PortNum,;
STRING @setpar,INTEGER retry,INTEGER time_out
DECLARE INTEGER CloseLocalPort IN syndll.dll
DECLARE INTEGER CloseTCPPort IN syndll.dll
DECLARE INTEGER SynGetStatus IN syndll.dll INTEGER term_no, ;
STRING @status_buffer
Synel Industries Ltd.
2
SynDLL
DECLARE INTEGER SynGetDataACK IN syndll.dll INTEGER term_no, ;
STRING @data_buffer
DECLARE INTEGER SynGetDataClear IN syndll.dll INTEGER term_no, ;
STRING @data_buffer
DECLARE INTEGER SynBufferReset IN syndll.dll INTEGER term_no
DECLARE INTEGER SynClear IN syndll.dll INTEGER term_no
DECLARE INTEGER SynClearByDate IN syndll.dll INTEGER term_no, ;
STRING @status_buffer
DECLARE INTEGER SynSetDateTime IN syndll.dll INTEGER term_no, ;
STRING @status_buffer ,STRING @status_2
DECLARE INTEGER SynProg IN syndll.dll INTEGER term_no, ;
STRING @status_buffer
DECLARE INTEGER SynDelAll IN syndll.dll INTEGER term_no
DECLARE INTEGER SynOneTable IN syndll.dll INTEGER term_no, ;
STRING @status_buffer
Endif
Synel Industries Ltd.
3
SynDLL
2.
The Application Program Interface (API)
The API programming interface was created so developers could quickly and easily incorporate the
application into their products. Future versions of the DLL may contain additional API’s within it. The
following describes each of the functions available in the API. The function descriptions are arranged
by function name, and include the details of the parameters passed in as well as the return codes. All
pointers passed into the functions assume that the calling routine has pre- allocated the necessary
memory. Memory over- writes and/or exceptions will result if you do not pre- allocate your variables.
Also specialized data types and error codes.
2.1.
Various modem INIT strings
A INITialization string sets up the modem for operation with your communication software. The
INITialization string could vary greatly depending on software requirements.
The INITialization String Can:
1.
Turn error correction ON or OFF. (On models that support hardware error correction/
compression).
2.
Limit the top speed that the modem will attempt. (On high speed 14,400bps and above models).
3.
Change the way the modem responds. (Numeric or verbal responses, Connect message at DTE
or DCE rate, etc.).
4.
Turn off dial tone detection to allow the modem to dial when the dial tone is not a standard
frequency and thus not detected as a dial tone by the modem.
Communicating via various modems requires to specify an INIT string, as listed:
ModemName
780A/7xx ISO MODEM
BOCA 14400
BOCA 33600
BOCA 56000
Dynamode 33600
Zoltrix 33600
BOCA 14400
BOCA 33600
BOCA 56000
Dynamode 33600
Zoltrix 33600
DAVICOM Modem
Inernal 33600 Data/FAX/Voice
DAVICOM Modem Inernal 33600 Data/
FAX/Voice
ModemName
Synel Industries Ltd.
Baud
rate
14,400
1200
ModemInit
&FE0V1
"&FE0V1X4&C1&D2%C0%E0S37=5N0\
N1&Q0H0"
2400
"&FE0V1X4&C1&D2%C0%E0S37=6N0\
N1&Q0H0"
1200
"&FE0N0&M0\N1%C0*Q0*N0H0"
2400
"&FE0N0&M0\N1%C0*Q0*N1H0"
Baud
rate
ModemInit
4
SynDLL
Dynamode 33600 for terminal modem
1200
Dynamode 33600 for terminal modem
2400
GVC External modem 33600 for terminal
modem
GVC External modem 33600 for terminal
modem
GVC External modem 33600 for terminal
modem
USRobotics 56600, GVC,TexasInstruments 33600
USRobotics 56600, GVC,TexasInstruments 33600
HSP-MicroModem PNP 56000
1200
HSP-MicroModem PNP 56000
2400
MICROCOM 33600, 56000 External OfficePopte Voice Modem
MICROCOM 33600, 56000 External OfficePopte Voice Modem
LUCENT Tehnology. (np)
Motorola V.34 28800 bps FAX Modem for
terminal
Motorola V.34 28800 bps FAX Modem for
terminal
Motorola 33600 bps Modem for Terminal
Motorola 33600 bps Modem for Terminal
PCI56RVP+ Modem
1200
PCI56RVP+ Modem
2400
Rockwell modem for Phantom baud
Rockwell modem for Phantom baud
Accura 28.8 - Maven
Accura 28.8 - Maven
1200
2400
1200
2400
Synel Industries Ltd.
1200
"&FE0V1X4&C1&D2%C0%E0S37=5N0\
N1&Q0H0"
"&FE0V1X4&C1&D2%C0%E0S37=6N0\
N1&Q0H0"
"&FE0V1X4&C1&D2%C0%E0\
N1&Q0S37=5N0H0"
"&FE0V1X4&C1&D2%C0%E0\
N1&Q0S37=6N0H0"
"&FE0V1X4&C1&D2%C0%E0\
N1&Q0S37=9N0H0"
"&FV1E0&A0&K0&M0&N2&B1H0"
2400
"&FV1E0&A0&K0&M0&N3&B1H0"
1200
2400
1200
ModemInit="&FE0V1X4&C1&D2%C%E\N0\
K0S37=4N0"
ModemInit="&FE0V1X4&C1&D2%C%E\N0\
K0S37=6N0"
"&FEV1X4&C1&D2%C%E\
N1&QS37=5N&k"
"&FEV1X4&C1&D2%C%E\
N1&QS37=6N&k"
"&FX"
"&FEX4%C\N1\Q-j/034HS37=5N"
2400
"&FEX4%C\N1\Q-j/034HS37=6N"
1200
2400
1200
"&FEX4%C&A&H6%Q\B3\G\N1\Q\T3"
"&FEX4%C&A&H6%Q\B3\G\N1\Q\T4"
"&FE%E+DS=0+ER=0+MS=V22B,0,1200,120
0,1200,1200"
"&FE%E+DS=0+ER=0+MS=V22B,0,2400,240
0,2400,2400"
"&FE0\N0&M0%E0%C0-K0S37=5N0"
"&FE0\N0&M0%E0%C0-K0S37=6N0"
"&FEV1X4&C1&D2&QS37=5N&k"
"&FEV1X4&C1&D2&QS37=6N&k"
2400
9600
1200
5
SynDLL
3.
DLL sequence
The library consists of functions which are implemented via Synel’s Communication Protocol. Most of
the functions indicates a success when return code is transmitted or a failure when an error code is
returned. There are four working modes when opening the ports; local, modem, TCP/IP and UDP.
Working with more than one opened port in parallel is not allowed. The work sequence includes
opening a specific port, sending commands and then closing the port prior opening a new port.
The following block diagrams describes functions sequence:
3.1.
DLL initialization
DLL_Int
debug_com=1
Building init log file
debug_com=0
Not
Building init log file
delet_file=1
delet_file=0
Delete log
file
Store log
file
Return=0
DLL was initialized
Synel Industries Ltd.
Error code
Initialization failed
6
SynDLL
3.2.
Opening communication port
SetLocalPort
Sends communication parameters
Port
Set parameters
Timeout
Retries
3.3.
Return=0
Error code
Communication port is available
Port opening failed
Receive terminal status
SynGetStatus
•
•
•
•
•
Testing communication
Recieve terminal parameters
Buffer size
Date and time stored in the terminal
Action; exit/entrance
Return=0
Terminal status
is transmitted
Synel Industries Ltd.
Error code
Communication failure
7
SynDLL
3.4.
Linear terminals data collection
DLL_Int
SetLocalPort
LinInit
LinGetClockData
Return=1
LinGetTrnas
Additional
transaction
Error code
Return=0
Return=1
No Transactions
LinMarkTrnas
DLL_Free
Synel Industries Ltd.
8
SynDLL
3.5.
Data collection stored for further collection
DLL_Int
SetLocalPort
SynGetDataACK
No
Return=1
No
Return=0
Error
Yes
Store Data
in a file
Yes
SynClear
Clears data from memory
on request
DLL_Free
Synel Industries Ltd.
9
SynDLL
3.6.
Re-Collecting the stored data
This can be performed only if the SynClearData is not executed.
DLL_Int
SetLocalPort
SynBufferReset
SynGetDataACK
No
No
Error
Return=0
Return=1
Yes
Store Data
in a file
Yes
SynClear
Clears data from memory
on request
DLL_Free
Synel Industries Ltd.
10
SynDLL
3.7.
Programming
SynProg
Terminal ID
Table path
Synel Industries Ltd.
Return=0
Error code
Terminal
Reprogramming
succeeded
No programming
11
SynDLL
4.
Function Usage
In UDP/TCP communication the disconnection timeout defined in the
terminal must exceed the time interval between commands (defined by
the application programmer) !
4.1.
Internal DLL commands
DLL_Init
iint DLL_Init(int LDebugFile, int LDeteteFile, string DebugDirectory)
Description:
An initialization function. The communication between the PC and the terminal can be stored in a log
file.
Parameters:
LDebug_comm_file – An integer value which returns:
1– Specifies that the communication between the PC and the terminal is set to the specified file.
0 – Specifies that the communication between the PC and the terminal is not set to the specified file.
LDelete_file
1= Specifies that log file is deleted before a new log file will be created.
0= Specifies that log file is stored on the host computer,a log is added to the same file.
* Debug_File_Name – A pointer to a string holding the file path.
Return values:
0 – Initialization was successful.
less than zero – Initialization failed.
Example:
DLL_Init(1,0,””);
DLL_Init(1,0,"C:\TMP\SYNCOM.LOG");
If debug_comm_file == 1 and Debug_File_Name == "",
The specified file is directed to the current dll directory, file name syncom.log.
int SynProgressType - Optional
int __stdcall SynProgressType(int communication_win_type ,char *txt,int x,int y,int w,int z);
Description:
A window that enables the user to follow-up on the progress of communication commands.
Synel Industries Ltd.
12
SynDLL
Parameters:
communication_wi 0
n_type :(integer): 1
2
No progress window will be displayed for communication commands.
Communication progress windows will be displayed for all commands.
Communication progress windows will be displayed for programming
commands only (and when upgrading Firmware).
3
Communication windows progress will be displayed for long commands such as: sendtemplteLarge, GettemplateLarge, programming
and etc.
char *txt
Caption free text (will be displayed on the window).
int x,int y,int w,int z Positioning of the progress window on screen.
Return values:
0 – Initialization was successful.
less than zero – Initialization failed
Example:
intSynProgressType (0,"terminal 1,100,100,200,300);
DLL_Free
int DLL_Free( )
Description:
Free all memory resources when application run is terminated.
Return values:
0
Freeing memory was successful.
less than zero Freeing memory failed
Example:
DLL_Free();
InitParam
int InitParam(int recived_tcp_time_out,int multi_thread);
Description:
Waits the number of milliseconds specified by timeout for each reply from TCP/IP buffer.
Parameters:
recived_tcp_time_outAn integer value that specifies the timeout value, in mSec. Default = [0].
multi_thread An integer value that specifies If application uses threading
0=No (Default) 1=Yes.
Return values:
=0
Timeout definition was successful
less than zero Timeout definition failed
Example: (Borland C)
InitParam(60,1);
GetDLLVer
int GetDLLVer( )
Synel Industries Ltd.
13
SynDLL
Description:
Automatically updates and displays the current DLL version.
Return values:
=0 – Presentation is successful
less than zero – Presentation failed
Example: (Borland C)
GetDLLVer( );
4.2.
Connection Commands
SetTCPPort
int SetTCPPort(int Port, string Address, int TimeOut, int Retries)
Description:
Opens a connection channel via a TCP protocol enabling data transmission.
Parameters:
Port – An integer value which contains the communication port address.
Address – A pointer to a string value containing the IP address, which defines the characteristics of the
socket to be created.
TimeOut – An integer value which specifies the timeout value, in seconds.
Retries – An integer value which holds the number of retries for communication.
Return values:
0 – Setting the TCP port was successful.
less than zero – Setting the TCP port failed
Example:
SetTCPPort (5000,"010.001.001.200",3,3) (timeout in seconds)
SetTCPPortEx
int SetTCPPortEx(int Port, string Address, int TimeOut, int Retries, int TimeOutInMsec)
Description:
Opens a communication channel via a TCP protocol enabling parameter transmission, timeout can be
measured in seconds or miliseconds.
Parameters:
Port – An integer value which contains the communication port address.
Address – A pointer to a string value containing the IP address which defines the characteristics of the
socket to be created.
TimeOut – An integer value which specifies the timeout value depending on whether the
TimeOutInMsec parameter is true or false.
Retries – An integer value which holds the number of retries for communication.
TimeOutInMsec – An integer value which specifies the timeout value, in seconds or milliseconds.
1 - Specifies the timeout value in milliseconds.
0 - Specifies the timeout value in seconds.
Return values:
0 – Setting the TCP port was successful.
less than zero – Setting the TCP port failed
Synel Industries Ltd.
14
SynDLL
Examples:
SetTCPPortEx (5000,"010.001.001.200",3,3, 0 (timeout in seconds)
SetTCPPortEx (5000,"010.001.001.200",3000,3,1 (timeout in milliseconds)
CloseTCPPort
int CloseTCPPort( )
Description:
Free all resources, initialized in functions SetTCPPort( ).
Return values:
0 - Closing the TCP port was successful.
less than zero - Closing the TCP port failed.
SetUDPPort
NOTE: In the terminal you must define the host address as the Remote address!
int SetUDPPort (int Port,char * IP_address,int Timeout, int Retries)
Description:
Opens a communication channel via a UDP protocol enabling parameters transmission (measured in
sec. or msec).
Parameters:
Port - An integer value which contains the communication port address.
IP_address - A pointer to a string value which contains the IP address,
Timeout - An integer value which specifies the timeout value, in seconds.
Retries - An integer value which holds the number of retries for communication.
Return values:
0 - Setting the UDP port was successful.
less than zero - Setting the UDP port failed
Example:
SetUDPPort (5000,"010.001.001.200",3,3)
SetUDPPortEx
int SetUDPPortEx (int Port,char * IP_address,int Timeout, int Retries, int time_out_in_msec)
Description:
Opens a communication channel via a UDP protocol enabling parameters transmission. Timeout can be
measured in sec. or msec.
Parameters:
Port - An integer value which contains the communication port address.
IP_address - A pointer to a string value which contains the IP address,
Timeout - An integer value which specifies the timeout value depending if the
- time_out_in_msec is true or false.
Retries - An integer value which holds the number of retries for communication.
time_out_in_msec. - 1- An integer value which specifies the timeout value, in milliseconds.
- 0- An integer value which specifies the timeout value, in seconds.
Return values:
0 - Setting the UDP port was successful.
Synel Industries Ltd.
15
SynDLL
less than zero - Setting the UDP port failed
Examples:
SetUDPPortEx (5000,"010.001.001.200",3,3, 0 (timeout in seconds)
SetUDPPortEx (5000,"010.001.001.200",3000,3,1 (timeout in milliseconds)
CloseUDPPort
int CloseUDPPort( )
Description:
Free all resources, initialized in functions SetUDPPort( ).
Parameters:
None
Return values:
0 - Closing the UDP port was successful.
less than zero - Closing the UDP port failed
SetLocalPort
int SetLocalPort(int Port ,string SetParameters,int TimeOut ,int Retries)
Description:
Opens the port (init Port), sets the communication port number for the local port, when Port = (n).
Initializes necessary data structures to communicate with 1 out of the 8 PC COM ports; for COM1
Port=1 , COM2 port=2, up to COM8 port=8.
Sets the communication speed for the COM port initialized by function OpenPort.
Note: If the COM port is used by terminals with various communication rates, you must use
SetLocalPort every time you switch between the terminals. Refer to the terminal
communication protocol documentation for more information.
Parameters:
Port - An integer value which represents the communication port number for the local port.
* SetParameters - A pointer to a string value, which includes the following parameters:
Bd - terminal baud rate (300, 600, 1200, 2400, 4800, 9600, 19200 bps)
Pr = Parity mode (N- None, O= Odd, E= Even, M= Mark, S= Space),
Dt= Data bit (8 or 7),
St= Stop bit (1,2), used when you need to set the stop bit at the value of 1.5, set Dt=5 and St=1.
TimeOut - An integer value which specifies the timeout value, in seconds.
Retries - An integer value which holds the number of retries for communication.
Return values:
0 - Setting the local port was successful.
less than zero - Setting the local port failed.
Example:
SetLocalPort (1,"9600,N,8,1",3,3)
SetLocalPortEx
int SetLocalPortEx(int Port, string SetParameters, int TimeOut,int Retries, int LTimeInMsec)
Description:
Opens the port (int Port), sets the communication port number for the local port, when Port = (n).
Synel Industries Ltd.
16
SynDLL
Initializes necessary data structures to communicate with 1 out of the 8 PC’s COM ports, for COM1
Port=1 , COM2 port=2, up to COM8 port=8.
Sets communication speed for the COM port initialized by function OpenPort.
Note: If the COM port is used by terminals with various communication rates, you must use
SetLocalPort every time you switch between the terminals. Refer to the terminal
communication protocol documentation for more information.
Timeout can be measured in seconds or miliseconds.
Parameters:
Port - An integer value which represents the communication local port number.
* SetParameters - A pointer to a string value, which includes the following parameters:
Bd = terminal baud rate (300, 600, 1200, 2400, 4800, 9600, 19200 bps)
Pr = Parity mode (N- None, O= Odd, E= Even, M= Mark, S= Space),
Dt= Data bit (8 or 7),
St= Stop bit (1,2) used when you need to set the stop bit at the value of 1.5, set Dt=5 and St=1.
TimeOut - An integer value which specifies the timeout value depending on whether the LTimeInMsec
parameter is true or false.
Retries - An integer value which holds the number of retries for communication.
LTimeInMsec - An integer value which specifies the timeout value, in seconds or milliseconds.
1 - An integer value which specifies the timeout value, in milliseconds.
0 - An integer value which specifies the timeout value, in seconds.
Return values:
0 - Setting the local port was successful.
less than zero - Setting the local port failed
Examples:
SetLocalPortEx (1,"9600,N,8,1",3,3, 0) (timeout in seconds)
SetLocalPortEx (1,"9600,N,8,1", 3000,3,1) (timeout in milliseconds)
CloseLocalPort
int CloseLocalPort( )
Description:
Free all resources, initialized in functions SetLocalPort( ).
Return values:
0 - Closing the local port was successful.
less than zero - Closing the local port failed
Synel Industries Ltd.
17
SynDLL
4.3.
Modem Commands
4.3.1. For Visual Basic users:
InstallModemParam
int InstallModemParam (string * Modem_Init),
int ModemTimeOutDial,
int ModemTimeOutWait,
string * ModemDial,
string * Prefix_str,
string * DialPrefix,
string * EscCodeSeq,
string * HangUp,
string * Reset_char,
string * ModemOKAns ,
string * ConnectAns,
string * ConnectAns2,
string * ModemHangScndAns)
Description:
Installs a modem, according to each parameter defintion.
Parameters:
charModem_Init [250]; // "&FE0V1X4&C1&D2%C0%E0S37=6N0\N1&Q0H0"
longModemTimeOutDial ;//30000
longModemTimeOutWait ;//3000
charModemDial[20];//”Telephon number”
charPrefix_str[4]; // "AT"
charDialPrefix[10]; // "DT"
charEscCodeSeq[20]; // "~~~+++"
charHangUp[20]; // "~~~ATH0"
charReset_char[20]; // "Z"
charModemOKAns[20]; // "OK"
charConnectAns[20]; // "CONNECT"
charConnectAns220]; // "CARRIER"
charModemHangScndAns[20]; // "NO CARRIER"
ModemInit - Initialises the modem.
ModemTimeOutDial - Defines the timeout for the dial operation connection in miliseconds.
ModemTimeOutWait - Defines the timeout to wait for the modem answer for another modem
commands in miliseconds.
ModemDial - number to dial
Prefix_str - Prefix string for init modem string.
DialPrefix - Prefix string for dial string.
EscCodeSeq - The escape characters switch from on-line mode to command mode while preserving the
connection with the on line modem.
HangUp - Instructs the modem to disconnect.
ResetChar - Indicates that the modem was reset to the stored settings.
Synel Industries Ltd.
18
SynDLL
ModemOKAns - Modem successfully executed a command line, defines the answer string.
ConnectAns - Connection made at the specified BPS rate, defines the answer string.
ConnectAns2 - Defines a string to hold the carrier rate.
ModemHangScndAns - Modem lost or could not detect a remote carrier signal within the Register
specified time.
Return values:
0 - modem installation was successful
less than zero - Installation failed
Example:
InstallModemParam("&FE0V1X4&C1&D2%C0%E0S37=6N0\N1&Q0H0",
30000,3000,"9936723",
"AT","DT","~~~+++","~~~ATH0",
"Z","OK","CONNECT","CARRIER","NO CARRIER");
InstallModemParamEx
int InstallModemParamEx(char * Modem_Init)
Description:
Same as int InstallModemParam but faster: Installs a modem, according to each parameters defintions.
HangupParamEx
int HangupParamEx (string * Modem_Init),
int ModemTimeOutDial,
int ModemTimeOutWait,
string * ModemDial,
string * Prefix_str,
string * DialPrefix,
string * EscCodeSeq,
string * HangUp,
string * Reset_char,
string * ModemOKAns ,
string * ConnectAns,
string * ConnectAns2,
string * ModemHangScndAns)
Description:
Hangs up the connection according to each modem parameter.
Parameters:
stringModem_Init [250]; // "&FE0V1X4&C1&D2%C0%E0S37=6N0\N1&Q0H0"
int ModemTimeOutDial ;//30000
int ModemTimeOutWait ;//3000
stringModemDial[20];//”Telephon number”
stringPrefix_str[4]; // "AT"
stringDialPrefix[10]; // "DT"
stringEscCodeSeq[20]; // "~~~+++"
stringHangUp[20]; // "~~~ATH0"
stringReset_char[20]; // "Z"
stringModemOKAns[20]; // "OK"
Synel Industries Ltd.
19
SynDLL
stringConnectAns[20]; // "CONNECT"
stringConnectAns220]; // "CARRIER"
stringModemHangScndAns[20]; // "NO CARRIER"Modem_Init modem is initiated
with this string
ModemTimeOutDial - Defines the timeout for dial operation connection in miliseconds.
ModemTimeOutWait - Defines the timeout for modem answer from another modem command in
miliseconds
ModemDial - The number dialing attemps
Prefix_str - Prefix string for init modem string
DialPrefix - The prefix string of the dial string
EscCodeSeq - the escape characters switch from on-line mode to command mode while preserving the
connection with the on line modem.
HangUp - Instructs modem to go disconnect
ResetChar - This character indicates that the modem was reset to the original settings.
ModemOKAns - Modem successfully executed a command line, defines the answer string.
ConnectAns - Connection made at a specified BPS rate, defines the answer string.
ConnectAns2 - Defines a string to hold the carrier rate
ModemHangScndAns - Modem lost or could not detect a remote carrier signal within the Register
specified time
Return values:
0 - Dialing was successful
less than zero - Dialing failed
Example:
HangupParam("&FE0V1X4&C1&D2%C0%E0S37=6N0\N1&Q0H0",
30000,3000,"9936723",
"AT","DT","~~~+++","~~~ATH0",
"Z","OK","CONNECT","CARRIER","NO CARRIER");
DialParam
int DialParam(char * Modem_Init),
long ModemTimeOutDial,
long ModemTimeOutWait,
char * ModemDial,
char * Prefix_str,
char * DialPrefix,
char * EscCodeSeq,
char * HangUp,
char * Reset_char,
char * ModemOKAns ,
char * ConnectAns,
char * ConnectAns2,
char * ModemHangScndAns)
Description:
Dialing is performed according to each modem initialization parameter.
Parameters:
charModem_Init [250]; // "&FE0V1X4&C1&D2%C0%E0S37=6N0\N1&Q0H0"
longModemTimeOutDial ;//30000
Synel Industries Ltd.
20
SynDLL
longModemTimeOutWait ;//3000
charModemDial[20];//”Telephon number”
charPrefix_str[4]; // "AT"
charDialPrefix[10]; // "DT"
charEscCodeSeq[20]; // "~~~+++"
charHangUp[20]; // "~~~ATH0"
charReset_char[20]; // "Z"
charModemOKAns[20]; // "OK"
charConnectAns[20]; // "CONNECT"
charConnectAns220]; // "CARRIER"
charModemHangScndAns[20]; // "NO CARRIER"
Modem_Init - modem is initiated with this string;
ModemTimeOutDial - defines timeout for dial operation connection in msecs;
ModemTimeOutWait - defines timeout for modem answer for another modem commands in msecs;
ModemDial - number for dials;
ModemHangup - string for hangs up (terminates);
Prefix_str - Prefix string for init modem string;
DialPrefix - Prefix string for dial string;
EscCodeSeq - the escape characters switch from on-line mode to command mode
while preserving the connection with the on line modem
HangUp - instructs modem to go on-hook
Reset_char - This character represents that modem was reset to the stores settings.
ModemOKAns - Modem successfully executed a command line, defines the answer string.
ConnectAns - Connection made at a specified bps rate, defines the answer string.
ConnectAns2 - Defines a string to hold the carrier rate
ModemHangScndAns - Modem lost or could not detect a remote carrier signal within
the Register specified time
Return values:
0 - Dialing was successful
less than zero - Dialing has failed
Example:
DialParam("&FE0V1X4&C1&D2%C0%E0S37=6N0\N1&Q0H0",
30000,3000,"9936723",
"AT","DT","~~~+++","~~~ATH0",
"Z","OK","CONNECT","CARRIER","NO CARRIER");
DialParamEx
int DialParamEx(char * Modem_Init)
Description:
Same as int DialParamEx but faster: Dialing is performed according to each modem initialization
parameter.
Synel Industries Ltd.
21
SynDLL
4.3.2. For C++ users:
Modem Init Structure
InstallModem
int InstallModem ( MODEM_INIT_STRUCT * modem_init_struct )
Description:
Installs a modem, according to the modem_init_struct defintions.
Note: Using AT string to defining the Prefix_str, eliminates the need to include the AT at the
beginning of the Modem_Init and DialPrefix stings. If the Prefix_str string is empty (““),
AT string is required.
For example:"&ATFE0V1X4&C1&D2%C0%E0S37=6N0\N1&Q0H0","", "ATDT"
Parameters:
typedef struct tag MODEM_INIT_STRUCT{
charModem_Init [250]; // "&FE0V1X4&C1&D2%C0%E0S37=6N0\N1&Q0H0"
longModemTimeOutDial ;//30000
longModemTimeOutWait ;//3000
charModemDial[20];//”Telephon number”
charPrefix_str[4]; // "AT"
charDialPrefix[10]; // "DT"
charEscCodeSeq[20]; // "~~~+++"
charHangUp[20]; // "~~~ATH0"
charReset_char[20]; // "Z"
charModemOKAns[20]; // "OK"
charConnectAns[20]; // "CONNECT"
charConnectAns220]; // "CARRIER"
charModemHangScndAns[20]; // "NO CARRIER"
InstallModemEx
int InstallModemEx( MODEM_INIT_STRUCT * modem_init_struct )
Description:
Same as int InstallModem but faster: Installs a modem, according to each parameters defintions.
Synel Industries Ltd.
22
SynDLL
Modem Init Structure - Explanation
Modem_Init modem is initiated with this string;
ModemTimeOutDialdefines timeout for dial operation connection in msecs;
ModemTimeOutWaitdefines timeout for modem answer for another modem commands in msecs;
ModemDial
number for dial;
Prefix_str
Prefix string for init modem string;
DialPrefix
Prefix string for dial string;
EscCodeSeq
The escape characters switch from on-line mode to command mode
while preserving the connection with the on line modem
HangUp
Instructs modem to go on-hook
Reset_char
This character represents that modem was reset to the stored settings.
ModemOKAns Modem successfully executed a command line, defines the answer string.
ConnectAns Connection made at a specified bps rate, defines the answer string.
ConnectAns2 Defines a string to hold the carrier rate
ModemHangScndAnsModem lost or could not detect a remote carrier signal within
the Register specified time
Return values:
0
modem installation was successful
less than zero Installation failed
Example: (Borland C)
MODEM_INIT_STRUCT modem_init_struct;
InstallModem (&modem_init_struct);
Hangup
int Hangup(MODEM_INIT_STRUCT &modem_init_struct)
Description:
Hangs up the connection according to modem init structure.
Parameters:
typedef struct tag MODEM_INIT_STRUCT{
charModem_Init [250]; // "&FE0V1X4&C1&D2%C0%E0S37=6N0\N1&Q0H0"
longModemTimeOutDial ;//30000
longModemTimeOutWait ;//3000
charModemDial[20];//”Telephon number”
charPrefix_str[4]; // "AT"
charDialPrefix[10]; // "DT"
charEscCodeSeq[20]; // "~~~+++"
charHangUp[20]; // "~~~ATH0"
charReset_char[20]; // "Z"
Synel Industries Ltd.
23
SynDLL
charModemOKAns[20]; // "OK"
charConnectAns[20]; // "CONNECT"
charConnectAns220]; // "CARRIER"
charModemHangScndAns[20]; // "NO CARRIER"
}MODEM_INIT_STRUCT;
Modem_Init - modem is initiated with this string;
ModemTimeOutDial - defines timeout for dial operation connection in msecs;
ModemTimeOutWait - defines timeout for modem answer for another modem commands in msecs;
ModemDial - number for dials;
Prefix_str - Prefix string for init modem string;
DialPrefix - Prefix string for dial string;
EscCodeSeq - the escape characters switch from on-line mode to command mode while preserving the
connection with the on line modem
HangUp - instructs modem to go on-hook
Reset_char - This character represents that modem was reset to the stores settings.
ModemOKAns - Modem successfully executed a command line, defines the answer string.
ConnectAns - Connection made at a specified bps rate, defines the answer string.
ConnectAns2 - Defines a string to hold the carrier rate
ModemHangScndAns - Modem lost or could not detect a remote carrier signal within the Register
specified time
Return values:
0 - Disconnection was successful
less than zero - Disconnection failed
Example:
MODEM_INIT_STRUCT modem_init_struct;
HangupEx
int HangupEx(MODEM_INIT_STRUCT &modem_init_struct)
Description:
Same as int Hangup but faster: Hangs up the connection according to modem init structure.
Dial
int Dial(MODEM_INIT_STRUCT &modem_init_struct)
Description:
Dialing is performed according to the modem_init_struct, which is the structure that includes modem
initialization parameters.
Parameters:
typedef struct tag MODEM_INIT_STRUCT{
charModem_Init [250]; // "&FE0V1X4&C1&D2%C0%E0S37=6N0\N1&Q0H0"
longModemTimeOutDial ;//30000
longModemTimeOutWait ;//3000
charModemDial[20];//”Telephon number”
charPrefix_str[4]; // "AT"
charDialPrefix[10]; // "DT"
charEscCodeSeq[20]; // "~~~+++"
Synel Industries Ltd.
24
SynDLL
charHangUp[20]; // "~~~ATH0"
charReset_char[20]; // "Z"
charModemOKAns[20]; // "OK"
charConnectAns[20]; // "CONNECT"
charConnectAns220]; // "CARRIER"
charModemHangScndAns[20]; // "NO CARRIER"
}MODEM_INIT_STRUCT;
Modem_Init - modem is initiated with this string;
ModemTimeOutDial - defines timeout for dial operation connection in msecs;
ModemTimeOutWait - defines timeout for modem answer for another modem commands in msecs;
ModemDial - number for dials;
ModemHangup - string for hangs up (terminates);
Prefix_str - Prefix string for init modem string;
DialPrefix - Prefix string for dial string;
EscCodeSeq - the escape characters switch from on-line mode to command mode
while preserving the connection with the on line modem
HangUp - instructs modem to go on-hook
Reset_char - This character represents that modem was reset to the stores settings.
ModemOKAns - Modem successfully executed a command line, defines the answer string.
ConnectAns - Connection made at a specified bps rate, defines the answer string.
ConnectAns2 - Defines a string to hold the carrier rate
ModemHangScndAns - Modem lost or could not detect a remote carrier signal within
the Register specified time
Return values:
0 - Dialing was successful
less than zero - Dialing failed
Examples:
MODEM_INIT_STRUCT modem_init_struct;
Dial(MODEM_INIT_STRUCT &modem_init_struct);
DialEx
int DialEx(MODEM_INIT_STRUCT &modem_init_struct)
Description:
Same as int Dial but faster: Dialing is performed according to the modem_init_struct, which is the
structure that includes modem initialization parameters.
4.4.
Data Collection commands
SynClear
int SynClear(int ID)
Description:
Actually clears the collected and acknowledged data records from terminal buffer memory.
Parameters:
ID - An integer value which holds the terminal ID.
Synel Industries Ltd.
25
SynDLL
Return values:
0 - Erasing terminal data succeeded
less than zero - Erasing failed
Example:
SynClear(0);
SynClearByDate
int SynClearByDate(int ID, string DateBuffer)
Description:
Clears the collected and acknowledged data records from the terminal buffer memory up to the
specified date (excluding the specified date).
Parameters:
ID - An integer value which holds the terminal ID.
DateBuffer - A pointer to a string value which contains the specified date. Date format: DD/MM/
YYYY (day,month,year).
Return values:
0 - Erasing terminal data according to a specified date succeeded
less than zero - Erasing failed
Example:
SynClearByDate (0,"01/01/2001" );
SynGetData
int SynGetData(int ID, ref string Data)
Description:
Collects one data block from terminal buffer. The data_buffer block contains Section I =
d1099999250301
Section II = B1021354000000000000002B1021354000000000000002A1011354000000000000002
B102135400000000000000279<=
Section I - A fixed sequence including;
Transaction - One letter represents the transaction category. d = data, q = queries, z = faulty
transactions.
Terminal ID - Communication ID that consists of one note, ranging between 0-? : A-O according to
the ASCII table.
Date saving format - One parameter defining the date format as follows: 0-DDMMYY
1-YYMMDD 2-DDMMYYYY 3-YYYYMMDD
EPROM - Five characters can appear as digits or letters, represents the terminal version.
Date - Six digits represent date displayed, according to terminal programming.
Section II - A sequence of terminal inputs in accordance with the terminal
programming, such as;
Terminal function key - A capital letter represents the terminal function key usage.
Function type - Function number, which represents the activity task/attendance
entrance/exit selected.
Transaction Time - Eight digits represents time displayed in HH:MM:SS format.
Badge no. - Employee’s badge number size is according to terminal programming.
The project, level, action or additional information could be presented.
Synel Industries Ltd.
26
SynDLL
Parameters:
ID - An integer value which holds the terminal ID.
Data - A pointer to a string value which holds the terminal’s buffer status. The maximum buffer size is
150 bytes.
Return values:
>=0 - Data collection succeeded
= 0 - No data was received
= 1 - there is data in the data
less than zero - Data collection failed
Example: (Borland C)
SynGetData (0,&data_buffer[0]);
SynGetDataACK
int SynGetDataACK(int ID, ref string Data)
Description:
Collects one data block from terminal buffer. The data_buffer block contains Section I =
d1099999250301
Section II = B1021354000000000000002B1021354000000000000002A1011354000000000000002
B102135400000000000000279<=
Section I - A fixed sequence including;
Transaction - A letter indicating the transaction category. d = data, q = queries, z = faulty transactions.
Terminal ID - Communication ID consisting of a note, between 0-? : A-O according to the ASCII
table.
Date saving format - One parameter defining the date format as follows: 0-DDMMYY
1-YYMMDD 2-DDMMYYYY 3-YYYYMMDD
EPROM - Five characters can appear as digits or letters, represents the terminal version.
Date - Six digits represent date displayed, according to terminal programming.
Section II - A sequence of terminal inputs in accordance with the terminal
programming, such as;
Terminal function key - A capital letter represents the terminal function key usage.
Function type - Function number, which represents the activity task/attendance
entrance/exit selected.
Transaction Time - Eight digits represents time displayed in HH:MM:SS format.
Badge no. - Employee’s badge number size is according to terminal programming.
The project, level, action or additional information could be presented.
ACK= Also: marks terminal buffer. This mark suggests that the data item is designated to be deleted.
Terminal ID - Communication ID consisting of a note, ranging 0-? : A-O according to the ASCII
table.
Parameters:
ID - An integer value which holds the terminal’s ID.
Data - A pointer to a string value which holds the terminal’s buffer status. The maximum buffer size is
150 bytes.
Return values:
>=0 - Data collection succeeded
= 0 - No data was received
= 1 - there is data in the data_buffer
less than zero - Data collection failed
Synel Industries Ltd.
27
SynDLL
Example: (Borland C)
SynGetDataACK (0,&data_buffer[0]);
SynGetDataClear
int SynGetDataClear(int ID, ref string Data)
Description:
Collects one data block from terminal buffer and completely clears it from the terminal buffer. This
data item will not be available for additionally data collection.
Parameters:
ID - An integer value which holds the terminal ID.
Data - A pointer to a string value holding the terminal buffer status, maximum buffer size is 150 bytes.
Return values:
>=0 - Data is cleared successfully
= 0 - No data was received
= 1 - there is data in the data_buffer
less than zero - Erasing data failed
Example:
SynGetDataClear (0,&data_buffer[0]);
SynBufferReset
SynBufferReset(int ID)
Description:
The terminal data, which was previously collected and acknowledged ,is reset and registered in the
terminal memory as available for further collection.
Parameters:
ID - An integer value which holds the terminal ID.
Return values:
0 - Resetting terminal succeeded
less than zero - Resetting failed
Example:
SynBufferReset (0);
SynACK
int SynACK(int ID)
Description:
Marks the terminal buffer. This mark indicates that the data item is designated to be deleted.
ID - Communication ID that consists of a note, between 0-? : A-O according to the ASCII table.
Return values:
=0 - Marking succeeded.
less than zero - Marking failed.
Example: (Borland C)
SynACK (0);
Synel Industries Ltd.
28
SynDLL
4.5.
Terminal Management Commands
SynGetStatus
int SYnGetStatus (int ID, ref string StatusResult)
Description:
Get terminal configuration.
Parameters:
ID - An integer value which holds the terminal’s ID.
StatusResult - A pointer to the string value holding the terminal buffer status. The maximum buffer
size is 150 bytes.
Return values:
0 - The terminal configuration was received successfully.
less than zero - Getting terminal configuration failed.
int err=SynGetStatus (0,ref status);
SynGetStatus (0,&status_buffer[0]);
status_buffer=s140999990103251324B0000000021K+0024KE040----------??0000000000683;
The terminal replies with:
Station status:
"s"(73 hex)
Multidrop I.D. 1 byte
Model (4/8/9) 1 *
Version number5 bytes
Timestamp:
Year
2 bytes
Month
2 bytes
Day
2 bytes
Hour
2 bytes
Minutes
2 bytes
Active function no.1 bytes
No. of full buffers3 bytes
No. of faulty buffers3 bytes
No. of full buffers sent and not cleared3 bytes
No. of empty buffers3 bytes
memory size used for the tables5 bytes
Station replay:
Station Type 1 bytes**
self test
1 bytes
CRC
4 bytes
EOT
1 (04 hex)
*see Firmware model and version table below.
**see Station type table below.
Synel Industries Ltd.
29
SynDLL
Firmware model and version table
The following table displays the way in which to specify the terminal model, version and version
number.
Model
4
8
9
Version
777
1/0
Firmware
OSC
0
76x
1
75x
1
FPU Type I
11
71x
2
FPU Type II
MHz
3
FPU-S
78x
4
Smartcard
76x
5
Mifare
74x
6
40x
7
Smartcard
2
8
DesFire
22
790
MHz
9
L
For example version 8.1032
8
10
78x/ 76x/ 74x/40x
3
FPU-S
74x
2
OSC
Station type table
The following table displays the way in which to specify the station type.
Value
Synel Industries Ltd.
Station type
M
SY-40x
V
SY-78x
v
SY-76x
L
SY-74x
G
SY-79x
E
TimeLOG
30
SynDLL
SynSetDateTime
int SynSetDateTime(int ID, string DateBuffer, string TimeBuffer)
Description:
Sets the terminal’s date and time.
Parameters:
ID - An integer value which holds the terminal ID.
DateBuffer - A pointer to a string value which contains the specified date. Date format: DD/MM/
YYYY(day,month,year).
TimeBuffer - A pointer to a string value which contains the specified hour time format:HH:MM:SS
(hours,minutes,seconds).
Return values:
0 - Setting terminal according to a specified date and hour succeeded
less than zero - Setting failed
Examples:
SynSetDateTime( 0, "01/01/2001", "10:00:00" )
SYNSetActiveKey
int SYNSetActiveKey(int ID, string ActiveKey)
Description:
Sets the terminal active keys.
Parameters:
ID - An integer value which holds the terminal ID.
ActiveKey - A string representing the active key to be set. For example in SY-780, function key IN is
set to A, OUT is set to B , F-1 is set to C.
Return values:
=0 - Setting the active key was successful.
less than zero - Setting the active key failed.
Example:
int resl=SYNSetActiveKey(1,A)
SynFixCrashMemory
int SynFixCrashMemory(ini id)
Description:
Formats the terminal memory and reverts to No Prog mode.
Parameters:
int id - Terminal ID
Return values:
=0 - Operation was successful
less than zero - Operation failed
Example: (Borland C)
SynFixCrashMemory(0)
Synel Industries Ltd.
31
SynDLL
4.6.
Programming Commands
SynHalt
int SynHalt(int ID)
Description:
The terminal is in programming mode, reporting is not possible. The first command before
programming.
Parameter:
ID - Terminal ID number
Return values:
>=0 - Marking succeeded.
less than zero - Marking failed.
Example: (Borland C)
SynHalt (0);
SynRUN
int SynRun (int ID)
Description:
The terminal is again in regular operation mode.
ID - Terminal ID number
Return values:
>=0 - Marking succeeded.
less than zero - Marking failed.
Example: (Borland C)
SynRun(0);
SynDelAll
int SynDelAll(int ID)
Description:
Clear terminal Tables, before re-programming delete all tables from the stations memory;
Parameters:
ID - An integer value which holds the terminal’s ID
Return values:
0 - Terminal tables were cleared successfully
less than zero - Clearing terminal tables failed
Examples:
SynDelAll (0);
SynProg
SynProg (int Term_ID, char * tables_dir)
Description:
Sends a dirXXX.rdy file containing a list of all the RDY Tables, located in directory tables_dir.
Synel Industries Ltd.
32
SynDLL
Note: You must allow a timeout between each table_dir loading,when multiple loading is performed.
Parameters:
Term_ID - An integer value which holds the terminal’s ID.
tables_dir - A pointer to a string value which contains the dirXXX.rdy directory path.
Return values:
0 - Sending RDY tables succeeded
less than zero - Sending RDY tables failed
Examples:
SynProg (0,”C:\TEMP\DIR100.rdy”); //location of DIR100.rdy
Timeout 10 Sec
SynProg (0,”C:\TEMP\DIR200.rdy”); //location of DIR200.rdy
Timeout 10 Sec
SynProg (0,”C:\TEMP\DIR300.rdy”); //location of DIR300.rdy
Synprog_display
int_stdcall Synprog_display(int Term_ID, char * tables_dir,int x,int y, int width, int height, int
display_type);
Description:
Sends a dirXXX.rdy file containing a list of all the RDY Tables, located in directory tables_dir.
Function progress is displayed online: the RDY file path, the total number of blocks it contains, and
progress rate.
Parameters:
Term_ID - An integer value which holds the terminal’s ID.
tables_dir - A pointer to a string value which contains the dirXXX.rdy directory path.
x - the left most position of the display screen
y - the top position of the display screen
Width - width of the display screen
Height - height of the display screen
display_type 1 full communication display, 2 blocks transfer progress
Return values:
0 - Sending RDY tables succeeded
less than zero - Sending RDY tables failed
Examples:
Synprog_display (0,”C:\TEMP\DIR300.rdy”,1 ,1 ,50 , 100, 1)
Synprog_displayEx
int_stdcall Synprog_displayEx(int Term_ID, char * tables_dir,int x,int y, int width, int height, int
display_type, char*txt);
Description:
Sends a dirXXX.rdy file containing a list of all the RDY Tables, located in directory tables_dir.
Function progress is displayed online: the RDY file path, the total number of blocks it contains, and
progress rate and a free text caption (i.e.: terminal name).
Parameters:
Term_ID - An integer value which holds the terminal’s ID.
tables_dir - A pointer to a string value which contains the dirXXX.rdy file path.
Synel Industries Ltd.
33
SynDLL
x - the left most position of the display screen
y - the top position of the display screen
Width - width of the display screen
Height - height of the display screen
display_type 1 full communication display, 2 blocks transfer progress
Return values:
0 - Sending RDY tables succeeded
less than zero - Sending RDY tables failed
Examples:
Synprog_displayEx (0,”C:\TEMP\DIR300.rdy”,1 ,1 ,50 , 100, 1, Terminal 1)
Synprog_displayEx_ALL
int_stdcall Synprog_displayEx(int id,char *t_file1,char *t_file2,char *t_file3,int x ,int y ,int
width,int height,int display_type,char *txt);
Description:
Sends 3 dirXXX.rdy files containing a list of all the RDY Tables, located in directory tables_dir.
Function progress is displayed online: the RDY files paths, the total number of blocks contained, and
progress rate and a free text caption (i.e.: terminal name).
Parameters:
Term_ID - An integer value which holds the terminal’s ID.
t_file1+
t_file2+
t_file3 - A pointer to a string value which contains 3 dirXXX.rdy files path.
x - the left most position of the display screen
y - the top position of the display screen
Width - width of the display screen
Height - height of the display screen
display_type 1 full communication display, 2 blocks transfer progress
Return values:
0 - Sending RDY tables succeeded
less than zero - Sending RDY tables failed
Examples:
Synprog_displayEx (0,”C:\TEMP\DIR300.rdy”, ”C:\TEMP\DIR400.rdy”, ”C:\TEMP\DIR500.rdy”,1 ,1 ,50 , 100,
1, Terminal 1)
SynOneTable
int SynOneTable(int ID, string file_name)
Description:
Sends one table, located in directory file_name. (With Full Path or without FullPath)
Parameters:
ID - An integer value which holds the terminal ID
*file_name - A pointer string value which contains the file name location.
Return values:
0 - Sending one table succeeded
Synel Industries Ltd.
34
SynDLL
less than zero - Sending one tables failed
Examples:
SynOneTable (0,”C:\TEMP\FN001.rdy”); //location of FN001.rdy
4.7.
Fingerprint Templates Commands
Before starting any FPU operation please make sure the terminal is in Programming mode: SynHalt -->SynRUN (back to standard operation mode).
SynDeleteTemplate
int SynDeleteTemplate(int ID, string Template, int TemplateType)
Description:
Deletes a template that is stored within the terminal.
Parameters:
ID - An integer value which holds the terminal’s ID.
Template - A pointer value which contains the string of template number defining the string as
"@@@@@@@@@", if all templates stored within the terminal are deleted.
TemplateType -
Return values:
0 - Deleting the template/s succeeded.
other than zero - Could not delet.
Examples:
SynDeleteTemplate(0,"00999999");
SynDeleteTemplate(0,"@@@@@@@@");
SynDeleteTemplate_Ex
int SynDeleteTemplate_Ex(int id,char * t_template, int template_type)
Description:
Deletes templates (either 0 or 1) stored within the terminal.
Parameters:
int id - Terminal ID
t_template - Number of fingerprint template to be deleted.
int template_type - 0= old mode (8 characters) or verification.
1 = new mode (10 characters) or identification.
Return values:
=0 - Operation was successful.
less than zero - Operation failed.
Example: (Borland C)
SynDeleteTemplate_Ex(0,”00000001”,1)
Synel Industries Ltd.
35
SynDLL
SynRequestForTemplate
int SynRequestForTemplate(int ID, string Template,ref string TemplateBuffer, int TemplateType)
Description:
Sends the terminal a request for the template number and returns the template image.
Parameters:
ID - An integer value which holds the terminal’s ID.
Template,ref - A pointer value which contains the string of template number
TemplateBuffer - A pointer value which contains the string of template buffer
TemplateType -
Return values:
0 - Sending the request for the template succeeded.
other than zero - Request failed
Example:
SynRequestForTemplate(0,"00999999",__templ_buf)
SynRequestForTemplate_Ex
int SynRequestForTemplate_Ex (int Term_ID, char * __template, char * templ_buf, int template_type);
Description:
Sends a request to terminal for the template no., returns the image of template.
Parameters:
Term_ID - An integer value which holds the terminal’s ID.
__template - A pointer value which contains the string of template number;
templ_buf - A pointer value which contains the string of template buffer;
int template_type - 0= old mode (8 characters) or verification.
1 = new mode (10 characters) or identification.
Return values:
0 - Sending the request for the template succeeded.
other than zero - Request failed
Example:
SynRequestForTemplate_Ex(0,"00999999",__templ_buf, 1)
SynRequestForTemplateIDX
int SynRequestForTemplateIDX(int ID, string Template,ref string TemplateBuffer, int IDX, int
TemplateType)
Description:
Requests the template number and the specified index (each template can have several indexes) from
the to terminal and returns the template image.
Parameters:
ID - An integer value which holds the terminal ID.
* Template,ref - A pointer value which contains the template number string.
TemplateBuffer - A pointer value which contains the template buffer string.
IDX - The specified fingerprint template index (between 0 and 9).
TemplateType -
Synel Industries Ltd.
36
SynDLL
Return values:
0 - Sending the request for the template succeeded.
other than zero - Request failed
Example:
SynRequestForTemplate(0,"00999999",__templ_buf, 0)
SynRequestForTemplate_idx_Ex
int SynRequestForTemplate_idx_Ex(int id,char * t_template,char * template_buf, int no, int template
type)
Description:
Sends a request to terminal for the template no. and the specified index (each template can have several
indexes) returns the image of template.
For new formats you can choose either 0 = old format (8 characters), 1 = new format (10 charchters)
only. Enables requesting template from the terminal.
Parameters:
int id - Terminal ID
t_template - Number of fingerprint template to be deleted.
template_buf - Template buffer sent to terminal
int no - Index number
int template_type - 0= old mode (8 characters) or verification.
- 1 = new mode (10 characters) or identification.
Return values:
=0 - Operation was successful.
less than zero - Operation failed.
Example:
SynRequestForTemplate_idx_Ex(0,"00999999",__templ_buf, 0,1)
SynGetFPUStatus
int SynGetFPUStatus(int ID, ref string StatusResult)
Description:
For getting the FPU information (terminal returns the information in the *resl parameter)
from the terminal, see parameters:
Parameters:
ID - terminal ID
*StatusResult - returns the following information:
first char
'V' or 'I' verify or indentify
next 12
kernel version
next 5
no. of templates
next 5
max. no of template
next 1
Terminal Mode : 'M" master or ''S' for slave
Synel Industries Ltd.
37
SynDLL
next 1
current global verification threshhold value:
'1' - Very high
'2' - High
'3' - medium
'4' - low
'5' - very low
Return values:
=0 - Operation was successful.
less than zero - Operation failed.
Example:
char resl[200]
SynGetStatusFpu(1,resl);
SynCheckForTemplateIdx
int __stdcall SynCheckForTemplateIdx(int id,char * t_template,int index);
Description:
Checking if a template exists in the terminal.
Parameters:
id - - terminal ID
t_template- - 0 = template exists
- -1= template does not exist
- other = communication problems
int index- - Use the specified fingerprint template index (between 0 and 9).
Return values:
=0 - Operation was successful.
less than zero - Operation failed.
Example:
int err=SynCheckForTemplateIdx(1,”0000000001”,1);
SynGetTemplateList
int __stdcall SynGetTemplateIdx(int id,int *size_of_block,int current_block,int *NumerOfBlock ,char
*resl);
Description:
There are two purposes to this command:
1.
The user determines how many template IDs will be in a block. The terminal divides the template IDs into blocks as per user requirements and replies: how many blocks there are = how
many times it will take for the terminal to send the whole template list to the PC.
2.
When we know the number of blocks we can get the template list by blocks.
Parameters:
id - - terminal ID
int *size_of_block- - number of templates in block
int current_block- - which block do you want to get (relevant only for option 2).
int *NumerOfBlock- - total number of blocks that comprise the complete template list
(for option 1: parameter must be initialized=0).
reslthe block that was actually sent (relevant for option 2).
Synel Industries Ltd.
38
SynDLL
Return values:
=0 - Operation was successful.
less than zero - Operation failed.
Example:
To get the number of templates:
char resl[4000];
int total_block=0,num_read=25;
int err:=SynGetTemplateList(1 ,&num_read,1,&total_block,t_resl);
To get a templete block:
total_trans=1;
for (int t_int=1;t_int<=total_block;t_int++)
int err=SynGetTemplateList(1,&num_read,&t_int,&total_trans,t_resl);
SynSendTemplate
int SynSendTemplate(int ID, string Template, string TemplateBuffer, int TemplateType)
Description:
Sends a template image to the terminal buffer. The buffer size is defined to1Kbyte.
Parameters:
ID - An integer value which holds the terminal ID.
Template - A pointer value containing the string of template number.
TemplateBuffer - A pointer value containing the string of template buffer.
TemplateType -
Example:
SynSendTemplate(0,"00999999”,
"‘1‘0‘0‘0‘0‘0‘0‘0‘0‘0‘0‘0‘2‘2‘0‘0‘0‘0‘0‘0‘0‘0‘0‘0‘0‘0‘0‘0‘0‘0‘:‘0‘0‘3l:n=l0m=‘?k8m:‘0h8‘:e0h7‘0‘0
‘0‘0‘0‘0g>b4a0b4c4b8a4a0b4‘9‘2‘0f3‘>o=e>o=e>m7e?j:k6e:c1e<j<c6a:h=d6n3e1i0d2j?g?k7e3k3m;
m<b>k7b;d5o6n;f:l1f1k0m8f4c0i7m9j8m4f<j?e7a;h5m6m9g1i>e;j5c4b<c5a8l8b0a3o8o5o7f;i=l6f3g1
k4e=f5k2j;d=m:h5h6c6h:h5c:o;f=l2n;f<k5d=b=m2h9f4j2e;c1i4e9m5l6l1g5i>m3b;i8d=n6i3c9h4k>d;b
8i:l=j6o2m2f8n8m:j<g3k6a>o3g9j<m2f3c7i>d:f6m3e7d;k;l6b9c4j;i5n>c7f;l1n<n=g5d<b6n>l9d<m:e;
b:a5h9‘=h6i5d3h5m6o5g5k=i>h>k7k;k9m6o7g:k:l5n2o3d1k5e8j>e4k;e=‘?d7e3m5n6n:g7c;e=d?f1e8j
<l8f1e7b;m5b>l7g;l9m>m<g5c;m>d?g7g3l8e2g0c3i:i5‘:h5d:l9e<n:g6c9m=‘?c7d;m5m6o7b1‘:‘<b6e5
d:j5e4j<e7c:a4f>l7g3l5n<n<g;k=b0l7c3e1i9d8j:e6b;e4n>o5d2j9m8o7g:c:e>j>j0")
SynSendTemplate_Ex
int SynSendTemplate_Ex(int id,char * t_template,char * template_buf, int template type)
Description:
Sends a template image to the terminal buffer ,buffer size should be defined to 1Kbyte.
For new formats you can choose either 0 = old format (8 characters), 1 = new format (10 charchters)
only. Enables sending the template to the terminal.
Parameters:
int id - Terminal ID
t_template - Number of fingerprint template to be deleted.
template_buf - Template buffer sent to terminal
int template_type - 0= old mode (8 characters) or verification.
1 = new mode (10 characters) or identification.
Synel Industries Ltd.
39
SynDLL
Return values:
=0 - Operation was successful.
less than zero - Operation failed.
SynSetSensorParameter
int SynSetSensorParameter(int ID, string TemplateBuffer, int TemplateType)
Description:
Sets the fingerprint sensor parameters.
Parameters:
ID - An integer value which holds the terminal’s ID.
TemplateBuffer - A pointer value containing the string of template buffer.
TemplateType -
Return values:
0 - Setting succeeded.
other than zero - Setting failed
Example:
SynSetSensorParameter(0, "T4-LOW-----")
4.8.
Firmware Downloading
When updating the terminal firmware you must send the following commands in
consecutive order. It is recommended to use a backup battery.
Note: The EX suffixed commands are extensions of their non EX counterparts:
SynSwitchToFirmwareUpdateMode
int SynSwitchToFirmwareUpdateMode(int ID)
Description:
The terminal now relies on its Boot Loader flash while its Main flash receives new firmware blocks.
Parameters:
ID - The terminal ID
Return values:
=0 - Operation was successful.
less than zero - Operation failed.
Example: (Borland C)
SynSwitchToFirmwareUpdateMode(0)
SynClearMainFlash
int SynClearMainFlash(int ID)
Description:
Deletes Main Flash memory including firmware.
Parameters:
ID - The terminal ID
Synel Industries Ltd.
40
SynDLL
Return values:
=0 - Operation was successful.
less than zero - Operation failed.
Example: (Borland C)
SynClearMainFlash(0)
SynSwitchToWorkingMode
int SynSwitchToWorkingMode(int ID)
Description:
The terminal no longer relies on its Boot Loader flash but on its Main flash memory.
Parameters:
ID - Terminal ID
Return values:
=0 - Operation was successful
less than zero - Operation failed
Example: (Borland C)
SynSwitchToWorkingMode(0,””);
SynSendFirmwareBlock
int SynSendFirmwareBlock(int ID, string Block)
Description:
The terminal downloads new firmware from host and burns it into its flash memory.
Parameters:
ID - Terminal ID
Block -
Return values:
=0 - Operation was successful.
less than zero - Operation failed.
Example: (Borland C)
SynSendFirmwareBlock(0,”c:\ff.256”,””)
SynSendFirmwareBlock_display(int id,char *File,char *result,int x ,int y ,int width,int height)
SynSendFirmwareFileDisplay
int SynSendFirmwareFileDisplay(int ID, string File, int x, int y, int Width, int Height, string Txt)
Description:
The terminal downloads new firmware from host and burns it into its flash memory and displays the
progress on a display window (as per the specified measurements).
Parameters:
ID - Terminal ID
File - Path of programming file
x - offset of top part of screen
y - offset of left side of screen
Width - Width of screen
Synel Industries Ltd.
41
SynDLL
Height - Height of screen
Return values:
=0 - Operation was successful.
less than zero - Operation failed.
Example: (Borland C)
SynSendFirmwareBlock_display(0,,”c:\ff.256”,”,20,20,300,400)
SynSendFirmwareBlock_displayEx
int SynSendFirmwareBlock_displayEx(int id,char *File,char *result,int x ,int y ,int width,int
height,char *txt)
Description:
The terminal downloads new firmware from host and burns it into its flash memory and displays
progress on a display window (as per the specified measurements) and adds to the displays a free text
caption (i.e.: terminal name).
Parameters:
int id - Terminal ID
file - Path of programming file
result - For future use
int x - Offset of top part of screen
int y - Offset of left side of screen
int width - Width of screen
int height - Height of screen
char*txt - Free text
Return values:
=0 - Operation was successful.
less than zero - Operation failed.
Example: (Borland C)
SynSendFirmwareBlock_displayEx(0,,”c:\ff.256”,”,20,20,300,400,”terminal 1”)
4.9.
Linear Terminal Commands
The Linear terminal family includes the following terminals: Master, Access I/II, Tango, TimePLUS,
COM II Pro, TA71, RODBEL TA78.
These terminls are self-contained and are connected to a PC for the purpose of controlling and
recording employee entry/exit transactions. These terminals are operated using a predefined
configuration file.
LinInit
int LinInit (char *fmt_file)
Description:
Defines the location of the Phantom.fmt which consists of the format for the terminal. The format file
converts transaction data so the terminal can decipher it. This file includes various sub-formats, the
commands can point to a sub-format. For further information see “Appendix A - Linear File Formats”
on page -71
Below please find and example of a *.fmt file:
master ="clock_id(2)" "slave_id(2)" "reader_id(2)" "card(1,6)" "day"/"month"/"year"
Synel Industries Ltd.
42
SynDLL
"hour":"min":"sec" type="type"
master_type =pass, not allow, tz viol, GAPB, antitam, expdt, domon, CodeTO, 3tt, count up, not all,
bad comm,ok comm, Emplfull, usnotall(kb), MentTO, Upanic, ro0, ro1, ro2, ro3, Ri0, Ri1, Ri2, Ri3,
mcs, mws, mpOK, Do_cl,Powfail, Powon, Batlow, sucCard2, TCard2, Same, 1Sen, 2Sen.
Parameter:
fmt_file - A pointer to a string value which holds the format file path.
Return values:
=0 - Defining file path was successful.
less than zero - Defining file path failed.
Example:
LinInit (“c:\phantom.fmt”);
LinGetStatus
int LinGetStatus(int id, char *resl)
Description:
Gets terminal's status to PC.
Parameters:
id - An integer value represents the terminal ID
resl - A pointer to a string value which holds the collected transactions
Return values:
=0 - Status was received successfully.
less than zero - Status was not received.
Example:
LinGetStatus(1,&char status_buffer[360]);
LinSetTime
int LinSetTime(int id, int houre, int min, int sec)
Description:
Sets the terminal's time.
Parameters:
id - An integer value represents the terminal ID
houre - HH format (00-23)
min - mm format (00-59)
sec - ss format (00-59)
Return values:
=0 - Setting time was successful.
less than zero - Setting time has failed.
Example:
LinSetTime(1,12,0,8);
LinSetDate
int LinSetDate(int id, int year, int month, int day)
Synel Industries Ltd.
43
SynDLL
Description:
Sets terminal's date. The format is “YYYY,MM,DD”
Parameters:
id - An integer value represents the terminal ID
year - YYYY format
month - MM format
day - DD format
Return values:
=0 - Setting the date was successful.
less than zero - Setting the date has failed.
Example:
LinSetDate(1,2005,1,1);
LinGetTrans
int LinGetTrans (int id, char *Format, char *tarns_file)
Description:
Collects the last data block from a Linear terminal buffer. The data is saved under a specified
Parameters:
id - An integer value represents the terminal ID
Format - A pointer to a string value which holds the format name
tarns_file - A pointer to a string value which holds the transaction file name
Return values:
=1 - Transaction collection was successful
=0 - No transaction was found
less than zero - Transaction collection failed
Example:
LinGetTrans(1,”Master”,”Trans.lst”);
LinMarkTrans
int LinGetTrans (int id)
Description:
Marks transactions after data collection, marking confirms that the transaction item was received by the
PC.
Note: Save data before using this command!
Parameters:
id - An integer value represents the terminal ID
Return values:
=0 - Marking transaction was successful
less than zero - Marking transaction failed
Example:
LinMarkTrans(1);
Synel Industries Ltd.
44
SynDLL
LinGetAllTrans
int LinGetAllTrans(int id, char *Format, char *trans_file)
Description:
Gets all transactions from the terminal (including those that were already collected).
Parameters:
id - An integer value represents the terminal ID
char *Format - A pointer to a string value which holds the format name
char *trans_file - A pointer to a string value which holds the format file path
Return values:
=0 - Getting all transactions was successful
less than zero - Getting all transactions has failed
Example:
LinGetAllTrans(1,Master,c:\\trans.lst);
LinGetDataCount
int LinGetDataCount(int id, Word *ptotal, Word *pmark, long *pfree)
Description:
Counts the number of transactions deposited within the terminal.
Parameters:
id - An integer value represents the terminal ID
ptotal - A pointer to a word value which holds the total number of transactions
pmark - A pointer to a word value which holds the number of marked transactions
pfree - A pointer to a word value which holds the free spaces
Return values:
=0 - Getting data count was successful.
less than zero - Getting data count has failed.
Example:
int x,y,z
LinGetDataCount(1,&x,&y,&z);
4.9.1. Master commands
LinGetMasterTrans
int LinGetMasterTrans(int id,char *resl,char *Format,char *tarns_file,int card_len);
Description:
Designated for Master terminals, collects one data block from the terminal buffer.
Parameters:
id - An integer value represents the terminal ID
resl - A pointer to a string value which holds the collected transaction
Format - A pointer to a string value which holds the format name
tarns_file - A pointer to a string value which holds the transaction file name
card_len - An integer value represents the badge no. length
Synel Industries Ltd.
45
SynDLL
Return values:
=1 - Transaction collection was successful.
=0 - No transaction was found.
less than zero- - Transaction collection failed.
Example:
char Resl[1000];
LinGetTrans(1,Resl,”Master”,”Trans.lst”,6);
LinResetMaster
int LinResetMaster (int id)
Description:
Clears the Master’s memory (definitions and transactions).
Parameters:
id - An integer value represents the terminal ID
Return values:
=0 - Resetting Master was successful
less than zero - Resetting Master has failed
Example:
LinResetMaster(1);
LinSendConfiguration
int LinSendConfiguration (int id, char *file_name)
Description:
Sends the configuration file to the terminal.
For further information see “Appendix A - Linear File Formats” on page -71
Parameters:
id - An integer value represents the terminal ID
file_name - A pointer string value which contains the file name location
Return values:
=0 - Sending configuration was successful.
less than zero - Sending configuration has failed.
Example:
LinSendConfiguration(1,c:\\config.dat);
LinSendAccessConfiguration
int LinSendAccessConfiguration (int id, char *file_name)
Description:
Sends the configuration file to the Access reader.
Parameters:
id - An integer value represents the terminal ID
file_name - A pointer string value which contains the file name location
Synel Industries Ltd.
46
SynDLL
Return values:
=0 - Sending terminal configuration was successful.
less than zero - operation failed.
Example:
LinSendAccessConfiguration(1,c:\\TermConfig.dat);
LinSendCalendar
int LinSendCalendar(int id, char *file_name)
Description:
Sends the calendar parameter txt file.
The Calendar table receives a character for every day of the week (logical day types from 0-7), when
February is always a 29 days month.
For further information see “Appendix A - Linear File Formats” on page -71
Parameters:
id - An integer value represents the terminal ID
file_name - A pointer string value which contains the calendar file location
Return values:
=0 - Sending calendar was successful.
less than zero - Sending calendar has failed.
Example:
LinSendCalendar(1,c:\\calenadar.dat);
LinSendTimeZone
int LinSendTimeZone(int id, char *file_name)
Description:
Sends the automode table, the time zone table and terminal(s) operation time dependencies in the
following format:
For further information see “Appendix A - Linear File Formats” on page -71.
Parameters:
id - An integer value represents the terminal ID
file_name - A pointer string value which contains the file name location
Return values:
=0 - Sending Timezone was successful.
less than zero - Sending Timezone has failed.
Example:
LinSendTimeZone(1,c:\\Timezone.dat);
LinSendPermittedCards
int LinSendPermittedCards (int id, char *file_name)
Description:
Sets permitted cards for a terminal in following format:
(Card_Num)(Type)(Code_Req)(Capt)(T_Z_G_num)(PIN/Count) (Exp_Date) (Exp_Time)
For further information see “Appendix A - Linear File Formats” on page -71.
Synel Industries Ltd.
47
SynDLL
Parameters:
id - An integer value represents the terminal ID
file_name - A pointer string value which contains the file name location
Return values:
=0 - Sending permitted was successful.
less than zero - Sending permitted has failed.
Example:
LinSendPermittedCards(1,c:\\hours\empl.crd);
LinDelPermittedCards
int LinDelPermittedCards (int id)
Description:
Removes permitted card list.
Parameters:
id - An integer value represents the terminal ID
Return values:
=0 - Deleting permitted cards was successful.
less than zero - Deleting permitted cards has failed.
Example:
LinDelPermittedCards(1);
LinMasterSendEmptoAccess
int LinMasterSendEmptoAccess (int id)
Description:
Authorized lists can be marked and then sent to Access units, to enable door opening regardless of
communication with Master.
Parameters:
id - An integer value represents the terminal ID
Return values:
=0 - Sending employees to Access was successful.
less than zero - Sending employees to Access has failed.
Example:
LinMasterSendEmptoAccess(1);
Synel Industries Ltd.
48
SynDLL
5.
Error Codes
The list below contains all of the possible return codes that can be generated when a function generates
an error. As can be seen, all errors in the are indicated by negative return values from the functions
called. Errors between 0 and 100 fingerprint unit and templates errors –30 and –50 for tables
transmitting -800 are communication errors and errors between -1000 and - 2000 are system errors.
5.1.
No.
00
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Fingerprint
Description
Unknown Error
Template was not found on Host computer (Unknown ID)
The check sum was not valid for fingerprint unit
The packet length was invalid for fingerprint unit
There are currently not enough resources to accept this command/FPU Busy
The cause is unknown/Template does not exist
A timeout occurred during the download of raw data/FPU not available
The request baud rate is not supported
The requested stop bit FPU setting is not supported
The requested net ID is out of range
One or more of the requested sensor parameters are out of range/Too large a value was specified for the number of data bytes
The specified template ID is not valid
The specified template index does not exist for the specified template ID
There was a general error writing to the non-volatile storage
There is not sufficient available space in non-voltage memory to perform the operation
The requested threshold setting is out of range
Expected a finger on the sensor and none was detected
Could not read the specified data from flash memory
A list sent to the device is to large
A Wiegand card is already assigned a different use
Current table is full
Error allocating MV1100 board memory on the unit
Template type does not match current unit configuration
MV1100 unit timeout while waiting for user action (such as card swipe)
The specified command is not supported by M1100
The maximal template index (255) was exceeded
The downloaded data size is too large
Unable to update templates to new format
Mismatch with the current template administrator level and those stored under the same ID
The number of bits for Wiegand IN or OUT is invalid
Synel Industries Ltd.
49
SynDLL
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
The Wiegand out TPI time is invalid
The Wiegand out TPW time is invalid
The requested Wiegand format is invalid
Command not appropriate for current sensor type
Key is incorrect. Used for lockable functions
The requested Wiegand format combination is not allowable
The input/output option is locked, for Wiegand structure (output format)
The requested Wiegand format combination is not allowable
An invalid loader file was sent to MV1100
Error acquiring image from the sensor
Port is locked
Port is locked, a password is required to unlock port
The requested operation was not completed
A finger was detected on the sensor but the requested operation requires that a finger not be
on the sensor
The version of the PIC, FPU does not support the requested option
A 1-1 template was sent, FPU supports only searching templates
A searching template was sent, FPU supports only 1 to 1 template
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
Terminal number, master mode
Send request for template from host
Firmware is not operational
No response from Fingerprint Unit (FPU) after Timeout and number of retries
The Fingerprint Unit (FPU) is busy
Incorrect Checksum sum of the strings
Incorrect Packet Length, terminal error
Incorrect Sync Word, terminal error
An empty error packet was received
Generic code
Error accessing PC’s COM port (from Readfile)
Time-out occurred before all data was received
No data was received from Veriprint
Special code used for single threaded communication
Failed to write data to comport
Failed to read data from port
FLOWCONTROLCHANGE
Failed getting COMM status
Failed setting COMM status
Failed to purge receive line on COMM port
Failed to purge transmit line on COMM port
Failed to close COMM port
Synel Industries Ltd.
50
SynDLL
114
115
116
117
118
119
120
201
202
203
204
205
206
207
The hardware detected a framing error
An I/O error occurred during communications with the device.
Error from ClearComError (invalid port specified or invalid mode)
A character-buffer overrun has occurred in the UART.
A character overrun has occurred in the device driver
The hardware detected a parity error
The transmit buffer is full
Command Echo’d back does not match command sent.
The Checksum received from the V1100 does not match data
Error packet returned from unit
Acknowledgement Packet has invalid length
An invalid sync word was received
A positive error code was received from V1100*/
Packet received does not respond to command sent*/
301
302
303
Memory allocation error
Memory allocation error
Memory allocation error
401
402
403
404
405
406
407
408
409
410
An invalid COMM port was specified
An invalid port handle was accesses
FLOWCONTROLMODE
This first parameter was invalid
This second parameter was invalid
This third parameter was invalid
This fourth parameter was invalid
The template passed in does not contain valid data
RAWIMAGE
BAUDRATE
501
Data monitor thread running
601
Generic exception error
5.2.
SY-Server
1
2
3
4
5
Terminal found, terminal not found
Command not done
Path or directory wrong
Wrong parameters
Request not found
Synel Industries Ltd.
51
SynDLL
6
7
5.3.
Request not done
Terminal not active
Linear
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
Illegal OPCODE
Illegal length
DATE_ERROR
TIME_ERROR
CLOCK_WITH_DATA
SPARE
MEMORY_FULL
ILLEGAL GROUP DEFINITION
ILLEGAL_CARD_LENGTH
ILLEGAL_CARD_DISPLAY
LAST_EMPLOYEE_BLOCK
LAST_TRANSACTION_BLOCK
RECORD_ALREADY_ALLOCATED
ILLEGAL_RECORDS_ALLOCATION
ILLEGAL_RECORDS_NUMBER
PEP_ADDRESS_ERROR
DOWLOAD_SEQUENCE_ERROR
151
152
154
TOO_MANY_ERRORS
ILLEGAL_SLAVE
ILLEGAL_EMPLOYEE_REC_ALLOC
1031
1032
1033
1034
1035
1036
1037
1038
Communication error messages
_ERR_TIMEOUT
_ERR_RECEIVE_CKS
_ERR_BID
_ERR_OPEN_FILE
_ERR_PARAMETERS
_ERR_BCD
_ERR_FRAME
Synel Industries Ltd.
52
SynDLL
5.4.
Suprema
97
98
99
105
106
107
108
109
110
Success
Scan Success
Scan fail
Not found
Not match
Try Again
Time out
Mem Full
User ID exists
114
116
117
118
122
128
129
130
131
134
145
161
Finger Limit
Continue
Unsupported
Invalid ID
Timeout for matching identification.
Busy
Cancelled
Data error
Data OK
Finger already enrolled
Duress finger
Locked
1000
1003
1004
1006
(Remote command) not_init_param
(Remote command) time_out_connect
(Remote command) time_out_receive
(Remote command) time_out_comm
3001
3002
3003
3004
Terminal is busy
Data on terminal
Error writing data
Error writing data
-31
-36
-37
-38
-39
File Tables.dat doesn’t exist
The station is already in the programming mode
Error in the file .rdy
File path does not exist
File is corrupted
Synel Industries Ltd.
53
SynDLL
-40
-41
Memory full is indicated when sending tables
One or more of the RDY files does not exist
-801
-802
-803
-804
-805
General error
Timed-out
Not supported
End of file transfer
Buffer was full
-827
-828
-829
-830
-831
-832
-833
-834
-835
-836
-838
-839
-840
-841
-842
-843
-844
-845
-846
-847
-848
-849
-851
-852
-853
-854
-855
-856
-857
-858
-859
Error setting up Break condition
Communication link couldn’t be opened
Communication link couldn’t be closed
Bad Handshaking Mode requested
Attempt to change read only line
Argument to function is bad
System call failed
Error during write operation
Error during read operation
A memory allocation failed
Link is already open
Used an unsupported baud rate setting
Used an unsupported parity setting
Used an unsupported stop bit setting
Used an unsupported word length setting
Device driver not installed
This device driver is not supported
The driver had a general failure
This board number is not installed
The user has selected to abort
An OK from modem in specified time was not transmitted
This board has already been configured.
An error occurred using DOS extender API
This IRQ is already used by another communication port
Tried to hook more than the allowed IRQs
General Error, non-specific
An error occurred using the NASI interface
NASI.EXE or NASI.DLL was not set-up properly
Unable to connect to a modem on a NASI server
Win 32s trunking layer failed to initialize
No default base address above COM4
Synel Industries Ltd.
54
SynDLL
-1033
-1034
-1035
-1036
-1037
-1038
Can not open socket
Wrong Data Format (BID)
File Opening Error
Invalid Parameters
Bad Data Format (BCD)
Bad Data Format (FRAME)
All 2xxx with “-” or not
-2001 Opening port was not successful
-2002 Trying to open port and the port is already opened
-2003 An error occurred when trying to open port
-2004 #define port_not_open
-2005 An error receiving date and time/invalid_parameter
-2006 An answer to query is not detected/ERR_TIMEOUT
-2007 Illegal port number/ERROR_MAX_PORT
-2008 #define ERROR_NEW_GF Serial
-2009 Parameter sent to port are faulty/ERROR_PORT_SETUP
-2010 CRC notes are incorrect
-2011 Received string is incorrect
-2012 Modem was not installed
-2013 Error with modem respond
-2014 #define ESC_PRESSED
-2015 Terminal is not responding
-2016 #define ERR_GENERAL
-2017 Programming debug/ERR_OPEN_FILE
-2018 User modem abort/ERR_Modem_DLL
-2019 Modem dll error (invalid file or function)
-2020 #define Modem_User_Abourt
Synel Industries Ltd.
55
SynDLL
6.
Script Examples
1. - Get status from a terminal with the ID no. 1
2. - Collect data from terminal with ID no. 1
Port =2,Baud = 9600, Parity=None,Data bit = 8,Stop bit = 1
6.1.
Direct communication
DLL_Init(1,0,"C:\TMP\SYNDLL.LOG");
SetLocalPort (1,"9600,N,8,1", 3,3);
SynGetStatus (1,&status_buffer[0]);
SynGetDataClear (1,&data_buffer[0]);
CloseLocalPort( );
6.2.
Communication via a modem using structure
MODEM_INIT_STRUCT definitions are set for communication via Zoltrix 33600 2400 modem:
Modem_Init
= "&FE0V1X4&C1&D2%C0%E0\N1&Q0S37=6N0H0"
ModemTimeOutDial = 30000;
ModemTimeOutWait = 3000;
ModemDial
= 9923456;
Prefix_str
= "AT"
DialPrefix
= "DT"
EscCodeSeq
= "~~~+++"
HangUp
= "~~~ATH0"
Reset_char
= "Z"
ModemOKAns = "OK"
ConnectAns = "CONNECT"
ConnectAns2 = "CARRIER"
ModemHangScndAns = "NO CARRIER"
DLL_Init(1,0,"C:\TMP\SYNDLL.LOG");
SetLocalPort (1, "9600,N,8,1", 3,3) ;
InstallModem (&modem_init_struct);
Dial (&modem_init_struct);
SynGetStatus (1,&status_buffer[0]);
SynGetDataClear (1,&data_buffer[0]);
Hangup (&modem_init_struct);
6.3.
Communication via a modem using parameters
MODEM_INIT_STRUCT definitions are set for communication via Zoltrix 33600 2400 modem:
Modem_Init
= "&FE0V1X4&C1&D2%C0%E0\N1&Q0S37=6N0H0"
ModemTimeOutDial = 30000;
ModemTimeOutWait = 3000;
ModemDial
= 9923456;
Synel Industries Ltd.
56
SynDLL
Prefix_str
= "AT"
DialPrefix
= "DT"
EscCodeSeq
= "~~~+++"
HangUp
= "~~~ATH0"
Reset_char
= "Z"
ModemOKAns
= "OK"
ConnectAns
= "CONNECT"
ConnectAns2 = "CARRIER"
ModemHangScndAns = "NO CARRIER"
DLL_Init(1,0,"C:\TMP\SYNDLL.LOG");
SetLocalPort (1, "9600,N,8,1", 3,3) ;
InstallModemParam ("&FE0V1X4&C1&D2%C0%E0S37=6N0\N1&Q0H0",
30000,3000,"9936723",
"AT","DT","~~~+++","~~~ATH0",
"Z","OK","CONNECT","CARRIER","NO CARRIER");
DialParam ("&FE0V1X4&C1&D2%C0%E0S37=6N0\N1&Q0H0",
30000,3000,"9936723",
"AT","DT","~~~+++","~~~ATH0",
"Z","OK","CONNECT","CARRIER","NO CARRIER");
SynGetStatus (1,&status_buffer[0]);
SynGetDataClear (1,&data_buffer[0]);
HangupParam ("&FE0V1X4&C1&D2%C0%E0S37=6N0\N1&Q0H0",
30000,3000,"9936723",
"AT","DT","~~~+++","~~~ATH0",
"Z","OK","CONNECT","CARRIER","NO CARRIER");
Synel Industries Ltd.
57
SynDLL
7.
Testing DLL
Using this source and running under a Borland 5.0.2 compiler enables to test dll functions. The source
file can be provided by Synel’s technical support department.
Below is the source layout sample:
#include "scerror.h"
#include "defcom.h"
#include <dos.h>
static char protocols_map[100];
static int current_system;
static int current_no_group;
static int current_no_terminal;
static char map_name[MAXPATH];
static char sio_name[MAXPATH];
static char groups_name[MAXPATH];
DEFINE_RESPONSE_TABLE1 (TPhantomWin, TDialog)
//
EV_WM_PAINT,
//
EV_COMMAND (400, Get_bin_file),
//
EV_COMMAND (IDCANCEL, Get_bin_file),
END_RESPONSE_TABLE;
//--------------------------------------------------------TPhantomWin::~TPhantomWin()
{
}
//--------------------------------------------------------TPhantomWin::TPhantomWin (TWindow *parent, TResId resID)
: TWindow ((TWindow*)0, 0, ::Module), TDialog ( parent, resID)
{
}
//--------------------------------------------------------void TPhantomWin::SetupWindow ()
{
TDialog::SetupWindow();
papp->MainWindow->ShowWindow(SW_MINIMIZE);
// PostMessage(WM_COMMAND, 400, 0L);
}
//----------------------------------------------------void TPhanApp::InitMainWindow()
{
Synel Industries Ltd.
58
SynDLL
// new TPhantomWin(0, DIALOG_1);
SetMainWindow(new TFrameWindow( 0, "SCOMM upgrade", cp, TRUE));
}
//int TPhantomWin::Get_bin_file()
//*******************************************************************
//
Get_bin_file
//*******************************************************************
int Get_bin_file()
{
// FILE *stream;
FILE *fp_gr, *fp_te, *fp_pr;
int i,j,err;
int
int
int
int
int
int
i_map_syst;
i_map_group;
i_map_term;
i_work;
len_ascii;
int_for_w; // For current work
int curr_group_no;
int curr_term_no;
int group_posit;
char name_file_param[MAXPATH];
char s3_path[MAXPATH];
char file_name[MAXPATH];
char default_path[MAXPATH];
char default_name[MAXPATH];
char line [300]; // to write to file
char string[25];
char work_protocol[MAX_COMM_DEF];
//********************************************
int __ret,__ret_com,__com;
char __err[5];
char __status_buf[250];
char __string[15];
Synel Industries Ltd.
59
SynDLL
char __string1[50];
HINSTANCE hinstDll;
int FAR PASCAL(FAR * lpfnOpenPort)(int, char * ,int,int);
int FAR PASCAL(FAR * lpfnClosePort)();
//Function definitions
int FAR PASCAL(FAR * lpfnStatus)(int,char *);
int FAR PASCAL(FAR * lpfnDataACK)(int,char *);
int FAR PASCAL(FAR * lpfnDataClear)(int,char *);
int FAR PASCAL(FAR * lpfnBufferReset)(int);
int FAR PASCAL(FAR * lpfnClear)(int);
int FAR PASCAL(FAR * lpfnClearByDate)(int,char *);
int FAR PASCAL(FAR * lpfnSetDateTime)(int,char *,char *);
int FAR PASCAL(FAR * lpfnProg)(int,char *);
int FAR PASCAL(FAR * lpfnDelAll)(int);
int FAR PASCAL(FAR * lpfnInit)(int,int,char *);
int FAR PASCAL(FAR * lpfnOpenTCP)(int, char * ,int,int);
int FAR PASCAL(FAR * lpfnCloseTCP)();
//*********************************************
__ret = 0;
(HINSTANCE)hinstDll = LoadLibrary("syndll.dll") ;
//****************** DLL_Init *******************************
if ( (HINSTANCE)hinstDll > (HINSTANCE)HINSTANCE_ERROR )
{
(FARPROC) lpfnInit =
GetProcAddress(hinstDll,"DLL_Init");
if(lpfnInit != NULL)
{
__ret = (*lpfnInit)(1,0,"debug.dat");
}
else
__ret = GetLastError();
if (__ret)
__ret_com = __ret;
}
//************************************************************
if ( (HINSTANCE)hinstDll > (HINSTANCE)HINSTANCE_ERROR ) /*Loaded
successfully*/
{
(FARPROC) lpfnOpenPort =
Synel Industries Ltd.
60
SynDLL
GetProcAddress(hinstDll,"SetLocalPort");
if(lpfnOpenPort != NULL)
{
__ret = (*lpfnOpenPort)((int)1,"9600,N,8,1",(int)3,(int)3);
}
else
__ret = GetLastError();
}
if (__ret)
__ret_com = __ret;
(FARPROC) lpfnStatus =
GetProcAddress(hinstDll,"SynGetStatus");
if(lpfnStatus != NULL)
{
for (i=1;i<2;i++)
{
__ret = (*lpfnStatus)((int)1,&__status_buf[0]);
if (__ret)
return __ret;
if ( ! (int)( fp_pr = fopen ( "mysyndll.err" , "a+" )))
return ( -1);
fprintf ( fp_pr ,"%s\n" , __status_buf );
fclose(fp_pr);
}
}
else
__ret = GetLastError();
//******************* SynGetDataACK ***********************************
(FARPROC) lpfnDataACK =
GetProcAddress(hinstDll,"SynGetDataACK");
if(lpfnDataACK != NULL)
{
for (i=1;i<2;i++)
{
__ret = (*lpfnDataACK)((int)1,&__status_buf[0]);
if(__ret !=0)
Synel Industries Ltd.
61
SynDLL
{
if (__ret == 1)
{
if ( ! (int)( fp_pr = fopen ( "mysyndll.err" , "a+" )))
return (-1 );
fprintf ( fp_pr ,"%s\n" , "SynGetDataACK : No data..." );
fclose(fp_pr);
break;
}
else
{
if ( ! (int)( fp_pr = fopen ( "mysyndll.err" , "a+" )))
return (-1 );
itoa(__ret,__string,10);
strcpy(__string1,"SynGetDataACK : error= ");
strcat(__string1,__string );
fprintf ( fp_pr ,"%s\n" ,__string1 );
fclose(fp_pr);
break;
}
}
if ( ! (int)( fp_pr = fopen ( "mysyndll.err" , "a+" )))
return (-1 );
strcpy(__string1,"SynGetDataACK :");
strcat(__string1,__status_buf);
fprintf ( fp_pr ,"%s\n" , __string1 );
fclose(fp_pr);
}
}
else
__ret = GetLastError();
//**************** SynBufferReset ****************************
(FARPROC) lpfnBufferReset =
GetProcAddress(hinstDll,"SynBufferReset");
if(lpfnBufferReset != NULL)
Synel Industries Ltd.
62
SynDLL
{
for (i=1;i<2;i++)
{
__ret = (*lpfnBufferReset)((int)1);
if ( ! (int)( fp_pr = fopen ( "mysyndll.err" , "a+" )))
return (-1 );
fprintf ( fp_pr ,"%s\n" , "SynBufferReset" );
fclose(fp_pr);
}
}
else
__ret = GetLastError();
//****************** SynGetDataACK ************************************
for(i=1; i<10; i++)
{
__ret = (*lpfnDataACK)((int)1,&__status_buf[0]);
if (__ret == 1)
{
if ( ! (int)( fp_pr = fopen ( "mysyndll.err" , "a+" )))
return (-1 );
fprintf ( fp_pr ,"%s\n" , "No data..." );
fclose(fp_pr);
break;
}
if ( ! (int)( fp_pr = fopen ( "mysyndll.err" , "a+" )))
return (-1 );
strcpy(__string1,"SynGetDataACK :");
strcat(__string1,__status_buf);
fprintf ( fp_pr ,"%s\n" , __string1 );
fclose(fp_pr);
}
//**************** SynClear ****************************
(FARPROC) lpfnClear =
Synel Industries Ltd.
63
SynDLL
GetProcAddress(hinstDll,"SynClear");
if(lpfnClear != NULL)
{
__ret = (*lpfnClear)((int)1);
if ( ! (int)( fp_pr = fopen ( "mysyndll.err" , "a+" )))
return (-1 );
fprintf ( fp_pr ,"%s\n" , "SynClear" );
fclose(fp_pr);
}
else
__ret = GetLastError();
//****************** SynGetDataClear ************************************
(FARPROC) lpfnDataClear =
GetProcAddress(hinstDll,"SynGetDataClear");
if(lpfnDataClear != NULL)
{
for(i=1; i<2; i++)
{
__ret = (*lpfnDataClear)((int)1,&__status_buf[0]);
if (__ret == 1)
{
if ( ! (int)( fp_pr = fopen ( "mysyndll.err" , "a+" )))
return (-1 );
fprintf ( fp_pr ,"%s\n" , "No data..." );
fclose(fp_pr);
break;
}
if ( ! (int)( fp_pr = fopen ( "mysyndll.err" , "a+" )))
return (-1 );
strcpy(__string1,"SynGetDataClear :");
strcat(__string1,__status_buf);
fprintf ( fp_pr ,"%s\n" , __string1 );
fclose(fp_pr);
}
Synel Industries Ltd.
64
SynDLL
}
//**************** SynClearByDate ****************************
(FARPROC) lpfnClearByDate =
GetProcAddress(hinstDll,"SynClearByDate");
if(lpfnClearByDate != NULL)
{
__ret = (*lpfnClearByDate)((int)1,"10/01/2001");
if ( ! (int)( fp_pr = fopen ( "mysyndll.err" , "a+" )))
return (-1 );
fprintf ( fp_pr ,"%s\n" , "SynClearByDate" );
fclose(fp_pr);
}
else
__ret = GetLastError();
//**************** SynSetDateTime ****************************
(FARPROC) lpfnSetDateTime =
GetProcAddress(hinstDll,"SynSetDateTime");
if(lpfnSetDateTime != NULL)
{
__ret = (*lpfnSetDateTime)((int)1,"15/04/2001","08:00:30");
if ( ! (int)( fp_pr = fopen ( "mysyndll.err" , "a+" )))
return (-1 );
itoa(__ret,__string,10);
strcpy(__string1,"SynSetDateTime: error = ");
strcat(__string1,__string);
fprintf ( fp_pr ,"%s\n" , __string1 );
fclose(fp_pr);
}
else
__ret = GetLastError();
//***************** SynDelAll ***************************************
Synel Industries Ltd.
65
SynDLL
(FARPROC) lpfnDelAll =
GetProcAddress(hinstDll,"SynDelAll");
if(lpfnDelAll != NULL)
{
__ret = (*lpfnDelAll)((int)1);
if ( ! (int)( fp_pr = fopen ( "mysyndll.err" , "a+" )))
return (-1 );
itoa(__ret,__string,10);
strcpy(__string1,"SynDelAll: error = ");
strcat(__string1,__string);
fprintf ( fp_pr ,"%s\n" , __string1 );
fclose(fp_pr);
}
else
__ret = GetLastError();
sleep(1);
//****************** SynProg ****************************************
(FARPROC) lpfnProg =
GetProcAddress(hinstDll,"SynProg");
if(lpfnProg != NULL)
{
__ret = (*lpfnProg)((int)1,
"D:\\TLOGVFP5\\TL6-02\\PROG\\DI001001.RDY");
if ( ! (int)( fp_pr = fopen ( "mysyndll.err" , "a+" )))
return (-1 );
itoa(__ret,__string,10);
strcpy(__string1,"SynProg: error = ");
strcat(__string1,__string);
fprintf ( fp_pr ,"%s\n" , __string1 );
fclose(fp_pr);
}
else
{
Synel Industries Ltd.
66
SynDLL
if(lpfnProg==NULL)
__ret = GetLastError();
}
//******************* CloseLocalPort*********************************
(FARPROC) lpfnClosePort =
GetProcAddress(hinstDll,"CloseLocalPort");
if(lpfnClosePort != NULL)
{
__ret = (*lpfnClosePort)();
}
else
__ret = GetLastError();
//~~~~~~~~~~~~~~~~~~~~~~~ TCP ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(FARPROC) lpfnOpenTCP =
GetProcAddress(hinstDll,"SetTCPPort");
if(lpfnOpenPort != NULL)
{
__ret = (*lpfnOpenTCP)((int)5000,"10.1.1.180",(int)3,(int)3);
}
else
__ret = GetLastError();
//
//
if (__ret)
__ret_com = __ret;
(FARPROC) lpfnStatus =
GetProcAddress(hinstDll,"SynGetStatus");
if(lpfnStatus != NULL)
{
for (i=1;i<2;i++)
{
__ret = (*lpfnStatus)((int)1,&__status_buf[0]);
if (__ret)
return __ret;
if ( ! (int)( fp_pr = fopen ( "mysyndll.err" , "a+" )))
return ( PROTOCOL_OPEN_ERROR );
fprintf ( fp_pr ,"%s\n" , __status_buf );
fclose(fp_pr);
Synel Industries Ltd.
67
SynDLL
}
}
else
__ret = GetLastError();
//******************* CloseTCPPort*********************************
(FARPROC) lpfnClosePort =
GetProcAddress(hinstDll,"CloseTCPPort");
if(lpfnClosePort != NULL)
{
__ret = (*lpfnClosePort)();
}
else
__ret = GetLastError();
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__ret = FreeLibrary(hinstDll);
__com = __ret_com + __ret ;
//*********************************************************************
if ( ! (int)( fp_pr = fopen ( "mysyndll.err" , "a+" )))
return (-1 );
fprintf ( fp_pr ,"%s\n\n" ,"" );
fclose(fp_pr);
return __com;
}
//--------------------------------------------------int OwlMain ( int argc, char *argv[])
{
int err;
char line[100];
FILE * stream;
TPhanApp
papp=&app;
app;
err = Get_bin_file();
// if (err)
// app.Run();
return 0;
Synel Industries Ltd.
68
SynDLL
Synel Industries Ltd.
69
SynDLL
Synel Industries Ltd.
70
SynDLL
Synel Industries Ltd.
71
SynDLL
Synel Industries Ltd.
72
SynDLL
Synel Industries Ltd.
73
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertising