MX Component for Android Version 1 Reference Manual · 2016-02-27 · Programming using labels...
Transcript of MX Component for Android Version 1 Reference Manual · 2016-02-27 · Programming using labels...
MX Component for Android Version 1Reference Manual
-SW1DNC-ACTAND-B
1
SAFETY PRECAUTIONS(Read these precautions before using this product.)
Before using this product, please read this manual carefully and pay full attention to safety to handle the product correctly.
The precautions given in this manual are concerned with this product only. For the safety precautions for the programmable
controller system, refer to the user's manual for the CPU module used and the system manual, (MELSEC iQ-R Module
Configuration Manual, QCPU User's Manual(Hardware Design, Maintenance and Inspection), MELSEC-L CPU Module
User's Manual (Hardware Design, Maintenance and Inspection)).
In this manual, the safety precautions are classified into two levels: " WARNING" and " CAUTION".
Under some circumstances, failure to observe the precautions given under " CAUTION" may lead to serious
consequences.
Observe the precautions of both levels because they are important for personal and system safety.
Make sure that the end users read this manual and then keep the manual in a safe place for future reference.
[Design Precautions]
[Startup and Maintenance Precautions]
WARNING● When data change or status control are performed from a device such as a tablet to a running
programmable controller CPU, create an interlock circuit outside the programmable controller to
ensure that the whole system always operates safely.
Since a wireless LAN is used for communication, the communication may not be performed properly
depending on the environment. Ensure the communication method other than using this product for
the situation when the wireless LAN communication cannot be established.
CAUTION● The online operations performed from a device such as a tablet to a running CPU module have to be
executed after the manual has been carefully read and the safety has been ensured.
Improper operation may damage machines or cause accidents.
WARNING Indicates that incorrect handling may cause hazardous conditions, resulting in death or severe injury.
CAUTION Indicates that incorrect handling may cause hazardous conditions, resulting in minor or moderate injury or property damage.
2
CONDITIONS OF USE FOR THE PRODUCT(1) Mitsubishi programmable controller ("the PRODUCT") shall be used in conditions;
i) where any problem, fault or failure occurring in the PRODUCT, if any, shall not lead to any major or serious accident; and ii) where the backup and fail-safe function are systematically or automatically provided outside of the PRODUCT for the case of any problem, fault or failure occurring in the PRODUCT.
(2) The PRODUCT has been designed and manufactured for the purpose of being used in general industries.MITSUBISHI SHALL HAVE NO RESPONSIBILITY OR LIABILITY (INCLUDING, BUT NOT LIMITED TO ANY AND ALL RESPONSIBILITY OR LIABILITY BASED ON CONTRACT, WARRANTY, TORT, PRODUCT LIABILITY) FOR ANY INJURY OR DEATH TO PERSONS OR LOSS OR DAMAGE TO PROPERTY CAUSED BY the PRODUCT THAT ARE OPERATED OR USED IN APPLICATION NOT INTENDED OR EXCLUDED BY INSTRUCTIONS, PRECAUTIONS, OR WARNING CONTAINED IN MITSUBISHI'S USER, INSTRUCTION AND/OR SAFETY MANUALS, TECHNICAL BULLETINS AND GUIDELINES FOR the PRODUCT. ("Prohibited Application")Prohibited Applications include, but not limited to, the use of the PRODUCT in;• Nuclear Power Plants and any other power plants operated by Power companies, and/or any other cases in which the
public could be affected if any problem or fault occurs in the PRODUCT.• Railway companies or Public service purposes, and/or any other cases in which establishment of a special quality
assurance system is required by the Purchaser or End User.• Aircraft or Aerospace, Medical applications, Train equipment, transport equipment such as Elevator and Escalator,
Incineration and Fuel devices, Vehicles, Manned transportation, Equipment for Recreation and Amusement, and Safety devices, handling of Nuclear or Hazardous Materials or Chemicals, Mining and Drilling, and/or other applications where there is a significant risk of injury to the public or property.
Notwithstanding the above, restrictions Mitsubishi may in its sole discretion, authorize use of the PRODUCT in one or more of the Prohibited Applications, provided that the usage of the PRODUCT is limited only for the specific applications agreed to by Mitsubishi and provided further that no special quality assurance or fail-safe, redundant or other safety features which exceed the general specifications of the PRODUCTs are required. For details, please contact the Mitsubishi representative in your region.
3
INTRODUCTIONThank you for purchasing the Mitsubishi FA software, MELSOFT series.
This manual is designate for users to understand operations of MX Component for Android.
Before using this product, please read this manual carefully, and develop familiarity with the functions and performance of MX
Component for Android to handle the product correctly.
4
CONTENTSSAFETY PRECAUTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1
CONDITIONS OF USE FOR THE PRODUCT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2
INTRODUCTION. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
RELEVANT MANUALS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6
TERMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6
CHAPTER 1 OVERVIEW 7
1.1 What Is MX Component for Android? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2 Main Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
CHAPTER 2 SYSTEM CONFIGURATION 9
2.1 System Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2 Device Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Usable CPU Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Accessible Ethernet modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3 Operating Environment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.4 Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
CHAPTER 3 USAGE 13
3.1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.2 Uninstallation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3 Parameter Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
CHAPTER 4 ACCESSIBLE DEVICES 18
4.1 List of Accessible Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.2 Considerations for Devices and Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Consideration for bit devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Considerations for using labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
CHAPTER 5 METHODS 23
5.1 List of Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.2 Details of Methods. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
MELMxCommunication class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
MELMxOpenSettings class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
MELMxLabel class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
MELMxErrorCode class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.3 Considerations for using methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.4 Sample Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Created application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Sample method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
CHAPTER 6 TROUBLESHOOTING 54
6.1 Error Processing and Corrective Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
6.2 Error Code List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
METHOD INDEX 58
REVISIONS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60
5
CO
NT
EN
TS
WARRANTY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61
TRADEMARKS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62
6
RELEVANT MANUALS
e-Manual refers to the Mitsubishi FA electronic book manuals that can be browsed using a dedicated tool.
e-Manual has the following features:
• Required information can be cross-searched in multiple manuals.
• Other manuals can be accessed from the links in the manual.
• The hardware specifications of each part can be found from the product figures.
• Pages that users often browse can be bookmarked.
TERMSUnless otherwise specified, this manual uses the following terms.
Manual name [manual number] Description Available form
MX Component for Android Version 1 Reference Manual
[SH-081498ENG] (this manual)
Explains the system configuration, operation methods,
and methods of MX Component for Android.
e-Manual
EPUB
Term Description
Built-in Ethernet CPU A generic term for a CPU that has an Ethernet port
FX5CPU A generic term for FX5UCPU and FX5UCCPU
GX Works2 A generic product name for model names, SWnDNC-GXW2 ('n' indicates version.)
GX Works3 A generic product name for model names, SWnDND-GXW3 ('n' indicates version.)
L series-compatible E71 LJ71E71-100
LCPU A generic term for L02SCPU, L02CPU, L02CPU-P, L02SCPU-P, L06CPU, L06CPU-P, L26CPU, L26CPU-P, L26CPU-
BT, and L26CPU-PBT
MELSEC iQ-R series-compatible
EN71
RJ71EN71
MX Component for Android A generic product name for SWnDNC-ACTAND-B ('n' indicates version.)
Q series-compatible E71 A generic term for QJ71E71-B2, QJ71E71-B5, and QJ71E71-100
QCPU A generic term for Q00JCPU, Q00UJCPU, Q00CPU, Q00UCPU, Q01CPU, Q01UCPU, Q02CPU, Q02HCPU,
Q02PHCPU, Q02UCPU, Q03UDCPU, Q03UDECPU, Q03UDVCPU, Q04UDHCPU, Q04UDEHCPU, Q04UDVCPU,
Q06HCPU, Q06PHCPU, Q06UDHCPU, Q06UDEHCPU, Q06UDVCPU, Q10UDHCPU, Q10UDEHCPU, Q12HCPU,
Q12PHCPU, Q12PRHCPU, Q13UDHCPU, Q13UDEHCPU, Q13UDVCPU, Q20UDHCPU, Q20UDEHCPU, Q25HCPU,
Q25PHCPU, Q25PRHCPU, Q26UDHCPU, Q26UDEHCPU, Q26UDVCPU, Q50UDEHCPU, and Q100UDEHCPU
RCPU A generic term for R04CPU, R08CPU, R16CPU, R32CPU, and R120CPU
Universal model QCPU A generic term for Q00UJCPU, Q00UCPU, Q01UCPU, Q02UCPU, Q03UDCPU, Q03UDVCPU, Q03UDECPU,
Q04UDHCPU, Q04UDVCPU, Q04UDPVCPU, Q04UDEHCPU, Q06UDHCPU, Q06UDVCPU, Q06UDPVCPU,
Q06UDEHCPU, Q10UDHCPU, Q10UDEHCPU, Q13UDHCPU, Q13UDVCPU, Q13UDPVCPU, Q13UDEHCPU,
Q20UDHCPU, Q20UDEHCPU, Q26UDHCPU, Q26UDVCPU, Q26UDPVCPU, Q26UDEHCPU, Q50UDEHCPU, and
Q100UDEHCPU
1 OVERVIEW1.1 What Is MX Component for Android? 7
11 OVERVIEW
This chapter explains the features of MX Component for Android.
1.1 What Is MX Component for Android?MX Component for Android is a library that reads and writes values of devices and labels in the programmable controller from
a tablet.
This product can be used when creating user programs which communicate with a programmable controller from Android
OS.
The communication between a device such as a tablet and wireless LAN router with wireless communication, and access the
programmable controller with Ethernet communication.
By using MX Component for Android when creating an application, the creation time of the programs for communication with
a programmable controller can be shortened.
This product can also be used for a static library of Java.
1.2 Main FunctionsMX Component for Android has the following main functions.
Creation of tablet applicationThe applications for a tablet for reading or writing devices or labels in a programmable controller can be created easily
regardless of the communication method between a programmable controller.
Programming using labels (RCPU only)When the communication target is RCPU, the devices in a programmable controller can be accessed using labels*1.
Therefore, re-creation of the application is not required after the change of the device configuration.
*1 The labels which are selected in "Access from External Device" in the global editor of GX Works3 can be used.
Creation of safety application for securityBy using this library, a safety application for security can be created since the password is encrypted*1 for the programmable
controller in which a remote password has been set.
*1 A built-in Ethernet port connection of FX5CPU, QCPU, and LCPU are not encrypted.
Sample programBy using the included sample program as a reference, an application can be created. The sample program also can be used
to know such as how to use the library or performing an error processing.
(AndroidTM OS)
programmable controller
Writing
Device/Label
Reading
Wireless LAN router
Tablet
81 OVERVIEW1.2 Main Functions
MEMO
2 SYSTEM CONFIGURATION2.1 System Configuration 9
2
2 SYSTEM CONFIGURATION
This chapter explains the system configuration of MX Component for Android.
2.1 System ConfigurationThe following shows the system configurations for development and practice.
For development
For practice
Consideration
■Access routeA tablet can be accessed modules which are connected to wireless LAN router. Other CPUs in the multiple CPU configuration
and other stations via Ethernet module cannot be accessed.
■Wireless LAN roaming (Hand-over)In an environment where roaming (or hand-over) occurs, i.e. the condition where the terminals of wireless LAN to which a
device such as tablet is connected are switched, the communication may be frequently disconnected resulting in the
occurrence of packet loss. For ensuring safety, disable the roaming function (and the hand-over function) in the Wireless LAN
setting in advance.
(AndroidTM OS)
(Windows® OS)Development personal computer
Tablet
Installation
Wireless LAN router
Ethernet module/Built-in Ethernet CPU
programmable controller
(AndroidTM OS)Tablet
Wireless LAN router
Ethernet module/Built-in Ethernet CPU
Hub Hub
programmable controller
102 SYSTEM CONFIGURATION2.2 Device Configuration
2.2 Device ConfigurationThe following shows the usable CPU modules and the accessible modules.
Usable CPU Modules
*1 Use the firmware version '05' or later.
Accessible Ethernet modules
*1 Use firmware version '02' or later.*2 Use the function version D or later of a module with a serial number of which first five digits are '15042'.*3 Use the function version A or later of a module with a serial number of which first five digits are '15042'.
Series Model Remarks
RCPU R04CPU, R08CPU, R16CPU, R32CPU, R120CPU
FX5CPU*1 FX5UCPU, FX5UCCPU
QCPU Q00JCPU, Q00UJCPU, Q00CPU, Q00UCPU, Q01CPU, Q01UCPU, Q02CPU, Q02HCPU, Q02PHCPU,
Q02UCPU, Q03UDCPU, Q04UDHCPU, Q06HCPU, Q06PHCPU, Q06UDHCPU, Q10UDHCPU,
Q12HCPU, Q12PHCPU, Q12PRHCPU, Q13UDHCPU, Q20UDHCPU, Q25HCPU, Q25PHCPU,
Q25PRHCPU, Q26UDHCPU
Ethernet module is necessary.
Q03UDECPU, Q03UDVCPU, Q04UDEHCPU, Q04UDVCPU, Q06UDEHCPU, Q06UDVCPU,
Q10UDEHCPU, Q13UDEHCPU, Q13UDVCPU, Q20UDEHCPU, Q26UDEHCPU, Q26UDVCPU,
Q50UDEHCPU, Q100UDEHCPU
LCPU L02SCPU, L02SCPU-P Ethernet module is necessary.
L02CPU, L02CPU-P, L06CPU, L06CPU-P, L26CPU, L26CPU-P, L26CPU-BT, L26CPU-PBT
Series Model
RCPU*1 RJ71EN71
QCPU*2 QJ71E71-B2, QJ71E71-B5, QJ71E71-100
LCPU*3 LJ71E71-100
2 SYSTEM CONFIGURATION2.3 Operating Environment 11
2
2.3 Operating EnvironmentThe following shows the operating environment of MX Component for Android.
Development environment
*1 For CPU module, required memory, and HDD free capacity, follow the specification that the development environment and language recommend.
*2 The operation using the simulator integrated on the development environment is not guaranteed.*3 Download JDK from ORACLE website.
Operating environment
Item Description
Personal computer*1 Personal computer on which Windows OS operates
Operating system • Microsoft Windows 8.1 Operating System (Japanese/English)
• Microsoft Windows 8.1 Pro Operating System (Japanese/English)
• Microsoft Windows 7 Professional Operating System (Japanese/English) (32-bit version/64-bit version)
Development environment*2 and
language
Development application Eclipse Kepler Service Release 2 or later
Development language Java
Software Java Platform, Standard Edition 7 Development Kit (JDK 7u60 or later)*3
Item Description
Smartphone and tablet Smartphone and tablet on which AndroidOS operate (usable type for wireless LAN router)
Operating system Android OS 4.2, 4.3, 4.4
Only ARM is supported by CPU module ('x86' is not supported.)
When using Android OS 4.4.2, only 'Dalvik VM' is supported. ('ART VM' is not supported.)
122 SYSTEM CONFIGURATION2.4 Considerations
2.4 ConsiderationsThe following shows the considerations for using MX Component for Android.
Considerations for programming and each setting
■Retry processingDuring communication using wireless LAN router, some communication packets may be lost by the electric interruption or
noise affection. When creating a user program, create the programs including the retransmission processing and the reopen
processing of the line according to the system.
■Erroneous data reception on time-outIf time-out occurs when connecting to the built-in Ethernet port of FX5CPU or QCPU, Erroneous data reception may be
caused. Create the program to perform the reopen processing of the line.
■The functions and applications that Wi-Fi communication is disconnected automaticallyWhen the following functions or applications are enabled on a device such as a tablet, Wi-Fi communication may be
disconnected, and packet loss and time-out error may occur.
If time-out error occurs, perform the close processing and reopen processing, or disable the functions and applications in
advance.
• Battery saving functions of Wi-Fi setting*1
• Auto connect/disconnect functions for Wi-Fi network*1
• Auto disconnect applications for Wi-Fi communication
*1 Depending on the device which is to be used, the setting method differs such as "Wi-Fi Advanced" "Wi-Fi optimization" or "Wi-Fi Advanced" "Wi-Fi timer".
■Wireless LAN roaming (Hand-over)In an environment where roaming (or hand-over) occurs, i.e. the condition where the terminals of wireless LAN to which a
device such as tablet is connected are switched, the communication may be frequently disconnected resulting in the
occurrence of packet loss. For ensuring safety, disable the roaming function (and the hand-over function) in the Wireless LAN
setting in advance.
■Considerations for Android specification • If the device such as a table is in sleep status or the application using this product is a background task, Ethernet
communication may be disconnected. In this case, perform the reopen processing as necessary.
• This product is communication libraries for Ethernet communication. There are some imperatives and recommendations
related to the tasks for communication for the operating system. Create a program in accordance with them.
Example: Perform a thread processing and a background processing for the communication processing.
Considerations for using this product with other productFor the connection settings between the device such as a tablet and wireless LAN router, set a protocol such as WPA2, which
encrypts data.
If a protocol which does not encrypt data is selected for the connection setting, illegal access to data may occur.
Select a much more safer security setting between a device such as a tablet and wireless LAN router.
3 USAGE3.1 Installation 13
3
3 USAGE
This chapter explains how to use MX Component for Android.
3.1 InstallationConfigure the settings of MX Component for Android on the development environment of Android application (Eclipse).
Importing of the component (jar file)
Operating procedure
1. Create a new project by using Eclipse.
2. Copy the following files from the CD-ROM provided with this product to the "libs" folder of the new project.
• interface.jar
• mxcomponent.jar
• support.jar
143 USAGE3.1 Installation
Precautions
• To perform socket communication, add the following statement in the "AndroidManifest.xml".
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
• This library can be imported as the following package name.
jp.co.melco.mxcomponent
3 USAGE3.2 Uninstallation 15
3
Checking the version of MX Component for AndroidThe version of MX Component for Android can be checked with 'AndroidManifest.xml' file.
Operating procedure
1. Move to the folder which stores the file of MX Component for Android and open the 'AndroidManifest.xml' file.
2. Check the character string (version) which is displayed after 'android:versionName=' in the XML file.
3.2 UninstallationDelete the files which are copied when installing.
163 USAGE3.3 Parameter Settings
3.3 Parameter SettingsSet the parameters for the accessible Ethernet communication using this library.
Set the parameters on the following screens.
For details on the setting items, refer to the manual for each module.
• GX Works3 module parameter
• GX Works2 PLC parameter
• GX Works3 module parameter (Ethernet)
Connection target Parameter setting Setting screen
RCPU (Built-in Ethernet port CPU) MELSOFT connection GX Works3 module parameter
FX5CPU (Built-in Ethernet port CPU) SLMP GX Works3 module parameter
QCPU (Built-in Ethernet port CPU) MC protocol GX Works2 PLC parameter
LCPU (Built-in Ethernet port CPU) MC protocol GX Works2 PLC parameter
MELSEC iQ-R series-compatible EN71 MELSOFT connection GX Works3 module parameter (Ethernet)
Q series-compatible E71 MELSOFT connection GX Works2 network parameter Ethernet/CC IE Field
L series-compatible E71 MELSOFT connection GX Works2 network parameter Ethernet/CC IE Field
3 USAGE3.3 Parameter Settings 17
3
• GX Works2 network parameter Ethernet/CC IE Field
184 ACCESSIBLE DEVICES4.1 List of Accessible Devices
4 ACCESSIBLE DEVICES
This chapter explains the accessible devices using this library.
4.1 List of Accessible DevicesThe following table shows the list of applicable devices for reading/writing devices of this library.
Note that digit specification, bit specification, and index modification are not available.
: Accessible, : Not accessible
Category Device*1 Device name
Type Notation Access target*8
RCPU FX5CPU QCPU/LCPU
System device Special relay SM Bit Decimal
Special register SD Word Decimal
User device Input X Bit Hexadecimal
Octal
Output Y Hexadecimal
Octal
Internal relay M Decimal
Latch relay L Decimal
Annunciator F Decimal
Edge relay V Decimal
Link relay B Hexadecimal
Data register D Word Decimal
Link register W Hexadecimal
Timer (T) Contact TS Bit Decimal
Coil TC Decimal
Current value TN Word Decimal
Long timer (LT) Contact LTS Bit Decimal
Coil LTC Decimal
Current value LTN Double Word Decimal
Retentive timer
(ST)
Contact STS Bit Decimal
SS Decimal
Coil STC Decimal
Current value STN Word Decimal
SN Decimal
Retentive long
timer (LST)
Contact LSTS Bit Decimal
Coil LSTC Decimal
Current value LSTN Double Word Decimal
Counter (C) Contact CS Bit Decimal
Coil CC Decimal
Current value CN Word Decimal
Long counter (LC) Contact LCS Bit Decimal
Coil LCC Decimal
Current value LCN Double Word Decimal
Link special relay SB Bit Hexadecimal
Link special register SW Word Hexadecimal
Step relay S Bit Decimal
Direct access input DX Hexadecimal
Direct access output DY Hexadecimal
Index register Z Word Decimal
LZ Double Word Decimal
4 ACCESSIBLE DEVICES4.1 List of Accessible Devices 19
4
*1 Local devices can not be accessed.*2 When the file registers consist of multiple blocks, use the device codes of the serial number access method.*3 For GX Works3, specify "Use Common File Register in All Programs" in the CPU parameter. For GX Works2, specify "Use the following
file" in the PLC parameter.*4 Only the Universal model QCPU and LCPU are supported.*5 For link direct device, specify the network number in hexadecimal.*6 Some methods are restricted since these devices are classified as device extension specifications.*7 For module access device, specify the I/O number of the target module.
Example: U20\G1000 (When the I/O number is '200H' and the address is '1000')*8 Even if the applicability is (Accessible), some devices have a possibility to be (Not accessible) due to the restriction of method. For
details, refer to the considerations of each method.
File register*2,*3 R Word Decimal
ZR Decimal
Extended data register D Word Decimal *4
Extended link register W Word Hexadecimal *4
Link direct device*5,*6 Link input J\X Bit Hexadecimal
Link output J\Y Hexadecimal
Link relay J\B Hexadecimal
Link special relay J\SB Hexadecimal
Link register J\W Word Hexadecimal
Link special register J\SW Hexadecimal
Module access device*6 Module access device U\G*7 Word Decimal
CPU buffer memory
access device*6CPU buffer memory U3E\G Word Decimal
Fixed scan communication area of
the CPU buffer memory
U3E\HG Decimal
Module refresh register Module refresh register RD Word Decimal
Category Device*1 Device name
Type Notation Access target*8
RCPU FX5CPU QCPU/LCPU
204 ACCESSIBLE DEVICES4.2 Considerations for Devices and Labels
4.2 Considerations for Devices and LabelsThe following shows the considerations for using devices and labels.
Consideration for bit devicesWhen reading/writing bit devices in bulk, regarding the place of memory in advance is necessary. Bit devices are stored in
word units in the memory. Keep in mind when obtaining/setting the bit values of target devices.
The byte-order of Android is big endian.
Ex.
Read bit devices for 1 point (one word) from M0
The bit devices are stored in order from upper byte.
Considerations for using labels
The data types of labelThe following shows the variable types in this library (Java) corresponding to the data type of labels.
If the labels of which data types are timer, retentive timer, counter, long timer, long retentive timer, or long counter, the labels
are handled as a structure. For details, refer to the following section.
Page 22 Data type of labels handled as structure
Data type of label Variable type in this library (Java) Definition name
Bit Boolean MEL_MX_LABEL_DATATYPE_BIT
Word [Signed] Integer MEL_MX_LABEL_DATATYPE_WORD
Word [Unsigned]/Bit String [16-bit] Integer MEL_MX_LABEL_DATATYPE_UNSIGNED_WORD
Double Word [Signed] Long MEL_MX_LABEL_DATATYPE_DOUBLE_WORD
Double Word [Unsigned]/Bit String [32-bit] Long MEL_MX_LABEL_DATATYPE_UNSIGNED_DOUBLE_WO
RD
FLOAT (Single Precision) Float MEL_MX_LABEL_DATATYPE_FLOAT_SINGLE
FLOAT (Double Precision) Double MEL_MX_LABEL_DATATYPE_FLOAT_DOUBLE
String (32) String MEL_MX_LABEL_DATATYPE_STRING_ASCII
String [Unicode] (32) String MEL_MX_LABEL_DATATYPE_STRING_UNICODE
Time Long MEL_MX_LABEL_DATATYPE_TIME
M7 M15M6 M5 M4 M3 M2 M1 M0 M9M14 M13 M12 M11 M10 M8
Upper byte Lower byte
1 byte 1 byte
4 ACCESSIBLE DEVICES4.2 Considerations for Devices and Labels 21
4
Specification methods for label nameWhen reading/writing the labels, specify the registered label names in the CPU modules.
The available labels are as shown below.
■Simple data typeSpecify the data types described in the following section.
Page 20 The data types of label
■Array typeUp to three dimensions can be specified for array type labels.
Specify the label names and the index of the array element (decimal).
As for the data type of the array type label, only the simple data type can be specified.
Ex.
When up to three dimensions are specified: Label1[10,10,10]
■Structure typeSpecify structure type labels.
Specify the whole elements by connecting each element name of the structure using a period.
For the last element, only simple data type and array type can be specified.
Whole structure cannot be specified by specifying only structure name.
Ex.
Applicable: stLabel1.stLabel2.bMember1 (Specification of simple data type label for the last element)
Inapplicable: stLabel1.stLabel2 (Specification of structure type label for the last element)
Precautions
• If the specific conditions for the label name length are not met, the label may not be specified. For details of the conditions,
refer to each method (considerations) of the classes described in the following section.
• Digit specification, bit specification, and index modification are not available. Unavailable label names are as follows;
• Alias names are not available.
Label type Specification example
Bit specification of labels Label.3
Digit specification of labels K4Label
Specification of index-modified devices LabelZ0
Specification of multiple CPU No.2 U3E1\Label
224 ACCESSIBLE DEVICES4.2 Considerations for Devices and Labels
Data type of labels handled as structureThe following data types of label are handled as a structure. Keep in mind the specification method of label name when
reading/writing labels.
• Timer
• Retentive Timer
• Counter
• Long Counter
• Long Retentive Timer
• Long Counter
Ex.
When reading the current value of the label name, 'TimerLabel' to which long retentive timer is assigned, specify the data type
as follows;
TimerLabel.N
The following shows the member of data type which are handled as a structure.
Data name Member name Data type
Contact S Bit
Coil C Bit
Current value N Timer, retentive timer, counter: Word (Unsigned)
Long timer, long retentive timer, long counter: Double Word (Unsigned)
5 METHODS 23
5
5 METHODS
This chapter explains the procedure and functions of methods provided by library.
Procedure for using methodsThe following shows the basic flow when reading and writing devices/labels using the methods of MX Component for Android.
To use the method in a program, open the communication line at the first of the program, and close the communication line at
the end of the program.
MELMXOpenSettings
MELMXCommunication
MELMXLabel
MELMXCommunicationMELMXCommunication
MELMXCommunication
Start
Set the parameters.
Execute open method.
Set the parameters.
Execute close method.
End
Labels
Devices
Call readArrayLabel method, writeLabelRandom method.
Call readDeviceBlock method, writeDeviceRandom method.
Check return values.
Check return values.
Target for reading/writing: Devices/Labels
Failed
Success
Failed
Success
Refer to the error code list.
Time-out
Read/Write data.
Not Time-outCheck error codes.
245 METHODS5.1 List of Methods
5.1 List of MethodsThe following table shows the list of methods.
Class Method Function Reference
MELMxCommunication MELMxCommunication Constructor Page 25 MELMxComminication (Constructor)
open Opening communication line Page 25 open (Opening communication line)
close Closing communication line Page 26 close (Closing communication line)
readDeviceBlock Reading devices in bulk Page 27 readDeviceBlock (Reading devices in
bulk)
writeDeviceBlock Writing devices in bulk Page 28 writeDeviceBlock (Writing devices in
bulk)
readDeviceRandom Reading devices randomly Page 29 readDeviceRandom (Reading devices
randomly)
writeDeviceRandom Writing devices randomly Page 30 writeDeviceRandom (Writing devices
randomly)
readArrayLabel Reading data by specifying array type label Page 31 readArrayLabel (Reading data by
specifying array type label)
writeArrayLabel Writing data by specifying array type label Page 31 writeArrayLabel (Writing data by
specifying array type label)
readLabelRandom Reading data by specifying multiple labels Page 32 readLabelRandom (Reading data by
specifying multiple labels)
writeLabelRandom Writing data by specifying multiple labels Page 32 writeLabelRandom (Writing data by
specifying multiple labels)
MELMxLabel MELMxLabel Constructor Page 36 MELMxLabel (Constructor)
getValues Acquiring label data Page 37 getValues (Acquiring label data)
getName Acquiring label name Page 37 getName (Acquiring label name)
getDataType Acquiring label data type Page 37 getDataType (Acquiring label data type)
setBitLabel Setting label data for Bit type Page 38 setBitLabel (Setting label data for Bit
type)
setWordLabel Setting label data for Word (Signed) Page 38 setWordLabel (Setting label data for
Word (Signed))
setUnsignedWordLabel Setting label data for Word (Unsigned) Page 38 setUnsignedWordLabel (Setting label
data for Word (Unsigned))
setDoubleWordLabel Setting label data for Double Word (Signed) Page 39 setDoubleWordLabel (Setting label data
for Double Word (Signed))
setUnsignedDoubleWordLabel Setting label data for Double Word
(Unsigned)
Page 39 setUnsignedDoubleWordLabel (Setting
label data for Double Word (Unsigned))
setFloatSingleLabel Setting label data for FLOAT (Single
Precision)
Page 39 setFloatSingleLabel (Setting label data
for FLOAT (Single Precision))
setFloatDoubleLabel Setting label data for FLOAT (Double
Precision)
Page 40 setFloatDoubleLabel (Setting label data
for FLOAT (Double Precision))
setAsciiStringLabel Setting label data for ASCII character string Page 40 setAsciiStringLabel (Setting label data for
ASCII character string)
setUnicodeStringLabel Setting label data for Unicode character
string
Page 40 setUnicodeStringLabel (Setting label
data for Unicode character string)
setTimeLabel Setting label data for Time Page 41 setTimeLabel (Setting label data for
Time)
5 METHODS5.2 Details of Methods 25
5
5.2 Details of MethodsThe following shows the details of each method.
MELMxCommunication classA class to access a CPU module and read/write data.
When performing communication with multiple CPU modules, create multiple instances as necessary.
Details of methods
■MELMxComminication (Constructor)
■open (Opening communication line)
RCPU FX5CPU QCPU LCPU
Item Description
Class name MELMxCommunication
Method definition void MELMxCommuinication()
Argument None
Return value None
Function A constructor of this class.
Up to 10 instances can be created for this class. The operation with 11 or more instances is not guaranteed.
Reference None
Considerations None
RCPU FX5CPU QCPU LCPU
Item Description
Class name MELMxCommunication
Method definition int open(
MELMxOpenSettings openSettings,
String remotePassword
)
Argument [in]openSettings Specify the instance of the MELMxOpenSettings class in which the setting values for connection
are stored.
For details, refer to the following section.
Page 33 MELMxOpenSettings class
[in]remotePassword Specify the password for unlock the remote password.
When a remote password has not been set for the module, specify 'null'.
For 'null', the unlock of the remote password is not performed.
Return value MX_SUCCESS: Succeed
Other than MX_SUCCESS: Failed (Page 54 Error Code List)
Function Open a communication.
The communication with one CPU module is performed per one instance. When performing communication with multiple CPU
modules, create multiple instances as necessary.
In addition, when accessing the CPU module using multiple instances with TCP/IP simultaneously, multiple Ethernet modules
or built-in Ethernet CPUs are required. The communication for the same port cannot be performed between multiple instances.
Reference close()
Considerations • Remote password
Unlock the remote password in open method, and lock the remote password again when close method is called.
The operation related to the remote password is the same as that for Ethernet modules and built-in Ethernet CPU.
If 'null' is specified to 'remotePassword' (argument) even when the remote password is set to the Ethernet module or built-in
Ethernet CPU, an error will be detected not with open, but with read/write API for devices and labels.
265 METHODS5.2 Details of Methods
■close (Closing communication line)
• Time until the connection between each connected module is disconnected
RCPU FX5CPU QCPU LCPU
Item Description
Class name MELMxCommunication
Method definition int close()
Argument None
Return value MX_SUCCESS: Succeed
Other than MX_SUCCESS: Failed (Page 54 Error Code List)
Function Disconnects the communication.
Reference open()
Considerations At the execution of close, if the disconnection request of TCP connection is not reached to the CPU module or Ethernet module
due to the disconnection of the Ethernet cable on the CPU module or Ethernet module side or the power OFF of the wireless
router, the connection of the CPU module or Ethernet module side is retained.
Wait until the connection is disconnected.
Connected module Check item
RCPU (built-in Ethernet port) GX Works3: Module Parameter [Application Settings] [Timer Settings for Data
Communication]FX5CPU (built-in Ethernet port)
MELSEC iQ-R series-compatible EN71
QCPU (built-in Ethernet port) Inapplicable (Time-out value of KeepAlive: 45 seconds)
LCPU (built-in Ethernet port)
Q series-compatible E71 GX Works2: Network Parameter Ethernet/CC IE Field Network Type: Ethernet [Initial
Settings] Timer SettingsL series-compatible E71
5 METHODS5.2 Details of Methods 27
5
■readDeviceBlock (Reading devices in bulk)
RCPU FX5CPU QCPU LCPU
Item Description
Class name MELMxCommunication
Method definition int readDeviceBlock(
String deviceName,
int size,
int[] readDatas
)
Argument [in]deviceName Specify the device name which includes the start reading device number.
[in]size Specify a number of points to be read.
Up to 960 points can be read.
[out]readDatas The read device value is stored.
Return value MX_SUCCESS: Succeed
Other than MX_SUCCESS: Failed (Page 54 Error Code List)
Function Reads device values specified to 'size' (argument) in bulk from the device specified to 'deviceName' (argument), and stores the
values to 'readDatas' (argument).
Device specification
method
(Bit device is specified)
Example: Read data for three points (three words) from M0
deviceName="M0", size=3
Data storage example (one element of array (4-byte))
readDatas[0]: M0 to M15
readDatas[1]: M16 to M31
readDatas[2]: M32 to M47
• Since bit devices are stored in word unit, upper 2-bytes are padded with '0'.
• The data storage example of the bit device differs depending on the environment of the system
used. For details, refer to the following section.
Page 20 Consideration for bit devices
Device specification
method
(Word device is specified)
Example: Read data for three points from D0
deviceName="D0", size=3
Data storage example (one element of array (4-byte))
readDatas[0]: D0
readDatas[1]: D1
readDatas[2]: D2
Reference open(), close(), writeDeviceBlock()
Considerations Device name The following device names cannot be specified. If specified, an error occurs.
• Long timer: LTN (Current value)
• Long retentive timer: LSTN (Current value)
• Long counter: LCN (Current value)
• Index register: LZ
Device extension
specification
Device extension specification cannot be used.
Read point The maximum read points are within the range that satisfies the following formula.
Start reading device number + Read points End device number
Specification of bit device When specifying a bit device, a device number of a multiple of 16 can only be specified.
Assure the 'size' (argument) or more number of elements for 'readDatas' (argument).
285 METHODS5.2 Details of Methods
■writeDeviceBlock (Writing devices in bulk)
RCPU FX5CPU QCPU LCPU
Item Description
Class name MELMxCommunication
Method definition int writeDeviceBlock(
String deviceName,
int size,
int[] writeDatas
)
Argument [in]deviceName Specify the device name which includes the start writing device number.
[in]size Specify a number of points to be written.
Up to 960 points can be written.
[in]writeDatas Specify the array of the device values to be written.
Return value MX_SUCCESS: Succeed
Other than MX_SUCCESS: Failed (Page 54 Error Code List)
Function Writes device values specified to 'size' (argument) in bulk from the device specified to 'deviceName' (argument).
Stores device values to be written to writeDatas.
Device specification
method
(Bit device is specified)
Example: Write data for three points (three words) from M0
deviceName="M0", size=3
Data storage example (one element of array (4-byte))
writeDatas[0]: M0 to M15
writeDatas[1]: M16 to M31
writeDatas[2]: M32 to M47
• Since bit devices are stored in word unit, upper 2-bytes are padded with '0'.
• The data storage example of the bit device differs depending on the environment of the system
used. For details, refer to the following section.
Page 20 Consideration for bit devices
Device specification
method
(Word device is specified)
Example: Write data for three points from D0
deviceName="D0", size=3
Data storage example (one element of array (4-byte))
writeDatas[0]: D0
writeDatas[1]: D1
writeDatas[2]: D2
Reference open(), close(), readDeviceBlock()
Considerations Device name The following device names cannot be specified. If specified, an error occurs.
• Long timer: LTN (Current value)
• Long retentive timer: LSTN (Current value)
• Long counter: LCN (Current value)
• Index register: LZ
Device extension
specification
Device extension specification cannot be used.
Number of write points The maximum write points are within the range that satisfies the following formula.
start writing device number + Write points End device number
Specification of bit device When specifying a bit device, a device number of a multiple of 16 can only be specified.
Assure the 'size' (argument) or more number of elements for 'writeDatas' (argument).
5 METHODS5.2 Details of Methods 29
5
■readDeviceRandom (Reading devices randomly)
RCPU FX5CPU QCPU LCPU
Item Description
Class name MELMxCommunication
Method definition int readDeviceRandom(
String[] deviceNames,
int[] readDatas
)
Argument [in]deviceNames Specify the device name, which includes device number, with array.
This method processes the number of elements of array as a read point. Therefore, the
specification of read points for an argument is not required.
Up to 96 points can be read.
[out]readDatas The read device value is stored.
Return value MX_SUCCESS: Succeed
Other than MX_SUCCESS: Failed (Page 54 Error Code List)
Function Reads device values for the number of points of 'deviceNames' from the device group specified to 'deviceNames' (argument),
and stores the values to 'readDatas' (argument).
Device specification
method
Example: Read the device values of M0, D10, and LZ20
deviceName="M0", "D10", "LZ20"
Data storage example (one element of array (4-byte))
readDatas[0]: M0 (ON/OFF is judged with bit 0.)
readDatas[1]: D10
readDatas[2]: LZ20
Reference open(), close(), writeDeviceRandom()
Considerations • When using the device extension specification for 'deviceNames' (argument), use the device extension specification for all
the devices. Devices and extended devices cannot be used together. (U3E1\G0 and D0 cannot be used together.)
• Assure the number of the read points or more elements for 'readDatas' (argument).
305 METHODS5.2 Details of Methods
■writeDeviceRandom (Writing devices randomly)
RCPU FX5CPU QCPU LCPU
Item Description
Class name MELMxCommunication
Method definition int writeDeviceRandom(
String[] deviceNames,
int[] writeDatas
)
Argument [in]deviceNames Specify the device name, which includes device number, with array.
This method processes the number of elements of array as a write point. Therefore, the
specification of write points for an argument is not required.
The maximum points that can be written are as follows:
RCPU: 68 points
QCPU/LCPU/FX5CPU: 80 points
[in]writeDatas Stores device values to be written.
Return value MX_SUCCESS: Succeed
Other than MX_SUCCESS: Failed (Page 54 Error Code List)
Function Writes device values for the number of points of 'deviceNames' to the device group specified to 'deviceNames' (argument).
Stores device values to be written to writeDatas.
Device specification
method
Example: Write the device values of M0, D10, and LZ20
deviceName="M0", "D10", "LZ20"
Data storage example (one element of array (4-byte))
writeDatas[0]: M0 (ON/OFF is judged with bit 0.)
writeDatas[1]: D10
writeDatas[2]: LZ20
Reference open(), close(), readDeviceRandom()
Considerations • When using the device extension specification for 'deviceNames' (argument), use the device extension specification for all
the devices. Devices and extended devices cannot be used together. (U3E1\G0 and D0 cannot be used together.)
• Assure the number of the write points or more elements for 'writeDatas' (argument).
• When bit devices and word devices (including double word devices) are mixed, they are processed as respective packets.
Therefore, the write timing of bit devices and word devices are different.
• When bit devices and word devices (including double word devices) are mixed, bit devices are written after word devices are
written. Therefore, the writing of bit devices may fail despite the writing of word devices are successful. If an error occurs in
this method, perform write processing again and complete the writing after checking the error content.
5 METHODS5.2 Details of Methods 31
5
■readArrayLabel (Reading data by specifying array type label)
■writeArrayLabel (Writing data by specifying array type label)
RCPU FX5CPU QCPU LCPU
Item Description
Class name MELMxCommunication
Method definition int readArrayLabel(
MELMxLabel label
)
Argument [in/out]label Specify the MELMxLabel object in which a label to be read is set.
For the MELMxLabel object, set the label name, the character string length of the label definition
(when the data type is string type only), and the number of data by using the setting method for
label data in advance.
After this method is successful, the read label data is stored.
Return value MX_SUCCESS: Succeed
Other than MX_SUCCESS: Failed (Page 54 Error Code List)
Function Reads array type label data specified to 'label' (argument) for the specified number of points.
The read label data is stored to 'label' (argument).
Reference open(), close(), writeArrayLabel()
Considerations • The array type label name of the following data types cannot be specified;
Timer, retentive timer, counter, long timer, long retentive timer, long counter
• Up to three dimensions can be specified. (Note that two-dimensional arrays and three-dimensional arrays of which data type
is bit cannot be specified in this method.)
• If the data size to be read exceeds 1914 bytes, an error occurs. Specify the data size to be read 1906 bytes or less.
• Specify the character string length for the label name up to 1906 bytes.
• 4-byte character of Unicode (Example: (U+20089)) is treated as 2 bytes, 2 characters.
RCPU FX5CPU QCPU LCPU
Item Description
Class name MELMxCommunication
Method definition int writeArrayLabel(
MELMxLabel label
)
Argument [in]label Specify the MELMxLabel object in which a label to be written is set.
For the MELMxLabel object, set the label name, the character string length of the label definition
(when the data type is string type only), the label data, and the number of data by using the
setting method for label data in advance.
Return value MX_SUCCESS: Succeed
Other than MX_SUCCESS: Failed (Page 54 Error Code List)
Function Writes array type label data specified to 'label' (argument) for the specified number of points.
Set the label data to be written to 'label' (argument).
Reference open(), close(), readArrayLabel()
Considerations • The array type label name of the following data types cannot be specified;
Timer, retentive timer, counter, long timer, long retentive timer, long counter
• Up to three dimensions can be specified. (Note that two-dimensional arrays and three-dimensional arrays of which data type
is bit cannot be specified in this method.)
• Specify the total number of character string length for the label name and write data up to 1906 bytes.
• 4-byte character of Unicode (Example: (U+20089)) is treated as 2 bytes, 2 characters.
325 METHODS5.2 Details of Methods
■readLabelRandom (Reading data by specifying multiple labels)
■writeLabelRandom (Writing data by specifying multiple labels)
RCPU FX5CPU QCPU LCPU
Item Description
Class name MELMxCommunication
Method definition int readLabelRandom(
MELMxLabel[] labels
)
Argument [in/out]labels Specify multiple MELMxLabel objects, in which labels to be read are set, using an array.
For each MELMxLabel object, set the label name, the character string length of the label
definition (when the data type is string type only), and the number of data by using the setting
method for label data in advance.
After this method is successful, the read label data is stored.
Return value MX_SUCCESS: Succeed
Other than MX_SUCCESS: Failed (Page 54 Error Code List)
Function Reads the label group specified to 'labels' (argument).
The read label data is set to each element of 'label' (argument).
Reference open(), close(), writeLabelRandom()
Considerations • Only the labels of simple data type (including elements of array and structure element) can be specified.
• Read data size must be met the following condition formula.
Total number of (read data size + 2) 1912
• Total length of the label name must be met the following formula.
Total number of (label name length 2 + 2) 1910
• 4-byte character of Unicode (Example: (U+20089)) is treated as 2 bytes, 2 characters.
RCPU FX5CPU QCPU LCPU
Item Description
Class name MELMxCommunication
Method definition int writeLabelRandom(
MELMxLabel[] labels
)
Argument [in]labels Specify multiple MELMxLabel objects, in which labels to be written are set, using an array.
For each MELMxLabel object, set the label name, the character string length of the label
definition (when the data type is string type only), the label data, and the number of data by using
the setting method for label data in advance.
Return value MX_SUCCESS: Succeed
Other than MX_SUCCESS: Failed (Page 54 Error Code List)
Function Write data to the label group specified to 'labels' (argument).
Set the label data to be written to each element of 'label' (argument).
Reference open(), close(), readLabelRandom()
Considerations • Only the labels of simple data type (including elements of array and structure element) can be specified.
• Total length of the label name must be met the following condition formula.
Total number of (label name length 2 + write data size + 4) 1910
• 4-byte character of Unicode (Example: (U+20089)) is treated as 2 bytes, 2 characters.
5 METHODS5.2 Details of Methods 33
5
MELMxOpenSettings classA class to manage the following parameters at communication.
These parameters can be accessed directly as "Public field".
Details of fields
■unitType
■cpuType • RCPU
• FX5CPU
Field name Data type Description Default value Reference
unitType Integer Specify the communication target module. UNIT_RETHER (1002H) Page 33 unitType
cpuType Integer Specify the communication target CPU module. CPU_R04CPU (1001H) Page 33 cpuType
protocolType Integer Specify the communication protocol. PROTOCOL_TCPIP
(05H)
Page 35 protocolType
hostAddress String Specify the host name (IP address) of the connection
target.
Only IPv4 is supported.
1.1.1.1
portNumber Integer Specify the port number of the devices such as a tablet. 0H
destinationPortNumber Integer Specify the port number of the connection target module.
When using the SLMP/MC protocol, specify the same
port number set to the connection target module.
When using the MELSOFT connection, specify the port
number as described in the following section.
Page 35 destinationPortNumber
5002
timeOut Integer Specify the communication time-out time (ms) between
the CPU module and the device such as a tablet.
10000 (2710H)
cpuTimeOut Integer Set the CPU monitoring timer. (Units: 250 ms)
Example: 2500 ms for 10
The available range is 0 to FFFFH. If the value outside
the range has been set, set '0'.
Note that when '0' is specified, it will indicate an infinity
wait.
Specify '0' for FX5CPU.
40
Connected module Definition name Value (Hexadecimal)
RCPU (Built-in Ethernet port CPU) UNIT_RETHER 1002H
FX5CPU (Built-in Ethernet port CPU) UNIT_FETHER 2001H
QCPU (Built-in Ethernet port CPU) UNIT_QNETHER 2CH
LCPU (Built-in Ethernet port CPU) UNIT_LNETHER 52H
MELSEC iQ-R series-compatible EN71 UNIT_RJ71EN71 1001H
Q series-compatible E71 UNIT_QJ71E71 1AH
L series-compatible E71 UNIT_LJ71E71 5CH
Applicable CPU module Definition name Value (Hexadecimal)
R04CPU CPU_R04CPU 1001H
R08CPU CPU_R08CPU 1002H
R16CPU CPU_R16CPU 1003H
R32CPU CPU_R32CPU 1004H
R120CPU CPU_R120CPU 1005H
Applicable CPU module Definition name Value (Hexadecimal)
FX5UCPU CPU_FX5UCPU 210H
FX5UCCPU CPU_FX5UCCPU 210H
345 METHODS5.2 Details of Methods
• QCPU
Applicable CPU module Definition name Value (Hexadecimal)
Q00JCPU CPU_Q00JCPU 30H
Q00UJCPU CPU_Q00UJCPU 80H
Q00CPU CPU_Q00CPU 31H
Q00UCPU CPU_Q00UCPU 81H
Q01CPU CPU_Q01CPU 32H
Q01UCPU CPU_Q01UCPU 82H
Q02(H)CPU CPU_Q02CPU 22H
Q06HCPU CPU_Q06CPU 23H
Q12HCPU CPU_Q12CPU 24H
Q25HCPU CPU_Q25CPU 25H
Q02PHCPU CPU_Q02PHCPU 45H
Q06PHCPU CPU_Q06PHCPU 46H
Q12PHCPU CPU_Q12PHCPU 41H
Q25PHCPU CPU_Q25PHCPU 42H
Q12PRHCPU CPU_Q12PRHCPU 43H
Q25PRHCPU CPU_Q25PRHCPU 44H
Q02UCPU CPU_Q02UCPU 83H
Q03UDCPU CPU_Q03UDCPU 70H
Q04UDHCPU CPU_Q04UDHCPU 71H
Q06UDHCPU CPU_Q06UDHCPU 72H
Q10UDHCPU CPU_Q10UDHCPU 75H
Q13UDHCPU CPU_Q13UDHCPU 73H
Q20UDHCPU CPU_Q20UDHCPU 76H
Q26UDHCPU CPU_Q26UDHCPU 74H
Q03UDECPU CPU_Q03UDECPU 90H
Q04UDEHCPU CPU_Q04UDEHCPU 91H
Q06UDEHCPU CPU_Q06UDEHCPU 92H
Q10UDEHCPU CPU_Q10UDEHCPU 95H
Q13UDEHCPU CPU_Q13UDEHCPU 93H
Q20UDEHCPU CPU_Q20UDEHCPU 96H
Q26UDEHCPU CPU_Q26UDEHCPU 94H
Q50UDEHCPU CPU_Q50UDEHCPU 98H
Q100UDEHCPU CPU_Q100UDEHCPU 9AH
Q03UDVCPU CPU_Q03UDVCPU D1H
Q04UDVCPU CPU_Q04UDVCPU D2H
Q06UDVCPU CPU_Q06UDVCPU D3H
Q13UDVCPU CPU_Q13UDVCPU D4H
Q26UDVCPU CPU_Q26UDVCPU D5H
5 METHODS5.2 Details of Methods 35
5
• LCPU
■protocolType
■destinationPortNumber
Applicable CPU module Definition name Value (Hexadecimal)
L02SCPU CPU_L02SCPU A3H
L02SCPU-P CPU_L02SCPU A3H
L02CPU CPU_L02CPU A1H
L02CPU-P CPU_L02CPU A1H
L06CPU CPU_L06CPU A5H
L06CPU-P CPU_L06CPU A5H
L26CPU CPU_L26CPU A4H
L26CPU-P CPU_L26CPU A4H
L26CPU-BT CPU_L26CPUBT A2H
L26CPU-PBT CPU_L26CPUBT A2H
Applicable protocol Definition name Value (Hexadecimal)
TCP/IP PROTOCOL_TCPIP 05H
Connected module TCP/IP
RCPU (Built-in Ethernet port CPU) 5007
MELSEC iQ-R series-compatible EN71 5002
Q series-compatible E71 5002
L series-compatible E71 5002
365 METHODS5.2 Details of Methods
MELMxLabel classA class to manage the label data for label names.
Use this class when using the read/write methods of label (readArrayLabel/writeArrayLabel/readLabelRandom/
writeLabelRandom of MELMxCommunication class).
Details of methods
■MELMxLabel (Constructor)
Item Description
Class name MELMxLabel
Method definition void MELMxLabel()
Argument None
Return value None
Function A constructor of this class.
The default value of label name is null character.
Set "MEL_MX_LABEL_DATATYPE_BIT" for the data type, and "false" for the value as a default.
The default value of the point is one point.
The default value of string data length for a label of which data type is 'string [32] or 'string' [Unicode] (32) is 32 characters.
Reference None
Considerations None
5 METHODS5.2 Details of Methods 37
5
■getValues (Acquiring label data)
■getName (Acquiring label name)
■getDataType (Acquiring label data type)
Item Description
Class name MELMxLabel
Method definition Object[] getValue()
Argument None
Return value Label data
Function Acquires the label data to be managed in the instance of this class.
• Use this class to acquire the label data read with readLabelRandom. (Page 32 readLabelRandom (Reading data by
specifying multiple labels))
The acquired data is the Object instance.
Before using data, convert the variable which are matched with the data type acquired by the data type acquisition method
(getDataType).(Page 37 getDataType (Acquiring label data type))
For details on the type of variable, refer to the following section.
Page 20 The data types of label
Reference None
Considerations 4-byte character of Unicode (Example: (U+20089)) is included when the label data is Unicode character string, it is treated
as 2 bytes, 2 characters.
Item Description
Class name MELMxLabel
Method definition String getName()
Argument None
Return value Label name
Function Acquires the label name specified with the label data setting method.
Reference MELMxLabel()
Considerations When 4-byte character of Unicode (Example: (U+20089)) is included in the label name, it is treated as 2 bytes, 2
characters.
Item Description
Class name MELMxLabel
Method definition int getDataType()
Argument None
Return value Data type of label
Function Acquires the data type of a label.
For details on the types of variables, refer to the following section.
Page 20 The data types of label
Reference None
Considerations None
385 METHODS5.2 Details of Methods
■setBitLabel (Setting label data for Bit type)
■setWordLabel (Setting label data for Word (Signed))
■setUnsignedWordLabel (Setting label data for Word (Unsigned))
Item Description
Class name MELMxLabel
Method definition void setBitLabel(
String name,
Boolean[] values,
int size
)
Argument [in]name Specify a label name.
[in]values Specify label data.
[in]size Specify a number of data.
Return value None
Function Set the label names, types, and label data to be managed in the instance of this class.
Use this method when the data type is Bit. (Page 20 The data types of label)
Reference getValues()
Considerations None
Item Description
Class name MELMxLabel
Method definition void setWordLabel(
String name,
Integer[] values,
int size
)
Argument [in]name Specify a label name.
[in]values Specify label data.
[in]size Specify a number of data.
Return value None
Function Set the label names, types, and label data to be managed in the instance of this class.
Use this method when the data type is Word (Signed). (Page 20 The data types of label)
Reference getValues()
Considerations None
Item Description
Class name MELMxLabel
Method definition void setUnsignedWordLabel(
String name,
Integer[] values,
int size
)
Argument [in]name Specify a label name.
[in]values Specify label data.
[in]size Specify a number of data.
Return value None
Function Set the label names, types, and label data to be managed in the instance of this class.
Use this method when the data type is Word (Unsigned). (Page 20 The data types of label)
Reference getValues()
Considerations None
5 METHODS5.2 Details of Methods 39
5
■setDoubleWordLabel (Setting label data for Double Word (Signed))
■setUnsignedDoubleWordLabel (Setting label data for Double Word (Unsigned))
■setFloatSingleLabel (Setting label data for FLOAT (Single Precision))
Item Description
Class name MELMxLabel
Method definition void setDoubleWordLabel(
String name,
Long[] values,
int size
)
Argument [in]name Specify a label name.
[in]values Specify label data.
[in]size Specify a number of data.
Return value None
Function Set the label names, types, and label data to be managed in the instance of this class.
Use this method when the data type is Double-Word (Signed). (Page 20 The data types of label)
Reference getValues()
Considerations None
Item Description
Class name MELMxLabel
Method definition void setUnsignedDoubleWordLabel(
String name,
Long values,
int size
)
Argument [in]name Specify a label name.
[in]values Specify label data.
[in]size Specify a number of data.
Return value None
Function Set the label names, types, and label data to be managed in the instance of this class.
Use this method when the data type is Double-Word (Unsigned). (Page 20 The data types of label)
Reference getValues()
Considerations None
Item Description
Class name MELMxLabel
Method definition void setFloatSingleLabel(
String name,
Float[] values,
int size
)
Argument [in]name Specify a label name.
[in]values Specify label data.
[in]size Specify a number of data.
Return value None
Function Set the label names, types, and label data to be managed in the instance of this class.
Use this method when the data type is FLOAT (Single Precision). (Page 20 The data types of label)
Reference getValues()
Considerations None
405 METHODS5.2 Details of Methods
■setFloatDoubleLabel (Setting label data for FLOAT (Double Precision))
■setAsciiStringLabel (Setting label data for ASCII character string)
■setUnicodeStringLabel (Setting label data for Unicode character string)
Item Description
Class name MELMxLabel
Method definition void setFloatDoubleLabel(
String name,
Double[] values,
int size
)
Argument [in]name Specify a label name.
[in]values Specify label data.
[in]size Specify a number of data.
Return value None
Function Set the label names, types, and label data to be managed in the instance of this class.
Use this method when the data type is FLOAT (Double Precision). (Page 20 The data types of label)
Reference getValues()
Considerations None
Item Description
Class name MELMxLabel
Method definition void setAsciiStringLabel(
String name,
Long length,
String[] values,
int size
)
Argument [in]name Specify a label name.
[in]length Specify the character string length of the label definition.
[in]values Specify label data.
[in]size Specify a number of data.
Return value None
Function Set the label names, types, and label data to be managed in the instance of this class.
Use this method when the data type is String [32]. (Page 20 The data types of label)
Reference getValues()
Considerations None
Item Description
Class name MELMxLabel
Method definition void setUnicodeStringLabel(
String name,
Long length,
String[] values,
int size
)
Argument [in]name Specify a label name.
[in]length Specify the character string length of the label definition.
[in]values Specify label data.
[in]size Specify a number of data.
Return value None
Function Set the label names, types, and label data to be managed in the instance of this class.
Use this method when the data type is String [Unicode] (32). (Page 20 The data types of label)
Reference getValues()
Considerations When 4-byte character of Unicode (Example: (U+20089)) is included in the label name or label data, it is treated as 2 bytes,
2 characters.
5 METHODS5.3 Considerations for using methods 41
5
■setTimeLabel (Setting label data for Time)
MELMxErrorCode classA class which retains an error code occurs in this library.
The error code is retained in 'public static const' field.
For details of error codes, refer to the following section.
Page 54 Error codes that MX Component library return
5.3 Considerations for using methodsWhen remote password has been set, unlock the remote password (in open method) before communication.
When the communication is completed (in close method), the remote password is locked.
Item Description
Class name MELMxLabel
Method definition void setTimeLabel(
String name,
Long[] values,
int size
)
Argument [in]name Specify a label name.
[in]values Specify label data.
[in]size Specify a number of data.
Return value None
Function Set the label names, types, and label data to be managed in the instance of this class.
Use this method when the data type is Time. (Page 20 The data types of label)
Reference getValues()
Considerations None
425 METHODS5.4 Sample Program
5.4 Sample ProgramThis section explains the sample program in the CD-ROM provided with this product.
Sample program differs depending on CPU series. Use the sample program according to the CPU module which is to be
accessed.
Created applicationThe following shows a screen image when the application created by using sample program is operated with a tablet.
Methods are executed by tapping the buttons which are on left side of the screen. After the method is executed, the result is
displayed on right side of the screen.
When the processing is successful, "SUCCESS" and the value of execution result are displayed. If the processing is failed,
the error code is displayed.
The following table shows the processing corresponding to the each button in above screen image.
Folder name Description
SampleProject iQ-F Sample for the MELSEC iQ-F series FX5CPU module
iQ-R Sample for the MELSEC iQ-R series CPU module
Q Sample for the MELSEC-Q series CPU module/ MELSEC-L series CPU module
Button name Processing
Open Page 44 execOpen
Close Page 45 execClose
ReadDeviceBlock Page 46 execReadDeviceBlock
WriteDeviceBlock Page 47 execWriteDeviceBlock
ReadDeviceRandom Page 48 execReadDeviceRandom
WriteDeviceRandom Page 49 execWriteDeviceRandom
ReadArrayLabel Page 50 execReadArrayLabel
WriteArrayLabel Page 51 execWriteArrayLabel
ReadLabelRandom Page 52 execReadLabelRandom
WriteLabelRandom Page 53 execWriteLabelRandom
Reading and writing devices/labels
5 METHODS5.4 Sample Program 43
5
Operation for applicationThe following shows the basic operation to communicate.
Operating procedure
1. Start up the application.
2. Tap the [Open] button.
3. Tap the button for reading and writing devices/labels.
4. Tap the [Close] button.
If tap the [ClearRecord] button, the execution result is cleared.
Operation environmentThe sample program is created to operate in the following environment.
Item Description
CPU • Sample for the MELSEC iQ-F series FX5CPU module: FX5UCPU
• Sample for the MELSEC iQ-R series CPU module: R16CPU
• Sample for the MELSEC-Q series CPU module: Q20UDEHCPU
IP address 192.168.2.100
Port
(Ethernet Port Direct
Connection)
• FX5UCPU: 5014
• R16CPU: 5007
• Q20UDEHCPU: 5014
445 METHODS5.4 Sample Program
Sample methodThe methods which are explained in this section are written in the following file.
Storage folder: SampleProject (folder for each series) src jp co melco mxcomponentsample
File name: MXComponentManager.java
Processing corresponding to each buttonThe following shows the processing corresponding to the button.
■execOpenWhen tap the [Open] button, the following processing are executed.
• Open method of the MELMxCommunication class is executed in the background.
• When counting the elapsed time and if it is over the time-out period which is set, time-out error is returned.
5 METHODS5.4 Sample Program 45
5
■execCloseWhen tap the [Close] button, the following processing are executed.
• Close method of the MELMxCommunication class is executed in the background.
• When counting the elapsed time and if it is over the time-out period which is set, time-out error is returned.
465 METHODS5.4 Sample Program
■execReadDeviceBlockWhen tap the [ReadDeviceBlock] button, the following processing are executed.
• Read the values from the device 'D100' of the connection target which has been executed the Open method, and display
the values.
• When counting the elapsed time and if it is over the time-out period which is set, time-out error is returned.
5 METHODS5.4 Sample Program 47
5
■execWriteDeviceBlockWhen tap the [WriteDeviceBlock] button, the following processing are executed.
• Write random values from 0 to 99 to the device 'D100' of the connection target which has been executed the Open method.
• When counting the elapsed time and if it is over the time-out period which is set, time-out error is returned.
485 METHODS5.4 Sample Program
■execReadDeviceRandomWhen tap the [ReadDeviceRandom] button, the following processing are executed.
• Read the values from the device 'D100', 'M0', and 'LZ0' of the connection target which have been executed the Open
method, and display the values.
• For bit devices, the execution result is displayed ON/OFF.
• When counting the elapsed time and if it is over the time-out period which is set, time-out error is returned.
5 METHODS5.4 Sample Program 49
5
■execWriteDeviceRandomWhen tap the [WriteDeviceRandom] button, the following processing are executed.
• Write random values to the device 'D100', 'M0', and 'LZ0' of the connection target which have been executed the Open
method.
• For bit devices, the execution result is displayed ON/OFF.
• When counting the elapsed time and if it is over the time-out period which is set, time-out error is returned.
505 METHODS5.4 Sample Program
■execReadArrayLabelWhen tap the [ReadArrayLabel] button, the following processing are executed.
• Read the values from the wLabel[0]*1 of the connection target which has been executed the Open method, and display the
values.
• When counting the elapsed time and if it is over the time-out period which is set, time-out error is returned.
*1 'wLabel' is the array type label of Word type.
5 METHODS5.4 Sample Program 51
5
■execWriteArrayLabelWhen tap the [WriteArrayLabel] button, the following processing are executed.
• Write random values from 0 to 99 to the wLabel[0]*1 of the connection target which has been executed the Open method.
• When counting the elapsed time and if it is over the time-out period which is set, time-out error is returned.
*1 'wLabel' is the array type label of Word type.
525 METHODS5.4 Sample Program
■execReadLabelRandomWhen tap the [ReadLabelRandom] button, the following processing are executed.
• Read the values from the wLabel[0], bLabel[0], and sLabel[0]*1 of the connection target which have been executed the
Open method, and display the values.
• When counting the elapsed time and if it is over the time-out period which is set, time-out error is returned.
*1 'wLabel' is the array type label of Word type. 'bLabel' is the array type label of Bit type. 'sLabel' is the array type label of String type.
5 METHODS5.4 Sample Program 53
5
■execWriteLabelRandomWhen tap the [WriteLabelRandom] button, the following processing are executed.
• Write random values to the wLabel[0], bLabel[0], and sLabel[0]*1 of the connection target which have been executed the
Open method.
• When counting the elapsed time and if it is over the time-out period which is set, time-out error is returned.
*1 'wLabel' is the array type label of Word type. 'bLabel' is the array type label of Bit type. 'sLabel' is the array type label of String type.
546 TROUBLESHOOTING6.1 Error Processing and Corrective Actions
6 TROUBLESHOOTING
This chapter explains error codes and corrective actions.
6.1 Error Processing and Corrective ActionsAn error code is returned for an error processing.
For the error codes and corrective actions, refer to the following section.
Page 54 Error Code List
6.2 Error Code ListThis section explains error codes and corrective actions.
Error codes that CPU module/module returnThe following shows the error code of which lower 4 digits indicate the error code of CPU module/module.
For details, refer to the manual for each module.
• 0x01090000 to 0x0109FFFF: FX5CPU
• 0x010A0000 to 0x010AFFFF: RCPU, QCPU, LCPU
• 0x010C0000 to 0x010CFFFF: MELSEC iQ-R series-compatible EN71, Q series-compatible E71, L series-compatible E71
Error codes that MX Component library return • 0xF0000000 to 0xF1FFFFFF, 0xFE000001 to 0xFE00FFFF: MX Component for Android library itself
• 0x01800000 to 0x0180FFFF, 0x01900000 to 0x0190FFFF: EasySocket Communication
Error code Error description Corrective action
0x00000000 Normal end
0x01800001 No command error
The specified CPU module or the module is
not supported by the function.
• Check if the CPU module or the module is supported by the function.
0x01800003 Memory securing error • End other running applications, and then restart the application which is created by
using MX Component for Android.
• Restart the device such as a tablet.
0x01800004 Load error • Check if the set module type, CPU type, and protocol type are corresponding to the
system configuration used.
• End other running applications, and then restart the application which is created by
using MX Component for Android.
• Restart the device such as a tablet.
• If the error occurs even after the actions mentioned above are taken, please consult
your local Mitsubishi representative.
0x01801002 Multi-line open error • End other running applications, and then restart the application which is created by
using MX Component for Android.
• Restart the device such as a tablet.0x01801003 Open not yet executed
0x01801006 Specified module error • Check that the set module type is corresponding to the system configuration used.
• End other running applications, and then restart the application which is created by
using MX Component for Android.
• Restart the device such as a tablet.
0x01801007 Specified CPU error • Check that the set CPU type is corresponding to the system configuration used.
• End other running applications, and then restart the application which is created by
using MX Component for Android.
• Restart the device such as a tablet.
0x01801009 Setting file open failed • End other running applications, and then restart the application which is created by
using MX Component for Android.
• Restart the device such as a tablet.
• Reinstall MX Component library.
• If the error occurs even after the actions mentioned above are taken, please consult
your local Mitsubishi representative.
6 TROUBLESHOOTING6.2 Error Code List 55
6
0x0180100B Protocol type error
The specified protocol is incorrect.
• Check that the set protocol type is corresponding to the system configuration used.
• End other running applications, and then restart the application which is created by
using MX Component for Android.
• Restart the device such as a tablet.
• Reinstall MX Component library.
• If the error occurs even after the actions mentioned above are taken, please consult
your local Mitsubishi representative.
0x01802001 Device error
The device character string specified in the
method is an incorrect device character
string.
• Review the device name.
0x01802002 Device number error
The device character string number specified
in the method is an incorrect device number.
• Review the device number.
0x01802005 Size error
The number of points specified in the method
is incorrect.
• Check the number of specified points in the method.
• Review the system such as the settings of CPU module or the module and the cable.
• Check the communication status between the device such as a tablet and the wireless
LAN router.
• End other running applications, and then restart the application which is created by
using MX Component for Android.
• Restart the device such as a tablet.
• Reinstall MX Component library.
0x01802007 Receive data error
The received data is abnormal.
• Review the system such as the settings of CPU module or the module and the cable.
• Check the communication status between the device such as a tablet and the wireless
LAN router.
• End other running applications, and then restart the application which is created by
using MX Component for Android.
• Restart the device such as a tablet.
0x01802079 'null' specification error
'null' is specified to the argument.
• Specify the correct value to the argument.
0x01808001 Multiple open error
Open method was executed while it was
open.
• Execute any method other than open.
• End other running applications, and then restart the application which is created by
using MX Component for Android.
• Restart the device such as a tablet.
0x01808007 Socket object generation error
Creation of the Socket object failed.
• Check if the application which uses the same port number is running.
• Change the value specified to PortNumber and retry.
• End other running applications, and then restart the application which is created by
using MX Component for Android.
• Restart the device such as a tablet.
0x01808008 Port connection error
Establishment of connection failed. The
connection target does not respond.
• Review the values specified to PortNumber and hostAddress.
• Review the system such as the settings of CPU module or the module and the cable.
• End other running applications, and then restart the application which is created by
using MX Component for Android.
• Restart the device such as a tablet.
0x01808101 Duplex close error • End other running applications, and then restart the application which is created by
using MX Component for Android.
• Restart the device such as a tablet.
0x01808201 Send error
Data send failed.
• Review the system such as the settings of CPU module or the module and the cable.
• Check the communication status between the device such as a tablet and the wireless
LAN router.
• Retry the method.
• End other running applications, and then restart the application which is created by
using MX Component for Android.
• Restart the device such as a tablet.
0x01808301 Receive error
Data receive failed.
• Review the system such as the settings of CPU module or the module and the cable.
• Review the time-out value.
• Check the communication status between the device such as a tablet and the wireless
LAN router.
• Retry the method.
• End other running applications, and then restart the application which is created by
using MX Component for Android.
• Restart the device such as a tablet.
0x01808404 Open not yet executed • Execute open method.
• End other running applications, and then restart the application which is created by
using MX Component for Android.
• Restart the device such as a tablet.
Error code Error description Corrective action
566 TROUBLESHOOTING6.2 Error Code List
0x0180840B Time-out error
Though the time-out period had elapsed,
data could not be received.
• Review the system such as the settings of CPU module or the module and the cable.
• Review the time-out value
• Check the communication status between the device such as a tablet and the wireless
LAN router.
• Retry the method.
• Perform close once and execute open method again.
• End other running applications, and then restart the application which is created by
using MX Component for Android.
• Restart the device such as a tablet.
• Disable battery saving functions of Wi-Fi setting (depending on the device which is to
be used, the display differs such as "Wi-Fi Advanced" "Wi-Fi optimization" or "Wi-Fi
Advanced" "Wi-Fi timer").
• Disable auto connect/disconnect functions for Wi-Fi network (depending on the device
which is to be used, the display differs such as "Wi-Fi Advanced" "Wi-Fi optimization"
or "Wi-Fi Advanced" "Wi-Fi timer").
• Close auto disconnect applications for Wi-Fi communication.
0x01902001 Extended device mixed error
Both extended devices and devices are
specified.
• When using an extended device, specify only the extended device.
0x01902801 Label data incorrect error
The specified label data to the arguments are
incorrect.
• Check the number of label data of the arguments.
0x01902802 Label name length error
Label name length or total number of label
name length exceeds the applicable length.
• Specify the label name or the total number of label names within the applicable length.
0x01902803 Label data size error
The data size of the label exceeds the
applicable size.
• Specify the data size of the label within the applicable range.
0x01902804 Label name length and label data size error
The total size of label name length and label
data exceeds the applicable size.
• Specify the total size of label name length and label data within the applicable size.
0x01902805 Label data incorrect error
The type of the specified label is unknown.
• Specify the data type supported by the label.
0x01903801 Data type mismatch error
The label data type of the specified label and
the data type set to the CPU are
mismatched.
• Set the correct label data type (the type matched with the CPU module) and perform
the API again.
0x01904001 Remote password length error
The length of the remote password is not 4
bytes, or exceeds 32 bytes.
• QCPU, LCPU:
Set the length of the remote password to 4 bytes.
• RCPU, FX5CPU:
Set the length of the remote password to 6 to 32 bytes.
0x01904002 Port number error
The port number is wrong.
• Specify the correct port number.
0x01905001 The send error of the remote password lock
occurred in close at the setting of the remote
password.
• Close has been completed. Execute open method when reopen is required.
0x0190FFFF Exception occurrence error in the operating
environment
An exception error occurred in the operating
device.
• End other running applications, and then restart the application which is created by
using MX Component for Android.
• Restart the device such as a tablet.
• Reinstall MX Component library.
• If the error occurs even after the actions mentioned above are taken, please consult
your local Mitsubishi representative.
0xF0000001 No-license error • MX Component for Android is used without license. Install the license of MX
Component for Android duly.
0xF0000003 Already open error
Open method was executed while it was
open.
• Perform close once and execute open method again.
0xF0000004 Not yet open error
The open method is not yet executed.
• After executing the open method, execute the corresponding method.
0xF1000005 Size error
The size specified to the read/write method is
abnormal. The read/write first number + size
exceeds the device or buffer area.
• Check the size specified in the method.
0xFE003001 Label name length error
Label name length or total number of label
name length exceeds the applicable length.
• Specify the label name or the total number of label names within the applicable length.
Error code Error description Corrective action
6 TROUBLESHOOTING6.2 Error Code List 57
6
0xFE003002 Label data size error
The data size of the label exceeds the
applicable size.
• Specify the data size of the label data within the applicable range.
0xFE003003 Label name length and label data size error
The total size of label name length and label
data exceeds the applicable size.
• Specify the total size of label name length and label data within the applicable size.
0xFE003004 Label data type error
The data type of the label is unsupported.
• Change the data type of the label to the supported data type.
• If the error occurs even after the actions mentioned above is taken, please consult your
local Mitsubishi representative.
0xFE004001 'null' is specified.
'null' is specified to the argument.
• Specify the correct value to the argument.
Error code Error description Corrective action
58
METHOD INDEX
C
close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
G
getDataType. . . . . . . . . . . . . . . . . . . . . . . . . . . 37getName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37getValues. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
M
MELMxComminication. . . . . . . . . . . . . . . . . . . . 25MELMxLabel . . . . . . . . . . . . . . . . . . . . . . . . . . 36
O
open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
R
readArrayLabel . . . . . . . . . . . . . . . . . . . . . . . . . 31readDeviceBlock. . . . . . . . . . . . . . . . . . . . . . . . 27readDeviceRandom . . . . . . . . . . . . . . . . . . . . . 29readLabelRandom . . . . . . . . . . . . . . . . . . . . . . 32
S
setAsciiStringLabel . . . . . . . . . . . . . . . . . . . . . . 40setBitLabel . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38setDoubleWordLabel . . . . . . . . . . . . . . . . . . . . . 39setFloatDoubleLabel . . . . . . . . . . . . . . . . . . . . . 40setFloatSingleLabel. . . . . . . . . . . . . . . . . . . . . . 39setTimeLabel . . . . . . . . . . . . . . . . . . . . . . . . . . 41setUnicodeStringLabel. . . . . . . . . . . . . . . . . . . . 40setUnsignedDoubleWordLabel . . . . . . . . . . . . . . 39setUnsignedWordLabel . . . . . . . . . . . . . . . . . . . 38setWordLabel . . . . . . . . . . . . . . . . . . . . . . . . . . 38
W
writeArrayLabel. . . . . . . . . . . . . . . . . . . . . . . . . 31writeDeviceBlock . . . . . . . . . . . . . . . . . . . . . . . 28writeDeviceRandom . . . . . . . . . . . . . . . . . . . . . 30writeLabelRandom . . . . . . . . . . . . . . . . . . . . . . 32
I
59
MEMO
60
REVISIONS*The manual number is given on the bottom left of the back cover.
Japanese manual number: SH-081496-A
2015 MITSUBISHI ELECTRIC CORPORATION
Revision date *Manual number Description
February. 2015 SH(NA)-081498ENG-A First edition
This manual confers no industrial property rights of any other kind, nor does it confer any patent licenses. Mitsubishi Electric Corporation cannot be held
responsible for any problems involving industrial property rights which may occur as a result of using the contents noted in this manual.
61
WARRANTYPlease confirm the following product warranty details before using this product.
1. Gratis Warranty Term and Gratis Warranty RangeIf any faults or defects (hereinafter "Failure") found to be the responsibility of Mitsubishi occurs during use of the product within the gratis warranty term, the product shall be repaired at no cost via the sales representative or Mitsubishi Service Company.However, if repairs are required onsite at domestic or overseas location, expenses to send an engineer will be solely at the customer's discretion. Mitsubishi shall not be held responsible for any re-commissioning, maintenance, or testing on-site that involves replacement of the failed module.[Gratis Warranty Term]The gratis warranty term of the product shall be for one year after the date of purchase or delivery to a designated place.Note that after manufacture and shipment from Mitsubishi, the maximum distribution period shall be six (6) months, and the longest gratis warranty term after manufacturing shall be eighteen (18) months. The gratis warranty term of repair parts shall not exceed the gratis warranty term before repairs.[Gratis Warranty Range](1) The range shall be limited to normal use within the usage state, usage methods and usage environment, etc., which
follow the conditions and precautions, etc., given in the instruction manual, user's manual and caution labels on the product.
(2) Even within the gratis warranty term, repairs shall be charged for in the following cases.1. Failure occurring from inappropriate storage or handling, carelessness or negligence by the user. Failure caused
by the user's hardware or software design.2. Failure caused by unapproved modifications, etc., to the product by the user.3. When the Mitsubishi product is assembled into a user's device, Failure that could have been avoided if functions
or structures, judged as necessary in the legal safety measures the user's device is subject to or as necessary by industry standards, had been provided.
4. Failure that could have been avoided if consumable parts (battery, backlight, fuse, etc.) designated in the instruction manual had been correctly serviced or replaced.
5. Failure caused by external irresistible forces such as fires or abnormal voltages, and Failure caused by force majeure such as earthquakes, lightning, wind and water damage.
6. Failure caused by reasons unpredictable by scientific technology standards at time of shipment from Mitsubishi.7. Any other failure found not to be the responsibility of Mitsubishi or that admitted not to be so by the user.
2. Onerous repair term after discontinuation of production(1) Mitsubishi shall accept onerous product repairs for seven (7) years after production of the product is discontinued.
Discontinuation of production shall be notified with Mitsubishi Technical Bulletins, etc.(2) Product supply (including repair parts) is not available after production is discontinued.
3. Overseas serviceOverseas, repairs shall be accepted by Mitsubishi's local overseas FA Center. Note that the repair conditions at each FA Center may differ.
4. Exclusion of loss in opportunity and secondary loss from warranty liabilityRegardless of the gratis warranty term, Mitsubishi shall not be liable for compensation of damages caused by any cause found not to be the responsibility of Mitsubishi, loss in opportunity, lost profits incurred to the user by Failures of Mitsubishi products, special damages and secondary damages whether foreseeable or not, compensation for accidents, and compensation for damages to products other than Mitsubishi products, replacement by the user, maintenance of on-site equipment, start-up test run and other tasks.
5. Changes in product specificationsThe specifications given in the catalogs, manuals or technical documents are subject to change without prior notice.
62
TRADEMARKSMicrosoft, Windows, Windows Vista, Windows NT, Windows XP, Windows Server, Visio, Excel, PowerPoint, Visual Basic,
Visual C++, and Access are either registered trademarks or trademarks of Microsoft Corporation in the United States, Japan,
and other countries.
Intel, Pentium, and Celeron are either registered trademarks or trademarks of Intel Corporation in the United States and other
countries.
Ethernet is a trademark of Xerox Corp.
Android is a trademark or a registered trademark of Google Inc.
ARM is a registered trademark or a trademark of ARM Ltd. in the United States and other countries.
Eclipse is a registered trademark or a trademark of Eclipse Foundation, Inc. in the United States and other countries.
Java is a registered trademark of Oracle Corporation and its affiliated companies.
All other company names and product names used in this manual are either trademarks or registered trademarks of their
respective companies.
SH(NA)-081498ENG-A(1502)
MODEL:MXC-AND1-R-E
Specifications subject to change without notice.
When exported from Japan, this manual does not require application to theMinistry of Economy, Trade and Industry for service transaction permission.
HEAD OFFICE : TOKYO BUILDING, 2-7-3 MARUNOUCHI, CHIYODA-KU, TOKYO 100-8310, JAPANNAGOYA WORKS : 1-14 , YADA-MINAMI 5-CHOME , HIGASHI-KU, NAGOYA , JAPAN