C tutorial : C language function
C tutorial : C language function
Table of Contents:
1.Introduction .......................................................................................... 3
2.C function ............................................................................................. 3
2.1 Functions .................................................................................. 3
2.1.1 Public functions ............................................................... 3
2.1.2 Performance functions ..................................................... 4
2.2 Predefined value type ................................................................. 4
2.3 Predefined value table ............................................................... 4
2.3.1 Constant .......................................................................... 4
2.3.2 Serial port ........................................................................ 4
2.3.3 Internal registers .............................................................. 5
2.3.4 Value length ..................................................................... 5
2.4 Macro ......................................................................................... 5
2.5 Direct operation for HMI internal registers ................................. 6
2.5.1 PSW registers .................................................................. 6
2.5.2 PSB operation functions .................................................. 6
2.6 Notice ......................................................................................... 7
3.Application ........................................................................................... 8
3.1 Purpose ..................................................................................... 8
3.2 Device ...................................................................................... 8
3.3 Reference manual ..................................................................... 8
3.4 Steps ......................................................................................... 8
4. Make the project .................................................................................. 9
4.1 Make C function ......................................................................... 9
4.2 Edit the C function .................................................................. 10
4.3 Make the HMI program .......................................................... 12
----------------------------------------
Sample of the pdf document :
1. Introduction
We will explain the C function programming rules with simple examples.
2. C function
2.1 Functions
The C function writing mode is the same as C language. C functions include public functions and performance functions.
2.1.1 Public functions
Public functions: support basic call for performance functions. It needs to write function prototype, parameters and return value are allowed.
Example:
DWORD Crc(BYTE* pBytes, int Length)
{
DWORD dwCrc = 0;
…
return dwCrc;
}
Call performance functions in public functions:
void CallFunction()
{
Func1();
}.............
Click here for Download PDF / FREE
C tutorial : C language function
Nice post
RépondreSupprimer