Open Core Interface - MLPI
MLPI-MotionLogicProgrammingInterface(mlpi4Java)  1.26.2
Logic.java
Go to the documentation of this file.
1 // -----------------------------------------------------------------------
2 // MLPI - <Logic.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 //
55 //
56 // -----------------------------------------------------------------------
57 package com.boschrexroth.mlpi;
58 
63 public class Logic extends MlpiComponent {
64  /*
65  * Constants
66  */
69  public static final int LOGIC_MAX_DIMENSION_OF_ARRAY = 3;
70 
71  /*
72  * Enums
73  */
85  public enum ApplicationState
86  {
87  STATE_NONE(0),
88  STATE_RUN(1),
89  STATE_STOP(2),
90  STATE_BP(3);
91 
92  private int _code;
93  int getCode() { return _code; }
94  ApplicationState(int code) { this._code = code; }
95  static ApplicationState valueOf(int code) {
96  for (ApplicationState value : values()) {
97  if (code == value.getCode()) return value;
98  }
99  return null;
100  }
101  };
102 
114  {
115  RESET_WARM(0),
116  RESET_COLD(1),
117  RESET_ORIGIN(2);
118 
119  private int _code;
120  int getCode() { return _code; }
121  ApplicationResetMode(int code) { this._code = code; }
122  static ApplicationResetMode valueOf(int code) {
123  for (ApplicationResetMode value : values()) {
124  if (code == value.getCode()) return value;
125  }
126  return null;
127  }
128  }
129 
140  {
141  LOGIC_CAP_OPERATION_ENABLE(0),
142  LOGIC_CAP_OPERATION_DISABLE(1);
143 
144  private int _code;
145  int getCode() { return _code; }
146  LogicCapabilityOperationValue(int code) { this._code = code; }
147  static LogicCapabilityOperationValue valueOf(int code) {
148  for (LogicCapabilityOperationValue value : values()) {
149  if (code == value.getCode()) return value;
150  }
151  return null;
152  }
153  }
154 
170  {
171  LOGIC_CAP_OPERATION_STOP(0),
172  LOGIC_CAP_OPERATION_RESET(1),
173  LOGIC_CAP_OPERATION_DOWNLOAD(2),
174  LOGIC_CAP_OPERATION_ONLINE_CHANGE(3),
175  LOGIC_CAP_OPERATION_SET_BREAKPOINT(4),
176  LOGIC_CAP_OPERATION_WRITE_VARIABLE(5),
177  LOGIC_CAP_OPERATION_FORCE_VARIABLE(6);
178 
179  private int _code;
180  int getCode() { return _code; }
181  LogicCapabilityOperation(int code) { this._code = code; }
182  static LogicCapabilityOperation valueOf(int code) {
183  for (LogicCapabilityOperation value : values()) {
184  if (code == value.getCode()) return value;
185  }
186  return null;
187  }
188  }
189 
202  {
203  ACCESS_RIGHTS_NONE (0),
204  ACCESS_RIGHTS_READ (1),
205  ACCESS_RIGHTS_WRITE (2),
206  ACCESS_RIGHTS_READWRITE (3);
207 
208  private int _code;
209  int getCode() { return _code; }
210  LogicSymbolAccessRights(int code) { this._code = code; }
211  static LogicSymbolAccessRights valueOf(int code) {
212  for (LogicSymbolAccessRights value : values()) {
213  if (code == value.getCode()) return value;
214  }
215  return null;
216  }
217  }
218 
267  public enum LogicType
268  {
310 
311  private int _code;
312  int getCode() { return _code; }
313  LogicType(int code) { this._code = code; }
314  static LogicType valueOf(int code) {
315  for (LogicType value : values()) {
316  if (code == value.getCode()) return value;
317  }
318  return null;
319  }
320  }
321 
333  {
334  MEMORY_AREA_INPUT(0),
335  MEMORY_AREA_OUTPUT(1),
336  MEMORY_AREA_MARKER(2);
337 
338  private int _code;
339  int getCode() { return _code; }
340  ApplicationMemoryArea(int code) { this._code = code; }
341  static ApplicationMemoryArea valueOf(int code) {
342  for (ApplicationMemoryArea value : values()) {
343  if (code == value.getCode()) return value;
344  }
345  return null;
346  }
347  }
348 
349 
350  /*
351  * Classes
352  */
363  public static class LogicArrayRange
364  {
365  public int minimum;
366  public int maximum;
367  }
368 
384  public static class LogicSymbolInformation {
385  public LogicType type;
386  public LogicType subType;
387  public int dataSize;
388  public int numElements;
389  public int dimension;
391  public LogicSymbolAccessRights accessRights;
392  }
393 
411  public static class ApplicationTaskInfo
412  {
413  public String name;
414  public int priority;
415  public boolean watchdog;
416  public int watchdogTime;
417  public int cycleTime;
418  public int averageCycleTime;
419  public int maxCycleTime;
420  public int minCycleTime;
421  public int cycleCount;
422  };
423 
438  public static class ApplicationInfo
439  {
440  public String name;
441  public String author;
442  public String version;
443  public String description;
444  public String profile;
445  public System.DateAndTime dateTime = new System.DateAndTime();
446  };
447 
473  public static class ApplicationOpState
474  {
475  public boolean none;
476 
477  public boolean loaded;
478  public boolean downloadActive;
479  public boolean onlineChangeActive;
480  public boolean storeBootprojectActive;
481 
482  public boolean forceVariablesActive;
483  public boolean exception;
484  public boolean initializeActive;
485  public boolean storeBootprojectOnlyActive;
486 
487  public boolean exitActive;
488  public boolean deleted;
489  public boolean resetActive;
490  public boolean retainMismatch;
491 
492  public boolean bootprojectValid;
493  public boolean loadBootprojectActive;
494  public boolean flowControlActive;
495  public boolean runInFlash;
496  };
497 
508  public static class LogicUserTypeInformation
509  {
510  public String name;
512  };
513 
514 
515  /*
516  * Methods
517  */
518  Logic(MlpiHandle connection) {
519  super(connection);
520  }
521 
539  public Application applications(String name) {
540  return new Application(getConnectionHandleObject(), name);
541  }
542 
556  public native void startApplication();
557 
571  public native void runSingleCycleApplication();
572 
586  public native void stopApplication();
587 
609  public native void resetApplication(ApplicationResetMode mode);
610 
636  public native String readVariableBySymbolAsString(String symbol);
637 
652  public native void writeVariableBySymbolAsString(String symbol, String data);
653 
676  public native String getNameOfApplication(int index);
677 
693  public native int getNumberOfApplications();
694 
754  public native String loadBootApplication(String file, String path);
755 
776 
794 
824  public native LogicSymbolInformation getInformationOfSymbol(String symbol);
825 
835  public native LogicUserTypeInformation[] getInformationOfUserType(String javaSymbol);
836 
852  public native String getStopAxesConfiguration();
853 
854 }
native int getNumberOfApplications()
LOGIC_TYPE_STRING
character strings (WCHAR16)
Definition: Logic.java:285
native void writeVariableBySymbolAsString(String symbol, String data)
LOGIC_TYPE_UDINT
unsigned double integer - 4 Byte (ULONG)
Definition: Logic.java:281
LOGIC_TYPE_SINT
signed short integer - 1 Byte (BYTE)
Definition: Logic.java:275
Class definition of the SystemLib.
Definition: System.java:65
This class defines the dimension range of an array.
Definition: Logic.java:363
LOGIC_TYPE_USINT
unsigned signed short integer - 1 Byte (USHORT)
Definition: Logic.java:279
This enumeration defines the different symbol types of the logic using getInformationOfSymbol.
Definition: Logic.java:267
LOGIC_TYPE_UNSUPPORTED
Symbolic access unsupported.
Definition: Logic.java:309
This class defines the information about an IEC task used by Application.getTaskInfoOfApplication.
Definition: Logic.java:411
LOGIC_TYPE_INT
signed integer - 2 Byte (SHORT)
Definition: Logic.java:276
LOGIC_TYPE_LTIME
Symbolic access unsupported.
Definition: Logic.java:306
LOGIC_TYPE_TIMEOFDAY
32 Bit, Time is given in milliseconds in TIME and TOD, time in TOD begins at 12:00 A...
Definition: Logic.java:290
LOGIC_TYPE_ANYNUM
Symbolic access unsupported.
Definition: Logic.java:303
static final int LOGIC_MAX_DIMENSION_OF_ARRAY
Definition: Logic.java:69
LOGIC_TYPE_USERDEF
Symbolic access unsupported.
Definition: Logic.java:297
This enumeration defines an operation which can be enabled/disabled by using setCapabilityOfOperation...
Definition: Logic.java:169
This enumeration defines the state of an application used by Application.getStateOfApplication.
Definition: Logic.java:85
This enumeration defines the possible capability to execute an operation.
Definition: Logic.java:139
native void runSingleCycleApplication()
Application applications(String name)
Definition: Logic.java:539
LOGIC_TYPE_ANY
Symbolic access unsupported.
Definition: Logic.java:299
LOGIC_TYPE_SUBRANGE
Symbolic access unsupported.
Definition: Logic.java:293
LOGIC_TYPE_DINT
double integer - 4 Byte (LONG)
Definition: Logic.java:277
This enumeration defines the memory areas &#39;Ix&#39; (Input), &#39;Qx&#39; (Output) and &#39;Mx&#39; (Marker) of an applica...
Definition: Logic.java:332
LOGIC_TYPE_LREAL
floating point IEC 559 - 8 Byte (DOUBLE)
Definition: Logic.java:284
This enumeration defines the access rights to a variable.
Definition: Logic.java:201
native LogicCapabilityOperationValue getCapabilityOfOperation(LogicCapabilityOperation operation)
LOGIC_TYPE_ANYDATE
Symbolic access unsupported.
Definition: Logic.java:301
This class defines the operation state of an application used by Application.getOperationStateOfAppli...
Definition: Logic.java:473
LOGIC_TYPE_TIME
32 Bit, Time is given in milliseconds in TIME and TOD, time in TOD begins at 12:00 A...
Definition: Logic.java:287
LOGIC_TYPE_DATEANDTIME
32 Bit, Time is given in seconds in DATE and DT beginning with January 1, 1970 at 12:00 A...
Definition: Logic.java:289
native void setCapabilityOfOperation(LogicCapabilityOperation operation, LogicCapabilityOperationValue value)
LOGIC_TYPE_UINT
unsigned signed integer - 2 Byte (USHORT)
Definition: Logic.java:280
LOGIC_TYPE_ANYREAL
Symbolic access unsupported.
Definition: Logic.java:304
LOGIC_TYPE_BIT
1 Bit), symbolic access unsupported
Definition: Logic.java:270
native void resetApplication(ApplicationResetMode mode)
native LogicUserTypeInformation[] getInformationOfUserType(String javaSymbol)
LOGIC_TYPE_PARAMS
Symbolic access unsupported.
Definition: Logic.java:296
LOGIC_TYPE_POINTER
Symbolic access unsupported.
Definition: Logic.java:291
native void stopApplication()
Class definition of the LogicLib.
Definition: Logic.java:63
This class defines the information about a type of a symbol used by getInformationOfUserType.
Definition: Logic.java:508
LOGIC_TYPE_LINT
long integer - 8 Byte (LLONG)
Definition: Logic.java:278
This enumeration defines the different reset possibilities of an application used by resetApplication...
Definition: Logic.java:113
LOGIC_TYPE_WSTRING
Symbolic access unsupported.
Definition: Logic.java:286
LOGIC_TYPE_DATE
32 Bit, Time is given in seconds in DATE and DT beginning with January 1, 1970 at 12:00 A...
Definition: Logic.java:288
LOGIC_TYPE_BITCONST
Symbolic access unsupported.
Definition: Logic.java:307
native void startApplication()
LOGIC_TYPE_ANYINT
Symbolic access unsupported.
Definition: Logic.java:302
LOGIC_TYPE_REFERENCE
Symbolic access unsupported.
Definition: Logic.java:292
This class defines the information about an application used by Application.getInfoOfApplication.
Definition: Logic.java:438
LOGIC_TYPE_ULINT
unsigned long integer - 8 Byte (LLONG)
Definition: Logic.java:282
LOGIC_TYPE_MAX_TYPE
Symbolic access unsupported.
Definition: Logic.java:308
native LogicSymbolInformation getInformationOfSymbol(String symbol)
native String loadBootApplication(String file, String path)
native String readVariableBySymbolAsString(String symbol)
LOGIC_TYPE_REAL
floating point IEC 559 - 4 Byte (FLOAT)
Definition: Logic.java:283
Class definition for PLC applications.
LOGIC_TYPE_NONE
Symbolic access unsupported.
Definition: Logic.java:298
LOGIC_TYPE_LAZY
Symbolic access unsupported.
Definition: Logic.java:305
native String getStopAxesConfiguration()
This structure defines the broken date and time information.
Definition: System.java:391
LOGIC_TYPE_ANYBIT
Symbolic access unsupported.
Definition: Logic.java:300
This class defines the information about a symbol.
Definition: Logic.java:384
native String getNameOfApplication(int index)