Eurotech DynaPCN 10-20 Owner's manual

Type
Owner's manual

Eurotech DynaPCN 10-20 is a PoE Ethernet-connected device for passenger and people counting in various public spaces and commercial buildings. It can be used as a standalone unit or integrated into a larger system. The device offers accurate and reliable counting with features like dual-directional counting, real-time data transmission, and the ability to differentiate between adults and children. Additionally, it has an alarm output for abnormal situations and supports remote configuration and monitoring via Ethernet.

Eurotech DynaPCN 10-20 is a PoE Ethernet-connected device for passenger and people counting in various public spaces and commercial buildings. It can be used as a standalone unit or integrated into a larger system. The device offers accurate and reliable counting with features like dual-directional counting, real-time data transmission, and the ability to differentiate between adults and children. Additionally, it has an alarm output for abnormal situations and supports remote configuration and monitoring via Ethernet.

DynaPCN 10
-20-xx
Ethernet/POE Passenger & People Counter
ETHERNET COMMUNICATION PROTOCOL
Rev
1-4 – 5 May 2021DYPCN-10-20-xx_EthComProt_EN_1-4 – ENGLISH
© 2021 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
1-4
Updated commands
5 May 2021
DynaPCN 10-20-xx Ethernet Communication Protocol Rev. 1-4 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 Ethernet Communication Protocol Rev. 1-4 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.
NOTES:
The DynaPCN acts as a “listening device” on TCP port 5400
For commands that return a reply: always wait for the reply to be received correctly before
closing the communication
All the parameters or the numerical responses (int and short) formed by more than one
byte (for example the output of gcounters, or the output of the function input0) follow the
ordering from LSB (Less Significant Byte) to MSB (Most Significant Byte ).
Example:
If gcounters replies with “99 01 00 00 E7 01 00 00” (there are two integer 4-byte counters),
the result will be as follows:
Result in hexadecimal format
Result in decimal format
00 00 01 99 (0x0199)
409
00 00 01 E7 (0x01e7)
487
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 you send, always 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 Ethernet Communication Protocol Rev. 1-4
6
/ 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 0x00 : disabled
If 0x01 : 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
String containing: “disconnect”
A byte “0x00” is included as terminator
Sample Code
char response[11]; // "disconnect" + terminator
SendString(sock, "disconnect");
RecvString(sock, response);
2.3 enable_pc
Command enable_pc
Command Description Enables or disables people counting
Parameters Unsigned char (1 byte).
Parameters Description
If 0x01 : enables people counting
If 0x00: 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 Ethernet Communication Protocol Rev. 1-4 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 current 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 variables unsigned long (4 bytes).
The first is the value of the In counter
The second is the value of the Out counter.
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 current system date in format DD/MM/YYYY.
The second contains the current system time in format HH.MM.
A byte “0x00” is included as terminator at the end of each string.
Sample Code
char sysdate[16];
char systime[16];
SendString(sock,"gdatetime");
RecvString(sock,sysdate);
RecvString(sock,systime);
.
Commands list DynaPCN 10-20-xx Ethernet Communication Protocol Rev. 1-4
8
/ 18
2.7 gdoorstatus
Command gdoorstatus
Command Description Gets the door status
Parameters
Parameters Description
Returns
unsigned char (1 byte).
If 0x01 : The door is open
If 0x00 : 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 Ethernet Communication Protocol Rev. 1-4 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 Ethernet Communication Protocol Rev. 1-4
10
/ 18
2.10 ker_version
Command ker_version
Command Description Gets the kernel version
Parameters
Parameters Description
Returns
String containing the current kernel version number (e.g. “2.1”).
A byte “0x00” is included as terminator.
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).
The first byte indicates the presence / absence of issues:
= 0x01
: No errors
0x01 : Error
T
he 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));
T
able 3. Error Codes and their meaning
Error code
Meaning
0
No issues
1
One or both video sensors partially occluded
2
One video sensor completely occluded
3
Both video sensors completely occluded
4
Right video sensor obscured
8
Left sensor obscured
12
Both video sensors obscured
16
High lighting difference between right and left video sensors
20, 24, 28
High lighting difference between right and left video sensors, and both video sensors occluded
The difference between occlusion and obscuring is the following:
Occlusion: condition in which an object placed near one or both video sensors partially or completely covers them.
This condition may occur in the typical case where a video sensor is covered by a hand, an opaque adhesive, or
a
c
hewing gum. If this condition persists for a sufficiently long time, it is necessary to verify that there are no objects
placed on the video sensors that prevent them from functioning properly
Obscuring: abnormal low light condition. If this condition persists for a sufficiently long time, it means that the PCN is
working in an environment too dark for its configuration. It is necessary to check the intensity of the infrared LEDs and
consider whether to increase it.
DynaPCN 10-20-xx Ethernet Communication Protocol Rev. 1-4 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 Ethernet Communication Protocol Rev. 1-4
12
/ 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 (0x00) to 255 (0xFF):
When 0x00 : OFF
When 0xFF : Maximum intensity
Returns
Codice Esempio
unsigned char val;
SendString(sock,"sled");
Recv(sock,&val,sizeof(val));
DynaPCN 10-20-xx Ethernet Communication Protocol Rev. 1-4 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 version of the Operating System installed (example: “1.6”).
A byte “0x00” is included as terminator
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 0x01 : High logic level
If 0x00 : 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 0x01 : High logic level
If 0x00 : Low logic level
Sample Code
unsigned char val;
SendString(sock,"testin1");
Recv(sock,&val,sizeof(val));
Commands list DynaPCN 10-20-xx Ethernet Communication Protocol Rev. 1-4
14
/ 18
2.21 version
Command version
Command Description Gets the installed imgserver version
Parameters
Parameters Description
Returns
String containing the version of imgserver installed (example: “2.3.11.3”).
A byte “0x00” is 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 > 0x00 : 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 Ethernet Communication Protocol Rev. 1-4 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 > 0x00 : 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 Ethernet Communication Protocol Rev. 1-4
16
/ 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 Ethernet Communication Protocol Rev. 1-4 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 Eurotech 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 PoE Ethernet-connected device for passenger and people counting in various public spaces and commercial buildings. It can be used as a standalone unit or integrated into a larger system. The device offers accurate and reliable counting with features like dual-directional counting, real-time data transmission, and the ability to differentiate between adults and children. Additionally, it has an alarm output for abnormal situations and supports remote configuration and monitoring via Ethernet.

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

Finding information in a document is now easier with AI