Open Core Interface - MLPI
MLPI-MotionLogicProgrammingInterface(mlpi4Java)  1.26.2
Io.java
Go to the documentation of this file.
1 // -----------------------------------------------------------------------
2 // MLPI - <Io.java>
3 // -----------------------------------------------------------------------
4 // Copyright (c) 2012 Bosch Rexroth. All rights reserved.
5 // Redistribution and use in source and binary forms of this MLPI software
6 // (SW) provided to you, with or without modification, are permitted
7 // without prior approval provided that the following conditions are met:
8 //
9 // 1. Redistributions of source code of SW must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 //
12 // 2. Redistributions in binary form of SW must reproduce the above copyright
13 // notice, this list of conditions and the following disclaimer in the
14 // documentation and/or other materials provided with the distribution.
15 //
16 // 3. User recognizes and acknowledges that it acquires no right,
17 // title or interest in or to any of the names or trademarks used in
18 // connection with the SW ("names") by virtue of this License and waives
19 // any right to or interest in the Names. User recognizes and acknowledges
20 // that names of companies or names or products of companies displayed
21 // in the documentation of SW to indicate the interoperability of products
22 // with the SW are the names of their respective owners. The use of such
23 // names in the documentation of SW does not imply any sponsorship,
24 // approval, or endorsement by such companies of this product.
25 //
26 // 4. Modified code versions, i.e. any addition to or deletion from
27 // the substance or structure of the original code of the SW running
28 // the MLPI must be plainly marked as such and must not be misrepresented
29 // as being original SW.
30 //
31 // 5. The SW may only be used in connection with a Bosch Rexroth product.
32 //
33 // THIS INFORMATION IS PROVIDED BY BOSCH REXROTH CORPORATION "AS IS"
34 // AND WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED, INCLUDING
35 // (BUT NOTLIMITED TO) ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
36 // FITNESS FOR ANY PARTICULAR PURPOSE, OR NON-INFRINGEMENT. WHILE THE
37 // INFORMATION PROVIDED IS BELIEVED TO BE ACCURATE, IT MAY INCLUDE
38 // ERRORS OR INACCURACIES.
39 // SUBJECT TO COMPULSORY STATUTORY PROVISIONS OF THE GERMAN LAW AS
40 // THE APPLICABLE LAW FOR THIS LICENSE BOSCH REXROTH CORPORATION WILL
41 // NOT BE LIABLE FOR ANY DAMAGES OF ANY KIND ARISING FROM THE USE OF
42 // THE SOFTWARE DISTRIBUTED HEREUNDER, INCLUDING BUT NOT LIMITED TO
43 // DIRECT, INDIRECT, INCIDENTAL, PUNITIVE, AND CONSEQUENTIAL DAMAGES.
44 // -----------------------------------------------------------------------
45 //
58 package com.boschrexroth.mlpi;
59 
60 
65 public class Io extends MlpiComponent {
66  /*
67  * Enums
68  */
87  {
88  FIELDBUS_MASTER_GENERIC (0),
89  FIELDBUS_MASTER_ONBOARD_IO (1),
90  FIELDBUS_MASTER_INLINE_IO (2),
91  FIELDBUS_MASTER_PROFIBUS_DP (3),
92  FIELDBUS_MASTER_SERCOS_III (4),
93  FIELDBUS_MASTER_FAST_IO (5),
94  FIELDBUS_MASTER_PROFINET (6),
95  FIELDBUS_MASTER_DEVICENET (7),
96  FIELDBUS_MASTER_ETHERNET_IP (8),
97  FIELDBUS_MASTER_ETHERNET_NETX (9);
98 
99  private int _code;
100  int getCode() { return _code; }
101  IoFieldbusMasterType(int code) { this._code = code; }
102  static IoFieldbusMasterType valueOf(int code) {
103  for (IoFieldbusMasterType value : values()) {
104  if (code == value.getCode()) return value;
105  }
106  return null;
107  }
108  };
109 
119  public enum IoFieldbusArea
120  {
121  IO_AREA_INPUT (0),
122  IO_AREA_OUTPUT (1);
123 
124  private int _code;
125  int getCode() { return _code; }
126  IoFieldbusArea(int code) { this._code = code; }
127  static IoFieldbusArea valueOf(int code) {
128  for (IoFieldbusArea value : values()) {
129  if (code == value.getCode()) return value;
130  }
131  return null;
132  }
133  }
134 
135  /*
136  * Structs
137  */
148  public static class IoHandle
149  {
150  public int ident;
151  public int hash;
152  }
153 
163  public static class IoDiagnosis
164  {
165  public int flags;
166  }
167 
182  public static class IoFieldbusSlaveInfo
183  {
184  public IoHandle handle = new IoHandle();
185  public String name;
186  public IoDiagnosis diagnosis = new IoDiagnosis();
187  public String address;
188  public int numberOfInputs;
189  public int numberOfOutputs;
190  }
191 
205  public static class IoFieldbusMasterInfo
206  {
207  public IoHandle handle = new IoHandle();
208  public String name;
209  public IoDiagnosis diagnosis = new IoDiagnosis();
210  public IoFieldbusMasterType type;
211  public int numberOfSlaves;
212  }
213 
214  /*
215  * Methods
216  */
217  Io(MlpiHandle connection) {
218  super(connection);
219  }
220 
236  public Fieldbus fieldbusses(String name) {
237  return new Fieldbus(getConnectionHandleObject(), name);
238  }
239 
254  public native String[] readFieldbusMasterList();
255 }
This class defines the diagnosis flag information of a fieldbus device.
Definition: Io.java:163
Class definition for fieldbusses.
Definition: Fieldbus.java:63
This class defines the information about a fieldbus master.
Definition: Io.java:205
This enumeration defines types of fieldbus master.
Definition: Io.java:86
This enumeration defines the I/O areas &#39;Input&#39; and &#39;Output&#39; of a fieldbus device. ...
Definition: Io.java:119
Fieldbus fieldbusses(String name)
Definition: Io.java:236
This class defines the information about a fieldbus slave.
Definition: Io.java:182
This class defines the handle to a fieldbus device.
Definition: Io.java:148
native String[] readFieldbusMasterList()
Class definition of the IoLib.
Definition: Io.java:65