You are on page 1of 29

2.........................................................................

:4...............................................
.1 4................................................
.2 8..................................................
: 17........................................................
.1 17................................................
.2 Data 20......................
.3 Data 22....................
27.......................................................................


)Supervisory Control and Data Acquisition (SCADA



.
SCADA :
Hardware
.
Software
Reports
Alarms .
Communication


)
(.

.
PLC 3

SIMENS
.
PLC
Ladder PLC

2

PLC
.
Controller
Display

PLC SCADA Cost


3000 L.E
)10000 L.E (HMI

Microcontroller SCADA Cost


50 L.E
) 500L.E ( Computer


SCADA
...
30
.
8 7
8 LCD

USART .
:
:

.
:
Analog Sensor Digital Sensor
8 8
.

:
.1

ATMEGA 32
MikroC Pro for AVR 5.4
Protues 7.8 SP2
LabView 8.5
Virtual Serial Port Kit

ATMEGA32 PORT
PORTA
PORTB
PORTC
PORTD

8 Analog sensor
7 Digital sensor
8 Digital Output
USART + LCD
Protues

PORTA Analog Sensors


0 5 .

PORTB Logic State Digital Sensors 0


1 Logic State .

PORTC
..
LED
.

RESET

PORTD

.2


PORTC Output

1 0

Line 2
Line 3

PORTC

Line 4

Line 1

bytes byte 0
255 byte ASCII CODE
Decimal
80
48
255

Binary
0000 0101
0000 0011
1111 1111

ASCII
P
0


PORTC
LEDS PORTC
0 ASCII 48 Decimal

MikroC Tools >ASCII





Digital
Analog

10

Line 1

PORTB

Line 2

High PIN 0 1 PIN 1


) 8 (

Line 3

0 255 byte
ASCII total

Line 4

0
.
total 128
PIN7 128
PORTB

Line 5

data_send

Line 6

ABC

Line 7

total

Line 8

Line 9

PORTB Input

Line 10

Line 11

data_send
.

Line 12

11

Digital
Analog
Analog to Digital Converter ADC
0 5
Digital resolution 8 bit 10 bit
output

notes

5 256

19.6

input

0-5 Volt

resolution

8 bit

5 1024

0-5 Volt

10 bit

4.8

ADC bit 10
0 1024
byte 0 255 4 resolution
1024 100 200
.255
array
.
0 255 .char
0
.

12

13

ADC

Line 1

0 1024

Line 2

0 255 4

Line 3

PORTA

Line 4

adc_rd0 4

Line 5

4 1024 255
5 4 int

Line 6

ABC

Line 7

Line 8

Line 9

14

15

16

LabView Graphical
Programming Language
. National Instruments
RS232 NI VISA Runtime Engine

.1



Timeout
VISA Resource Name
Baud rate

Flow control

Right Click > Create > constant


Right Click > Create > indicator
Right Click > Create > constant
..
Right Click > Create > constant

constant Front Panel



17

Block Diagram

Front Panel

VISA Resource Name

Write buffer

Error in , Error out

VISA Resource Name out


18

VISA Resource Name

constant Bytes

data_send

Byte count

Error in , Error out

VISA Resource Name out


data_send bytes
Byte Count

Read buffer

VISA Resource Name

Error in
19

.2 Data
8 PORTC
1
5
.
Right Click > Buttons > Toggle Switch

20

8 Cluster Cluster Array


0 255
. ASCII

> Right Click > Programming > Cluster


Bundle
> Right Click > Programming > Cluster
Cluster to Array
> Right Click > Programming> Numeric
Conversion > Boolean Array To number
> Right Click > Programming > Numeric
Data manipulation > Type Cast
> Right Click > Programming > String
String Subset

) Type Cast 4
( 3
8

21

.3 Data
data_send 13

10 11 12

13
End Protocol

Data_send[0] 1 2 3
Start Protocol

Data

Right Click > Programming > String > String Subset

Right Click > Programming > Comparison > Equal


Right Click > Programming > Boolean > And

22

%100 data
case structure gauges
Analog Sensor Digital Sensor

23

Right Click > Programming >


String > Conversion > String To
Byte Array
Right Click > Programming >
Array > Index Array
Right Click > Programming >
Numeric > Conversion > To
Unsigned Long Integer
Right Click > Programming >
Numeric > Conversion > Number
To Boolean Array
Right Click > Programming >
Array > Array To Cluster

Right Click > Programming >


Cluster > Unbundle




PCB
.

24

25

26

27

:
:
: -
:
eng.haitham.khairy@gmail.com:
01112970435 :
28