Professional Documents
Culture Documents
Mitsubishi PLC and Barcode Scanner Sample
Mitsubishi PLC and Barcode Scanner Sample
iQ Monozukuri POKAYOKE
To utilize these samples introduced in this technical bulletin for an actual system, sufficiently
CAUTION confirm that the samples will not cause system control problems on user's own responsibility.
Contents
4. TROUBLESHOOTING
4.1 Troubleshooting related to the barcode reader................................................................................ 4 - 1
4.2 Troubleshooting related to the sub GOT ......................................................................................... 4 - 1
A-1
1. Barcode Reading Function
This is a sample program that adds functionality to the POKAYOKE system to perform barcode reading using the bar-
code reader.
In this sample program, "external interface" and "devices disclosed to users" of the POKAYOKE application are used.
POINT
For details of the external interface and devices disclosed to users, refer to the following.
iQ Monozukuri POKAYOKE Technical Bulletin (BCN-E2113-0008)
External Interface/Devices Disclosed to Users Information
1.1 Description
This function allows a user to enter codes using the barcode reader connected to the POKAYOKE system to read codes
that have been registered in the POKAYOKE system.
POINT
For the corresponding codes, refer to the following.
iQ Monozukuri POKAYOKE Technical Bulletin (BCN-E2113-0008)
External Interface/Devices Disclosed to Users Information
2. Select [POU] → [Program] → [PRG_BCIN] in the Navigation window, and then select [Copy] from the right-click
menu.
1-1
3. Open "AP10-PKY002AA-L06_*.****.gxw"*1 in GX Works2.
*1 "*" indicates the version.
4. Select [POU] → [Program] in the Navigation window, and then select [Paste] from the right-click menu to copy
[PRG_BCIN] to that location.
5. Select [Register Program] → [Scan] from the right-click menu of [PRG_BCIN] which has been copied.
1-2
6. In [Program Setting] → [Scan Program], a task and a program file where [PRG_BCIN] has been registered are
created.
POINT
• Select [Parameter] and double-click [PLC Parameter] in the Navigation window to set the execution order of the
programs in the "Program Settings" tab in the L Parameter Setting window.
• Modify the sample program or change the project settings when loading user-specific codes or using a program
other than the default.
1-3
1.3 Program specification
The flowchart of the sample program is as follows.
Barcode scan
(1)Store the values read with all barcode readers on the device.
(2)Store the value read with the barcode reader to be processed on the device.
(6)Determination of an area
(11)End processing
1-4
(1) Store the values read with all barcode readers on the device.
Store the values read with all barcode readers on the device as follows depending on the barcode reader
connection destination.
Number of Order of prece-
Barcode reader connection destination Storage destination device
devices dence
Main GOT ZR120000 to ZR120129 130 1
(2) Store the value read with the barcode reader to be processed on the device.
Select a barcode reader to be processed and store the values read by the barcode reader on the devices
(ZR121690 to ZR121819) according to the order of precedence listed above.
(3) Storage of the barcode reader and area number to be processed
Store the barcode reader connection destination number to be processed on the device (D9071), and store the
area number on the device (D9070), as follows.
Barcode reader connection destination
Barcode reader connection destination Area No.
No.
1-5
(5) Switch between main GOT and sub GOT
Change the values of the "main GOT signal" (M5124) and "sub GOT signal" (M5125) of the devices disclosed to
users with the barcode reader to be processed.
For details of the signals, refer to the following.
Barcode reader to be processed Main GOT signal Sub GOT signal
Main GOT
1 6
2 7
3 8
4 9
5 10
1-6
If the extracted valid code is a barcode of "area", change the value of the designated area device corresponding
to the barcode reader to be processed to the new area number.
For details of "designated area devices", refer to the following.
Barcode reader to be processed Designated area device
If the extracted valid code is a barcode of "parts supply mode" or "parts return mode", change the value of the
"parts return mode signal device" corresponding to the barcode reader to be processed.
For the details, refer to the following.
Barcode reader to be processed Parts return mode signal device
1-7
(8) Processing of the sub GOT check screen
If the barcode reader to be processed is connected to the sub GOT, store the extracted valid code on the device
indicated below to display it on the check screen of the sub GOT.
Barcode reader to be processed Storage destination device Number of devices
Sub GOT (Area No. 1) D9130 to D9139 10
For details of the sub GOT check screen, refer to the following.
3.7Check screen
(9) Storage on the devices disclosed to users
Store the connection destination number of the extracted valid code, area number, and barcode reader to be
processed on the devices disclosed to users.
For the details, refer to the following.
Data to be stored Destination device disclosed to users
If the extracted valid code is a barcode of "parts supply mode" or "parts return mode", change the value on the
device disclosed to users.For the details, refer to the following.
Barcode Value to be stored Destination device disclosed to users
POINT
If the check operation is valid on the main GOT, the area number cannot be changed by barcode.
1-8
2. Plan Operation Function
This function starts operation of the POKAYOKE system according to the pre-registered plan and manages the produc-
tion quantity.
It consists of sample program and sample screen of the main GOT.
In this sample program, "external interface" of the POKAYOKE application is used.
POINT
For details of the external interface and devices disclosed to users, refer to the following.
iQ Monozukuri POKAYOKE Technical Bulletin (BCN-E2113-0008)
External Interface/Devices Disclosed to Users Information
2.1 Description
This function allows users to manage the progress of each plan by noting "Sets" registered on the sample "Register
Plan" screen and "Total" which was actually produced.
(The progress of the plan can be checked on the sample "Plan Progress" screen.)
Enter "Plan No." from the sample "Process Display" screen to begin plan operations, and then the plan operation starts.
(Plan operations end when the area in which a plan is running enters the Standby state.)
POINT
Incorporating the sample function ( 1. Barcode Reading Function) into the POKAYOKE system enables the
following operations with the barcode reader.
• By reading the production plan code on the sample "Process Display" screen, the operation of the
corresponding plan can be started.
• By reading the part code on the sample "Process Display" screen, the corresponding part can be supplied.
• By reading the production plan code on the sample "Register Plan" window, the production plan code can be
entered.
To register a production plan code by using the barcode reader and start operation by using the production plan
code, the "sample barcode program" other than "sample production plan program" is required.
For the details, refer to the following.
1.2 How to install the program
2-1
2.2 How to install programs and screens
The following describes how to install the sample plan program and screen.
2. Select [POU] → [Program] → [PRG_PLAN] in the Navigation window, and then select [Copy] from the right-click
menu.
4. Select [POU] → [Program] in the Navigation window, and then select [Paste] from the right-click menu to copy
[PRG_PLAN] to that location.
2-2
5. Select [Register Program] → [Scan] from the right-click menu of [PRG_PLAN] which has been copied.
6. In [Program Setting] → [Scan Program], task and program file which [PRG_PLAN] has been registered is created.
2-3
POINT
• Select [Parameter] and double-click [PLC Parameter] in the Navigation window to set the execution order of the
programs in the "Program Settings" tab in the L Parameter Setting window.
• Modify the sample program or change the project settings when loading user-specific codes or using a program
other than the default.
• To register a production plan code by using the barcode reader and start operation by using the production plan
code, set "sample barcode program" [PRG_BCIN] before execution of the "sample production plan program"
[PRG_PLAN].
2-4
3. Click the Browse button in the "Utilize Project" window, and then select AP10-PKY002AA-
GT27S_Main_SA_*.****.GTX*2.
4. Select the following items from the "Source Project" tree and click the [Execute] button.
Level 1 Level 2 Level 3
POINT
• For the B10001 screen, overwrite the existing screen. If the B-10001 screen and comment No. 500 were
previously modified, the modification will be cleared. In that case, copy the Plan switch (object ID: 10006)
manually from AP10-PKY002AA-GT27S_Main_SA_*.****.GTX*2, without utilizing the B10001 screen in "Utilize
Project".
• Since the contents of comments number 500-1 to 500-51 in AP10-PKY002AA-GT27S_Main_SA_*.****.GTX*2
needs to be used without change, overwrite the contents using "Utilize Project" or manual copying.
2-5
5. Select [Environmental Setting] and double-click [Screen Switching/Window Setting] to open the Environmental
Setting window.
• Enter D9074 in the input window and click the [OK] button.
• Click the [...] button in the "Detail Setting" column, configure the same settings as the screen below, and then
click the [OK] button.
2-6
• Select the check boxes for 5 and "Display Position" and then click the [...] button in the "Screen Switching Device"
column.
• Enter D9077 in the input window and click the [OK] button.
• Click the [...] button in the "Detail Setting" column, configure the same settings as the screen below, and then
click the [OK] button.
2-7
2.3 Plan operation start procedure
To start plan operations, the following conditions must be satisfied by each start method.
Start method
No. Operation condition External Production Automatic
Run switch
Input plan code feed
6 The item for the plan number is same as the item in the area being displayed. ○ ○ ○ ○
The shelf configured to be shared with the pickup side in the area that starts the
8 ○ ○ ○ ○
operation is not currently supplying parts.
The system is in the manager mode, or a user is logged in to the area that starts the
10 ○ ○ ○ ○
operation.
12 The area number of the shelf to be used for the start item matches the start area. ○ ○ ○ ○
If shelf number 2000s is invalid as the shelf number of the start item, it must be within
13 the range 1001 to 1128. If shelf number 2000s is valid as the shelf number of the start ○ ○ ○ ○
item, it must be within the range of 1001 to 1128 and 2001 to 2128.
14 Both the pickups and pickup count of the start item are registered as 0 or more. ○ ○ ○ ○
There is no shelf where the pickup terminal type is unspecified in the process
15 ○ ○ ○ ○
registration for the start item.
17 The same shelf was not set at once in the process registration for the start item. ○ ○ ○ ○
1.Manually change the plan number on the sample "Process Display" screen.
2.The process information for the item number area that was set in the plan number on the sample "Process
Display" screen is displayed.
3.Touch the Run switch on the screen, or set the External Input to ON to start plan operations.
(2) Using the production plan code
1.Use the barcode reader on the sample "Process Display" screen to read the code that was registered as the
production plan code.
2.The value of the plan number on the sample "Process Display" screen will switch to the plan number
corresponding to the scanned production plan code.
3.The process information for the item number area that was set in the plan number on the sample "Process
Display" screen is displayed.
4.The processing of the program will automatically start the plan operations.
2-8
2.4 Process Display screen (B-10002)
This section describes the sample "Process Display" screen for displaying the process information of the plan.
(1)
(2)
(3) (4)
(5)
(6)
2-9
(5) Process Info
The description is the same as that of the "Process Display (Simple Display)" screen including this application.
( iQ Monozukuri POKAYOKE Operating Manual)
(6) Run, Suspend, and End switches
The description is the same as that of the "Process Display (Simple Display)" screen including this application.
( iQ Monozukuri POKAYOKE Operating Manual)
(1)
(3)
(2)
(4)
2 - 10
(4) Back switch
Touch this switch to go back to the sample "Process Display" screen.( 2.4 Process Display screen (B-
10002))
(1)
(5)
(2)
(3) (4)
2 - 11
(3) Setting data copy (From USB) switch
Plan data is copied from the USB memory inserted to the USB port of the GOT to the CPU module.
When a USB memory has been inserted to the GOT, holding down this switch for two seconds checks the
following.
• Check if the folder "\AP10-PKY002AA-QRT\plan" exists in the root directory of the USB memory.
• Check if the plan registration data "plan2_0001.CSV" exists in the folder "\AP10-PKY002AA-QRT\plan".
When the above folder and data exist, the plan data is read.
(4) Process Shift Mode switches
Select a process shift mode.
For details of each mode, refer to the following.
2.4 Process Display screen (B-10002)
(5) Page selection switches
With these switches, the displayed Register Plan page can be switched.
Plans are displayed from page 1 to 2, and 10 rows are displayed per page.
(1)
(2) (4)
(3)
2 - 12
Register Plan window (W-10001)
Register the plan indicated by the selected plan number.
(1)
(2)
(3)
(4)
(5)
(6)
2 - 13
3. Sub GOT Screen
GT Designer 3 project files are provided as samples for the sub GOT screen.
The sample screens in the project files are as follows.
• Main screen
• Process Display screen
• Check screen
• Login window
• Language Setting window screen
• Confirmation window
• Warning window
3.1 Description
The sub GOT implements different functions from the main GOT.
The following table lists the differences from the main GOT.
Function Details Main GOT Sub GOT
Area login ○ ○
Manager login ○ ×
Suspend operation ○ ○
Run
End operation ○ ○
Warning window ○ △
*3
Reset alarm ○ ×
3-1
3.2 How to install
In the sample project file, one screen project is prepared for each GOT.
The default screen project settings are configured for operations in Area No. 1.
Change the screen data settings and script values provided in the sample to use them for Areas 2 to 10.
For how to change the script values, refer to the following.
3.3How to change the script
The following table lists sample project files and the corresponding models.
AP10-PKY002AA-GT2104RTBD_Sub_SA_*.****.GTX GT2104-RTBD*2
AP10-PKY002AA-GT2104PMBD_Sub_SA_*.****.GTX GT2104-PMBD*3
AP10-PKY002AA-GT2103PMBD_Sub_SA_*.****.GTX*4 GT2103-PMBD*3
2. Open [Common] → [Script] → [Script] on the menu bar at the top of the screen.
3-2
3. In the window that appears, select "Script No.4, startup process".
Then, click [Edit] on the right side of the window.
5. In the line "[w:TMP0] = 1;" in the script, the "1" represents Area No. 1.
Change the value here to the numeric value of the area to be operated (in the range 1 to 10).
Then, click the [OK] button to close the window.
6. Click the [OK] button to close the remaining two windows. The area number has been changed.
3-3
3.4 Changing the controller settings
To increase the number of connected devices while using the same screen project, configure the connected programma-
ble controllers and the station numbers, IP addresses and port numbers of all the GOTs so that they do not overlap.
These values can be changed from "Controller Setting" in GT Designer3.
The following describes the procedure for changing the values.
2. From the docking window on the left side of the screen, select [System] → [Controller Setting] and click [CH1:
MELSEC-L].
3. When the controller settings appear, change the values of GOT Station, GOT Standard Ethernet Setting, and GOT
Communication Port No.
GOT Station and the GOT Communication Port No. can be changed by entering the value directly.
GOT Standard Ethernet Setting can be changed from the "GOT Standard Ethernet Setting" window, which can be
opened by clicking the [GOT Standard Ethernet Setting] button.
3-4
4. Click the [OK] button on the controller setting window to complete the settings.
POINT
The example of controller settings are shown below.
Item
Device
Net No. Station Number IP Address Port No.
3-5
3.5 Main screen
On the "Main" screen of the sub GOT, users can log in/off to/from the POKAYOKE system, switch the screen to the sub
GOT "Process Display" screen, and call a manager.
This section describes the "Main" screen of the sub GOT.
(2)
(2)
(5)
(1) (5) (1)
(3)
(3)
(4) (6)
(1) (5)
(6)
(3)
(7)
(4)
(8)
GT2104-PMBD (3)
3-6
(8) Time display
The date and time set in the main GOT are displayed.
POINT
While this window is displayed, reading a registered barcode allows a user to log in to the system in the operator
mode as the corresponding user.
GT2104-PMBD
For details of the "Area Login" window, refer to the following manual.
iQ Monozukuri POKAYOKE Operating Manual
For details of the "Language Setting" window, refer to the following manual.
iQ Monozukuri POKAYOKE Operating Manual
3-7
3.6 Process Display screen
The "Process Display" screen of the sub GOT displays information required for picking operations (the number of a shelf
which stores parts to be picked up next or the number of picked pieces), and allows picking operations to be started, sus-
pended, and stopped.
The screen configurations of the different models are shown below.
1-screen configuration
(1) (1)
(4)
GT2103-PMBD
(4)
(1)
(5)
GS2110-WTBD, GS2107-WTBD
2-screen configuration
(1) (1)
(4)
(4)
(7) (7)
(5) (5)
GT2104-RTBD
(2) (6)
(3)
(7)
(4) (7) (4)
GT2104-PMBD
3-8
(4) Item- and shelf-related information
• Item Name:
The name of the item specified with Item No. is displayed.
• Target Time:
The target time (Minute: Second) for creating the item specified with Item No. is displayed.
• Production Time:
The production time (Minute: Second) for the item specified with Item No. is displayed.
When production of 1 product ends, it resets to "00:00".
If the production time is 100 minutes or more, "99:59" is displayed.
• Products:
The items specified as "Number of products that have been produced/Number of products (set value)" is
displayed.
The value is reset when the Item No. is changed in the standby state or an operation is started.
• Shelf No.:
The shelf number of the target part is displayed.
• Pickup Count:
The number of picked pieces as "Number of parts that have been picked up/Number of pieces (set value)" is
displayed.
• Stocks:
The stock quantity in the shelf which stores the parts to be picked up as a numerical value is displayed.
(5) Run, Suspend, and End switches
• Run:
When the switch is touched, the switch is turned on and an operation starts.
• Suspend:
When the switch is touched, the switch is turned on and an operation suspends.
At this time, the [Run] switch is off. While an operation is being suspended, touching the [Run] switch restarts
the suspended operation.
• End:
When the switch is touched, the "operation stop confirmation" window appears.
Select [Yes] to end the operation.
At this time, the [End] switch turns on, and the [Run] switch or the [Suspend] switch turns off from on.
(6) Call switch
Touch this switch to call a manager in the event of a sudden shortage of parts or a terminal lamp error.
If the switch is touched while it is off, the buzzer is turned on. If the switch is touched while it is on, the buzzer is
turned off.
(7) Screen display switch
If the "Process Display" screen of the sub GOT is in a 2-screen configuration, this switch switches the display
screens.
3-9
3.7 Check screen
This section describes the sample screen that displays the values to be stored when using the barcode interface.
(1) (1)
(2) (3)
(2)
(3)
GT2104-RTBD
GT2712-STBA, GT2712-STBD, GT2712-STWA,
(1) GT2712-STWD, GT2710-STBA, GT2710-STBD,
GT2708-STBA, GT2708-STBD
(2) (3)
GS2110-WTBD, GS2107-WTBD
The following models do not support connection of a barcode reader, and therefore the
corresponding sample project has no "Check" screen.
CAUTION • GT2103-PMBD
• GT2104-PMBD
3 - 10
4. TROUBLESHOOTING
The following shows the troubleshooting regarding this technical bulletin.
4-1
REVISIONS
Revision date Issue No. Revision
Before using any product mentioned in this technical bulletin, please read the product
Safety Precaution manual to use it correctly.