Professional Documents
Culture Documents
<Instructors Name>
Objectives
$elcome
+ntrodction to Cicode
Conversion %nctions
+nclde %iles
Agenda ) (ay /
Conditional Exectors
Arrays
Emergency Exits
&itc.en
Brea2s 3 lnc.
4obile #.ones
Compendim
$elcome
+ntrodce trainer
5ame
Employer
Express ideas
Offer examples
8estion
0elax
-raining Agreement
-rainer1s role
Listen non)defensively
'elp yo learn
-raining Agreement
Yor role
Be on time
#articipate
Enjoy yorself
Ergonomics
Environmental conditions
Lig.ting
Air conditioning
0eglar movement
Eye strain
+ntrodction to Cicode
Chapter 2
+ntrodction to Cicode
Chapter Overview
A programming langage>
Execte Command
(igital -ag
Analog -ag
,ariable*Bvale
,ariable*B,ariable/
Plant1_Pump=1 ;
Plant1_Pump=0 ;
Oven_Temp=10 ;
Oven_Temp=Kettle_Temp;
"tring ,ariables
Expressions
8 + 4
Motor_Speed / 5
4ltiple statements
Add a prompt
T)*_P4_P+ = T)*_P1_P+ + T)*_P_P+ ;
Prompt,-*al$ulat.on .s /.n.s%ed-0
Operator +npt
*onve3or_Speed=1r21
*onve3or_Speed=1r2+alue1
4oT%.sT%en4oT%at,1r2151r20
Varia'le $rgu*ent +,
$rgu*ent +,
Chec-s )or "u*eric .alue
$rgu*ent +, $rgu*ent +2
/(20 ,2& 1 &25 /enter0
C.ange 4isc*
properties
Calling %nctions
(efinition
/un$t.on&ame,1r2151r2 60
Prompt,'S%utdo7n(0
S%utdo7n,0
$rgu*ents passed
to the )unction
"a*e o) the (unction
Calling fnctions
%nction +nformation
Loo2 p in online
.elp
Prompt
S%utdo7n
Pa2e4.spla3
#assing (ata to %nctions
<o2.n,'Mana2er(5 '1#*(0
Login ID Password
#assing 5meric Argments
1ss=.n,->+alve-55805150551+8+15'+alve_*ool_*M4-0
"a*e o) Popup
%indo%
Location on
screen
7ode o)
Popup
%indo%
Tag
#assing ,ariable Argments
4spStr,55(Te?t/ont(5 *O1<_<@+@<0;
4spStr,55(Te?t/ont(5 '*O1<_<@+@<(0;
$ni*ation
Point
nu*'er
8isplay
using this
)ont
Value o)
C5$L6LEVEL .aria'le
%ill 8isplay
C5$L6LEVEL string %ill
8isplay as its =!uoted>
4spStr,"A5 -*ontrol<.m.ts-5 Re$.pe0
$" &2?
0etrning (ata
"ccess 0
Data
As in?
date,0
Prompt,'9ello5( + /ull&ame,0 0
#esult o)
@(ull"a*eA
used as a
para*eter to
@Pro*ptA
BTa2B=/orm&umPad,-@nter-5BTa2B500
Pass Value )ro*
nu*Bpad into Tag
.aria'le
Title gi.en
to nu*'er
pad
Value
passed i)
cancelled
7ode
standard in
this case
Execte %nction on "tartp
Messa2e,'Startup(5'9ello
=orld(5A40
elect
Custom
7ode
7odi)y
"mmary of ,ariables
(igital@,ariable B C
(igital@,ariable B *
(igital@,ariable* B (igital@,ariable/
+nteger@,ariable B FK
+nteger@,ariable B )*/GK
+nteger@,ariable* B +nteger@,ariable/ J F
"tring@,ariable B DappleE
%red
,ariable
#LC variable
Cicode variable
D%redE
"tring
%red9:
%nction
M%redN
#at. sbstittion
Array index
O%redP
%ield definition
"etting variables
Using expressions
Operator inpt
Order of #recedence
Classes of Operators
4at.ematical
Operator Description
+ Addition 9for nmeric vale:
+ Concatenation 9for string variables:
"btraction
! 4ltiplication
" (ivision
#OD
4odls 90emainder:
+nt-o"tr9: fnction
#OD Operator
Concatenation
Messa2e,(P- 5 (T)*_P_P+ = - +
)ntToStr,T)*_P_P+0 5 A40
Logical Operators
12.tator_S.lo_+
!ill be trned on O5LY
!.en bot.
12.tator_1l8ast_+
and
*entr.8u2e_*lar_+
are trned on7
(isplay tag* as t.ree digits before and one digit after t.e decimal point
Operator Description
- 9colon:
"tring %ormat
%ormat Operators
.peci/ier Description Function 0se 12ample
S -.e .as.
c.aracter
-.e nmber of
c.aracters to
display to t.e
rig.t of t.e A5
####
+ 23
+472213
C Tero #adding
#0##
+0023
) 4ins Ustification
#-###
+23
7 #eriod (ecimal notation
###.##
+ 23.54
EU Engineering
nits
#.##EU
" Exponential
notation
#s###
+1.234e+012
%ormat Operator
Messa2e,'P"- 5 T)*_P"_P+CDDDEDD5A40
TA !ormat
Operator order of #recedence
Order Operator
* 34
/ &O(
F ! , " , #OD
K -
L + ,
H + , , , +* , ,*
G * , +,
I %&D
V O'
*C 56(%&D, 56(O', 56()O'
#recedence Examples
4at.ematical operators
Logical operators
0elational operators
Order of precedence
-.e Cicode Editor
Chapter 7
-.e Cicode Editor
Chapter Overview
C.anging #references
"tarting t.e Cicode Editor
Compile & 0n
Compile only
Error
shown
oTo
error
Go-o Errors
Color Coding
Ato +ndenting
Comment 3 Uncomment featre
En.anced %ile 5avigation
WctrlX WspaceX
Select List
!unctions
Right Clic,
in te+t
+ntellisense Atoprompt
Cicode #references
C.apter K ) "mmary 8estions
Goto errors
%ile navigation
Editing tools
%nction tools
#references
Cicode %nctions
Chapter 8
Cicode %nctions
Chapter Overview
"imple %nctions
"trctre of a %nction
"tatements
,oid %nctions
Cicode ,ariables
+nclde %iles
"imple %nctions
PF#<)*
/F&*T)O&
)n$*ounter,0
)/ *ount J 100 T9@&
*OF&T=*OF&T + 1;
@<S@
*OF&T@R = 0 ;
@&4
@&4
"cope of %nction #blic or
#rivate
"tart of %nction
5ame of %nction
"tart of Code
End of +% statement
End of Code
%nction "yntax Y #sedocode
9@<<O
StandFp,0
)/ told T9@&
Stand Fp ;
@<S@
Rema.n Seated;
/.n.s%ed
KOO4#L@
%nction Elements
"cope
(eclaration
5ame
"tatement
"cope
#UBL+C
(efalt
#0+,A-E
'U()%#
FUN#$%&N
StatementE*amp+e!
)/ M1S9_PFMP T9@&
@<S@
@&4
END
Statements
,oid %nctions
'U()%#
FUN#$%&N
,oi-E*amp+e!
)/ M1S9_PFMP T9@&
@<S@
@&4
END
PF#<)*
/F&*T)O&
M34ateT.me,0
M)S*1=4ate,"0;
M)S*=T.me,10;
@&4
PF#<)*
/F&*T)O&
1ud1larm,0
4spPla3Sound,'MRF&NCTadaE7av(500;
Messa2e,'1larm(5(9old.n2 TuHe too 9ot(5480;
@&4
$TA3$ )R $TA3$$
/F&*T)O&
1vera2e@?1,0
T)*_P_P+ = ,T)*_P1_P+ + T)*_P4_P+0 /
@&4
Cicode ,ariables
(ata -ypes
"trings ) "-0+5G
+ntegers ) +5-
"yntax?
S*OP@ 41T1TLP@ &1M@ = )&)T)1<+1<F@
K<O#1< STR)&K sM3Str.n2 = '( > &ull +alue
lobal
4odule
Local
STRIN
INT
REAL
1ariable
Name
Initiali5e
1ariable
Global Cicode ,ariables
(isplay -ime
Convention? Fi+ename.cii
0eferenced by?
PJ8.lenameQ
D) Include %'
Use 5otepad
+%larms;cii,
1ud1larm,*CO=)&4O=SOMed.aO$%.mesE7av5
'9old.n2 TuHe(5 '9old.n2 TuHe Too *old(0
C.apter L ) "mmary 8estions
Elements of a fnction
,oid fnctions
Cicode variables
+nclde files
Conditional Exectors
Chapter <
Conditional Exectors
Chapter Overview
+%
%O0
$'+LE
"ELEC- CA"E
+% "tatement
+ncrease L+C@Balance@#,
/F&*T)O&
/OR_@?ample1,0
)&T *ounter;
)&T .SP;
)&T .P+;
.SP = <)*_#alan$e_SP;
.P+ = <)*_#alan$e_P+;
/OR *ounter = .P+ TO .SP V 1 4O
<)*_#alan$e_P+ = <)*_#alan$e_P+ + 1;
SleepMS,"000;
@&4
@&4
(ecrease L+C@Balance@#,
/F&*T)O&
/OR_@?ample,0
)&T *ounter;
)&T .SP;
)&T .P+;
.SP = <)*_#alan$e_SP;
.P+ = <)*_#alan$e_P+;
/OR *ounter = .SP TO .P+ V 1 4O
<)*_#alan$e_P+ = <)*_#alan$e_P+ V 1;
SleepMS,"000;
@&4
@&4
/F&*T)O&
/OR_@?ample",0
)&T *ounter;
)&T .SP;
)&T .P+;
.SP = <)*_#alan$e_SP;
.P+ = <)*_#alan$e_P+;
)/ <)*_#alan$e_P+ Q <)*_#alan$e_SP T9@&
/OR *ounter = .SP TO .P+ V 1 4O
<)*_#alan$e_P+ = <)*_#alan$e_P+ V 1;
SleepMS,"000;
@&4
@<S@
/OR *ounter = .P+ TO .SPV1 4O
<)*_#alan$e_P+ = <)*_#alan$e_P+ + 1;
SleepMS,"000;
@&4
@&4
@&4
$'+LE Loop
+% statement
%O0 loop
$'+LE loop
0etrn %nctions
Cicode Arrays
Comments
0etrn %nctions
0etrn fnctions retrn data to calling fnction
9o71reLou,0
R@TFR&,') am 8.ne(0
0etrn %nctions
0etrn ,ales
'U()%#
)&T
FUN#$%&N
7etu0nE*amp+e!
(+a;"
7etu0n3!"
END
0etrn ,ales
'U()%#
STR)&K
FUN#$%&N
#u00ent7ecipe!
(+a;"
7etu0n<Fu++ #0eam
=i+>?!"
END
Data
Type
returned
Data
Type
returned
Create Function
/F&*T)O&
1vera2e@?1,0
T)*_P_P+ = ,T)*_P1_P+ + T)*_P4_P+0 /
@&4
'eturn Function
)&T > return data t3pe .s )nte2er
/F&*T)O&
1vera2e@?,0
R@TFR& ,T)*_P1_P+ + T)*_P4_P+0 / > return
e?press.on
@&4
$.at is an Array=
0etrn fnctions
(ebgging code
Arrays
Comments
Cicode (ebgger
Chapter E
Cicode (ebgger
Chapter Overview
(ebg Options
Advanced "tepping
C.apter I ) "mmary 8estions
Advanced stepping
(id !e Ac.ieve t.e Objectives=
-
i
l
l
#
e
!
u
i
r
e
*
e
n
t
End of Corse
8estions
Certificates
CC"E Certification
Corse evalation
!!!7citect7com3evalation