Post on 24-Dec-2015
transcript
CCNCCNCentral Control Network
Part A presentation
Winter & Spring 2002/03
Student : Kormas Tal
Guide : Gerber Alex
CCNCCN - motivation
• Many systems around the world use central computer for
security devices (such as entrance and security
cameras).
• Most of the devices are low resource requires and so
many could be connected to one computer.
• We would like to take advantage of the USB port speed
and availability, and implement multiple area network (a
separate bus for each area) connected to it.
3
CCN - functional
Devices
Data base
Internet
Users
Future
USBHUB
תורFIFO
עם זכרון
CAN BUS
CAN to USB & Can Master
CCNCCN – block diagram view
אלמנט תקשורת
ושליטה
Nice for a future projectFuture
CCNCCN – main idea• Each device uses bus interface to connect a CAN bus.
• Each level/area have it’s own bus.
• All buses controlled by a master device, which also
convert the CAN protocol into USB protocol.
• All the Can Masters outputs (USB) are connected to a
USB Hub (which is power supplied, so the net will keep
working when communication to the computer N/A).
• The hub connected to a memory unit for keeping the
data in a FIFO line if the computer is down.
6
CCN – main idea (cont)• The data from the devices is inserted to a Database on the
computer side.
• The users connect to the computer and login. Each user
have links to is devices.
• The user can look on the data received from his device and
configure them, according to his permissions.
• As a conclusion : The project is a very interconnected with
other devices, both networked (CAN/TCP/USB) and both
functionality (door opener/cameras and etc.)
7
CCN - Interfaces
• There are 3 main interfaces on this project:
1) devices interface with the network bus
using CAN protocol (ISO/IS 11898-2 )
2) buses interface with the PC using USB
protocol.
3) users interface with the PC and data using
TCP/IP protocol.
8
CNN – spec
• Since CAN bus can support 1024 devices, and it’s
throughput is 125KB/sec.
• And Since USB 1.1 (slow) can support 12MB/sec.
• And Since there is no limit to hub usage.
• We could support up to about 100 full buses (or more if
it’s not full).
• TCP/IP rates are network based (since each user could
be connected in a different speed).
9
CCN - Software
אחד תהליכונים:2התוכנה הבסיסית כוללת •הוא הראשי והמאתחל, השני הוא המאזין על ה
USB.
עבור כל הודעה שמתקבלת נפתח תהליכון •חדש, לטיפול בהודעה הזו.
אותו תהליך בודק את המידע שהתקבל ומבצע •את הפעולות שהוגדרות עבור קבלת המידע ע"י
אותו רכיב (ע"י קריאה ממסד הנתונים).
10
CCN – Devices1. Input : CAN packet p (this will be done one thread for 1 packet)
2. IF p.data.cont then
3. Act recording to the data(add/remove).
4. ELSE
5. db.(p.dev).data(time) = p.data
6. if(irreg(db.(p.dev))) do db.(p.dev).irlist
7. else if(ok(db.(p.dev))) do db.(p.dev).oklist
8. else do db.(p.dev).failist
9. End if
10. return
11
CCN – Devices databaseDatabase for device contains the following data for each:
1. device name
2. Device type
3. configures (i.e. good time, legal users list)
4. list of devices for irregularities.
5. list of devices for legal operations
6. list of devices for illegal operations.
7. What data is considered good.
12
CCN – log Database
Each line at the log has:
• Device ID
• Device name
• Time
• Irregularly flag
• OK flag
13
CCN – implementation notes
• The computer OS: windows 2000
• I’m using C# to implement the software, and Microsoft
SQL Server for the database.
• I’ll use the SQL server to also log the operation made by
the users for the administration side.
• NOTE : there is special user “admin” which will have a
different kind of page, and could control all users and
devices. He is the manager of the system.
14
CCN – course of development• First I had to verify that the master device works
properly. It took some time to understand it’s demo program.
• Then developing the software on C# was needed, and this was problematic.
• Connected the bus with the SQL.• Wrote a program for simulating 2 clients on the bus.• Connected a PIC device to the bus and check
working with it.• Developing CANopen layer for the program (only
PDO). This is done with Konstantin, and not yet completed.
15
CCN – Test Spec
• The project was checked using a know working devices.
• One CAN bus was used.
• It had 2 devices connected to the bus.
• Data was received and translated correctly. The data
received from the package, is causing a correct data
fetch for the device who sent it, and followed by a correct
sequence (O.K / Fail / Irregularity)
16
CCN – Software checks
I’ve checked my software as follow:1) Devices work : checked that I get the
messages on the bus from a debugger connected to the bus.
2) Database insertion work: checked that when a device message receive, it’s inserted to the right place on the database.
3) Data decision work : checking correct time, check if the data correct. I’ve checked 2 different devices, with all the possibility groups (OK / Fail / Irregularity)
17
CCN – what already done
הפרוייקט אופיין•
תיאור התוכנה הושלם•
צבירת ידע בשפת התכנות ורקע בנושא מסדי •נתונים.
הוכנו מצבורי ידע בנושאי התוכנה (כמו הגנת •אתרים וכו').
יחיד Can Busנכתבה ונבדקה התוכנה עבור •(עם מספר אלמנטים) וללא משתמשים.
18
מה למדתיNet. ובסביבת פיתוח #Cראשית למדתי להשתמש ב •
.#C לשפת ++Cלמדתי להמיר קוד משפת •
למדתי כיצד עובד קישור ספריה דינמית עבור פונקציות להעתקת •
classes.או זכרון
, כיצד להגדיר ולשנות הגדרות של SQLלמדתי כיצד לכתוב שאילתות ב •
טבלה.
.concurrency וtransactionsלמדתי ליישם את החומר הנלמד לגבי •
השתמשתי בחומר התאורתי לצורך יישום וחשיבה על פרוטוקול •
CANopen לעומת פרוטוקול PCI (פרוטוקול דמוי busהתקשורת על ה
וכו).
19
CCN – why not…
• Why not single user?
Single user cannot secure a large site, we want to
allow more users, each securing a smaller area.
• Why not single bus?
Single bus won’t allow large number of devices, and
we’ll be limited by CAN max throughput.
20
CCN – why not…(cont)
• Why using hub?
since we are limited on the number of USB’s
connectors to a single computer -> HUB.
21
CCN – Next Step
)CANopenיש לסיים את מימוש הפרוטוקול (•
.USB Hubיש להזמין •
למערכת ולהרחיב את busesיש להוסיף עוד •התוכנה לתמוך בכולם.
יש לכתוב את התוכנה עבור משתמשים.•
יש לבדוק את המערכת השלמה ולהוסיף עליה •הגנות (נגד פריצה).
CCN – part 2 timetable10.4.03 : סיום מימוש הפרוטוקול •
Buses : 31.4.03 ו Hubהוספת •
31.5.03 כתיבת התוכנה עבור המשתמשים :•
31.6.03 סיום של כל הבדיקות, הוספת ההגנות וכו':•
20.7.03: עד ה הגשת הפרוייקט •