自动化立体仓库 - WCS系统
#
luxiaotao1123
2020-08-05 7bb6bff9506d1b0153b814e45f622c4f8538f67c
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
package com.zy.common.HslCommunication.Profinet.Melsec;
 
 
/**
 * 三菱的数据类型
 */
public class MelsecMcDataType {
 
 
    /**
     * 如果您清楚类型代号,可以根据值进行扩展
     * @param code 数据类型的代号
     * @param type 0或1,默认为0
     * @param asciiCode ASCII格式的类型信息
     * @param fromBase 指示地址的多少进制的,10或是16
     */
    public MelsecMcDataType( byte code, byte type, String asciiCode, int fromBase )
    {
        DataCode = code;
        AsciiCode = asciiCode;
        FromBase = fromBase;
        if (type < 2) DataType = type;
    }
 
 
 
    private byte DataCode = 0x00;                   // 类型代号
    private byte DataType = 0x00;                   // 数据类型
    private String AsciiCode = "";                  // ascii格式通信的字符
    private int FromBase = 0;                       // 类型
 
 
    /**
     * 数据的类型代号
     * @return
     */
    public byte getDataCode() {
        return DataCode;
    }
 
    /**
     * 字访问还是位访问,0表示字,1表示位
     * @return
     */
    public byte getDataType() {
        return DataType;
    }
 
    /**
     * 当以ASCII格式通讯时的类型描述
     * @return
     */
    public String getAsciiCode() {
        return AsciiCode;
    }
 
    /**
     * 指示地址是10进制,还是16进制的
     * @return
     */
    public int getFromBase() {
        return FromBase;
    }
 
 
    /**
     * X输入寄存器
     */
    public final static MelsecMcDataType X = new MelsecMcDataType( (byte) (0x9C), (byte) (0x01), "X*", 16 );
    /**
     * Y输出寄存器
     */
    public final static MelsecMcDataType Y = new MelsecMcDataType( (byte) (0x9D), (byte) (0x01), "Y*", 16 );
    /**
     * M中间寄存器
     */
    public final static MelsecMcDataType M = new MelsecMcDataType( (byte) (0x90), (byte) (0x01), "M*", 10 );
    /**
     * D数据寄存器
     */
    public final static MelsecMcDataType D = new MelsecMcDataType( (byte) (0xA8), (byte) (0x00), "D*", 10 );
    /**
     * W链接寄存器
     */
    public final static MelsecMcDataType W = new MelsecMcDataType( (byte) (0xB4), (byte) (0x00), "W*", 16 );
    /**
     * L锁存继电器
     */
    public final static MelsecMcDataType L = new MelsecMcDataType( (byte) (0x92), (byte) (0x01), "L*", 10 );
    /**
     * F报警器
     */
    public final static MelsecMcDataType F = new MelsecMcDataType( (byte) (0x93), (byte) (0x01), "F*", 10 );
    /**
     * V边沿继电器
     */
    public final static MelsecMcDataType V = new MelsecMcDataType( (byte) (0x94), (byte) (0x01), "V*", 10 );
    /**
     * B链接继电器
     */
    public final static MelsecMcDataType B = new MelsecMcDataType( (byte) (0xA0), (byte) (0x01), "B*", 16 );
    /**
     * R文件寄存器
     */
    public final static MelsecMcDataType R = new MelsecMcDataType( (byte) (0xAF), (byte) (0x00), "R*", 10 );
    /**
     * S步进继电器
     */
    public final static MelsecMcDataType S = new MelsecMcDataType( (byte) (0x98), (byte) (0x01), "S*", 10 );
    /**
     * 变址寄存器
     */
    public final static MelsecMcDataType Z = new MelsecMcDataType( (byte) (0xCC), (byte) (0x00), "Z*", 10 );
    /**
     * 定时器的值
     */
    public final static MelsecMcDataType T = new MelsecMcDataType( (byte) (0xC2), (byte) (0x00), "TN", 10 );
    /**
     * 计数器的值
     */
    public final static MelsecMcDataType C = new MelsecMcDataType( (byte) (0xC5), (byte) (0x00), "CN", 10 );
}