Brother PT-P900 Reference Manual
Brother PT-P900 Reference Manual

Brother PT-P900 Reference Manual

Melsec iq-f sample program
Hide thumbs Also See for PT-P900:

Advertisement

Quick Links

MELSEC iQ-F
Brother
Label Printer Sample Program
Reference Manual
Version 1.00

Advertisement

Table of Contents
loading

Summary of Contents for Brother PT-P900

  • Page 1 MELSEC iQ-F Brother Label Printer Sample Program Reference Manual Version 1.00...
  • Page 2 The Brother logo is a registered trademark of Brother Industries, Ltd. Brother is a registered trademark of Brother Industries, Ltd. © 2023 Brother Industries, Ltd. All rights reserved. Other software and product names mentioned herein may be the trademarks or registered trademarks of...
  • Page 3 PT-P900W PT-P950NW TD-4210D TD-4410D TD-4420DN TD-4510D TD-4520DN TD-4550DNWB TD-2020 TD-2120N TD-2130N TD-2130NSA Ethernet connection supported printers PT-P950NW TD-4420DN TD-4520DN TD-4550DNWB TD-2120N TD-2130N TD-2130NSA Available printers are depending on region or countries. MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 4: Table Of Contents

    7.2.1. Use program .................. 35 7.2.2. Label variable definition ..............35 7.2.3. Program detail ................37 [Appendix A] Outline of communication protocol to control label printer ···· 42 [Appendix B] Related Manual ································································ 45 MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 5 Revision history Reference manual revision history Version Revised day Revised content V1.00 2023/2/1 New creation Sample program revision history Version Revised day Revised content V1.00 2023/2/1 New creation MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 6: Introduction

    4.2. For serial connection 5. Setting at programmable controller side 5.1. For serial connection 6. Sequence program outline 6.1. Function outline 6.2. Program outline 7. Sequence program explanation 7.1. For serial connection MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 7: For System Structure With Ethernet Connection

    4.3. For Ethernet connection 5. Setting at programmable controller side 5.2. For Ethernet connection 6. Sequence program outline 6.1. Function outline 6.2. Program outline 7. Sequence program explanation 7.2. For Ethernet connection MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 8: Outline

    The label printer prints out the label according to the settings (for example: numbering and date setting). * Initial settings of the template information, bar code information, and any numbering are performed with connection to PC beforehand. MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 9: Label Printer Structure

    2.2. Label printer structure 2.2.1. For serial connection Label printer  The sample program for serial connection is applied to the following Brother label printers. Brother label printers PT-P900 PT-P900W PT-P950NW TD-4210D TD-4410D TD-4420DN TD-4510D TD-4520DN TD-4550DNWB TD-2020 TD-2120N TD-2130N...
  • Page 10: For Ethernet Connection

    2.2.2. For Ethernet connection Label printer  The sample program for Ethernet connection is applied to the following Brother label printers. Brother label printers PT-P950NW TD-4420DN TD-4520DN TD-4550DNWB TD-2120N TD-2130N TD-2130NSA * Any printers other than above list, which has P-touch Template command mode and interface of serial or Ethernet, have possibility to connect with the programmable controller.
  • Page 11: System Structure

    IP address: 192.168.1.2 IP address: 192.168.1.1 Programmable controller module and development tool  Module type Model Programmable controller module CPU module FX5U-32MR/ES * This program is created by GX Works3 Version 1.070Y. MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 12: Preparing Templates

    * For the above label printers, connection operation check with the Mitsubishi programmable controller has already finished, but other models supporting the P-touch Template command are possible to be connected. For more detail, refer to the following URL. (https://support.brother.com/g/s/es/dev/en/command/reference/index.html?c=eu_ot&lang=en&navi=offall &comple=on&redirect=on) MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 13: Use Software

    Printer setting tool Software to set template print condition You can download the latest version of software from Brother support website. Also, you can check the latest information of the supported OS and firmware version of each software in the Brother support website.
  • Page 14: Template Creation

    PT-P900W PT-P950NW TD-2020 auto_TD-2130N.lbx TD-2120N TD-2130N TD-2130NSA TD-4210D auto_TD-4D.lbx TD-4410D TD-4420DN TD-4510D TD-4520DN TD-4550DNWB * For the next page and thereafter, change above file name to "auto.lbx" to read the explanation. MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 15: P-Touch Editor Operation

    3) Insert the logo image. Designate image file by [Insert] - [Picture] - [From File..]. 4) Insert the straight line. Click [ ] in the tool bar and draw the straight line. MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 16 Object name list obj0005 obj0007 obj0001 obj0002 obj0003 obj0006 obj0004 * For more details on how to use P-touch Editor, refer to [Help] or "Software user's guide" of each label printer. MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 17: Template Transfer

    1) Open auto.lbx which is used in the previous chapter in P-touch Editor. 2) Click [File] - [Transfer Template] - [Transfer] of P-touch Editor. P-touch Transfer Manager in the next page will start its operation. MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 18: P-Touch Transfer Manager Operation

    Click the [Save Transfer File] button with the data selected. * For more details on how to use P-touch Transfer manager, refer to [Help] or "Software user's guide" of each label printer. MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 19: Label Printer Unit Setting

    4. Label printer unit setting 4.1. Printer setting tool Start the P-touch template setting. Windows10: Click [Start] - [Brother] - [Printer Setting Tool]. For Ethernet connection Click "P-touch Template Settings" in "Printer Setting Tool". Set each item. This program is activated on the following screen.
  • Page 20 * Example of the screen 1: Setting screen except TD-2130N (or TD-2020, 2120N: Windows10) MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 21 * According to the label printer model, the window is different. For more details on how to use the P-touch Template setting, refer to "P-touch Template manual" of each label printer. MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 22: For Serial Connection

    Click "Communication Settings" button at 4.1 "P-touch Template Settings", Communication Settings window is displayed. In this sample setting, the following screen is displayed. (if you want to change setting, change setting at programmable controller side as well.) MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 23: For Ethernet Connection

    Click "Communication Settings" of the "General" tab and set "Network Settings on Power On" to "Wired LAN by Default" as the following. (screen is example of TD-4550DNWB) TD-4420DN, TD-4520DN, TD-2120N and TD-2130N/NSA are fixed in Wired LAN. MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 24 Click the "Apply" button after changing to reflect the setting value by rebooting the label printer. (If you want to change the setting, change the setting at programmable controller side as well.) MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 25: Setting At Programmable Controller Side (Melsec Iq-F Series)

    The setting remains as default condition. Registration of module labels for serial communication module  Select [Element Selection] → [Module] → [Module Label] → [FX5UCPU], and right-click [Add Module Label]. Set as shown above. MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 26 Parameter setting of FX expansion adapter (CH3) or FX expansion board (CH2)  The setting shall be the same as Communication Settings at label printer side. Parameters beside the above screen are the same as the default value. MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 27: For Ethernet Connection

    Network module (port 1) parameter setting (own node)  Parameters beside the above screen are the same as the default value. Network module (port 1) parameter setting (target node)  Set it to be connection No.1. MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 28: Sequence Program Outline

    6. Sequence program outline 6.1. Function outline This chapter explains the use example of the print operation using Brother label printer based on the information from the Mitsubishi programmable controller (MELSEC). 6.2. Program outline This program can transmit the following P-touch Template commands to the label printer just one time communication.
  • Page 29 Relation between templates and filling data Page 1 Page 2 Page 3 TD-4410D TD-4420D TD-4430D Create 'DD/MM/YYYY' string using the calendar inside the programmable controller. A2000 A3000 A4000 U12345-L10000 U12345-L10001 U12345-L10002 MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 30: Sequence Program Explanation

    For serial communication module M+FX5UCPU-SerialComm_Output * Project file target programmable controllers are set by the MELSEC iQ-F series. 7.1.2. Label variable definition Global labels used in this program are shown in the following. MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 31 String for months sDayStr STRING String for days sTempStr STRING String for concatenation * Data type POINTER Pointer WORD Word [without code]/bit stream [16 bit] Word [with code] BOOL STRING String MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 32: Program Detail

    Set a string to print out in each page. Print page wPrintCount sModelStr sLotNumStr number Page 1 TD-4410D A2000 Page 2 TD-4420D A3000 Page 3 TD-4430D A4000 bSetDataFlg turns ON just one time by printing 1 page. MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 33 Row number 17: Copies transmitted data prepared at Sub-routine SetTransData to the transmission data array "wSendData". Row number 20: Calls Sub-routine SendData when it is wPrintCount < 3. MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 34 */ sPrintStartStr:='^FF'; /* start printing */ sTempStr:=CONCAT(sInitStr,sObj1Str,sObj2Str,sObj3Str,sObj4Str,sPrintStartStr);/* concatenate strings */ wTransDataSize:=len(sTempStr)+4; /* transmission data length */ SET(TRUE,bSendRequest); /* set transmission request */ RST(TRUE,bSetDataFlg); /* reset transmission data set flag */ MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 35 The data is transmitted with the number of bytes which is shown in the transmit data length wTransDataSize stored in wSendData [ ] or later. For the operation of M+FX5UCPU-SerialComm_Output, refer to "MELSEC iQ-F FX5 CPU Module Function Block Reference" for the Mitsubishi Electric programmable controller. MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 36 Row number 39/40: wPrintCount (print timing counter) is 3 or larger, 0 is stored in wPrintCount (print timing counter) and bSetDataFlg (transmission data set) is reset. MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 37: For Ethernet Connection

    BOOL Socket close success bClose_NG BOOL Socket close failure bSendRequest BOOL Transmission request flag bSetDataFlg BOOL Transmission data set sInitStr STRING Initial setting command string sObj1Str STRING String for object 1 MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 38 Open command control data wSendCtrl[2] Send command control data wCloseCtrl[2] Close command control data * Data type WORD Word [without code]/bit stream [16 bit] Word [with code] BOOL STRING String MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 39: Program Detail

    The following is the explanation of the program by function block. 7.2.3.1. Socket communication connection open For the operation of row number 8: SP.SOCOPEN, refer to "MELSEC iQ-F FX5 User's Manual (Ethernet Communication)" for the Mitsubishi Electric programmable controller. MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 40 Set a string to print out in each page. Row number Print page wPrintCount sModelStr sLotNumStr Page 1 TD-4410D A2000 Page 2 TD-4420D A3000 Page 3 TD-4430D A4000 bSetDataFlg turns ON just one time by printing 1 page. MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 41 /* increase serial number by one */ sObj4Str:=CONCAT('U12345-L',RIGHT(sObj4Str,5));/* create barcode string */ sPrintStartStr:='^FF'; /* start printing */ sTempStr:=CONCAT(sInitStr,sObj1Str,sObj2Str,sObj3Str,sObj4Str,sPrintStartStr);/* concatenate strings */ wSendData[0]:=len(sTempStr)+4; /* add 4 bytes of transmission data length wSendData [1] and [2] */ MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 42 Row number 37/38: When transmission is completed, turns OFF the variable of above control and increases wPrintCount by one for the next printing. Row number 43: Turns ON bStartClose when wPrintCount is 3 or larger. MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 43 For the operation of row number 46: SP.SOCCLOSE, refer to "MELSEC iQ-F FX5 User's Manual (Ethernet Communication)" for the Mitsubishi Electric programmable controller. Row number 49/50: When close processing is completed, turns OFF the variable of above control. MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 44: [Appendix A] Outline Of Communication Protocol To Control Label Printer

    [Appendix A] Outline of communication protocol to control label printer Command mode Brother label printers have three functions such as "Raster" mode, "ESC/P" mode and "P-touch Template" mode. This is called "Command mode". Command mode is set according to its printing functions and receiving command type.
  • Page 45 5Eh 54h 53h n1 n2 n3 Fix 30h to n1 Designate template No. to n2, n3 (n2 * 10) + n3 → Template No. Change the above to ASCII number {30h to 39h} and designate it MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 46 P-touch Template Usage Printing start Data length 3 bytes Data 5Eh 46h 46h More details of commands or other "P-touch Template command", refer to "P-touch Template manual" of the each label printer. MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...
  • Page 47: [Appendix B] Related Manual

    [Appendix B] Related Manual Brother Label Printers  Brother User's guide TD-2020 / TD-2120N / TD-2130N / TD-2130NSA  Brother User's guide TD-4210D / TD-4410D / TD-4420DN / TD-4510D / TD-4520DN  / TD-4550DNWB Brother User's guide PT-P900 / PT-P900W / PT-P950NW ...
  • Page 48 [Contact window] Product and support information Find Brother global website and select in your country or region: (https://www.brother.com) Developer support Top page: (https://support.brother.com/g/s/es/dev/en/index.html) Contact form: (https://secure6.brother.co.jp/dev/ContactUs_InputDisp.aspx) Brother group headquarters Brother Industries, Ltd. 15-1, Naeshiro-cho, Mizuho-ku, Nagoya, 467-8561, Japan MELSEC iQ-F Brother Label Printer Sample Program Reference Manual...

Table of Contents