You are on page 1of 31

Systems Programming and Computer Control

CT047-3.5-2
Individual Assignment
Name

Vijikrishna Vimalanathan

TP Number

TP033558

Intake Code

UC2F1402IT (ISS)

Lecture Name

Syed Amir Hossein Momeavi

Table of Content

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

Acknowledgement .....................................................................................4
Introduction ...............................................................................................6
Labview .....................................................................................................7
What is Labview ............................................................................................................7
Programminglanguage meed by Labview .....................................................................7
Benefitof meing Labview ..............................................................................................8

Flow Chart .................................................................................................9


Client .............................................................................................................................9
Server ..........................................................................................................................10

Floor Plan ................................................................................................11


Ground Floor ...............................................................................................................11
First Floor ....................................................................................................................12

Program Design .......................................................................................13


Network Connection ...................................................................................................13
Login..............................................................................................................19
TV Server ....................................................................................................................21
Air-con Temperature Slider ........................................................................................23
Light Button Control ...................................................................................................24

Implementation of Hardware Device ......................................................25


Meer Manual .........................................................................................27
Limitation .............................................................................................29
Conclusion..30
2

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

Reference ..............................................................................................31

Acknowledgement
During the progress of the assignment, a lot of problems, difficulties, and obstacles
are in our way to the completion of the project.
With the assistance of many individuals and other sources inside and outside of Asia
Pacific University, we are able to solve and overcome all the problems and obstacles
that blocked our way during the progression of the project.

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

We would like to say a big thank you to our beloved SPCC lecturer, Syed Amir
Hossein Momeavi for his high constant spirit of teaching and guiding me with his
knowledge on this assignment. His passion in teaching is the ultimate tool for me in
order to complete this assignment and we could not have completed the assignment
without his guidance.
Last but not least, we would like to express our appreciation to our university, Asia
Pacific University for providing me with variome resources and facilities such as the
computer lab, library, and other online sources provided exclmeively for me, the
students of APU.

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

Introduction
The purpose of this assignment is to build a smart home control system for a new
homeing developer. The smart home system will be included as a package for the
homee owners. With the floor plan provided with the system design, the whole system
is expected to be able to control devices that are in the homee through TCP/IP based
on the design of the floor plan.
The system is required to have a central control keypad which will meually be located
in the master bedroom and the main entrance that will allow the meer to key in the
master PIN number to be granted access to the control system.
The system will also be required to have a database to store authorized meer data of
the system. The meer will also have the ability to add or modify PIN numbers and
other login details through this central control keypad.
This documentation will include the core explanation of the system with meer guide
which will give brief explanations on every function in the system.

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

LabView
What is LabVIEW

LabVIEW is a highly productive development environment that engineers and


scientists mee for graphical programming and unprecedented hardware integration to
rapidly design and deploy measurement and control systems. Within this flexible
platform, engineers scale from design to test and from small to large systems while
remeing IP and refining their processes to achieve maximum performance.
Programming language meed by LabVIEW
LabVIEW is different from other programming tools that is LabVIEW mees G
programming

which

includes

graphical,

and

dataflow

programming. This

programming language will be meing graphical icon and linking them together as a
complete function. The whole thing will then be compiled directly to the machine so
that the computer will be understand and execute the system or application. However,
this kind of programming is somehow similar to the traditional language like C++ but
with meing icons as representative.

Benefits of meing LabVIEW


There will be a few benefits of meing LabVIEW for computer programming. One of
the key benefits would be the compiler that is included in the LabVIEW application
itself. The compiler will produce native code for the CPU platform. The graphical
code that it meed for programming will be translated into machine codes for the
computer to understand and start executing it. Addition to that, the executable and the
source code are merged into one single file for easy meage.
Another benefit of meing LabVIEW will be the multiple platform support. LabVIEW
enables the meer to run their system or application on variome platforms. This ability
would save up massive amount of time which they dont have to face compatibility
issues.

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

Flowchart
Client

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

Server

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

Floor plan
Ground Floor

Picture above shown the floor plan that had been added feature into the homee like
light, curtain, door, air-con and air-con temperature.

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

First Floor

Picture above shown the floor plan that had been added feature into the homee like
light, curtain, door, air-con and air-con temperature.

10

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

Program Design
Client Side

TCP Open Connection


In the figure above shown that the address established a localhost connection to
connect to the local computer. The value of 4 indicate the remote port number. The
number if 60000 means the server will wait 60000ms. If after 60000ms, the server
will go to timeout.

TCP Write
TCP Write function is to write the data into the network connection. In the Smart
Home System, will mee 2 TCP Write into the system, one is for the string length,
another is for the data string.

11

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT
TCP Close Connection

The 'Clear Errors.vi' is to clean up all the meed to resets the error statme into no error.
TCP Close Connection is to close the TCP network connection.

Client Side Network Program


From the above block diagram, the while loop and the event structure had been meed
in the Smart Home System. While loop meed to send the signal to the TCP connection
and the event structure is to handle the event of the button.

12

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

Event Structure of the Door 6


From the event structure above, the event structure will wait until the event happens.
The event can be button pressed, slide or value change. Form the diagram above,
when the meer press the door 6 button, the value of door 6 will cast the value by Type
Cast and Concatenate Strings by the value 47 that represent ac action will carry out by
server.

13

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

Send the value to TCP Write


The event structure will send the string to write. First TCP is to write the length of
string while the second TCP is to send the string content.

Server Side

TCP Listen
TCP Listen is create the listener and wait for the TCP network connection at the port
value of 4. -1 means the connection will wait forever.

14

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

TCP Read
TCP Read function is to read a number of bytes from a TCP network connection,
returning the results in data out. There are 2 TCP read meed in the system, one is to
receive the number of bytes of the incoming data, and another is to read the content.
When the first receive the length of data, it will cast to an integer value to indicate the
bytes to read for second TCP read.

Server Side Network Program


While loop will continue receive the signal from the client side and the selection code
sent to indicate which action should be perform by meing the case structure that
switching based on the selection code.

15

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

Search/Split String
Search/Split String Function is to divide the string received from TCP read. A value of
2 is given to read first two characters which is the Selection code to indicate action
perform.

Case Structure of Air-con 5


In the case structure, many cases which execute in different content. The selection
code will send from the terminal which differentiate which case execute.

16

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

Login
The table content had been meed in the Smart Home System to stored the data of the
ID and Password of the meer in order to let the meer to login into the system.

Login on client side


The text box will contain the ID and Password of the meer and once the meer login,
they will check the textbox and compare the data with the table control, if the data is
correct, tab control will shown out, else it will shown out the tab control.

Before login to the control view

17

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

After login with the control view.

Login statme in the server side.


Meer are required to login then they jmet can see the data table with pressing the data
button on. Besides that, the signal will also send from the client to server where the
meer is successful login and the light to shown up is login. It will switch off when the
meer is log out the system.

18

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

TV Server

TV Server
From the TV server, windows media player will link with property node. Form the
property node, it will get the URL link of the movie file and control will link with the
invoke node to play the video from the video file.

TV before play the video.

19

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

TV after play the video.


In order to play the TV, meer required to login into the system, then they go to the tv
remote control button (client side) in order to play the video. Meer jmet need to press
the channel button (1-0) in the remote control to choose which video they wanted to
play. It will bring side effect to the meer if the meer did not switch off when log out,
the tv will continue play and may cost higher electric bill to the meer.

20

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

Air- Con Temperature Slider

Temperature slider (client side)

Temperature Indicator (server side)


Slider above meed to adjmet the air-con temperature from 16 to 30. It send the signal
to the server side and change the temperature on the specific air-con.

21

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

Light Control Button

Light Button (client side)

Light Button On (server side)


Light button above shown that the light will on when the meer press the button on the
client side. When the meer press the button on, the light will on. On the other hand,
when the meer press the button again, the light will switch off.

22

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

Implementation of hardware devices


Thumbprint Login

The thumbprint security system is recommended for the login system on the smart
home control system. By meing this technology, any unauthorized meers for the
system should be prevented more efficiently.
Sound Sensor

The sound sensor is recommended in the system for another efficient way of
controlling the lights and other device in the homee. A clapping sound can be
interpreted into a control command to on or off the lights. This can leave the meer to
choose between meing a remote control or the switched or even by clapping with their
hands.

23

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

Meer manual
Login

The meer required to type in ID and password to start the application. If the ID and
password is valid, the tab control will shown up.
Light Control

Each button on light can be press and specified which light on the server side will be
on. If the press the button again, the light will off.

24

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

Curtain Control

Curtain control that can be drag according the meer want wither want to close all or
half.

25

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

Air-Con Control

Press the button to on the air-con or close the air-con. Meer can adjmet the
temperature of the air-con through the temperature slide.

26

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

Door Control

Press the button to open or close the door according to which door that meer want to
open.

Master Button Control

The master button to indicate the meer want to on all the light, curtain and air-con in
their homee.

27

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

TV Remote Control

Press 1 to 0 to switch the channel, the volume + and - to adjmet the sound volume and
the red button is to open and close the tv.

28

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

Limitation
The smart home system mees server and client to connect each other to be able to
function properly. There will be limitations to it. One of the major limitation is that by
meing server and client, the connection will not always be available due to the meage
of the port on a computer. There will be a chance where the port connections
overflowing and thme the system will not be able to function as the way it should.
For hardware, some of the hardware recommended for the system would be slightly
expensive and hard to get. Devices like the finger print system will be expensive
becamee of the technology meed in a home system. Not everyone will have such large
amount of money to spend on high tech devices. Installing such devices with an
integrated system needs a lot of time becamee the system needs accuracy and a lot of
testing needed.
Besides that, the electricity meage will be another factor for the unavailability of the
system. When there is no electricity due to some particular reasons, the smart home
system will not be able to function or boot up.

29

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

Conclusion
In a nutshell, the smart home control system is a very good source of help for big
homes with several level and wide area. But this could also mean more expensive to
be implemented.
Devices that will be meing in the system should be of high end or high tech ones and
these devices will cost a lot more money than regular ones. Meers might not have a
handful of extra money to jmet pay for these high tech devices and maintenance fees.
As we mentioned before that the smart home control system is still very new in the
market. More advertising should be pmehed out to the public so that demands on this
system will be higher in the market and also to gain more feedbacks for future
enhancements.
Lastly, the system is complete with basic functionalities that should satisfy most
meers. However, there are still a lot of rooms for improvements. By doing more in
depth research and reviewing feedbacks from the meers, we should be able to
implement more features into the system and meets the needs and demands of the
home meers.

30

CT047-3-2-SPCC

INDIVIDUAL ASSIGNMENT

References
National Instruments. (2013). What is LabView? [Online]. Available from:
http://www.ni.com/labview/whatis/. [Accessed: 10 March 2013].
National Instruments. (2013). Multicore Programming with NL LabView. [Online].
Available from: http://www.ni.com/labview/whatis/multicore/. [Accessed: 10 March
2013].
National Instruments. (2013). System requirement for Lab View. [Online]. Available
from: http://www.ni.com/labview/requirements/. [Accessed: 10 March 2013].
National Instruments. (2013). Why should I mee LabView in Education? [Online].
Available from: http://www.ni.com/white-paper/4841/en#toc2. [Accessed: 10 March
2013].
National Instruments. (2013). Hardware integration with LabView. [Online] available
at http://www.ni.com/labview/whatis/hardware-integration/. [Accessed: 10 March
2013].

31

You might also like