1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#[derive(Clone, Copy)]
#[allow(dead_code)]
pub(crate) enum Area {
ProcessInput = 0x81,
ProcessOutput = 0x82,
Merker = 0x83,
DataBausteine = 0x84,
Counter = 0x1C,
Timer = 0x1D,
Unknown,
}
pub const WL_BIT: i32 = 0x01;
pub const WL_BYTE: i32 = 0x02;
pub const WL_CHAR: i32 = 0x03;
pub const WL_WORD: i32 = 0x04;
pub const WL_INT: i32 = 0x05;
pub const WL_DWORD: i32 = 0x06;
pub const WL_DINT: i32 = 0x07;
pub const WL_REAL: i32 = 0x08;
pub const WL_COUNTER: i32 = 0x1C;
pub const WL_TIMER: i32 = 0x1D;
pub fn data_size_byte(word_length: i32) -> i32 {
match word_length {
WL_BIT | WL_BYTE | WL_CHAR => 1,
WL_WORD | WL_INT | WL_COUNTER | WL_TIMER => 2,
WL_DWORD | WL_DINT | WL_REAL => 4,
_ => 0,
}
}
#[allow(dead_code)]
pub const CPU_STATUS_UNKNOWN: i32 = 0;
#[allow(dead_code)]
pub const CPU_STATUS_RUN: i32 = 8;
#[allow(dead_code)]
pub const CPU_STATUS_STOP: i32 = 4;
pub const SIZE_HEADER_READ: i32 = 31;
pub const SIZE_HEADER_WRITE: i32 = 35;
pub const TS_RES_BIT: i32 = 3;
pub const TS_RES_BYTE: i32 = 4;
#[allow(dead_code)]
pub const TS_RES_INT: i32 = 5;
#[allow(dead_code)]
pub const TS_RES_REAL: i32 = 7;
pub const TS_RES_OCTET: i32 = 9;