
—
Programing with CODESYS
—
CPSN-PCB271-S1-041 Reference Manual (Software)
—
132
—
Sample
When repeating counting up of Counter Input Data (CH0).
Internal I/O Mapping
Variable declaration
uiState: UINT := 0;
dwCntValue: DWORD;
wMatchStatus: BYTE;
Program
CASE uiState OF
0:
CNT_COMP_SET := 100;
CNT_VALUE_SET := 0;
CNT_VALUE_SET_FLAG := 16#01;
uiState := 1;
1:
CNT_VALUE_SET_FLAG := 16#00;
CNT_START := 16#01;
uiState := 2;
2:
dwCntValue := CNT_VALUE;
wMatchStatus := CNT_MATCH_STATUS AND 16#01;
IF wMatchStatus <> 0 THEN
CNT_MATCH_RESET := CNT_MATCH_RESET OR 16#01;
CNT_VALUE_SET_FLAG := CNT_VALUE_SET_FLAG OR 16#01;
uiState := 3;
END_IF
3:
CNT_MATCH_RESET := CNT_MATCH_RESET AND 16#FE;
CNT_VALUE_SET_FLAG := CNT_VALUE_SET_FLAG AND 16#FE;
uiState := 2;
END_CASE
Содержание CONPROSYS nano CPSN-PCB271-S1-041
Страница 21: ...21 CONPROSYS nano WEB Setting This section describes the product system and functions...
Страница 49: ...49 CODESYS Installation This section describes the CODESYS installation procedure...
Страница 55: ...55 Basic Programming This section describes basic procedure to operate this product with CODESYS...
Страница 76: ...76 Programing with CODESYS This section describes the CODESYS programming procedure per function...
Страница 118: ...Programing with CODESYS CPSN PCB271 S1 041 Reference Manual Software 118 5 END_CASE...
Страница 122: ...Programing with CODESYS CPSN PCB271 S1 041 Reference Manual Software 122...
Страница 133: ...133 Maintenance This section describes how to perform maintenance on the product...
Страница 140: ...140 Appendix This section describes additional information of specification and the product...