Eurotech DynaPCN 10-20 Owner's manual

Type
Owner's manual

Eurotech DynaPCN 10-20 is a device for counting people and passengers. It has two channels, allowing it to count people entering and leaving a given area simultaneously. The DynaPCN 10-20 also has a digital input that can be used to connect a door sensor, enabling it to automatically count people only when the door is open. Additionally, it features an Ethernet port for communication and PoE (Power over Ethernet) capability, allowing for easy installation and power supply.

Eurotech DynaPCN 10-20 is a device for counting people and passengers. It has two channels, allowing it to count people entering and leaving a given area simultaneously. The DynaPCN 10-20 also has a digital input that can be used to connect a door sensor, enabling it to automatically count people only when the door is open. Additionally, it features an Ethernet port for communication and PoE (Power over Ethernet) capability, allowing for easy installation and power supply.

DynaPCN
-10-20-xx
Ethernet/POE Passenger & People Counter
ETHERNET COMMUNICATION PROTOCOL
Rev
1-3 – 21 March 2018 DYPCN-10-20-xx_EthComProt_EN_1-3 – ENGLISH
© 2018 Eurotech SpA - Via Fratelli Solari 3/A - 33020 AMARO (UD) - Italy
Trademarks
All trademarks, registered trademarks, logos, trade names and products names contained in this
document are the property of their respective owners
Revision history
Revision
Description
Date
1-0
First release 28 February 2014
1-1
Updated “Table 1. Mapping Function-Digital Input” 15 October 2015
1-2
Contents review 6 March 2018
1-3
Contents review 21 March 2018
DynaPCN-10-20-xx Rev. 1-3 Contents
3 /
18
Contents
Trademarks ........................................................................................................................................................ 2
Revision history .................................................................................................................................................. 2
Contents ...................................................................................................................................................................... 3
1 Introduction ......................................................................................................................................................... 5
2 Commands list .................................................................................................................................................... 6
2.1 diagnostic_en ........................................................................................................................................... 6
2.2 disconnect ................................................................................................................................................ 6
2.3 enable_pc ................................................................................................................................................. 6
2.4 fw_version ................................................................................................................................................ 7
2.5 gcounters .................................................................................................................................................. 7
2.6 gdatetime .................................................................................................................................................. 7
2.7 gdoorstatus ............................................................................................................................................... 8
2.8 input0 ........................................................................................................................................................ 8
2.9 input1 ........................................................................................................................................................ 9
2.10 ker_version ............................................................................................................................................. 10
2.11 pcn1001_status ...................................................................................................................................... 10
2.12 rdsave ..................................................................................................................................................... 11
2.13 reboot ..................................................................................................................................................... 11
2.14 reset........................................................................................................................................................ 11
2.15 restore .................................................................................................................................................... 12
2.16 sdatetime ................................................................................................................................................ 12
2.17 sled ......................................................................................................................................................... 12
2.18 sys_version ............................................................................................................................................ 13
2.19 testin0 ..................................................................................................................................................... 13
2.20 testin1 ..................................................................................................................................................... 13
2.21 version .................................................................................................................................................... 14
2.22 updateI ................................................................................................................................................... 14
2.23 updateF .................................................................................................................................................. 15
3 Application flow ................................................................................................................................................ 16
Notes .......................................................................................................................................................................... 17
(This page has been intentionally left blank)
DynaPCN-10-20-xx Rev. 1-3 Introduction
5 /
18
1 Introduction
This document describes the Ethernet Communication Protocol between a user application and the
DynaPCN.
In this protocol, the DynaPCN is the server and the user application is the client.
The DynaPCN acts as a “listening device” on port 5400.
You can use an utility such as Packet Sender (https://packetsender.com/download
) to test the
functionality of the commands.
Each command is represented in the following way:
Command
Name of command
Command Description
Brief description of command purpose
Parameters
Format and type of possible parameter(s)
Parameters Description
Description of parameter(s) : permitted value, default ..
Returns
Format, type and meaning of possible returned parameter(s)
Sample Code
Example of code (only client side)
At the end of each command / parameter sent, include a “0x00” byte as terminator.
First of all it is necessary to create a communication socket between the user application and
DynaPCN.
Below you can find an example of client code to initialize the connection with DynaPCN.
#include <winsock2.h>
...
struct sockaddr_in my_addr_data,serv_addr_data;
SOCKET sock = socket(AF_INET,SOCK_STREAM,0);
memset((char *)&serv_addr,0,sizeof(serv_addr));
serv_addr.sin_family = AF_INET;
serv_addr.sin_port = htons(PORT);
serv_addr.sin_addr.s_addr = inet_addr(ADDRESS);
if(connect(sock,(struct sockaddr *)&serv_addr, sizeof(sockaddr)) == -1)
{
printf(“Unable to connect to %s", ADDRESS);
return;
}
...
Commands list DynaPCN-10-20-xx Rev. 1-3
/ 18
2 Commands list
2.1 diagnostic_en
Command
diagnostic_en
Command Description
Enables or disables the diagnostic
Parameters
unsigned char ( 1 byte)
Parameters Description
Diagnostic status :
If 0 : disabled
If 1 : enabled
Returns
Sample Code
unsigned char val = 1; // Enables diagnostic
SendString(sock, "diagnostic_en");
Send(sock,&val,sizeof(val));
2.2 disconnect
Command
disconnect
Command Description
Closes the communication between users application and the PCN
Parameters
Parameters Description
Returns
Sample Code
SendString(sock,"disconnect");
2.3 enable_pc
Command
enable_pc
Command Description
Enables or disables people counting
Parameters
Unsigned char (1 byte).
Parameters Description
If 1 : enables people counting
If 0: disables people counting
Returns
String containing:
“counting started”
“counting stopped
A byte “0x00” is included as terminator
Sample Code
unsigned char val = 1; // Enables people counting
SendString(sock,"enable_pc");
Send(sock,&val,sizeof(val));
DynaPCN-10-20-xx Rev. 1-3 Commands list
7 /
18
2.4 fw_version
Command fw_version
Command Description
Gets the installed FPGA firmware version
Parameters
Parameters Description
Returns
String containing the actual FPGA firmware version number (e.g:“2.9”).
A byte “0x00” is included as terminator
Sample Code
char version[32];
SendString(sock,"fw_version");
RecvString(sock,version);
2.5 gcounters
Command
gcounters
Command Description
Returns the current counter values (In & Out)
Parameters
Parameters Description
Returns
Two unsigned long values (4 bytes long).
The first is the incoming counter value.
The second is outgoing counter value.
Sample Code
unsigned long in,out;
SendString(sock,”gcounters”);
Recv(sock, &in,sizeof(in)); // incoming counting
Recv(sock, &out,sizeof(out)); // outcoming counting
2.6 gdatetime
Command
gdatetime
Command Description
Gets date and time in the PCN system
Parameters
Parameters Description
Returns
Two strings.
The first contains the actual system date in format DD/MM/YYYY.
The second contains the actual system time in format HH.MM.
A byte “0x00” is included as terminator
Sample Code
char sysdate[16];
char systime[16];
SendString(sock,"gdatetime");
RecvString(sock,sysdate);
RecvString(sock,systime);
.
Commands list DynaPCN-10-20-xx Rev. 1-3
/ 18
2.7 gdoorstatus
Command
gdoorstatus
Command Description
Gets the door status
Parameters
Parameters Description
Returns
unsigned char (1 byte).
If 1 : The door is open
If 0 : The door is close
Sample Code
unsigned char val;
SendString(sock, "gdoorstatus");
Recv(sock, &val, sizeof(val));
2.8 input0
Command
input0
Command Description
Sets the associated function at to the Digital input 0
Parameters
unsigned short (2 byte)
Parameters Description
Refer to Table 1
Returns
Sample Code
// To set do nothing functionality
unsigned short val = 0;
// To set reset counters functionality
unsigned short val = 1;
// To set Enable/Disable person counting functionality
unsigned short val = 2;
// To set Test functionality
unsigned short val = 3;
// Send command
SendString(sock,"input0");
Send(sock,&val,sizeof(val));
Table 1. Mapping Function of Digital Input0
Value
Function
Description
0
Do Nothing
The digital input signal is ignored
1
Reset Counters
When a rising edge is detected the counters are set to zero
2
Enable/Disable Person Counting
When a rising edge is detected the counting process starts.
When a falling edge is detected the counting process stops.
3
Test
Used to test the signal
4
Reset Counters Reverse
When a falling edge is detected the counters are set to zero
5
Enable/Disable Person Counting Reverse
When a falling edge is detected the counting process starts.
When a rising edge is detected the counting process stops.
DynaPCN-10-20-xx Rev. 1-3 Commands list
9 /
18
2.9 input1
Command
Input1
Command Description
Sets the associated function to the Digital input 1
Parameters
unsigned short (2 byte)
Parameters Description
Refer to Table 2
Returns
Sample Code
// To set do nothing functionality
unsigned short val = 0;
// To set reset counters functionality
unsigned short val = 1;
// To set Enable/Disable person counting functionality
unsigned short val = 2;
// To set Test functionality
unsigned short val = 3;
// Send command
SendString(sock,"input0");
Send(sock,&val,sizeof(val));
Table 2. Mapping Function of Digital Input1
Value
Function
Description
0
Do nothing
The digital input signal is ignored
1
Reset Counters
When a rising edge is detected the counters are set to zero
2
Enable/Disable person counting
When a rising edge is detected the counting process starts.
When a falling edge is detected the counting process stops.
3
Test
Used to test the signal
4
Reset Counters Reverse
When a falling edge is detected the counters are set to zero
5
Enable/Disable person counting Reverse
When a falling edge is detected the counting process starts.
When a rising edge is detected the counting process stops.
Commands list DynaPCN-10-20-xx Rev. 1-3
/ 18
2.10 ker_version
Command
ker_version
Command Description
Gets the kernel version
Parameters
Parameters Description
Returns
String containing the actual kernel version number (e.g. “2.1”)
Sample Code
char version[32];
SendString(sock,"ker_version");
RecvString(sock,version);
2.11 pcn1001_status
Command
pcn1001_status
Command Description
Gets the status of the PCN and the diagnostic error code
Parameters
Parameters Description
Returns
2 unsigned char ( 1 byte) value.
The first byte indicates the presence / absence of issues:
= 1 : No errors
≠ 1 : Error
The second byte specifies the type of error (error code): see Table 3.
The second byte has no meaning if the first byte = 1
Sample Code
unsigned char status,code_error;
SendString(sock,"pcn1001_status");
// gets the PCN status
Recv(sock,&status, sizeof(status));
// gets the error code
Recv(sock,&code_error, sizeof(code_error));
Table 3. Error Codes and their meaning
Error code
Meaning
1
Right sensor occluded
2
Left sensor occluded
3
Both sensors occluded
4
Right sensor obscured
8
Left sensor obscured
12
Both sensors obscured
16
High difference between right and left sensors
20,24,28
High difference between right and left sensors and both sensors obscured
The difference between occluded and obscured is the following:
Occluded: This is a condition of complete masking of one or both sensors (example: a thick label attached on the sensor,
or sensor broken).
It should be better to verify if the PCN is ok
Obscured: This is a lighter condition than the Occluded one. In this case the masking of one or both sensors is partial
and transitory. Generally this condition does not affect the counting.
DynaPCN-10-20-xx Rev. 1-3 Commands list
11 /
18
2.12 rdsave
Command
rdsave
Command Description
Returns a buffer with variable dimension, that contains the log file of the PCN.
Parameters
Parameters Description
Returns
Values returned:
Size of the log file : int (4byte)
Buffer file : vector of the unsigned char of length <size>
Sample Code
int size = 0;
unsigned char *buffer;
FILE *out;
// Send the command
SendString(sock,"rdsave");
// Receive the size of the buffer
Recv(sock,(char *)&size,sizeof(size));
buffer = new unsigned char [size];
// Receive the buffer
Recv(sock,(char *)buffer,size);
fopen(out,”logfile.txt”,”w");
fwrite(buffer,size,1,out);
fclose(out);
delete [] buffer;
2.13 reboot
Command
reboot
Command Description
Reboots the PCN
Parameters
Parameters Description
Returns
Sample Code
SendString(sock,"reboot");
2.14 reset
Command
reset
Command Description
Resets the IN and OUT counters
Parameters
Parameters Description
Returns
Sample Code
SendString(sock,"reset");
Commands list DynaPCN-10-20-xx Rev. 1-3
/ 18
2.15 restore
Command
restore
Command Description
Restores the system factory settings
Parameters
Parameters Description
Returns
Sample Code
SendString(sock,"restore");
2.16 sdatetime
Command
sdatetime
Command Description
Sets date and time in the PCN system
Parameters
Strings
Parameters Description
String containing the date and time in format MMDDhhmmYYYY
E.g.: 21 May 2014 at 15:39 = “052115392014”
Returns
Sample Code
char datetime[16]; // MMDDhhmmYYYY
SendString(sock,"sdatetime");
SendString(sock,datetime);
2.17 sled
Command
sled
Command Description
Sets the light intensity of LEDs
Parameters
Unsigned char (1 byte)
Parameters Description
Values from 0 to 255:
When 0 : OFF
When 255 : Maximum intensity
Returns
Codice Esempio
unsigned char val;
SendString(sock,"sled");
Recv(sock,&val,sizeof(val));
DynaPCN-10-20-xx Rev. 1-3 Commands list
13 /
18
2.18 sys_version
Command
sys_version
Command Description
Returns the Operating System version of the DynaPCN-10-20-xx
Parameters
Parameters Description
Returns
String containing the Operating System version number (e.g.: “1.6”)
Sample Code
char version[32];
SendString(sock,"sys_version");
RecvString(sock,version);
2.19 testin0
Command
testin0
Command Description
Gets the logic level of the input
Parameters
Parameters Description
Returns
Unsigned char (1 byte).
If 1 : High logic level
If 0 : Low logic level
Sample Code
unsigned char val;
SendString(sock,"testin0");
Recv(sock,&val,sizeof(val));
2.20 testin1
Command
testin1
Command Description
Gets the logic level of the input
Parameters
Parameters Description
Returns
Unsigned char (1 byte).
If 1 : High logic level
If 0 : Low logic level
Sample Code
unsigned char val;
SendString(sock,"testin1");
Recv(sock,&val,sizeof(val));
Commands list DynaPCN-10-20-xx Rev. 1-3
/ 18
2.21 version
Command
version
Command Description
Gets the installed imgserver version
Parameters
Parameters Description
Returns
String containing the actual imgserver version number (e.g. “2.3.11.3”).
A byte “0x00is included as terminator.
Sample Code
char version[32];
SendString(sock,"version");
RecvString(sock,version);
2.22 updateI
Command
updateI
Command Description
Updates the imgserver
Parameters
Integer (4 byte)
Vector unsigned char (1byte * size)
Parameters Description
Size of the log file
Buffer file : vector of the unsigned char of length <size> containing the file to upload.
Returns
An integer value (4 byte)
If > 0 : updating complete successfully
Otherwise : updating failed.
Sample Code
int handle,status;
handle = fopen(FileName, “rb”);
int size = fseek(handle,0,2);
fseek(handle,0,0);
unsigned char *buffer = new unsigned char [size];
fread(handle, buffer, size);
fclose(handle);
SendString(sock,"updateI"); // Sends Command
Send(sock,&size,sizeof(size)); // Sends file’s size
Send(sock,(char *)buffer,size); // Sends the buffer
Recv(sock,(char *)&status,sizeof(status));
DynaPCN-10-20-xx Rev. 1-3 Commands list
15 /
18
2.23 updateF
Command
updateF
Command Description
Updates the FPGA firmware
Parameters
Integer (4 byte)
Vector unsigned char ( 1byte * size)
Parameters Description
Size of the log file
Buffer file : vector of the unsigned char of length <size> containing the file to upload.
Returns
An integer value (4 byte)
If > 0 : updating complete successfully
Otherwise : updating failed.
Sample Code
int handle,status;
handle = fopen(FileName, “rb”);
int size = fseek(handle,0,2);
fseek(handle,0,0);
unsigned char *buffer = new unsigned char [size];
fread(handle, buffer, size);
fclose(handle);
SendString(sock,"updateF"); // Sends Command
Send(sock,&size,sizeof(size)); // Sends file’s size
Send(sock,(char *)buffer,size); // Sends the buffer
Recv(sock,(char *)&status,sizeof(status));
Application flow DynaPCN-10-20-xx Rev. 1-3
/ 18
3 Application flow
The following flow chart describes the typical application flow.
A digital input (0/1) of the PCN is connected to a circuit which retrieves the open/close state of the
port, and enables/disables the counting accordingly to its state.
CONNECT
SDATETIME
RESET
Initialization:
1. Connect to the PCN
2. Set the current time and date
3. Enable diagnostic
4. Reset counters
GCOUNTERS
RESET
NO
NO
GDOORSTATUS
Is the door
closed?
Was the door
status open
previously?
SI
SI
Door status check and counters
retrieval:
1 Monitor the door status;
the exit criteria is a transition
of the door state from open to
close
2 Retrieve the counters
3 Reset the counters
DIAGNOSTIC_EN
DynaPCN-10-20-xx Rev. 1-3 Notes
17 /
18
Notes
EUROTECH.COM
HEADQUARTERS
Via Fratelli Solari, 3/a
33020 Amaro (UD)
– Italy
Tel:
+39 0433.485.411
Fax
: +39 0433.485.499
E
-mail: support.it@eurotech.com
Web:
www.eurotech.com
For your Eurotech local contact refer to: eurotech.com/contacts
For the E
urotech Global Support Centre refer to: support.eurotech.com
For the Eurotech Download Area refer to:
eurotech.com/download
All trademarks, registered trademarks, logos, trade names and products names contained in this document are the property of their respective owners.
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18

Eurotech DynaPCN 10-20 Owner's manual

Type
Owner's manual

Eurotech DynaPCN 10-20 is a device for counting people and passengers. It has two channels, allowing it to count people entering and leaving a given area simultaneously. The DynaPCN 10-20 also has a digital input that can be used to connect a door sensor, enabling it to automatically count people only when the door is open. Additionally, it features an Ethernet port for communication and PoE (Power over Ethernet) capability, allowing for easy installation and power supply.

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI