Home
"user manual"
Contents
1. 13 2 2 1 Precautions when programming 13 2 2 2 Precautions when accessing own station link devices and other station s programmable COMMONER deVI CBS ENG Gu EU cade grate ELA 15 2 3 Settings for Using Functions e es heat o CR ORA Ee o ACE Re 17 2 8 1 Using Visual 5 0 Visual 6 0 17 2 3 2 Using Visual 5 0 Visual C 496 0 sss ee 18 2 3 3 Using Visual Basic NET 0 0 0 ees 20 2 3 4 Using Visual C NET 2003 Visual C 2005 Visual 2008 21 2 3 5 Using Visual C 2010 Visual 2012 23 CHAPTER 3 ACCESSIBLE DEVICES AND RANGES 30 ACCESS Target sus ose esp ERE etel Rea 30 32 Accessible Ranges c eve eer EC IR Ep arn e eae ac RR dnd aep 31 3 2 1 Access target on own 31 3 2 2 Access target when connected via 32 3 8 Accessible ER EG d vod een 33 3 3 1 Access to link devices and buffer memory of own station 33 3 3 2 Access to devices of QnA L and R series module 34 3 3 8 Access to devices of A
2. 108 4 3 24 mdRandR reading devices 111 4 3 25 mdDevSet setting bit devices 115 4 3 26 mdDevRst resetting bit 116 CHAPTER 5 SAMPLE PROGRAMS 117 5 1 Sample Programs for CC Link Ver 2 Board 117 5 1 1 Description of sample programs 00 ccc cece 117 5 1 2 rs 119 5 2 Sample Programs for MELSECNET H Board 120 5 2 1 Description of sample programs sssssssss s 120 5 2 2 121 5 3 Sample Programs for CC Link IE Controller Network Board 122 5 3 1 Description of sample programs ssssssssee s 122 5 3 2 rs 123 5 4 Sample Programs for CC Link IE Field Network 124 5 4 1 Description of sample programs xs sema bau dase 124 542 Programming language issssssssssslsss sss rn 125 CHAPTER 6 ERROR CODES 126 APPENDIX 134 Appendix 1 Method for Increasing Minimum Working Set Size of Personal Computer
3. 66 4 3 8 mdDevRstEx resetting extended bit 68 4 3 9 mdRemBufWriteEx writing data to buffer memory of remote device station 70 4 3 10 mdRemBufReadEx reading data from buffer memory of remote device station 72 4 3 11 mdTypeRead reading model names of CPU 0 0 ccc ccc eee ee 74 4 3 12 mdControl remote 5 5 79 4 3 13 mdWaitBdEvent waiting for event 80 4 3 14 mdBdRst resetting 83 4 3 15 mdBdModSet setting modes of board 84 4 3 16 mdBdModRead reading modes of 86 4 3 17 mdBdLedRead read LED information of the 88 4 3 18 mdBdSwRead reading switch status of the 94 4 3 19 mdBdVerRead read version information of the 96 4 3 20 mdlnit initializing programmable controller information table 99 4 3 21 mdSend batch writing devices SEND function 100 4 3 22 mdReceive batch read devices RECV 104 4 3 23 mdRandW writing devices
4. NR NA Canin roe Configuration Properties Linker Input ed ie Mood res res Ie See tfo ries Ver Dres ae CCH Add Module to Assembly Linker Embed Managed Resource File General Force Symbol References Miss Delay Loaded Dis Fans ae Assembly Link Resource Debugging Sen opinati Embedded IDL Advanced Command Line Manifest Tool E Resources XML Document Generator Browse Information 89 Buld Events Custom Buld Step E Managed Resources Custom Buld Too EE XML Data Generator Tool Additional Dependencies Specifies additional tems to add to the Ink command ine Le kernels2 lb m Microsoft Cpp Win32 user Property Pages Configuration NA NIA Configuration Manager E Common Properties General User Macros VC Directories cce Linker General Input Manifest Fle Debugging System Optimization Embedded 10L Advanced Command Line Manifest Tool E Resources XML Document Generator 89 Browse Information E8 Buld Events Custom Buld Step E Managed Resources 89 Custom Buld Too XML Data Generator Tool odbc32 lb odbccpS2 ib AddtionaDependencies Ignore All Default Libraries Ignore Specific Defau Libraries Module Definition Fie Add Module to Assembly Embed Managed Resource Fie Force Symbol References Delay Loaded Dis Assembly Link Resource Additional Dependencies Specifie
5. A2ACPU A2ACPU S1 A2UCPU A2UCPU S1 A2USCPU A2USCPU S1 A2USHCPU S1 A3UCPU A4UCPU QCPU A mode QO02CPU A Q02HCPU A Q06HCPU A QnA series CPU module QnACPU Q2ACPU Q2ASCPU Q2ASHCPU Q2ACPU S1 Q2ASCPU S1 Q2ASHCPU S1 Q3ACPU Q4ACPU Q4ARCPU Q series CPU module QCPU Q mode Basic model QCPU Q00JCPU QOOCPU Q01CPU High Performance model QCPU Q02CPU Q02HCPU Q06HCPU Q12HCPU Q25HCPU Process CPU Q02PHCPU Q06PHCPU Q12PHCPU Q25PHCPU Redundant CPU Q12PRHCPU Q25PRHCPU Universal model QCPU QO3UDVCPU Q03UDECPU Q04UDHCPU Q04UDEHCPU Q04UDVCPU QO6UDHCPU QO6UDEHCPU Q0GUDVCPU Q10UDHCPU Q10UDEHCPU Q13UDHCPU Q13UDEHCPU Q13UDVCPU Q20UDHCPU Q20UDEHCPU Q26UDHCPU Q26UDEHCPU Q26UDVCPU Q50UDEHCPU Q100UDEHCPU L series CPU module LCPU LO2SCPU LO2SCPU P LO2CPU LO2CPU P LO6CPU LO6CPU P L26CPU L26CPU P L26CPU BT L26CPU PBT Head module LJ72GF15 T2 iQ R series CPU module RCPU RO4CPU RO8CPU R16CPU R32CPU R120CPU Ethernet adapter module NZ2GF ETB Intelligent device station AJ65BT R2 a slave station on the CC Link system that can perform the transient transmission CC Link IE Field remote device station Input module NZ2GF2B1 16D NZ2GFCE3 16D NZ2GFCE3 16DE NZ2GFCM1 16D NZ2GFCM1 16DE Output module NZ2GF2B1 16T NZ2GF2B1 16TE NZ2GFCE3 16T NZ2GFCE3 16TE NZ2GFCM1 16T NZ2GFCM1 16TE
6. Oo Jul 2011 SH 081035ENG A First edition Addition Section 5 1 1 Section 5 1 2 Section 5 2 1 Section 5 2 2 Section 5 3 1 Section 5 3 2 Section 5 4 1 Section 5 4 2 Correction TERMS Section 2 1 1 Section 3 1 1 Section 3 1 2 Section 3 1 4 Section 3 2 1 Section 3 2 2 Section 3 2 3 Section 3 2 4 Section 5 1 Chapter 6 Correction SH 081035ENG C TERMS Section 3 1 1 Section 3 1 2 Section 3 1 3 Section 3 1 4 Section 4 3 9 Section 4 3 14 Section 4 3 17 Chapter 6 Addition Section 3 3 Section 3 3 1 to Section 3 3 6 Correction RELATED MANUALS Section 2 2 1 Section 2 3 3 Section 2 3 5 Section 3 1 Section 3 2 SH 081035ENG D Section 3 2 1 Section 3 2 2 Section 4 2 2 Section 4 2 3 Section 4 2 4 Section 4 3 Section 4 3 3 Section 4 3 4 Section 4 3 9 Section 4 3 15 Section 4 3 19 Section4 3 20 Section 5 1 2 Section 5 2 2 Section 5 3 2 Section 5 4 2 Chapter 6 Delete Section 3 1 1 to Section 3 1 4 Section 3 2 3 Section 3 2 4 Correction SH 081035ENG E RELATED MANUALS TERMS Section 1 2 Section 2 2 1 Section 2 3 Section 3 1 Section 4 3 9 Section 4 3 13 Section 4 3 17 Chapter 6 Section 4 3 9 Section 4 3 10 SH 081035ENG F Section 2 2 1 Section 3 1 Section 3 2 1 Section 3 2 2 Section 3 3 2 Section 3 3 4 Section 3 3 6 Section 4 1 Section 4 2 4 Section 4 3 3 Section 4 3 4 Section 4 3 5 Section 4 3 6 Section 4 3 11 Section 4 3 15 Section 4 3 16 Section 4 3 21 Section 4 3 22
7. Options ZI 2 Select lt lt Directories gt gt and specify Include files for Show irectories for Editor Tabs Debug Compatbiliy Build Directories directories fo Platform Show directories for wina2 E Include files m Directories D Program Files Microsoft Visual Studios VC98 INCLUDE D Program Files Microsoft Visual Studio VC98 MFC INCLUDE D Program Files Microsoft Visual Studio WC98 ATLAINCLUDE 7 3 Double click the item be set and browse the folder Choose Directory containing include files Directory name Mdfunc h is stored in the following directory at installation DAMELSECXCOMMONNNCLUDE cma lt User specified folder COMMON INCLUDE g d Network MELSEC EUM E Common 4 Add include lt Mdfunc h gt at the beginning of the program 18 CHAPTER 2 PROGRAMMING 2 Setting library files 1 Start Visual C and select Tools Options Tools Window Help Source Browser Alt F12 Visual Component Manager Register Control Error Lookup ActiveX Control Test Container OLEJCOM Object Viewer soy MFC Tracer Customize M Macro Record Quick Macro Ctrl Shift R Play Quick Macro Ctrl Shift P 2 Select lt lt Directories gt gt and specify Library files for Show directories for Browse the folder containing library files as in Options Editor Tabs Debug Compatibility
8. 2003 e Visual Studio 2005 Visual C Visual Studio 2008 Visual C e Visual Studio 2010 Visual e Visual Studio 2012 Visual Sample programs are created in Visual 5 0 project format Burwwes6olg z LG pJeog Z 49A XUurT 22 104 swes6oig Convert the project when using Visual C other than Visual 5 0 An include file and a library file are not included in the sample program Set an include file and a library file before using the sample program For the setting method Page 18 Section 2 3 2 Page 21 Section 2 3 4 Page 23 Section 2 3 5 119 5 2 Sample Programs for MELSECNET H Board Sample programs are stored in the user specified folder that is specified when installing the software package to a personal computer lt User specified folder lt MNETH gt lt SAMPLES gt 5 2 1 Description of sample programs 1 Sample Programs for MELSEC data link library The following sample programs are stored as examples of functions a Reading device data A sample program for reading device DO of network number 1 and station number 1 Folder name folder for programming language DEMO b Testing MELSEC data link library in general A sample program for the MELSEC data link library in general Folder name folder for programming language MTEST 1 The sample programs for Visual Studio 2012 Visual Basic are stored in MTEST2 folder Poi
9. This sample program cannot be used as a 64 bit version user application In order to use this sample program on a 64 bit version operating system select x86 for Target CPU and build the program as a 32 bit version user application warning occurs because a controller created by the Visual basic 6 0 is used for this sample program However there is no effect for the operation of the sample program 124 CHAPTER 5 SAMPLE PROGRAMS 5 4 2 Programming language Sample programs are stored on the following folders for each programming language to be used 1 NETVB folder Sample programs for the following Visual Basic Visual Basic NET 2003 e Visual Studio 2005 Visual Basic e Visual Studio 2008 Visual Basic e Visual Studio 2010 Visual Basic e Visual Studio 2012 Visual Basic Sample programs are created in Visual Basic NET 2003 project format Convert the project when using Visual Basic other than Visual Basic NET 2003 Mdfunc vb is not included in the sample program Add Mdfunc vb before using the sample program For the setting method Page 20 Section 2 3 3 2 VC folder Sample programs for the following Visual C49 e Visual 2003 e Visual Studio 2005 Visual e Visual Studio 2008 Visual e Visual Studio 2010 Visual C e Visual Studio 2012 Visual C Sample programs are created in VisualC NET 2003 project format Convert the project when us
10. z z 7 Static type variables Do not specify any variables which are declared in static for output arguments of the MELSEC data link library functions 8 64 bit version user program a Accessing CPU modules other than QCPU Q mode or RCPU modules 64 bit version user program cannot access CPU modules other than QCPU Q mode or RCPU modules Use 32 bit version user program to access CPU modules other than QCPU Q mode or RCPU modules 13 b Creating 64 bit version user program To create 64 bit version user program a project needs to be configured to set the 64 bit platform as a target platform For configuring a project and setting a target platform refer to Help How to Configure Projects to Target Platforms in Visual Studio c Creating 64 bit version user program using Visual Basic NET Framework 4 0 or NET Framework compatible with NET Framework 4 0 is required Use Visual Studio 2010 or later d Restriction when creating 64 bit version user programs 64 bit version user programs can be created on a 32 bit version operating system however the following dialog box appears and cannot be executed When using Windows XP 32 bit version C MELSEC MTEST exe C MELSEC MTEST exe is not a valid Win32 application When using Windows 7 32 bit version gt The version of this file is not compatible with the version of Windows you re running Check your computer s system infor
11. long ret Return value OUT long path Path of channel IN long netno Network number IN long stno Station number IN long devtyp Device type IN long devno Specified device number IN Visual Basic NET ret mdDevRstEx path netno stno devtyp devno Integer ret Return value OUT Integer path Path of channel IN Integer netno Network number IN Integer stno Station number IN Integer devtyp Device type IN Integer devno Specified device number IN Visual Basic 5 0 Visual Basic 6 0 ret mdDevRstEx path amp netno stno devtyp devno Long ret Return value OUT Long path Path of channel IN Long netno Network number IN Long stno Station number IN Long devtyp Device type IN Long devno Specified device number IN Argument Description path Specify the path channel whose communicaan line is opened Use the path which is returned when executing mdOpen neina Network number Specify the network number of target station C Page 43 Section 4 2 3 ina Station nimber specily the station n mber of target station Page 43 Section 4 2 3 devtyp Device type ites the type of device to be reset OFF lt gt Page 45 Section 4 2 4 devno Specified device number Specify the device number of device to be reset OFF CHAPTER 4 FUNCTIONS Explanation This function is a dedicated function for bit devices such as link relays B and internal relays M Y Return value Success R
12. Other Windows Toolbars Sj Ful Screen Shift Alt Enter Navigate Backward Ctrl B Ctrl Shift4 Previous Task Property Manager Property Pages fala tale lid Property Manager Microsoft Cpp Win3 X 5 1 2 Debug Win32 M t Pure MSIL CLR 8 4 Application Unicode Support By Core Windows Librar 3 ij Release Win32 id x Add New Project Property Sheet Add Existing Property Sheet Move Later in Evaluation Move Earlier in Evaluation Save Microsoft Cpp Win32 user Remove Rename To the next page Ctri s Del pa Open the project to create a user application and select View Property Manager 1 1 menu configuration may differ depending on the development setting or customized setting Right click the user property sheet and select Properties from the shortcut menu The Property Pages screen is displayed 23 ZLOZ O IENSIA OLOZ t O IenstA Bust g e z suonoun Buris 104 sPumes ez 24 From the previous page ft Cpp Win32 user Propert 88 Custom Buld Step E Managed Resources 88 Custom Buld Tool 8 XML Data Generator Tool Microsoft Cpp Win32 user Property Pages Common Properties Gener User Macros Coe Linker 9 Manifest Tool Resources MID 88 XML Document Generator Browse Information G Custom Buld Step Managed Resources
13. 134 Appendix 1 1 Processing overview of sample program 134 Appendix 1 2 Sample programs eee eee eee eee 135 REVISIONS rer se ee de eee e Rp FADE pesos 137 eies ee rernm Rer Sad eon i ap ae e on Sar Der ge fue eu ber Es 139 HOW TO READ THIS MANUAL In this manual pages are organized and the symbols are used as shown below The following page illustration is for explanation purpose only and the content is different from the actual page 2 3 Settings for Using Functions This section explains how to set the development tool to use the MELSEC data link library functions The chapter of the For programming languages supported by boards refer to the User s Manual corresponds to the board current page is lt shows reference Page 3 RELEVANT MANUALS shown pages e r Point LAshows reference To create a 64 bit version user application a needs to be configured to set the 64 bit platform as a target platform manuals For configuring a project and setting a target platform refer to Help How to Configure Projects to Target Platforms in Visual Point P shows notes jg Sue that requires attention shows useful 2 3 1 Using Visual Basic 5 0 Visual Basic 6 0 information This section explains the setting operation when using Visual Basic 5 0 Visual Basic 6 0 Microsoft Visual Basic design
14. Q81BD J71LP21 25 Q80BD J71GP21 10H Hardware to usd Q80BD J61BT11N Q80BD J71LP21S 25 Q80BD J7 1GP218S Q80BD J71GF11 T2 47H 16 bytes Q81BD J61BT11 Q80BD J7 1LP21G Q81BD J71GP21 Q81BD J71GF11 T2 i Q80BD J71LP21GE Q81BD J71GP21S Q80BD J7 1BR11 2 port memory 18H 0200H 512K bytes 0080H 128K bytes 0180H 384K bytes 0080H 128K bytes possession size 2 port 19 0080H fixed 0080H fixed 0080H fixed 0080H fixed attribute Applicable 1AH 0000 fixed 0000 fixed 0000 fixed 0000 fixed offset Function 1 1BH Function version 1BH Function version version L L L L L Major version 1BH 1BH 1BH of CC Link 0000 fixed 00004 fixed H H H 0002 1 Machine Minor version to classification 1CH OOOOH fixed 1FH a ee 0000 m 1CH 1CH H 0000 fixed to 0000 fixed to 00004 fixed 1FH 1FH 1DH to 0000H fixed 1FH 97 pyeoq eui JO uois18A peexeApgpul eye v spejeq uogounj Y Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes 5 126 CHAPTER 6 Related function mdOpen mdClose 98 CHAPTER 4 FUNCTIONS 4 3 20 initializing programmable controller information table lf Function Reflesh a programmable controller de
15. Store the bit pattern or device value when the conditions of device are details Event detail information satisfied Reserve the variable for 4 words 80 CHAPTER 4 FUNCTIONS Explanation This function waits the occurrence of the event specified by the waiting event number on the specified channel for a period of time out Timeout value Description 1 Indefinitely waiting 0 No wait to 2147483647 7FFFFFFFH Millisecond waiting Waiting event number eventno is specified as follows Waiting event eventno eventno 0 Number of waiting events 1 to 64 eventno 1 Waiting event number 0 to 63 1st event eventno 2 Waiting event number 0 to 63 2nd event eventno 64 Waiting event number 0 to 63 64th event The following is an example when waiting the multiple events simultaneously Example When waiting the event No 1 No 5 and No 12 simultaneously Waiting event eventno eventno 0 3 Number of waiting events 3 eventno 1 1 Waiting event number 1 1st event eventno 2 5 Waiting event number 5 2nd event eventno 3 12 Waiting event number 12 3rd event When the No 5 interrupt event occurs 5 is returned to signaledno Values stored to the event detail information details are as follows depending on whether the specified device of the occurred event condition is a bit device or a word device Bit device A bit pattern which indicates the condition satisfi
16. Build Directories Platform Show directories for 1 on the previous page Win32 Libra fies Mdfunc32 lib is stored in the following directory at Directories 13 installation D Program Files Microsoft Visual Studio VC98 LIB D Proaram Files Microsoft Visual StudioNVCSEAMFCALIB lt User specified folder gt lt COMMON gt lt LIB gt D MELSEC COMMONALIB 3 Open the workspace to create a user application and select Project Build Tools Window Help Project Settings Set Active Project Add To Project Source Control gt suonoun Buris 104 sPumes ez Dependencies Settings Export Makefile 0 9g O IENSIA 0 9 0 IenstA BUIN ze Insert Project into Workspace Project Settings 4 Select lt lt Link gt gt and specify General for the category and LL RENI EE enter Mdfunc32 lib in the Object library modules field e Categor General Dutput file name Debug project exe Object library modules MdFunc32 lit IV Generate debug info Ignore all default libraries Iv Link incrementally Generate Enable profiling Project Options nologo subsystem windows incremental yes pdb Debug project pdb debug machine 386 out Debug project pdbtype sept 19 2 3 3 Using Visual Basic NET This section explains the setting operation when using Visual Basic NET 2003 or
17. Change the setting of Channel used by the own station or own station or Target station channel is being FFFF9032n Target station channel in the control data used by another instruction Check the system log of event viewer and take a corrective 28634 action on the registered error 9026H Exit the program and restart the personal computer FFFF9026H Check the mounting condition of the board Hardware self diagnosis error A personal computer error is suspected if the board operates An board error was detected by the hardware self i normally on other personal computers Repair or replace the diagnosis 28636 personal computer 9024H When the same error occurs on other personal computers FFFF9024H replace the board Consult your local Mitsubishi representative When an error code is returned as a return value of the extended function Page 38 Section 4 1 the error codes from 1 to 28636 will be an 8 digit value FFFFFFFFH to FFFF9024nH in the hexadecimal format as described in the table 133 APPENDIX Appendix 1 Method for Increasing Minimum Working Set Size of Personal Computer The following explains the method and sample programs for increasing the minimum working set size of the personal computer when an error with code 77 004Dx occurs due to the execution of the MELSEC data link library function The personal computer board driver runs using the minim
18. Link direct device link special relay Jn SB 25001 to 25255 61A9H to 62A7H DevLSB1 to 255 Link direct device link special register Jn SW 28001 to 28255 6061 to 6E5FH DevLSW1 to 255 Intelligent function module device Buffer memory Intelligent function module access device Un G 29000 to 29255 7148 to 7247H DevSPG0 to 255 a1 44 1 With the random read function mdRandR mdRandREx execute normally even specifying devices that do not exist With the random read function ndRandR mdRandREx the function may complete normally if the specified devices do not exist The read data is error 2 Specify a block number 0 to 256 for the lower 3 digits of the code specification decimal and the numerical value of the device specification 3 Specify a network number 1 to 255 for the lower digits of the code specification decimal and the numerical value of the device specification 4 Specify a value start I O number divided by 16 for the lower 3 digits of the code specification decimal and the numerical value of the device specification 3 Buffer memory of CC Link other station When accessing the buffer memory of CC Link network module or other CC Link Ver 2 board from CC Link Ver 2 4 board specify the following device type CHAPTER 4 FUNCTIONS Device type Device Code specification Device name Decimal Hexadecimal specification Buffer memory 32768 8000H DevRBM R
19. RUN Display the operating status of board 1 Operating normally 0 Hardware error or Board WDT error ON 1 OFF 0 buf 1 B15 0 RESERVE CHAPTER 4 FUNCTIONS CC Link IE Field Network Element Bit LED Description Note b15 12 RESERVE Display the link status of PORT2 b11 LNK2 1 Linkup in progress 0 Linkdown in progress Display the link status of PORT1 b10 LNK1 1 Linkup in progress 0 Linkdown in progress Display the frame loss status of PORT2 b9 LER2 1 Frame loss occurring 0 No frame loss Display the frame loss status of PORT1 b8 LER1 1 Frame loss occurring 0 No frame loss Display the operating mode b7 MODE 1 Operating in online mode 0 Operating in offline mode Display the network reception status b6 RD 1 Data are being received buf 0 0 Data not received ON 1 Display the network sending status OFF 0 b5 SD 1 Data are being transmitted 0 Data not transmitted Display the detection status of communication error b4 L ERR 1 Detected 0 Not detected Display the detection status of network board error b3 ERR 1 Detected 5 0 Not detected Display the data link status cyclic transmission status b2 D LINK 1 Data link in operation S 0 No data link A g o Display the station type b1 MST 1 Operating as the master station 0 Other than master station Display the operating status of board bO
20. is stored when the received actual data size is greater than the specified receive byte size size e 125 7Du is stored to the send source station number when the station number of the send source is 0 Y Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes Page 126 CHAPTER 6 gt Related function mdOpen mdClose mdReceive mdSend mdSendEx 58 CHAPTER 4 FUNCTIONS 4 3 5 mdRandWEx writing extended devices randomly lf Function Write data to the devices on the target station specified with the randomly specified devices L Format Visual C ret mdRandWEx path netno stno dev buf bufsize long ret Return value OUT long path Path of channel IN long netno Network number IN long stno Station number IN long devi Randomly specified device IN short buf Written data single precision integer array IN long bufsize Dummy IN Visual Basic NET ret mdRandWEx path netno stno dev O buf 0 bufsize Integer ret Return value OUT Integer path Path of channel IN Integer netno Network number IN Integer stno Station number IN Integer dev n Randomly specified device IN Short buf n Written data single precision integer array IN Integer bufsize Dummy IN Visual Basic 5 0 Visual Basic 6 0 ret mdRandWEx path amp netno stno dev 0 buf 0 bufsize Long ret Return value OUT Long path Path of ch
21. 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 service Overseas 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 liability Regardless 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 specifications The sp
22. on other station O Accessible X Not accessible Access target A0J2HCPU A1SCPU A1SJCPU A1SHCPU A2UCPU A1SJHCPU A2UCPU S1 Device Access type A3NCPU AZUSCRU A1NCPU A2CJCPU A2USCPU S1 A4UCPU 2 ASACPU 51 A2NCPU S1 A3UCPU A2SCPU QCPU A mode A2SHCPU A2ACPU A2ACPU S1 Input X Batch Random Output Y Batch Random Latch relay L Batch Random O O O O Internal relay M Batch Random O O Special relay M9000 to Batch Random Data register D Batch Random Special register D9000 to Batch Random O O O G Annunciator F Batch Random O O Timer contact coil current value Batch Random Timer Batch O O O setting value main Random x x x x x Timer Batch setting value sub1 Random x x x Timer Batch x O setting value sub2 sub3 Random x i x Counter contact coil currentvalue Batch Random O O O O O Counter Batch Q O O setting value main Random x x x x x Counter C Batch setting value sub1 Random x x e Counter Batch x i O setting value sub2 sub3 Random x Accumulator A Batch Random O Index register Z V Batch Random File register R Batch Random x Extended file register ER Batch Random x Link re
23. stno buf Visual Basic NET ret mdTypeRead path stno buf Short Integer Short Short ret path stno buf Return value OUT Path of channel IN Station number IN Model name code OUT Return value OUT Path of channel IN Station number IN Model name code OUT Visual Basic 5 0 Visual Basic 6 0 ret mdTypeRead path amp stno buf Integer ret Return value OUT Long path Path of channel IN Integer stno Station number IN Integer buf Model name code OUT Argument Description path Path of channel Specify the path of channel whose communication line is opened Use the path which is returned when executing mdOpen Specify the station number of target station stno Station number NOME C Page 41 Section 4 2 2 Return the model name code of CPU being read buf Model name code For details of the model name code of CPU being read refer to Explanation shown on the next page 74 Explanation The following table shows the model name codes and corresponding model names MELSEC iQ R series CHAPTER 4 FUNCTIONS Model name code Hexadecimal eels elt 4800H RO4CPU 4801H RO8CPU 4802H R16CPU 4803H R32CPU 4804H R120CPU MELSEC L series Model name code Hexadecimal 0541 LO2CPU 0543H LO2SCPU 0544 LOGCPU 0545H L26CPU 0548H L26CPU BT 0549H LO2CPU P 054AH L26CPU PBT 054BH L26CPU P 054CH
24. 0 Error Return the value other than 0 Refer to the list of error codes Page 126 CHAPTER 6 C gt Related function mdOpen mdClose mdReceiveEx mdSend mdSendEx 105 ADAH seoiep peal uojeq zze v spejeq uogounj 2 RECV function lf Function Read data of the specified channel number from the data which are received by the own station L Format Visual C ret mdReceive path stno devtyp devno size data short ret Return value OUT long path Path of channel IN short stno Station number IN short devtyp Device type IN short devno Channel number IN short size Receive byte size IN OUT short data J Receive data single precision integer array OUT Visual Basic NET ret mdReceive path stno devtyp devno size data 0 Short ret Return value OUT Integer path Path of channel IN Short stno Station number IN Short devtyp Device type IN Short devno Channel number IN Short size Receive byte size IN OUT Short data n Receive data single precision integer array OUT Visual Basic 5 0 Visual Basic 6 0 ret mdReceive path amp stno devtyp devno size data 0 Integer ret Return value OUT Long path Path of channel IN Integer stno Station number IN Integer devtyp Device type IN Integer devno Channel number IN Integer size Receive byte size IN OUT Integer data n Receive data single precision integer array OUT C
25. 2 to 1920 When receiving the data which are transmitted by MELSECNET H us ecelve Dyte size board with CC Link IE Controller Network board or CC Link IE Controller Network board specify within the range of 2 to 960 The size of received actual data is received data Received data and send source information are stored as single data with send source information pcd Mager array am Reserve an area for the specified receive byte size and send source single precision integer array information 6 bytes C Explanation This function supports the RECV instruction of the link dedicated instruction For details of the function refer to the manuals of each board lt Receive data with send source information data gt Receive byte size and send source information 6 bytes are stored in receive data with send source information data Reserve an area for receive byte size and send source information 6 bytes in receive data with send source information data Data are stored in receive data with send source information data as shown below Receive data with send source information data data 0 Send source network number Send source information data 1 i 1 Send source station number 6 bytes data 2 Send source channel number data 3 Receive byte size Actual data size e Only the actual data with the specified receive byte size size
26. 70 All bits are OFF buf 1 10 Stores 10 to D10 buf 2 200 Stores 11 to D200 buf 3 300 Stores 12 to D300 buf 4 400 Stores 13 to D400 60 CHAPTER 4 FUNCTIONS The following shows an example when writing data to one of the double word devices LZ LTN LCN or LSTN Example When writing Ox1 to LCN100 and 0x10000 to LCN101 Randomly specified devices dev dev 0 1 One specified range LCN100 to LCN101 dev 1 DevLCN dev 2 100 dev 3 2 2 points LCN100 to LCN101 LCN100 and later Written data buf buf 0 0x1 Lower 1 word of LCN100 buf 1 0x0 Upper 1 word of LCN100 buf 2 0x0 Lower 1 word of LCN101 buf 3 0x1 Upper 1 word of LCN101 Y Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes Page 126 CHAPTER 6 ES Related function mdOpen mdClose mdRandREx spejeq uogounj Ajwopues Bunuw 61 4 3 6 mdRandREx reading extended devices randomly Lf Function Read the device specified with the randomly specified devices from the target station A Format Visual C ret mdRandREx path netno stno dev buf bufsize long long long long long short long Visual Basic NET ret path netno stno J buff bufsize Return value Path of channel Network number Station number Randomly specified d
27. 89 Text Templating Windows Forms Designer E Workflow Designer Show directories for eal x s ei Library files YCInstallDir lib VCInstallDir atimfcllib VCInstallDir atimfclliblisse WindowsSdkDir lib FrameworkSDKDirib vSInstallDir stVSInstallbir lib S em gt Library Directories Path to use when searching for library files while building a VC project Corresponds to environment variable LIB Show all settings Cx Ces bsoft Visual Studio 3 Project Buld Debug Data Tools Add Class Ei E Add New CtrheShift A 3 Add Existing Item Ctrl D Exclude From Project Show Al Files Update Managed Resources m Properties E Linker General Manifest Fle Debugging System Optimization Embedded 10L Advanced Command tine E Manifest Tool Force Symbol References Delay Loaded DLL Assembly Link Resource Additional Dependencies Specifies additional tems to add to the ink ine ex kernelS2 ib configuration specific 22 Ce Start Visual C and select Tools Options Select VC Directories in the folder area of the Options screen For other than Visual C NET 2003 Select Projects and Solutions VC Directories For Visual 2003 Select Projects VC Directories Specify L
28. Argument Description Specify the path of channel whose communication line is opened path Path of channel Use the path which is returned when executing mdOpen Store the LED information being read buf Read data For details of stored LED information refer to Explanation shown on the next page 88 Explanation CHAPTER 4 FUNCTIONS The following table shows the LED information When the LED is flashing the status at read is stored For details of the LED refer to the manual of each board CC Link Ver 2 Board Element Bit LED Description Note b15 9 RESERVE Display the detection status of communication error for all stations b8 ERR 1 Detected i OFF 0 0 Not detected buf 0 b7 1 RESERVE Display the operating status of board bO RUN 1 Operating normally 0 0 Board WDT error b15 1 RESERVE Display the detection status of switch setting error bO SW 1 Detected OFF 0 0 Not detected b15 9 RESERVE Display the detection status of parameter error b8 PRM 1 Detected i OFF 0 0 Not detected buf 2 b7 1 RESERVE Display the detection status of master station duplication error ON 1 bO M S 1 Detected OFF 0 0 Not detected b15 9 RESERVE Display the detection status of cable disconnection error b8 LINE 1 Detected i OFF 0 0 Not detected buf 3 b7 1 RE
29. CHAPTER 4 FUNCTIONS 4 3 24 mdRandR reading devices randomly lf Function Read the device specified with the randomly specified devices from the target station L Format Visual C mdRandR path stno dev buf bufsize short ret Return value OUT long path Path of channel IN short stno Station number IN short devi Randomly specified device IN short buff Read data single precision integer array OUT short bufsize Number of bytes of read data IN Visual Basic NET ret mdRandR path stno dev 0 buf 0 bufsize Short ret Return value OUT Integer path Path of channel IN Short stno Station number IN Short dev n Randomly specified device IN Short buf n Read data single precision integer array OUT Short bufsize Number of bytes of read data IN Visual Basic 5 0 Visual Basic 6 0 ret mdRandR path amp stno dev 0 buf 0 bufsize Integer ret Return value OUT Long path Path of channel IN Integer stno Station number IN Integer dev n Randomly specified device IN Any buf n Read data single precision integer array OUT Integer bufsize Number of bytes of read data IN Argument Description Specify the path of channel whose communication line is opened path Path of channel Use the path which is returned when executing mdOpen Specify the station number of target station stno Station number Page 41 Section 4 2 2 Specify the number of blocks the
30. CHAPTER 6 E gt Related function mdOpen 50 CHAPTER 4 FUNCTIONS 4 3 3 batch writing extended devices SEND function 1 Batch writing extended devices lf Function Batch write data to the devices on the target station for the number of written data bytes from the start device number L Format Visual C ret mdSendEx path netno stno devtyp devno size data long ret Return value OUT long path Path of channel IN long netno Network number IN long stno Station number IN long devtyp Device type IN long devno Start device number IN long size Written byte size IN OUT short data J Written data single precision integer array IN Visual Basic NET ret mdSendEx path netno stno devtyp devno size data 0 A Integer ret Return value OUT Integer path Path of channel IN Integer netno Network number IN Integer stno Station number IN A Integer devtyp Device type IN Integer devno Start device number IN Integer size Written byte size IN OUT Short data n Written data single precision integer array IN Visual Basic 5 0 Visual Basic 6 0 ret mdSendEx path amp netno stno devtyp devno size data 0 uojoury ANIS seowep Buyum uojeq xapuespu Long ret Return value OUT Long path Path of channel IN Long netno Network number IN Long stno Station number IN Long devtyp Device type IN Long devno Start device nu
31. Custom Buld Tool 8 XML Data Generator Tool Path to use when searching for include while buiding a VC project Corresponds to environment Variable INCLUDE Include Directories Select Directory MELSEC ccru C3 Common Help orma LIB Easysocket MNETG 3 4 5 6 7 Select Common Properties VC Directories on the Property Pages screen Select Include Directories Click the button and select lt Edit gt On the Include Directories screen click the button and then click On the Select Directory screen select the folder to which the include file is stored Mdfunc h is stored in the following directory at installation User specified folder COMMON INCLUDE Add include lt Mdfunc h gt at the beginning of the program 2 Setting library files Microsoft Visual Studio View 2 7 Dat fool gl Solution Explorer Ctrl alk L i Team Explorer Ctr Ctr M d Bookmark Window Ctrl K Ctr Ww E Call Hierarchy Ctrl Alc K E Class View Ctrl Shift C Code Definition window Ctrl Shift H Object Browser Ctrlealt J Error List Ctr E E Output Alt 2 a Resource View Ctrl Shift E Start Page Toolbox Ctri Alt x Find Results Other Windows Toolbars B Ful Screen Shift Alt Enter Navigate Backward Ctrla Fd Navigate Forward Ctrl Shift Next Task Previous Task
32. LO2SCPU P 054DH LOGCPU P 0641H LJ72GF15 T2 MELSEC Q series Model name code Model name Hexadecimal 0041H Q02CPU Q02HCPU 0042H QO6HCPU 0043H Q12HCPU 0044 Q25HCPU 0049H Q12PHCPU 004AH Q25PHCPU 004BH Q12PRHCPU 004CH Q25PRHCPU 004DH Q02PHCPU 004 QO6PHCPU 0141H Q02CPU A mode QO2HCPU A mode 0142H QO6HCPU A mode 0250H Q00JCPU 0251H QO0CPU 0252H Q01CPU 0260H Q00UJCPU 0261 QO0UCPU 0262H Q01UCPU 75 Jo seweu BuipeeJ Lye y siejeq uogounj Model name code Hexadecimal 0263 Q02UCPU 0266H Q10UDHCPU 0267H Q20UDHCPU 0268H QO3UDCPU 0269H Q04UDHCPU 026AH QO6UDHCPU 026BH Q13UDHCPU 026CH Q26UDHCPU 02E6H Q10UDEHCPU 02E7H Q20UDEHCPU 02 8 QO3UDECPU 02 9 Q04UDEHCPU 02EAH QO6UDEHCPU 02 Q13UDEHCPU 02 Q26UDEHCPU 02EDH Q50UDEHCPU 02 Q100UDEHCPU 0366H QO3UDVCPU 0367H QO04UDVCPU 0368H QO6UDVCPU 036AH Q13UDVCPU 036CH Q26UDVCPU 2010H Q172CPU Q172CPUN Q172CPUN T 2012H Q172HCPU 2011H Q173CPU Q173CPUN Q173CPUN T 2013H Q173HCPU 2014H Q172DCPU 2015H Q173DCPU 2018H Q172DSCPU 2019H Q173DSCPU e MELSEC QnA series Model name code Hexadecimal 0021 Q2ACPU Q2AHCPU Q2ASCPU Q2ASHCPU 0022H Q2ACPU S1 Q2AHCPU S1 Q2A
33. SEND RECV function is out of the range 31 DLL load error FFE1H An attempt to load DLL required to execute the Reinstall the software package FFFFFFE1H function failed Resource time out error Close the user program correctly 32 The user program was forcibly terminated Retry the operation FFEOH The resource is not freed within the transient There is a possibility of a memory shortage Terminate other FFFFFFEOH timeout monitoring time because other tasks application s currently running and threads are occupying the resource Exit the program and restart the personal computer 33 Incorrect access target error Check whether an unsupported communication target is FFDEH The communication target specified by the specified by the network number and the station number EFFFFEDFH network number and the station number is a Check the Target Setting of the utility model which is not supported Update the software package 34 FFDEH FFFFFFDEH 35 FFDDH Registry access error Reinstall the software package FFFFFFDDH 36 FFDCH FFFFFFDCH Retry the operation 37 Pee ae There is a possibility of a memory shortage Terminate other Communication initialization setting error FFDBH eee application s currently running The initial setting for communication is failed FFFFFFDBH Exit the program and restart the personal computer Check the memory availability 42 FFD6H Cl
34. The board or the master station control station FFBEH Retry the operation was reset during the execution of the FFFFFFBEH mdWaitBdEvent function 67 No event setting error The event setting of the event number which is Set the event number that sets the user application to wait in the specified in the mdWaitBdEvent function to set utility FFFFFFBDH 25 the user application to wait does not exist 69 Unsupported function execution error 2 b Check if the function is supported by the software package or the FFBBH A function which is not supported by the driver iver FFFFFFBBH software package or the driver was executed 70 Event overlapped occurrence error Set the interval of the event occurrence longer enough for the FFBAH The event with the same event number occurred user program to process FFFFFFBAH multiple times Check if the target station is remote device station of CC Link IE 71 Remote device station access error Field Network FFB9H Failed to access to the buffer memory of a remote Check the network number and station number FFFFFFB9H device station Check if the offset values or offset write read byte size is within the range of the buffer memory of the target station 257 FFFFFEFFH to Errors detected in the MELSECNET H and Refer to the MELSECNET H and MELSECNET 10 Network 4096 MELSECNET 10 network system System Reference Manua
35. b15 10 RESERVE Display the detection status of station number or control station duplication error on the same network b9 M S E 1 Detected 0 Not detected Display the error detection status when the internal processing of send b8 F LOOP data is not performed on the forward loop side at regular intervals UNDER 1 Detected 0 Not detected Display the error detection status when the internal processing of send b7 R LOOP data is not performed on the reverse loop side at regular intervals UNDER 1 Detected 0 Not detected Display the error detection status when the error data whose size is 2K bytes or more is received on the forward loop side 1 Detected 0 Not detected b6 F LOOP DATA Display the error detection status when the error data whose size is 2K bytes or more is received on the reverse loop side 1 Detected 0 Not detected b5 R LOOP DATA buf 1 Display the error detection status when the data link monitoring timer is ON 1 operated on the forward loop side OFF 0 1 Detected 0 Not detected b4 F LOOP TIME Display the error detection status when the data link monitoring timer is operated on the reverse loop side 1 Detected 0 Not detected b3 R LOOP TIME Display the error detection status when receiving 1 more than specified number of times continuously or the received data length is too short on b2 F LOOP AB IF the forward loop side 1 Detected 0 Not d
36. bit pattern of each driven event is stored in details GWord device This function returns The driven event overlapped 70 FFBAH The device value when the condition of the event that occurred first is satisfied is stored in details O This function is a dedicated function for CC Link IE Controller Network board and CC Link IE Field Network board If channel path of another board is specified an error occurs Page 126 CHAPTER 6 CHAPTER 4 FUNCTIONS 4 3 14 mdBdRst resetting board lf Function Reset a board L Format Visual ret mdBdRst path short ret Return value OUT long path Path of channel IN Visual Basic NET ret mdBdRst path Short ret Return value OUT Integer path Path of channel IN Visual Basic 5 0 Visual Basic 6 0 ret mdBdRst path amp Integer ret Return value OUT Long path Path of channel IN Argument Description Specify the path of channel whose communication line is opened path Path of channel out Use the path which is returned when executing mdOpen C Explanation The board is reset to the current settings with the utility function The same process as that of the board reset operation of the utility function The board reset error 9922u which notifies the board reset is returned to other applications accessing the reset board Y Return value Success Return the value 0 Error Return the value other than 0 Refer to
37. definition of variables id ph wkmin wkmax from Integer to Long Dim id As Integer User program ID variable Dim ph As Integer User program handle variable Dim wkmin As Integer Minimum working set variable Dim wkmax As Integer Maximum working set variable Dim bret As Boolean Return value Obtain the user program ID id GetCurrentProcessID Open the user program handle PROCESS SET QUOTA 256 PROCESS QUERY INFORMATION 1024 ph OpenProcess 256 1024 False id Obtain the maximum working set size and the minimum working set size for the user program A bret GetProcessWorkingSetSize ph wkmin wkmax Set the minimum working set size to 1MB 1 1024 1024 1048576 wkmin 1048576 Set the maximum working set size to 3MB 3 1024 1024 3145728 wkmax 3145728 Change the maximum working set size and the minimum working set size for the user program bret SetProcessWorkingSetSize ph wkmin wkmax Close the user program handle bret CloseHandle ph The set sizes shown here are reference sizes Adjust the sizes according to your system ajdwes 2 xipueddy JO ezis 18S Buom JO poyan xipueddy 135 2 When setting with Visual An example when the minimum working set size is 1MB and the maximum working set size is 3MB define ERROR 1 short ChangeWorkingSetSize DW
38. device type the start device number dev Randomly specified device and points of device to be read For details refer to Explanation shown on the next page Read data buf Store the data being read single precision integer array bufsize Number of bytes of read data Specify the number of bytes of read data 111 Ajwopued seoi ep Bulpeas ypueypu pz v spejeq uogounj Explanation The number of transient transmissions performed inside of the function changes with the specified randomly specified devices A longer function processing time is required for the random read function as compared with the batch read function Consider using the batch read function if a shorter function processing time is required The following explains how to specify the randomly specified devices dev Randomly specified devices dev dev 0 Number of blocks dev 1 Device type of block number 1 dev 2 Start device number of block number 1 Block number 1 dev 3 Points of block number 1 dev 4 Device type of block number 2 dev 5 Start device number of block number 2 Block number 2 dev 6 Points of block number 2 The number of blocks that can be specified is within 1 to 32767 112 CHAPTER 4 FUNCTIONS The following shows an example when reading multiple devices Example When reading the values of M100 to M115 D10 to D13 MO to M13 and the current value of T10 M100 to M115 All bits are OFF D
39. integer array single precision integer array bufsize Dummy CHAPTER 4 FUNCTIONS Explanation The number of transient transmissions performed inside of the function changes with the specified randomly specified devices A longer function processing time is required for the random write function as compared with the batch write function Consider using the batch write function if a shorter function processing time is required When accessing another station the extended comment information will be deleted by writing data to the block extended file register to which the extended comment is assigned When accessing another station the sub2 and sub3 programs will be deleted by writing data to the block extended file register which overlaps with the setting areas of the sub2 and sub3 programs If an error occurs when writing devices randomly to B or W of the own station in MELSECNET II or MELSECNET 10 blocks with errors may exist among blocks in which the write function is normally completed The following explains how to specify the randomly specified devices dev Randomly specified devices dev dev 0 Number of blocks dev 1 Device type of block number 1 dev 2 Start device number of block number 1 Block number 1 dev 3 Points of block number 1 dev 4 Device type of block number 2 dev 5 Start device number of block number 2 Block number 2 dev 6 Points of block number 2 The number of blocks that can be s
40. library file before using the sample program For the setting method Page 18 Section 2 3 2 Page 21 Section 2 3 4 Page 23 Section 2 3 5 123 5 4 Sample Programs for CC Link IE Field Network Board Sample programs are stored on the user specified folder that is specified when installing the software package to a personal computer e lt User specified folder CCIEF SAMPLES 5 4 1 Description of sample programs 1 Sample Programs for MELSEC data link library The following sample programs are stored as examples of functions a Reading device data A sample program for reading device DO of network number 1 and station number 1 Folder name folder for programming language DEMO b Testing MELSEC data link library in general A sample program for the MELSEC data link library in general Folder name folder for programming language MTEST 1 The sample programs for Visual Studio 2012 Visual Basic are stored in MTEST2 folder Point Sample programs for MTEST folder of NETVB This sample program cannot be used as a 64 bit version user application In order to use this sample program on a 64 bit version operating system select x86 for Target CPU and build the program as a 32 bit version user application MSFlexGrid is used in the sample program If MSFlexGrid is not installed a warning occurs however the operation of sample program is not affected Sample programs for MTEST2 folder of NETVB
41. modes of board Lf Function Read the mode in which the board is currently operating A Format Visual C ret mdBdModRead path mode short ret Return value OUT long path Path of channel IN short mode OUT Visual Basic NET ret mdBdModRead path mode Short ret Return value OUT Integer path Path of channel IN Short mode Mode OUT Visual Basic 5 0 Visual Basic 6 0 ret mdBdModRead path amp mode Integer ret Return value OUT Long path Path of channel IN Integer mode Mode OUT Argument Description path Path of channel Specify the path of channel whose communication line is opened Use the path which is returned when executing mdOpen Return the corresponding code to the mode being read mode Mode For details of codes being read refer to Explanation shown on the next page 86 Explanation When the mdBdModSet function is executed and the mode of the board is changed temporarily the mode set in the utility is read instead of the currently operating mode The following table shows the modes and the corresponding codes CHAPTER 4 FUNCTIONS Description Code CC Link IE Controller CC Link IE Field CC Link Ver 2 MELSECNET H Network Network 0000H Online with automatic return Online with automatic return Online Online normal mode 0001H Online high speed mode 0002H Offline Offline Offline Offline 0003
42. number of target station stno Station number Page 41 Section 4 2 2 Specify the type of device from which the data is read devtyp Device type lt Page 45 Section 4 2 4 Specify the start device number of device range to be read Specify the start device number with a multiple of 8 for the access to a devno Start device number bit device except for LTT LTC LSTT and LSTC Specify the start device number with a multiple of 16 0 16 32 for the access to a bit device RX RY SB of CC Link other station link device Specify the byte size to be read in even number When the specified byte size to be read exceeds the device range 5 size Read byte size size error the applicable size is returned to size When a double word device LZ LTN LCN or LSTN is specified to devtyp specify the size in multiples of 4 Read data data EM Store the data being read single precision integer array Explanation When the specified read byte size exceeds the transient transmission size data are divided inside the function and read When a double word device LZ LTN LCN or LSTN is specified to devtyp the data is stored to data as follows Example When devtyp is LZ and size is 8 Array Value data 0 Lower 1 word of LZO data 1 Upper 1 word of LZO data 2 Lower 1 word of LZ1 data 3 Upper 1 word of LZ1 Y Return value Success Return the value
43. of buf 0 or later Read data buf T For details of checking the read data refer to Explanation shown on the single precision integer array next page Specify the number of bytes of read data bufsize Number of bytes of read data For details of values to be specified refer to Explanation shown on the next page C Explanation The number of transient transmissions performed inside of the function changes with the specified randomly selected devices A longer function processing time is required for the random read function as compared with the batch read function Consider using the batch read function if a shorter function processing time is required The following explains how to specify the randomly specified devices dev Randomly specified devices dev dev 0 Number of blocks dev 1 Device type of block number 1 dev 2 Start device number of block number 1 Block number 1 dev 3 Points of block number 1 dev 4 Device type of block number 2 dev 5 Start device number of block number 2 Block number 2 dev 6 Points of block number 2 spejeq uogounj The number of blocks that can be specified is within 1 to 32767 Ajwopues pepueixe BuipeeJ xq jpuespul 63 The following shows an example when reading multiple devices Example When reading the values of M100 to M115 D10 to D13 MO to M13 and the current value of T10 M100 to M115 All bits are OFF D10 to D13 1
44. short chan number of communication line short mode IlDummy long line path pointer Visual ret mdOpen chan mode path Short ret Return value Short chan Channel number of communication line Short mode Dummy Integer path Opened line path pointer Visual Basic 5 0 Visual Basic 6 0 ret mdOpen chan96 mode96 path amp Integer ret Return value OUT Integer chan Channel number of communication line IN Integer mode Dummy IN Long path Opened line path pointer OUT Argument Explanation dan Channel number of communication line SPeciy the channel number of communication line EF Page 46 Section 4 2 1 mode Dummy Specify 1 path Opened line path pointer Return the opened line path yc Explanation A path of the channel used for argument of another function is returned to the opened line path pointer When using multiple communication lines they need to be opened for each channel number Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes 17 Page 123 CHAPTER 6 7 Related function mdClose Indicates an description of the function Indicates the description format in each programming language Item Description Visual C A format for Microsoft Visual C A format for the following Visual Basic e Visual Basic NET 2003 e Visu
45. to the list of error codes 126 CHAPTER 6 gt Related function mdOpen mdClose 82 Point P If the data link is not executed properly an event does not occur When the device assigned by Network range assignment is not used an event does not occur This function returns immediately if the event has already occurred when it is called Create a program to avoid calling this function from multiple processes with specifying same event number of the same channel number simultaneously If executed Event number registration overlap error 63 FFC1H of return value is returned to the process that called this function later Lengthen the occurrence interval of the event up to extent where the user program can process satisfactorily This function returns The event is not set error 67 FFBDH of return value if executed without the event setting When the board or the master station control station is reset during the execution of this function the function returns Event initialization error 66 FFBEH of return value When multiple or more events occur simultaneously either of events is detected first When this function is executed again the other events are detected When the events whose number is the same occur multiple times Execution result of this function and Value details stored of Bit device and Word device are as follows Bit device This function ends normally Logical add in the
46. 0 for D10 200 for D11 300 for D12 and 400 for D13 MO to M13 All bits are ON Current value of T10 10 1 second for the current value of T10 Note that the above values are presumed values in the current status of the target devices Randomly specified devices dev dev 0 4 Four specified ranges M100 to M115 D10 to D13 MO to M13 T10 dev 1 DevM dev 2 100 dev 3 16 16 points M100 to M115 dev 4 DevD dev 5 10 dev 6 4 4 points D10 to D13 dev 7 DevM dev 8 0 dev 9 14 14 points MO to M13 dev 10 DevTN dev 11 10 dev 12 1 1 point T10 lt M100 and later D10 and later MO and later Current and later values of T10 timer Number of bytes of read data bufsize Specify the number of bytes of array variable buf which stores the read data buf 0 to buf 6 7 x 2 14 bytes Enter 14 for this example Read data buf buf 0 0 All bits of M100 to M115 are OFF 16 points of bit information can be stored buf 1 10 Current value of D10 buf 2 200 Current value of D11 buf 3 300 Current value of D12 buf 4 400 Current value of D13 buf 5 Ox3fff All bits of MO to M13 are ON buf 6 10 Current value of T10 is 10 1 second CHAPTER 4 FUNCTIONS The following shows an example when reading data from one of the double word devices LZ LTN LCN or LSTN Example When reading current values of LCN100 and LCN101 LCN100 is 0 1 and LCN101 is 0x10000 Randomly spe
47. 1 Start Visual Basic and select Project Add Module ject Format Debug Run Query gg add MDI Form Pde Moa IB L5 add class modue f add User Control Add Property Page dd User Docun The section of the current page m 2 Select lt lt Existing gt gt and select Mdfunc bas is shown eaa Mdfunc bas is stored in the following directory at z o installation User specified folder lt COMMON gt INCLUDE suorpuna Buisr 10 SUMAS Z T mecs ret s ox 079521828 ENSIA O S DISA lensiA BUSA Vez T Dort show tis dialog in the fauie The following shows the symbols used in this manual with descriptions and examples Example Project lt lt Existing gt gt tab Option screen button TERMS This manual uses the following terms unless otherwise specified Term Description Board Generic term for PC interface boards supported by MELSEC data link library Utility Generic term for utility of PC interface board supported by MELSEC data link library CC Link Ver 2 board Generic term for QB0BD J61BT11N and Q81BD J61BT11 CC Link system master local interface board MELSECNET H board Generic term for Q80BD J71LP21 25 Q81BD J71LP21 25 Q80BD J7 1LP218S 25 Q80BD J71LP21G Q80BD J71LP21GE and Q80BD J71BR11 MELSECNET H interface board CC Link IE Controller Network board Generic te
48. 10 to D13 10 for D10 200 for D11 300 for D12 and 400 for D13 MO to M13 All bits are ON Current value of T10 10 1 second for the current value of T10 Note that the above values are presumed values in the current status of the target devices Randomly specified devices dev dev 0 4 Four specified ranges M100 to M115 D10 to D13 MO to M13 T10 dev 1 DevM dev 2 100 dev 3 16 16 points M100 to M115 dev 4 DevD dev 5 10 dev 6 4 4 points D10 to D13 dev 7 DevM dev 8 0 dev 9 14 14 points MO to M13 dev 10 DevTN dev 11 10 dev 12 1 1 point T10 M100 and later 7010 and later MO and later Current and later values of T10 timer Number of bytes of read data bufsize Specify the number of bytes of array variable buf which stores the read data buf 0 to buf 6 7 x 2 14 bytes Enter 14 for this example Read data buf buf 0 0 All bits of M100 to M115 are OFF uoouny 16 points of bit information can be stored buf 1 10 Current value of D10 buf 2 200 Current value of D11 buf 3 300 Current value of D12 buf 4 400 Current value of D13 buf 5 Ox3fff All bits of MO to M13 are ON buf 6 10 0 Current value of T10 is 10 1 second Ajuiopuei seoi ep Bulpeas ypueypu 113 The following shows an example when reading data from one of the double word devices LZ LTN LCN or LSTN Example When reading the current va
49. 1683 Transient data improper 0250 The data over 960 bytes has been sent from Check if the sent data using the SEND function of MELSECNET H board to CC Link IE Field MELSECNET H board exceeds 960 bytes FFFFD25DH Network board Station number error The specified station number is incorrect 11746 A process that should be requested to other D21EH station was requested to the own station Or Check the network number and station number FFFFD21EH the station number corresponds to the own station 255 FFH but the network number is not 0 12128 Check if the own station or the target station is disconnected DOAOH Transient data send response wait time out error Check if an unsupported communication target is specified with FFFFDOAO0H the network number and the station number 12289 CFFFH FFFFCFFFH to Errors detected in the Ethernet network system Refer to the Ethernet Interface Module User s Manual 16384 000 000 16385 BFFFH FFFFBFFFH i Refer to the CC Link system master local board and CC Link to Errors detected in the CC Link system system master local module user s manual 20480 B000H FFFFBO000H 18560 Module mode setting error B780H A transient transmission was executed to the Check the network number and the station number FFFFB780H remote I O station 18572 Transient unsupported error Check the network number and the station number 774 A tra
50. 3 Common Help e C3 Easysocket amp E Cancel INCLUDE Start Visual C and select Tools Options Select VC Directories in the folder area of the Options Screen For other than Visual C NET 2003 Select Projects and Solutions VC Directories For Visual C NET 2003 Select Projects VC Directories Specify Include Files for Show directories for and click Browse the folder containing include files Mdfunc h is stored in the following directory at installation User specified folder COMMON INCLUDE Add include lt Mdfunc h gt at the beginning of the program 21 suonoun 104 sPumes ez 8002 2 IENSIA GOOZ O IENSIA 00 L3N 0 IenstA rez 2 Setting library files Options 3 Tools Window Bus Attach to Process Ctr At P Connect to Database Connect to Server Code Snippets Manager Ctrl B Choose Toolbox Items Add in Manager Macros Partner Products Catalog Dotfuscator Community Edition B WCF Service Configuration Editor External Tools Import and Export Settings Customize Options Environment 3 Projects and Solutions General Build and Run VB Defaults VC Directories VC Project Settings Source Control Text Editor Database Tools Debugging 89 HTML Designer
51. 31 xX1o0Ageu UO sseooy L Z e qisseoov z 3 2 2 Access target when connected via network The following shows the accessibility when accessing via multiple networks Own station The combination other than shown in the following table cannot be accessed Accessing the access target via multiple networks is not supported by CC Link network O Accessible X Not accessible Access target 3 CC Link IE S T Relay Access target LCPU QCPU ACPU Field wn networ Seu POOR RCPU Head module Q mode QnACPU remote Ethernet adapter PC interface QCPU module board station CC Link IE Controller O x x x CC Link IE Controller Network Network CC Link IE Field O x Network RCPU CC Link IE Controller O x O x x CC Link IE Field Network Network CC Link IE Field O O O x x Network MELSECNET H x x x MELSECNET H MELSECNET 10 x x O x MELSECNET 10 QCPU 2 CC Link IE Controller Q mode COLINK IE Controller 5 x Network CC LinkIE 2 4 Network Field Network CC Link IE Field y Network CC Link IE Field CC Link IE Field LCPU O O x Network Network QnACPU ACPU MELSECNET 10 MELSECNET 10 x x x QCPU A mode 1 For details of access target refer to Page 30 Section 3 1 Access Target 2 When using a CPU module whose number of mountable ne
52. 60 When accessing via MELSECNET 10 network specify the byte size within the range of 2 to 960 Send data m ies data EM Specify the data to be written in single precision integer array single precision integer array 1 Do not specify all stations or group numbers for the station number when sending data with arrival acknowledgement Explanation This function supports the SEND instruction of the link dedicated instruction For details of the functions refer to the manuals of each board The following explains how to specify the channel numbers 4 bytes Target station channel Channel number 3 2 1 0 To Channel used by the own station Item Description Specify a target station channel Target station channel MELSECNET H board CC Link IE Controller Network board 1to8 CC Link IE Field Network board 1to2 Specify a channel used by the own station MELSECNET H board CC Link IE Controller Network board 1to8 CC Link IE Field Network board 1to2 Channel used by the own station Y Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes 15 Page 126 CHAPTER 6 gt Related function mdOpen mdClose mdSend mdReceive mdReceiveEx 103 ANES seoep Buum yoyeq puespul seed uogounj 4 3 22 mdReceive batch read devices RECV function 1 Batch readi
53. 9 MITSUBISHI ELECTRIC Mitsubishi PC Interface Board MELSEG MELSEC Data Link Library Reference Manual Q80BD J61BT11N Q80BD J71LP21 25 080 0 716 21 5 Q80BD J71GF11 T2 Q81BD J61BT11 Q80BD J71LP21S 25 Q80BD J71GP21S SX Q81BD J71GF11 T2 Q81BD J71LP21 25 Q81BD J71GP21 SX MODEL Q80BD J71LP21G Q81BD J71GP21S SX Q80BD J71BR11 SAFETY PRECAUTIONSG Read these precautions before using this product Before using this product please read this manual and the relevant manuals carefully and pay full attention to safety to handle the product correctly Make sure that the end users read this manual and then keep the manual in a safe place for future reference G CONDITIONS OF USE FOR THE PRODUCTO 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 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 WARRANT Y TORT PRODUCT LIABILITY FOR ANY INJURY OR DEATH TO PERSONS OR LOSS OR DAMAGE TO PRO
54. ACPU CC Link IE Intelligen RCPU Head adapter PC interface QnACPU Field remote t device module module board QCPU A mode devicestation station CC Link Ver 2 S 2 CC Link O o3 x board MELSECNET H MELSECNET H x x x x x board MELSECNET 10 x x x x CC Link IE CC Link IE Controller Controller x x x x x Network board Network CC Link IE CC Link IE Field Field O x o3 Network Network board z 2 37 For details of access target refer to L 30 Section 3 1 Access Target When the own station number is 64 other station cannot be accessed Only the own station can be accessed Only 32 bit version user application can be accessed For the accessible devices of each access target refer to the following table Access target Reference Access to link devices or buffer memory of own station Access to devices of other station module PC interface board QnACPU QCPU Q mode LCPU RCPU Page 33 Section 3 3 1 Page 34 Section 3 3 2 ACPU QCPU A mode Page 35 Section 3 3 3 Ethernet adapter module Head module Page 36 Section 3 3 4 Access to other station buffer memory of CC Link CC Link network module CC Link Ver 2 board etc Page 36 Section 3 3 5 Access using the SEND function or the RECV function QnACPU QCPU Q mode LCPU RCPU PC interface board Page 37 Section 3 3 6
55. Analog input module Analog output module NZ2GF2B 60AD4 NZ2GF2B 60DA4 Temperature control module NZ2GF2B 60TCTT4 NZ2GF2B 60TCRT4 High speed counter module NZ2GFCF D62PD2 PC interface board CC Link Ver 2 board MELSECNET H board Q80BD J61BT11N Q81BD J61BT 11 Q80BD J71LP21 25 Q81BD J71LP21 25 Q80BD J71LP21S 25 Q80BD J71LP21G Q80BD J7 1LP21GE Q80BD J71BR11 CC Link IE Controller Network board Q80BD J71GP21 SX Q80BD J71GP21S SX Q81BD J71GP21 SX Q81BD J71GP21S SX CC Link IE Field Network board Q80BD J71GF11 T2 Q81BD J71GF11 T2 30 Cannot be accessed when using a product whose model name or version is not supported by the network For the supported network of each product refer to the manual of product 2 CHAPTER 3 ACCESSIBLE DEVICES AND RANGES For CC Link IE Field network only A2UCPU A2UCPU S1 A2USCPU A2USCPU S1 A2USHCPU S1 A3UCPU and A4UCPU can be accessed Point When accessing other than QCPU Q mode or RCPU use 32 bit version user application 3 2 Accessible Ranges This section explains accessible ranges when communicating with boards 3 2 1 Access target on own network The following module board or own station can be accessed on the network connected to each board Own station N Access target Ye Accessible Not accessible Access target 1 Own station Own network LCPU Ethernet QCPU Q mode
56. CNET H board CC Link IE Controller Network board yur OASTAW FL 11 CHAPTER 2 PROGRAMMING This chapter explains how to use the MELSEC data link library 2 1 Programming Procedure The following flow chart shows the procedure to create a user program using the MELSEC data link library on the personal computer to which the software package is installed C Programming procedure Set the development tool to use K Page 17 Section 2 3 the MELSEC data link library i Create a user program using the MELSEC data link library Open the communication port mdOpen function d Communicate with the programmable controller CPU and the board using functions End the program Close the port that was opened by the mdOpen function mdClose function CA Refer to the user s manual Perform debugging using of corresponding board the Device monitor utility A user program is created 12 CHAPTER 2 PROGRAMMING 2 2 Precautions when Using MELSEC Data Link Library 2 2 1 Precautions when programming 1 Multi thread communications The MELSEC data link library cannot be accessed from multiple threads within the same process Access the MELSEC data link library with a single thread 2 Opening and closing of a communication line Perform the opening and closing processes of a communication line mdOpen m
57. Custom Buld Step 8 Managed Resources Custom Bull Tool XML Data Generator Tool Select Directory E MELsEC cou E C3 Common Help INCLUDE 12 x64 Bu Easysocket To the next page 26 Select Common Properties VC Directories on the Property Pages screen Select Library Directories Click and select lt Edit gt On the Library Directories screen click ei and then click GJ On the Select Directory screen select the folder to which the library file is stored Mdfunc32 lib is stored in the following directory at installation For creating a 32 bit version user application lt User specified folder lt gt LIB For creating a 64 bit version user application lt User specified folder COMMON lt LIB gt x64 CHAPTER 2 PROGRAMMING From the previous page 7 Openthe project to create a user application and select rosoft Visual Studio Project Properties Add Class ui Class Wizard Add Resource Add New Item Add Existing Item Ctrl Shift Xx Ctr Shift A Shift Alt A New Filter w E E E Show All Files Unload Project Rescan Solution References Set as StartUp Project Build Customizations 4 Refresh Project Toolbox Items E Properties 1 Open Folder in Windows Explorer In the folder area of the Property Pages screen select
58. Device type IN Integer devno Specified device number IN Visual Basic 5 0 Visual Basic 6 0 ret mdDevSetEx path amp netno stno devtyp devno Long ret Return value OUT Long path Path of channel IN Long netno Network number IN Long stno Station number IN Long devtyp Device type IN Long devno Specified device number IN Argument Description path Specify the path channel whose communicaan line is opened Use the path which is returned when executing mdOpen neina Network number Specify the network number of target station C Page 43 Section 4 2 3 ina Station nimber specily the station n mber of target station Page 43 Section 4 2 3 e un Eo cm devno Specified device number Specify the device number of device to be set ON CHAPTER 4 FUNCTIONS Explanation This function is a dedicated function for bit devices such as link relays B and internal relays M Y Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes 5 Page 126 CHAPTER 6 gt Related function mdOpen mdClose mdDevRstEx spejeq uogounj yq Bumes x3jes egpui 67 4 3 8 Lf Function Reset the specified bit device on the target station to OFF A Format 68 Visual C ret mdDevRstEx path netno stno devtyp devno mdDevRstEx resetting extended bit devices
59. ELSECNET H 3 slot Channel number is set with MELSECNET H utility 54 MELSECNET H 4 slot 81 CC Link 1 slot CC Link Ver 2 board 82 CC Link 2 slot Channel number is set with the channel number setting switch 83 CC Link 3 slot The channels are set as follows according to the SW1 and SW2 settings 84 CC Link 4 slot 81 Off Off 82 On Off 83 Off On 84 On On 151 CC Link IE Controller Network Channel No 151 452 CC Link IE Controller Network Channel No 152 CC Link IE Controller Network board CC Link IE Controller Network Channel number is set with CC IE Control utility ds Channel No 153 154 CC Link IE Controller Network Channel No 154 181 CC Link IE Field Network Channel No 181 182 CC Link IE Field Network Channel No 182 CC Link IE Field Network board CC Link IE Field Network Channel number is set with CC IE Field utility 188 Channel No 183 184 CC Link IE Field Network Channel No 184 40 CHAPTER 4 FUNCTIONS 4 2 2 Specifying station numbers The following tables show the station numbers specified in the MELSEC data link library For specifying network numbers and station numbers for extended functions refer to 43 Section 4 2 3 1 CC Link Ver 2 board Specification Station number Own station 255 FFH Other station 0 00 to 63 3FH The logical station number set with the utility 65 41 to 239 EFH 1 Station number 64 cannot be spec
60. Format Visual C ret mdWaitBdEvent path eventno timeout signaledno details short long short long short short ret path eventno timeout signaledno details 4 Visual Basic NET ret mdWaitBdEvent path eventno 0 timeout signaledno details 0 Short Integer Short Integer Short Short ret path eventno n timeout signaledno details 4 Return value OUT Path of channel IN INaiting event number IN Timeout value IN Driven event number OUT Event detail information OUT Return value OUT Path of channel IN Waiting event number IN Timeout value IN Driven event number OUT Event detail information OUT Visual Basic 5 0 Visual Basic 6 0 ret mdWaitBdEvent path amp eventno 0 timeout amp signaledno details 0 Integer ret Return value OUT Long path Path of channel IN Integer eventno n Waiting event number IN Long timeout Timeout value IN Integer signaledno Driven event number OUT Integer details 4 Event detail information OUT Argument Description path Pathotchannel Specify the path of channel whose communication line is opened Use the path which is returned when executing mdOpen Specify the event number of event to wait Use the event number set in the utility timeout Timeout value Specify the time until time out to wait the event signaledno Driven event number Return the occurred event number
61. H Data link test Forward loop test 0004H Remote station test Reverse loop test Setting parameter check Station to station test 0005H Station to station test mode executing stations Station to station test 0006H Hardware test Loop test Loop test target stations 0007H Not applicable Self loopback test Self loopback test Self loopback test 0008H Self loopback test internal 0009H Hardware test Hardware test Hardware test 000 Bus interface test Bus interface test 0010H Memory test Y Return value Success Return the value 0 Error gt Related function mdOpen mdClose mdBdModSet Return the value other than 0 Refer to the list of error codes 17 126 CHAPTER 6 87 p1eoq jo Buipeej peaypowpgpwi 9L t spejeq uogounj 4 3 17 mdBdLedRead read LED information of the board Lf Function Read the LED information of the board A Format Visual C ret mdBdLedRead path buf short ret Return value OUT long path Path of channel IN short buff J Read data OUT Visual Basic NET ret mdBdLedRead path buf 0 Short ret Return value OUT Integer path Path of channel IN Short buf n Read data OUT Visual Basic 5 0 Visual Basic 6 0 ret mdBdLedRead path amp buf 0 Integer ret Return value OUT Long path Path of channel IN Integer buf n Read data OUT
62. HAPTER 4 FUNCTIONS Argument Description Specify the path of channel whose communication line is opened path Path of channel 2l Use the path which is returned when executing mdOpen stno Station number Specify the own station 255 FFH devtyp Device type Specify the function 101 65n Specify the own station channel number on which the received messages are stored MELSECNET H board CC Link IE Controller Network board devno Channel number 1to8 CC Link IE Field Network board 1to2 Specify the byte size of received data in even number Specify the byte size within the range of 2 to 1920 When accessing via MELSECNET 10 network specify the byte size within the range of 2 to 960 size Receive byte size p When receiving the data which are transmitted by MELSECNET H board with CC Link IE Controller Network board or CC Link IE Controller Network board specify within the range of 2 to 960 The size of actual received data is received Received actual data and send source information are stored as single Receive data IND precision integer array data with send source information ARM Reserve an area for the specified receive byte size and send source single precision integer array information 6 bytes Explanation This function supports the RECV instruction of the link dedicated instruction For details of the function refer to the manuals of each boar
63. In order to use this sample program on a 64 bit version operating system select x86 for Target CPU and build the program as a 32 bit version user application warning occurs because a controller created by the Visual basic 6 0 is used for this sample program However there is no effect for the operation of the sample program 117 suJeJBoJd ajdwes jo uonduoseq LS pueog Z 49A Xur1 92 104 8 ajdwes 2 Sample programs for checking data link of CC Link Ver 2 board The following sample programs are stored as program examples to check whether the data link between the master station and each station is executed properly For details refer to the following manual LUIType Q80BD J61BT11N Q81BD J61BT11 CC Link System Master Local Interface Board User s Manual For SW1DNC CCBD2 B a Communication between a master station and a remote station A sample program to read write the remote I Os for the remote I O station Folder name MasterStation RemotelO b Communication between a master station and a remote device station A sample program to perform the digital analog conversion for AJ65BT 64DAV Folder name MasterStation RemoteDevice c Communication between a master station and a local station A sample program for communications between a master and a local station Folder name MasterStation Datalink LocalStation Datalink d Communication between a master station and an intelligent dev
64. ORD dwProcessld User program ID variable HANDLE hProcess User program handle variable DWORD dwMinimumWorkingSetSize Minimum working set variable DWORD dwMaximumWorkingSetSize Maximum working set variable Obtain the user program ID dwProcessld GetCurrentProcessld Open the user program handle hProcess OpenProcess PROCESS SET QUOTA PROCESS QUERY INFORMATION FALSE dwProcessld if hProcess NULL Error end return ERROR Obtain the maximum working set size and the minimum working set size for the user program if GetProcessWorkingSetSize hProcess amp dwMinimumWorkingSetSize amp dwMaximumWorkingSetSize 0 Error end CloseHandle hProcess return ERROR Set the minimum working set size to 1MB dwMinimumWorkingSetSize 1 1024 1024 Set the maximum working set size to 3MB dwMaximumWorkingSetSize 3 1024 1024 Change the maximum working set size and the minimum working set size for the user program if SetProcessWorkingSetSize hProcess dwMinimumWorkingSetSize dwMaximumWorkingSetSize 0 Error end CloseHandle hProcess return ERROR Close the user program handle CloseHandle hProcess Normal return return 0 The set sizes shown here are reference sizes Adjust the sizes according to your system 136 REVISIONS The manual number is written at the bottom left of the back cover Printdate_
65. PERTY 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 re
66. Property Manager Property Pages Property Manager Microsoft Cpp Win3 v PX ata i 8 MESTI 5 85 Debug Win32 Cpp C Pure MSIL CLR SR Application Unicode Support By Core Windows Libra amp 8 08 Release Win32 v ad x Add New Project Property Sheet fj Add Existing Property Sheet Move Later in Evaluation Move Earlier in Evaluation Save Microsoft Cpp Win32 user Ctri s Remove Del Rename F2 Properties CHAPTER 2 PROGRAMMING Open the project to create a user application and select View Property Manager 1 1 The menu configuration may differ depending on the development setting or customized setting Right click the user property sheet and select Properties from the shortcut menu The Property Pages screen is displayed 25 023 O IENSIA OLOZ t O IenstA Bus g e z suonoun Buris 104 sPumes ez From the previous page Microsoft Cpp Win32 user Property Pages 3 4 VCInstalbir bin WindowsSdkDir binlNETFX 4 0 Tools C MELSEC Common INCLUDE IncludePath XML Dats Generator Tool E Common Properties Gener HV CInstalDir bin WindowsSdkDirbiniNETFX 4 0 Took User Macros CAMELSEC Common INCLUDE IncludePath S VCInstalDretinfclb stVCInstalbiib nib WindowsschDil FramewerkSOKDI Nb Document Generator Browse Information Buld Events
67. RUN 1 Operating normally 0 A board WDT error is occurring or the board is resetting buf 1 B15 0 RESERVE Y Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes 15 Page 126 CHAPTER 6 pyeoq jo uoneuuojui q31 pees Zpet gt Related function mdOpen mdClose 93 4 3 18 mdBdSwRead reading switch status of the board Lf Function Read a board switch status such as station number setting board number setting board identification and I O address setting information L Format Visual C ret mdBdSwRead path buf short ret Return value OUT long path Path of channel IN short buff Read data OUT Visual Basic NET mdBdSwRead path buf 0 Short ret Return value OUT Integer path Path of channel IN Short buf n Read data OUT Visual Basic 5 0 Visual Basic 6 0 ret mdBdSwRead path amp buf 0 Integer ret Return value OUT Long path Path of channel IN Integer buf n Read data OUT Argument Description Specify the path of channel whose communication line is opened path Path of channel PR Use the path which is returned when executing mdOpen Store the board switch status being read buf Read data For details of the stored switch status refer to Explanation shown on the next page 94 Explanation CHAPTER 4 FUNCTIONS The board
68. SCPU S1 Q2ASHCPU S1 0023H Q3ACPU 0024 Q4ACPU Q4ARCPU MELSEC A series Model name code Hexadecimal 0082 A2UCPU A2USCPU 0083H A2UCPU S1 A2USCPU S1 0084H A3UCPU A2USHCPU S1 0085 A4UCPU 0092H A2ACPU 0093H A2ACPU S1 CHAPTER 4 FUNCTIONS Model name code Hexadecimal Boe 0094H A3ACPU 0098H A0J2HCPU A1SCPU A1SJCPU 009AH A2CCPU A2CJCPU 00A0H A0J2CPU 00A1H A1CPU A1NCPU 00A2H A2CPU A2NCPU A2SCPU 00A3H A3CPU A3NCPU A1SHCPU A1SJHCPU A2SHCPU A2SH1CPU 00A4H A3HCPU A3MCPU Tf Jo seweu BuipeeJ Lye y uogounj Others Model name code Model name Hexadecimal Q80BD J71GF11 T2 Q81BD J71GF11 T2 Q80BD J71GP21 SX Q80BD J71GP21S SX Q81BD J71GP21 SX Q81BD J71GP21S SX 0090 Q80BD J71LP21 25 Q81BD J71LP21 25 Q80BD J71LP21S 25 Q80BD J71LP21G Q80BD J71LP21GE Q80BD J71BR11 Q80BD J61BT11N Q81BD J61BT11 0642H NZ2GF ETB Y Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes 5 Page 126 CHAPTER 6 gt Related function mdOpen mdClose 78 CHAPTER 4 FUNCTIONS 4 3 12 mdControl remote RUN STOP PAUSE lf Function Remotely operate a CPU on the target station Remote RUN STOP PAUSE 77 Format Visual C ret mdControl path stno buf short ret Return value OUT long path Path of cha
69. SERVE Display the error detection status when the data link monitoring timer is operated ON 1 bO TIME 1 Detected OFF 0 0 Not detected b15 9 RESERVE Display the detection status of communication error b8 L ERR 1 Detected OFF 0 0 Not detected buf 4 b7 1 RESERVE Display the data link execution status bO L RUN 1 Data link in operation OFF 0 0 No data link b15 9 RESERVE Display the data reception status ON 1 b8 RD 1 Data are being received i OFF 0 0 Data not received buf 5 b7 1 RESERVE Display the data sending status SD 1 Data are being transmitted i OFF 0 0 Data not transmitted 89 pyeoq jo uoneuuojui q31 pees Zpet spejeq uogounj MELSECNET H Board Element Bit LED Description Note b15 R LOOP OVER Display the detection status of data import delay error on the reverse loop side 1 Detected 0 Not detected b14 F LOOP CRC Display the detection status of code check error on the forward loop side 1 Detected 0 Not detected b13 R LOOP CRC Display the detection status of code check error on the reverse loop side 1 Detected 0 Not detected b12 F LOOP Display the detection status of loop line error on the forward loop side 1 Detected 0 Not detected b11 R LOOP Display the detection status of loop line error on th
70. Section 4 3 23 Section 4 3 24 Chapter 6 Section 4 3 9 to Section 4 3 24 are changed to Section 4 3 11 to Section 4 3 26 This manual confers no industrial property rights or any rights of any other kind nor does it confer any patent licenses SH 081035ENG B Japanese Manual Version SH 081034 F 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 2011 MITSUBISHI ELECTRIC CORPORATION 137 Memo 138 Warranty Please confirm the following product warranty details before using this product 1 Gratis Warranty Term and Gratis Warranty Range If 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 designat
71. Studio 2010 or later as a development environment 2 3 1 Using Visual 5 0 Visual Basic 6 0 This section explains the setting operation when using Visual Basic 5 0 or Visual Basic 6 0 1 Start Visual Basic and select Project Add Module W Project Format Debug Run Query 915 add Form 153 Add MDI Form i Add Class Module 18 Add User Control Add Property Page Ei 1l Add User Document 2 Select lt lt Existing gt gt and select Mdfunc bas Mdfunc bas is stored in the following directory at Add Module New Existing Look in INCLUDE emerEM installation User specified folder COMMON INCLUDE File name dfunc bas Files of type Basic Files bas v Cancel Help Don t show this dialog in the future 17 0 92 5 IENSIA 0 Ggorseg ensiA USN suonoun Husn 104 sPumes ez 2 3 2 Using Visual C 5 0 Visual 6 0 This section explains the setting operation when using Visual C 5 0 or Visual C 6 0 1 Setting include files 1 Start Visual C and select Tools Options Tools Window Help Source Browser Alt F12 A Visual Component Manager Register Control Error Lookup A ActiveX Control Test Container OLEJCOM Object Viewer Tracer Customize M i Macro Record Quick Macro Ctrl Shift R Play Quick Macro Ctrl Shift P
72. a double word device LZ LTN LCN or LSTN is specified to devtyp specify the size in multiples of 4 Read data data Store the data being read single precision integer array Explanation When the specified read byte size exceeds the transient transmission size data are divided inside the function and read When a double word device LZ LTN LCN or LSTN is specified to devtyp the data is stored to data as follows Example When devtyp is LZ and size is 8 Array Value data 0 Lower 1 word of LZO data 1 Upper 1 word of LZO data 2 Lower 1 word of LZ1 data 3 Upper 1 word of LZ1 Y Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes 5 Page 126 CHAPTER 6 D Related function 56 mdOpen mdClose mdReceive mdSend mdSendEx CHAPTER 4 FUNCTIONS 2 RECV function Lf Function Read data of the specified channel number from the data which are received by the own station L Format Visual C ret mdReceiveEx path netno stno devtyp devno size data long ret Return value OUT long path Path of channel IN long netno Network number IN long stno Station number IN long devtyp Device type IN long devno Channel number IN long size Receive byte size IN OUT short data J Receive data single precision integer array OUT Visual Basic NET ret mdRe
73. ad delay loaded DLL a tinker Nokind delay loaded DLL General Input Manifest File Debugging system Optimization Embedded IDL Windows Metadata Ke Advanced Key Container AllOptions Deley Sign Command Line CIR Unmanaged Code Check gt Marifest Tool Detect One Definition Rule violations gt Librarian Error Reporting Promptlmmediately ERRORREPORT PROMPT Resources SccionAlignment gt MDL Preserve Lest Error Code for invoke Calls gt XML Document Genera Browse Information gt Build Events gt Cusombuidsep When i speciet the ine wil only produce an image F it cma produce a table of the exeption handlers This table species far the operating system which exception handlers are valid for the image Cancel Apply Import Library Merge Sections Target Machine MachineX 5 MACHINEXBS Profile No CLR Thread Attribute CLR Image Type Default image type suonoun 104 sPumes ez ZLOZ O IENSIA OLOZ t O IenstA Bus g e z 29 CHAPTER 3 ACCESSIBLE DEVICES AND RANGES This chapter explains the devices and the ranges that can be accessed when communicating with each type of boards 3 1 Access Target The following table shows the accessible other stations Item Model name A series CPU module ACPU A0J2HCPU A1SCPU A1SJCPU A1SHCPU A1SJHCPU A1NCPU A2CCPU A2CJCPU A2NCPU A2NCPU S1 A2SCPU A2SHCPU
74. adecimal specification Link input LX Remote input RX EU Link output LY Remote output RY 2 pogai Bevy Link special relay SB 5 0005H DevSM Link special register Sw 14 000EH DevSD Link relay LB 23 0017H DevB Link register LW 24 0018H DevW Remote register for transmission RWw 36 0024 DevWw Remote register for reception RWr 37 0025H DevWr Buffer memory 50 0032H DevSPB Random access buffer 33 0021H DevMRB 2 Devices of other station module Device type Device Code specification Device name Decimal Hexadecimal specification Input X 1 0001H DevX Output Y 2 0002H DevY Latch relay L 3 0003H DevL Internal relay M 4 0004H DevM Special relay SM 5 0005H DevSM Annunciator F 6 0006H DevF Timer contact 7 0007 DevTT Timer coil T 8 0008H DevTC Counter contact C 9 0009H DevCT Counter coil C 10 000AH DevCC Timer current value T 11 000BH DevTN Counter current value C 12 000CH DevCN Data register D 13 000DH DevD Special register SD 14 000 DevSD Timer setting value main T 15 000FH DevTM Timer setting value sub1 T 16 0010H DevTS Timer setting value sub2 T 16002 3E82H DevTS2 Timer setting value sub3 T 16003 3E83H DevTS3 Counter setting value main C 17 0011H DevCM Counter setting value sub1 C 18 0012H DevCS 45 sedf BulAjioedS Jo suoneouimeds UOWWOD zr Device type Devic
75. al Studio 2005 Visual Basic e Visual Studio 2008 Visual Basic e Visual Studio 2010 Visual Basic e Visual Studio 2012 Visual Basic Visual NET A format for the following Visual Basic Visual Basic 5 0 Visual Basic 6 0 Visual Basic 5 0 Visual Basic 6 0 G Describes arguments of the function Describes features of the function and details of arguments Indicates the return values Indicates related functions for programming 48 CHAPTER 4 FUNCTIONS 4 3 1 mdOpen opening communication lines lf Function Open a communication line by specifying a channel number of communication line L Format Visual C ret mdOpen chan mode path short ret Return value OUT short chan Channel number of communication line IN short mode Dummy IN long path Opened line path pointer OUT Visual Basic NET ret mdOpen chan mode path Short ret Return value OUT Short chan Channel number of communication line IN Short mode Dummy IN Integer path Opened line path pointer OUT Visual Basic 5 0 Visual Basic 6 0 ret mdOpen chan mode path amp AS Integer ret Return value OUT un Integer chan Channel number of communication line IN 3 S Q Integer mode Dummy IN 9 Long path Opened line path pointer OUT 5 S a r 9 o Argument Description gt Q ND Specify the channel number of communication line 8 chan Channel number of co
76. an be specified when using the SEND function mdSend without arrival acknowledgment Group numbers can be specified when using MELSECNET H network or CC Link IE Controller Network For specifying another station set a network number in the upper byte of the station number Setting a station number when another station is specified Network number D Station number Upper Lower Access to the control station or master station station number 0 specified with the network number on the network When accessing the control station operating as a control station and the mater station operating as a master station when using the submaster function specify the station number CHAPTER 4 FUNCTIONS 4 2 3 Specifying network numbers and station numbers for extended functions The following tables show the network numbers and the station numbers used for extended functions in the MELSEC data link library For specifying network numbers and station numbers for functions other than the extended functions refer to 5 Page 41 Section 4 2 2 1 For CC Link Ver 2 board Specification Network numbers Station number Own station Other station The logical station number set with the utility 0 00 255 FFH 0 00 to 63 3FH 65 41 to 239 EFH 1 Station number 64 cannot be specified on the CC Link Ver 2 board 2 For MELSECNET H board Specification Network n
77. andom O Internal relay M Batch Random O O Special relay SM Batch Random O O Data register D Batch Random O O Special register SD Batch Random O O Annunciator Batch Random Timer contact coil current value Batch Random O Long timer contact coil current value LT Batch Random x O Counter contact coil current value C Batch Random O O Long counter contact coil current value LC Batch Random x O Index register Z Batch Random O x Long index register LZ Batch Random x O Unit refresh register RD Batch Random x File register R ZR Batch Random o Extended file register ER Batch Random Link relay B Batch Random O Link register Batch Random O O Link special relay SB Batch Random O O Link special register SW Batch Random O O Retentive timer contact coil current value ST Batch Random O O Long retentive timer contact coil current value LST Batch Random x O Edge relay V Batch Random Link direct device link input Jn x link output Jn Y link relay Jn B Batch Random link register Jn w link special relay Jn SB link special register Jn SW Intelligent function module device Un G Batch Random 1 For details of access target refer to gt Page 30 Section 3 1 Access Target 2 Cannot be accessed with QOOJCPU 3 3 3 CHAPTER 3 ACCESSIBLE DEVICES AND RANGES Access to devices of A series module The following table shows the accessible devices of ACPU or QCPU A mode
78. andom access buffer 32736 8020H DevRAB Remote input 32735 8021H DevRX Remote output 32734 8022H DevRY Remote register 32732 8024 DevRW Link special relay 32669 8063H DevSB Link special register 32668 8064 DevSW 1 These devices can not be used for random write ndRandW mdRandWEx random read mdRandR mdRandREx bit set mdDevSet mdDevSetEx and bit reset mdDevRst mdDevRstEx The SEND function and the RECV function The same operation as device access the SEND function and the RECV function execute Batch write mdSend mdSendEx or Batch read mdReceive mdReceiveEx with specified device type for each function Device type Device Code specification Device name Decimal Hexadecimal specification function 101 0065H DevMAIL SEND function with arrival acknowledgment SEND function without arrival acknowledgment 102 0066H DevMAILNC 47 sedf Bulfjiosds Jo suoneouimeds UOWWOD zr 4 3 Function Details The following shows the detailed specifications of the MELSEC data link library This section provides the description of the instructions in the layout as shown below 4 3 1 mdOpen Opens a communication line N Y Function This function opens a communication line by specifying a communication line channel number L Format Visual C ret mdOpen chan mode path short ret Return value
79. annel IN Long netno Network number IN Long stno Station number IN Long dev n Randomly specified device IN Any buf n Written data single precision integer array IN Long bufsize Dummy IN Argument Description Specify the path of channel whose communication line is opened path Path of channel NA j Use the path which is returned when executing mdOpen netno Network number Specify the network number of target station 43 Section 4 2 3 stno Station number Specify the station number of target station I Page 43 Section 4 2 3 Specify the number of blocks the device type the start device number dev Randomly specified device and points of device to be written For details refer to Explanation shown on the next page Written data buf NEM Specify the data to be written to the array variable of buf 0 or later single precision integer array bufsize Dummy 59 Ajwopues Bunuw siejeq uogounj Explanation The number of transient transmissions performed inside of the function changes with the specified randomly specified devices A longer function processing time is required for the random write function as compared with the batch write function Consider using the batch write function if a shorter function processing time is required When accessing another station the extended comment inform
80. ath amp buf 0 Integer ret Return value OUT Long path Path of channel IN Integer buf n Read data OUT Argument Description path Path of channel Specify the path of channel whose communication line is opened Use the path which is returned when executing mdOpen Store the version information of board being read buf Read data For details of the stored version information refer to Explanation shown on the next page 96 Explanation The following table shows the details of the version information CHAPTER 4 FUNCTIONS Description Offset Item CC Link IE Controller CC Link IE Field word CC Link Ver 2 MELSECNET H Network Network 00H Fixed value S G fixed S G fixed S G fixed S G fixed 01H Checksum Sum of 02H to OFH Sum of 02H to OFH Sum of 02H to OFH Sum of 02H to OFH Software 02H A to ZZ to 9Z 0 to 9Z to 9Z version 03H Date year month day Date year month day Date year month day Date year month day to Date Example 2010 2 1 Example 2010 2 1 Example 2010 2 1 Example 2010 2 1 054 YEON Ot 2 0 4 Q O 2 0 4 EON IO 2 04 Q O 2 Q 4 06H Reservation to area 000H fixed 0004 fixed 0004 fixed 000H fixed 07H 4 bytes QJ71LP21 25 08H Software QJ71LP21S 2 QJ71GP21 SX to model name QJ61BT11N QJ71GF11 T2 QJ71LP21G QJ71GP21S SX OFH 16 bytes QJ71BR11 Q80BD J71LP21 25
81. atic return Online with automatic return Online Online normal mode 0001H Online high speed mode 0002H Offline Offline Offline Offline 0003H Data link test Forward loop test 0004 Remote station test Reverse loop test EX Setting parameter check Station to station test 0005H 2 Station to station test mode executing stations Station to station test m 0006H Hardware test Min Loop test Loop test 3 target stations 0007H Not applicable Self loopback test Self loopback test 2 Self loopback test 0008H Self loopback test internal 0009H Hardware test Hardware test 2 Hardware test 000 Bus interface test Bus interface test 0010H E Memory test 1 Cannot be set when the target board is local station 2 Forthe test method and check method of the test result refer to the manuals of each board 8 For the test method refer to the manuals of each board For the test result check with the values of the link special relays link special registers of each board 4 Check the test result with the return value spejeq uogounj Y Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes 5 126 CHAPTER 6 C gt Related function mdOpen mdClose mdBdModRead p1eoq jo zjaSpoNpapw Sev 85 4 3 16 mdBdModRead reading
82. ation will be deleted by writing data to the block extended file register to which the extended comment is assigned When accessing another station the sub2 and sub3 programs will be deleted by writing data to the block extended file register which overlaps with the setting areas of the sub2 and sub3 programs If an error occurs when writing devices randomly to B or W of the own station in MELSECNET II or MELSECNET 10 blocks with errors may exist among blocks in which the write function is normally completed The following explains how to specify the randomly specified devices dev Randomly specified devices dev dev 0 Number of blocks dev 1 Device type of block number 1 dev 2 Start device number of block number 1 Block number 1 dev 3 Points of block number 1 dev 4 Device type of block number 2 dev 5 Start device number of block number 2 Block number 2 dev 6 Points of block number 2 The number of blocks that can be specified is within 1 to 32767 The following shows an example when writing data to multiple devices Example When all bits of M100 to M115 are set to OFF and 10 200 300 and 400 are written to D10 D11 D12 and D13 respectively Randomly specified devices dev Two specified ranges M100 to M115 D10 to D13 dev 1 DevM dev 2 100 dev 3 16 16 points M100 to M115 dev 4 DevD dev 5 10 dev 6 4 4 points D10 to D13 M100 and later D10 and later Written data buf buf 0
83. ceiveEx path netno stno devtyp devno size data 0 Integer ret Return value OUT Integer path Path of channel IN Integer netno Network number IN x Integer stno Station number IN o Integer devtyp Device type IN Integer devno Channel number IN 8 Integer size Receive byte size IN OUT 7 Short data n Receive data single precision integer array OUT Visual Basic 5 0 Visual Basic 6 0 ret mdReceiveEx path amp netno stno devtyp devno size data 0 Long ret Return value OUT Long path Path of channel IN Long netno Network number IN Long stno Station number IN Long devtyp Device type IN Long devno Channel number IN Long size Receive byte size IN OUT Any data n Receive data single precision integer array OUT uonouni ADY pepuerxe Buipee yoyeq 57 Argument Description path Path of channel Specify the path 9r whose communication line is opened Use the path which is returned when executing mdOpen netno Network number Specify O 0H stno Station number Specify the own station 255 FFH devtyp Device type Specify the function 101 65n Specify the own station channel number on which the received messages are stored CC Link IE Controller Network board devno Channel number 1108 CC Link IE Field Network board 1to2 Specify the byte size of received data in even number Specify the byte size within the range of
84. cified devices dev dev 0 1 One specified range LCN100 to LCN101 dev 1 DevLCN dev 2 100 dev 3 2 2 points LCN100 to LCN101 LCN100 and later Number of bytes of read data bufsize Specify the number of bytes of array variable buf which stores the read data buf 1 to buf 4 4 x 2 8 bytes Enter 8 for this example Read data buf buf 0 0x1 Lower 1 word of LCN100 buf 1 0x0 Upper 1 word of LCN100 buf 2 0x0 Lower 1 word of LCN101 buf 3 O0x1 777008 Upper 1 word of LCN101 Y Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes Page 126 CHAPTER 6 gt Related function mdOpen mdClose mdRandWEx uogounj Ajwopues pepueixe BuipeeJ xq jpuespul 65 4 3 7 Lf Function Set the specified bit device on the target station to ON A Format 66 Visual C ret mdDevSetEx path netno stno devtyp devno mdDevSetEx setting extended bit devices long ret Return value OUT long path Path of channel IN long netno Network number IN long stno Station number IN long devtyp Device type IN long devno Specified device number IN Visual Basic NET ret mdDevSetEx path netno stno devtyp devno Integer ret Return value OUT Integer path Path of channel IN Integer netno Network number IN Integer stno Station number IN Integer devtyp
85. d lt Receive data with send source information data gt Receive byte size and send source information 6 bytes are stored in receive data with send source information data Reserve an area for receive byte size and send source information 6 bytes in receive data with send source information data Data are stored in receive data with send source information data as shown below Receive data with send source information data data 0 Send source network number M Send source information 6 bytes data 1 Send source station number data 2 Send source channel number data 3 Receive byte size Actual data size Only the actual data with the specified receive byte size size is stored when the received actual data size is greater than the specified receive byte size size 125 70 is stored to the send source station number when the station number of the send source is 0 Y Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes Page 126 CHAPTER 6 C gt Related function mdOpen mdClose mdReceiveEx mdSend mdSendEx 107 uonouny ADAH seoiep peal uojeq ewe espul zz v uogounj 4 3 23 Lf Function Write data to the devices on the target station specified with the randomly specified devices A Format 108 Visual C mdRandW path
86. d extension file register FFFFFFF3H register is overlapping with the write protect area Check the write protect switch of the memory cassette on the of the memory cassette programmable controller CPU of the target station 16 Network number and station number error FFFOn The specified network number or station number Check the network number and the station number FFFFFFFOH is out of the range 128 CHAPTER 6 ERROR CODES application to wait is out of the range Error Code ae Error description Corrective action HEX All station specification and group number specification error Check the network number and station number 47 All stations or group number was specified fora Check if the function supports all station specification and group function other than the SEND function number specification FFFFFFEFH The device type with arrival acknowledgment The device type without arrival acknowledgment when using the was specified when using the SEND function SEND function with all station specification and group number with all station specification and group number specification specification 18 Remote command code error FFEEH A command code which is not valid for mdControl Check the command code FFFFFFEEH was specified 19 SEND RECV channel number error FFEDH The channel number specified for the Check the channel number FFFFFFEDH
87. d points The set of start device number and points in the Check if the specified device is validated on the programmable same block that is specified for the device controller CPU of the target station random read write is over the device range 3 Specify a device type described in the device type list Device type error p fy FFFDH m Check if the specified device is validated on the programmable The specified device type is invalid FFFFFFFDH controller CPU of the target station Size error 5 The set of start device number and size is over Check the device size FFFBH the device range Check the start device number and size FFFFFFFBH An access was attempted with odd number Specify even number bytes bytes 6 Number of blocks error FFFAH The number of blocks specified for the device Check the number of blocks FFFFFFFAH random read write is out of the range 8 Channel number error FFF8H The channel number specified in the mdOpen Check the channel number FFFFFFF8H function is invalid 12 Block number error Check the block number device type of the file register FFF4H The block number of the specified file register is Check if the specified device is valid on the programmable FFFFFFF4H invalid controller CPU of the target station 13 Write protect error Check the block number device type of the extension file The block number of the specifie
88. dClose only once at the beginning and the end of a user program Repeating opening and closing processes for each communication causes deterioration of communication performance 3 Function execution time at the initial access The MELSEC data link library obtains detailed information of the programmable controller at the initial access to the programmable controller CPU Therefore a longer function execution time is required for the initial function 4 Number of stations for other station accesses When accessing other stations with the user program limit the total number of access stations to 256 or less The communication performance will be deteriorated if the total number of access stations is 257 or more 5 Forcible termination of user program When the user program in which the MELSEC data link library operation is currently running is forcibly terminated the following symptoms may occur The application that is forcibly terminated cannot be ended An error of MELSEC Data Link Library occurs in other application The forcible termination affects other Mitsubishi software packages such as MX Component GX Works2 6 Execution speed The execution speed and the execution interval of the MELSEC data link library function may be extended temporarily by Windows processes or other applications Create programs considering these conditions BuiuueJ80ud ueuw suonneoaJd LZZ DISTIN Buisr ueuw
89. dundant or other safety features which exceed the general specifications of the PRODUCTS are required For details please contact the Mitsubishi representative in your region INTRODUCTION Thank you for purchasing the PC interface board This manual describes the programming procedure and function specifications of the MELSEC data link library Before using this product please read this manual and the related manuals carefully and develop familiarity with the functions and performance of the MELSEC data link library to handle the product correctly Please make sure that the end users read this manual RELATED MANUALS The following are the manuals relevant to this product Refer to the following tables when ordering required manuals 1 Related manuals of CC Link Ver 2 board Manual name Manual number model code Description Type Q80BD J61BT11N Q81BD J61BT11 CC Link System Master Local Interface Board User s Manual For SW1DNC CCBD2 B SH 080527ENG 13JR77 Overview of system configuration specifications functions handling wiring and troubleshooting for type Q80BD J61BT11N Q81BD J61BT11 CC Link system master local interface board MELSEC L CC Link System Master Local Module User s Manual lt SH 080895ENG 13JZ41 gt Overview of system configuration performance specifications functions handling wiring and troubleshooting for L series master local modules MELSEC Q CC Link System Ma
90. e Code specification Device name Decimal Hexadecimal specification Counter setting value sub2 C 18002 4652H DevCS2 Counter setting value sub3 C 18003 4653H DevCS3 Accumulator A 19 0013H DevA Index register 2 8 iin V 21 0015H DevV R 22 0016H DevR File register ZR 220 00DCH DevZR Extended file register 1 ER 22000 to 22256 55F0H to 56F0H DevERO to 256 Link relay B 23 0017H DevB Link register 24 0018u DevW Link special relay SB 25 0019H DevQSB Retentive timer contact ST 26 001AH DevSTT Retentive timer coil ST 27 001BH DevSTC Link special register SW 28 001CH DevQSW Edge relay V 30 001EH DevQV Retentive timer current value ST 35 0023H DevSTN Long index register LZ 38 0026H DevLZ Unit refresh register RD 39 0027H DevRD Long Timer contact LT 41 0029H DevLTT Long Timer coil LT 42 002AH DevLTC Long Timer current value LT 43 002BH DevLTN Long counter contact LC 44 002CH DevLCT Long counter coil LC 45 002DH DevLCC Long counter current value LC 46 002EH DevLCN Long retentive timer contact LST 47 002FH DevSTT Long retentive timer coil LST 48 0030H DevSTC Long retentive timer current value LST 49 0031H DevSTN Link direct device link input Jn x 1001 to 1255 O3E9H to 04E7H DevLX1 to 255 Link direct device link output 1 Jn Y 2001 to 2255 07D1H to O8CFH DevLY1 to 255 Link direct device link relay 3 Jn B 23001 to 23255 59D9H to 5AD7H DevLB1 to 255 Link direct device link register Jn w 24001 to 24255 5DC1 to 5EBFH DevLW1 to 255
91. e block Y Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes Page 126 CHAPTER 6 extended file register which overlaps with the setting areas of the sub2 and sub3 programs gt gt When a double word device LZ LTN LCN or LSTN is specified to devtyp store the data to be written to T data as follows ei a o Example When devtyp is LZ and size is 8 g D o gs Array Value 8 data 0 Lower 1 word of LZO data 1 Upper 1 word of LZO a data 2 Lower 1 word of LZ1 g data 3 Upper 1 word of LZ1 8 m 2 e 2 S gt Related function mdOpen mdClose mdSendEx mdReceive mdReceiveEx 101 2 SEND function lf Function Send data to the specified channel number on the target station L Format Visual C ret mdSend path stno devtyp devno size data short long short short short short short ret Return value path Path of channel stno Station number devtyp Device type devno Channel number size Send byte size data J Send data single precision integer array Visual Basic NET ret mdSend path stno devtyp devno size data 0 Short Integer Short Short Short Short Short ret Return value path Path of channel stno Station number devtyp Device type devno Channel number size Send byte size data n Send data single precision
92. e package cannot be identified with CC Link IE Field Network board use SW1DNC CCIEF B version 1 04E or later 133 Parameter error Reset the board 0085 A parameter set on the board is incorrect Correct the parameter 4096 to 16383 Exit the program and restart the personal computer 1000H to MELSEC data link library internal error Reinstall the software package 3FFFH Consult your local Mitsubishi representative 16384 to 20479 4000H to Error detected by the access target CPU Refer to the user s manual of the access target CPU module 4FFFH 16432 Saves BRE specify a device type described the device type list Check if the device number is validated on the programmable 4030H The specified device type does not exist controller CPU of the target station Device error Check the device number The specified device number is out of the Check the block number device type and the start I O number of 16433 the specified device The start I O number of the specified devices is 4031 Check with the programmable controller CPU on the target invalid The block number of the specified device is invalid station whether the specified device the block number and the start I O number are valid 127 Error Code Error description Corrective action HEX Request data error Check the content of specified reque
93. e reverse loop side 1 Detected 0 Not detected b10 F LOOP RD Display the data reception status on the forward loop side 1 Data are being received 0 Data not received b9 b8 buf 0 R LOOP RD F LOOP SD Display the data reception status on the reverse loop side 1 Data are being received 0 Data not received Display the data sending status on the forward loop side 1 Data are being transmitted 0 Data not transmitted b7 b6 R LOOP SD S MNG Display the data sending status on the reverse loop side 1 Data are being transmitted 0 Data not transmitted Display the station type 1 Operating as a sub control station 0 Other than sub control station b5 MNG Display the station type 1 Operating as a control station 0 Other than control station b4 D LINK Display the data link status cyclic transmission status 1 Data link in operation 0 No data link b3 T PASS Display the baton pass status 1 Baton pass in progress 0 No baton pass b2 PRM E Display the detection status of parameter error 1 Detected 0 Not detected b1 SW E Display the detection status of switch setting error 1 Detected 0 Not detected RUN Display the operating status of board 1 Operating normally 0 Hardware error or Board WDT error ON 1 OFF 0 90 CHAPTER 4 FUNCTIONS Element Bit LED Description Note
94. ead data single precision integer eee data Specify the data to be read in single precision integer array array 72 CHAPTER 4 FUNCTIONS Explanation This function reads data only from the buffer memory of the remote device station on a CC Link IE Field Network Data cannot be read from the buffer memory of an intelligent function module controlled by a CC Link IE Field Network Head module When reading data from an intelligent function module controlled by a CC Link IE Field Network Head module use mdSendEx mdSend function Be sure that the read byte size from offset does not exceed the buffer memory range of the remote device station Failure to do so may cause a timeout error For the buffer memory range of a remote device station refer to the manuals of each remote device station This function is applicable only for 32 bit version user application Y Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes 126 CHAPTER 6 E Related function mdOpen mdClose mdRemBufWriteEx spejeq uogounj uoneis ejoujeJ Jo eyep BuipeeJ xqpeesinguespul op t 73 4 3 11 mdTypeRead reading model names of CPU Lf Function Read a model name codeof the CPU on the target station A Format Visual C ret mdTypeRead path stno buf short long short short ret path
95. ecifications given in the catalogs manuals or technical documents are subject to change without prior notice 139 Microsoft Windows Windows XP Visual Basic Visual C Visual Studio are trademarks or registered trademarks of Microsoft All other company names and product names used in this manual are trademarks or registered trademarks of their respective companies 140 MELSEC Data Link Library Reference Manual MODEL MD FUNC LIB R E RE 13JV25 SH NA 081035ENG F 1406 KWIX MITSUBISHI ELECTRIC CORPORATION HEAD OFFICE TOKYO BUILDING 2 7 3 CHIYODA KU TOKYO 100 8310 JAPAN NAGOYA WORKS 1 14 YADA MINAMI 5 CHOME HIGASHI KU NAGOYA JAPAN When exported from Japan this manual does not require application to the Ministry of Economy Trade and Industry for service transaction permission Specifications subject to change without notice
96. ed 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
97. ed device is stored to the event detail information e 1 is set to the bits that correspond to the condition satisfied device 1is setto the first bit at the condition satisfaction because device points cannot be specified with the CC Link IE Field Network board Ois set to the bits other than the corresponding bits when the device point is less than 64 Event detail information details details O 1stto 16th point 1st point bit15 16th point details 1 17th to 32nd point bitO 17th point bit15 32nd point details 2 33rd to 48th point bit0 33rd point bit15 48th point details 3 49th to 64th point 49th point bit15 64th point 81 JO ere v uogounj QWord device Device values at the condition satisfaction are stored to the event detail information Event detail information details details 0 Device value when the condition is satisfied details 1 details 2 details 3 GRECV function CC Link IE Field Network board The information on received data is stored to the event detail information Event detail information details details 0 Receive channel 1 to 2 details 1 0 details 2 0 details 3 0 When the event does not occur within the timeout time a timeout error is returned as a return value Y Return value Success Return the value 0 Error Return the value other than 0 Refer
98. etected spejeq uogounj Display the error detection status when receiving 1 more than specified number of times continuously or the received data length is too short on b1 R LOOP AB IF the reverse loop side 1 Detected 0 Not detected Display the detection status of data import delay error on the forward loop side 1 Detected 0 Not detected bO F LOOP OVER pyeoq jo uoneuuojui pees 7L v 91 92 CC Link IE Controller Network Element Bit LED Description Note buf O b15 EXT PW Display the external power supply status of CC Link IE Controller Network module with external power supply function 1 External power supply is being supplied 0 External power supply is not supplied ON 1 OFF 0 b7 14 RESERVE b6 RD Display the data reception status 1 Data are being received 0 Data not received b5 D LNK Display the data link status cyclic transmission status 1 Data link in operation 0 No data link b4 PRM Display the detection status of parameter error 1 Detected 0 Not detected b3 ERR Display the error detection status 1 Detected 0 Not detected b2 b1 SD MODE Display the data sending status 1 Data are being transmitted 0 Data not transmitted Display the operating mode 1 Operating in online mode 0 Operating in offline mode
99. eturn the value 0 Error Return the value other than 0 Refer to the list of error codes 5 Page 126 CHAPTER 6 gt Related function mdOpen mdClose mdDevSetEx spejeq uogounj Bumesej xaissi egpui 8 69 4 3 9 mdRemBufWriteEx writing data to buffer memory of remote device station Lf Function Write data to the buffer memory of a target station remote device station of CC Link IE Field Network L Format Visual C ret mdRemBufWriteEx path netno stno offset size data long ret Return value OUT long path Path of channel IN long netno Network number IN long stno Station number IN long offset Offset IN long size Written byte size IN short data MWritten data single precision integer array Visual Basic NET ret mdRemBufWriteEx path netno stno offset size data 0 Integer ret Return value OUT Integer path Path of channel IN Integer netno Network number IN Integer stno Station number IN Integer offset Offset IN Integer size Written byte size IN Short data n Written data single precision integer array IN Argument Description pati Path of channel Specify the path of channel whose communication line is opened Use the path which is returned when executing mdOpen Specify the network number of target station netno Network number em Page 43 Section 4 2 3 Specify the station number
100. evice Read data single precision integer array Number of bytes of read data mdRandREx path netno stno dev 0 buf 0 bufsize Integer Integer Integer Integer Integer Short Integer ret path netno dev n dev n buf n bufsize Return value Path of channel Network number Randomly specified device Randomly selected device Read data single precision integer array Number of bytes of read data Visual Basic 5 0 Visual Basic 6 0 ret mdRandREx path amp netno stno dev 0 buf 0 bufsize Long Long Long Long Long Any Long 62 ret path netno stno dev n buf n bufsize Return value Path of channel Network number Station number Randomly specified device Read data single precision integer array Number of bytes of read data CHAPTER 4 FUNCTIONS Argument Description Specify the path of channel whose communication line is opened path Path of channel nM Use the path which is returned when executing mdOpen Specify the network number of target station netno Network number i Page 43 Section 4 2 3 Specify the station number of target station stno Station number Page 43 Section 4 2 3 Specify the number of blocks the device type the start device number dev Randomly specified device and points of device to be read For details refer to Explanation shown on the next page Store the read data to the array variable
101. evices on the target station for the number of written data bytes from the start device number L Format Visual C ret mdSend path stno devtyp devno size data short long short short short short short Visual Basic NET ret path stno devtyp devno size data Return value Path of channel Station number Device type Start device number MWritten byte size Written data single precision integer array ret mdSend path stno devtyp devno size data 0 Short Integer Short Short Short Short Short ret path stno devtyp devno size data n Return value Path of channel Station number Device type Start device number Written byte size Written data single precision integer array Visual Basic 5 0 Visual Basic 6 0 ret mdSend path amp stno devtyp devno size data 0 Integer Long Integer Integer Integer Integer Integer 100 ret path stno devtyp devno size data n Return value Path of channel Station number Device type Start device number Written byte size Written data single precision integer array IN OUT IN IN OUT IN IN OUT IN CHAPTER 4 FUNCTIONS Argument Description Specify the path of channel whose communication line is opened path Path of channel 2l which i u wi xecuti Use the path which is returned when executing mdOpen pino Eid eee Specify the station number of tar
102. fied channel is executed Station number error The specified station number is incorrect A process that should be requested to other 70 station was requested to the own station or the Check the network number and station number 00461 station number corresponds to the own station When accessing CPU modules other than QCPU Q mode or 255FFH but the network number is not 0 A CPU module other than QCPU Q mode or RCPU is accessed from the 64 bit version user application RCPU use the 32 bit version user application 126 CHAPTER 6 ERROR CODES Error Code ae 1 Error description Corrective action HEX Check the channel number No reception data error when RECV function Check whether the data is sent on the sending station with the Data is not received SEND function 71 With the RECV function of CC Link IE Check if the sent data using the SEND function of 0047H Controller Network board or CC Link IE Field MELSECNET H board exceeds 960 bytes Network board the data over 960 bytes has When the receive station is CC Link IE Controller Network board been received from MELSECNET H restart a personal computer of the receive station Retry the operation There is a possibility of a memory shortage Terminate other 7 Memory reservation error resource memory application s currently running 004Dx shortage error Exit the program and restart the personal compu
103. func vb is not included in the sample program Add Mdfunc vb before using the sample program For the setting method Page 20 Section 2 3 3 2 VB folder Sample program for Visual Basic 5 0 and Visual Basic 6 0 Mdfunc bas is not included in the sample program Add Mdfunc bas before using the sample program For the setting method Page 17 Section 2 3 1 3 VC folder Sample program for the following Visual C e Visual C 5 0 e Visual C 6 0 e Visual 2003 e Visual Studio 2005 Visual C Visual Studio 2008 Visual C e Visual Studio 2010 Visual e Visual Studio 2012 Visual Sample programs are created in VisualC 5 0 project format eBenBue Burwwes6olg z z G pjeog H LANOASTAW 40 sure46o4g ejdues z G Convert the project when using Visual C other than Visual C 5 0 An include file and a library file are not included in the sample program Set an include file and a library file before using the sample program For the setting method Page 18 Section 2 3 2 Page 21 Section 2 3 4 Page 23 Section 2 3 5 121 5 3 Sample Programs for CC Link IE Controller Network Board Sample programs are stored on the user specified folder that is specified when installing the software package to a personal computer e lt User specified folder lt MNETG gt SAMPLES 5 3 1 Description of sample programs 1 Sample Programs for MELSEC data link
104. get station i u Page 41 Section 4 2 2 Specify the type of device to which the data is written devtyp Device type iid vty vice ty lt Page 45 Section 4 2 4 Specify the start device number of device to which the data is written Specify the start device number with a multiple of 8 for the access to a devno Start device number bit device except for LTT LTC LSTT and LSTC Specify the start device number with a multiple of 16 0 16 32 for the access to a bit device RX RY SB of CC Link other station link device Specify the byte size to be written in even number When the specified byte size to be written exceeds the device range size Written byte size 5 size error the applicable size is returned to size When a double word device LZ LTN LCN or LSTN is specified to devtyp specify the size in multiples of 4 Written data data M Specify the data to be written in single precision integer array single precision integer array Explanation When the specified written byte size exceeds the transient transmission size data are divided inside the function and written When accessing another station the extended comment information will be deleted by writing data to the block extended file register to which the extended comment is assigned When accessing another station the sub2 and sub3 programs will be deleted by writing data to th
105. ibrary files for Show directories for and browse the folder containing library files as in 1 on the previous page Mdfunc32 lib is stored in the following directory at installation For creating a 32 bit version user application lt User specified folder COMMON LIB For creating a 64 bit version user application lt User specified folder COMMON lt LIB gt x64 Open the project to create a user application and select Project project Properties Select Configuration Properties Linker Input in the folder area of the Property Pages screen Enter MdFunc32 lib in the Additional Dependencies field 2 3 5 CHAPTER 2 PROGRAMMING Using Visual 2010 Visual C 2012 This section explains the setting operation when using Visual C in Visual Studio 2010 or Visual Studio 2012 The screens of Visual C in Visual Studio 2010 are used for the explanation in this section These screens are slightly different from other Visual Ce 9 1 Setting include files Microsoft Visual Studio View j T T it Solution Explorer Ctri Alt L gj Team Explorer Ctrl Ctri M d Bookmark Window Ctr Ctr Ww Ei Call Hierarchy Ctri Alt K Hg Class View Ctrl Shift C Code Definition Window Ctrl Shift Object Browser Ctrl Ale 3 Error List Ctrl E E Output Alt 2 HB Resource View Ctrl Shift E Start Page 3 amp Toolbox Ctri Alt x Find Results
106. ication Upper byte Lower byte Own station 255 FFH 0 00H Station number 1 01H to 120 78H Other 2 n station ius pen SUI Group Number 1 to 32 129 81H to 160 A0H All stations 240 F0H The logical station number set with the utility 0 00H to 239 EFH ils E 2 3 All stations and group numbers can be specified when using the SEND function mdSend without arrival acknowledgment For specifying another station set a network number in the upper byte of the station number Setting a station number when another station is specified Network number D Station number Upper Lower Access to the control station or master station station number 0 specified with the network number on the network When accessing the control station operating as a control station and the mater station operating as a master station when using the submaster function specify the station number 4 CC Link IE Field Network board Station number Upper byte Specification Lower byte Own station 255 FFH Other station 0 00H to 120 78 Station number Network number 1 01 to 239 EFH 125 7DH 129 81H to 160 A0H Group Number 1 to 3212 All stations 240 F0H The logical station number set with the utility 0 00H to 239 EFH 1 x2 8 4 42 All stations and group numbers c
107. ice station AJ65BT R2 A sample program to perform the initialization transmission and reception of AJ65BT R2 Folder name MasterStation R2 e Communication between a master station and an intelligent device station AJ65BT D75P2 S3 A sample program to perform the initialization positioning origin point return and JOG operation of AJ65BT D75P2 S3 Folder name MasterStation PositioningSystem 118 CHAPTER 5 SAMPLE PROGRAMS 5 1 2 Programming language Sample programs are stored on the following folders for each programming language to be used 1 NETVB folder Sample programs for the following Visual Basic Visual Basic NET 2003 e Visual Studio 2005 Visual Basic e Visual Studio 2008 Visual Basic e Visual Studio 2010 Visual Basic e Visual Studio 2012 Visual Basic Sample programs are created in Visual Basic NET 2003 project format Convert the project when using Visual Basic other than Visual Basic NET 2003 Mdfunc vb is not included in the sample program Add Mdfunc vb before using the sample program For the setting method Page 20 Section 2 3 3 2 VB folder Sample programs for Visual Basic 5 0 and Visual Basic 6 0 Mdfunc bas is not included in the sample program Add Mdfunc bas before using the sample program For the setting method Page 17 Section 2 3 1 3 VC folder Sample programs for the following Visual C e Visual C 5 0 e Visual C 6 0 e Visual
108. ified on the CC Link Ver 2 board 2 MELSECNET H board 1 Station number Specification Upper byte Lower byte Own station 255 FFH 0 00x 4 Station number 1 01H to 120 78H 9 Other Network number A 125 70 station 1 01H to 239 EFH Group number 1 to 32 2 129 81 to 160 A0H All stations 240 F0H The logical station number set with the utility 65 41 to 239 EFH 1 stations and group numbers can be specified when using the SEND function mdSend without arrival acknowledgment 2 For MELSECNET 10 mode only group numbers from 1 to 9 129 81 to 137 89 can be specified 3 For specifying another station set a network number in the upper byte of the station number Setting a station number when another station is specified Network number D Station number Upper Lower sjequunu Bulfyiosds zzv suoneouimeds UOWWOD zv 4 Access to the control station or master station station number 0 specified with the network number on the network When accessing the control station operating as a control station and the mater station operating as a master station when using the submaster function specify the station number 5b Station numbers from 65 41 to 120 78H can be specified when using CC Link IE Controller Network 41 3 CC Link IE Controller Network board Station number Specif
109. ing Visual C other than Visual 2003 An include file and a library file are not included in the sample program Set an include file and a library file before using the sample program For the setting method Page 21 Section 2 3 4 Page 23 Section 2 3 5 eBenBue ZG pueog WOMEN PI 21 1 2 40 8 ejdures 125 CHAPTER 6 ERROR The following table shows the errors and the corrective actions that correspond to the error code When an error whose error code is not described in the following table occurs consult your local Mitsubishi representative Error Code HEX 1 Error description Driver not started Corrective action Check the channel number Check the driver operating condition with Device Manager Check the error of event viewer 0001 The driver is not started Check the board settings Reinstall the software package Check the status of the network operation status of the access Time out error x station s and mounting condition of the module s Timeout during waiting for the response of N HE Check the mounting condition of the board Check the Target Setting of the utility A CPU module other than QCPU Q mode or Fit Check the Transient Timeout Monitoring Time of the utility RCPU is accessed from the 64 bit version user Retry the opera
110. integer array Visual Basic 5 0 Visual Basic 6 0 ret mdSend path amp stno devtyp devno size data 0 Integer Long Integer Integer Integer Integer Any 102 ret Return value path Path of channel stno Station number devtyp Device type devno Channel number size Send byte size data n Send data single precision integer array IN OUT IN IN OUT IN IN OUT IN CHAPTER 4 FUNCTIONS Argument Description Specify the path of channel whose communication line is opened path Path of channel Use the path which is returned when executing mdOpen Specify the station number of target station stno Station number gt Page 41 Section 4 2 2 Logical station numbers cannot be specified Specify whether to send data with arrival acknowledgment or without arrival acknowledgment devtyp Device type With arrival acknowledgment Specify 101 65H Without arrival acknowledgment Specify 102 66H Specify a channel used by the own station and a target station channel devno Channel number For details of specifying the channels refer to Explanation shown below Specify the byte size of send data in even number Specify the byte size within the range of 2 to 1920 When receiving the data which are transmitted by MELSECNET H size Send byte size board with CC Link IE Controller Network board or CC Link IE Controller Network board specify within the range of 2 to 9
111. ision integer array Explanation When the specified written byte size exceeds the transient transmission size data are divided inside the function and written When accessing another station the extended comment information will be deleted by writing data to the block extended file register to which the extended comment is assigned When accessing another station the sub2 and sub3 programs will be deleted by writing data to the block extended file register which overlaps with the setting areas of the sub2 and sub3 programs When a double word device LZ LTN LCN or LSTN is specified to devtyp store the data to be written to data as follows Example When devtyp is LZ and size is 8 Array Value data 0 Lower 1 word of LZO data 1 Upper 1 word of LZO data 2 Lower 1 word of LZ1 data 3 Upper 1 word of LZ1 Y Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes Page 126 CHAPTER 6 gt Related function mdOpen mdClose mdSend mdReceive mdReceiveEx 52 CHAPTER 4 FUNCTIONS 2 SEND function Lf Function Send data to the specified channel number of the target station L Format Visual C mdSendEx path netno stno devtyp devno size data long ret Return value OUT long path Path of channel IN long netno Network number IN long stno Station number IN long dev
112. ith arrival acknowledgment or without arrival acknowledgment devtyp Device type T With arrival acknowledgment Specify 101 65 Without arrival acknowledgment Specify 102 66 Specify a channel used by the own station and a target station channel For details of specifying the channels refer to Explanation shown below devno Channel number Specify the byte size of send data in even number Specify the byte size within the range of 2 to 1920 When accessing via MELSECNET 10 network specify the byte size within the range of 2 to 960 size Send byte size Send data 7 m VP data AT Specify the data to be written in single precision integer array single precision integer array 1 Do not specify all stations or group numbers for the station number when sending data with arrival acknowledgment C Explanation This function supports the SEND instruction of the link dedicated instruction For details of the functions refer to the manuals of each board The following explains how to specify the channel numbers 4 bytes o Target station channel Channel number 3 2 1 0 I Channel used by the own station Item Description Specify a target station channel target station channel MELSECNET H board CC Link IE Controller Network board 1to8 CC Link IE Field Network board 1to2 Specify a channel used by the own station channel used by the CC Li
113. lay B Batch Random Link register Batch Random 1 Cannot be accessed from CC Link IE Field Network board 35 Salas y Jo 0 sse2oy e qisseoov 3 3 4 3 3 5 36 IE Field remote device station Access to Ethernet adapter module Head module and CC Link The following table shows the accessible Ethernet adapter module Head module and CC Link IE Field remote device station via CC Link and CC Link IE Field Network Accessible X Not accessible Access target CC Link IE Field Device Access type Ethernet adapter 3 Head module remote device module station Input X Batch Random x Output Y Batch Random x Special relay SM Batch Random Special register SD Batch Random Link register Batch Random x Link special relay SB Batch Random x Link special register SW Batch Random O x Intelligent function module device Buffer memory Un G Batch Random x o1 Intelligent function module access device 1 When accessing via CC Link IE Field Network the buffer memory can be accessed only by the mdRemBufWriteEx function or the mdRemBufReadEx function Access to other station buffer memory of CC Link The following table shows the accessible buffer memory of CC Link network module and CC LinkVer 2 board The m
114. library The following sample programs are stored as examples of functions a Reading device data A sample program for reading device DO of network number 1 and station number 1 Folder name folder for programming language DEMO b Testing MELSEC data link library in general A sample program for the MELSEC data link library in general Folder name folder for programming language MTEST 1 sample programs for Visual Studio 2012 Visual Basic are stored in MTEST2 folder Point Sample programs for MTEST folder of NETVB This sample program cannot be used as a 64 bit version user application In order to use this sample program on a 64 bit version operating system select x86 for Target CPU and build the program as a 32 bit version user application MSFlexGrid is used in the sample program If MSFlexGrid is not installed a warning occurs however the operation of sample program is not affected Sample programs for MTEST2 folder of NETVB This sample program cannot be used as 64 bit version user application In order to use this sample program on a 64 bit version operating system select x86 for Target CPU and build the program as a 32 bit version user application warning occurs because a controller created by the Visual basic 6 0 is used for this sample program However there is no effect for the operation of the sample program 122 CHAPTER 5 SAMPLE PROGRAMS 5 3 2 Programming lang
115. ls F000H FFFFF000H Check the target station number and perform the operation 2174 Transient data target station number error uain in F782H The target station number is incorrect 9 If the error occurs after performing the above corrective action FFFFF782H The target station number is 0 NUN please consult your local Mitsubishi representative 4097 EFFFH FFFFEFFFH a Errors detected in the CC Link IE Controller Refer to the CC Link IE Controller Network System Reference network system Manuals 8192 E000H FFFFEO000H 130 CHAPTER 6 ERROR CODES version user application to a CPU module other than QCPU Q mode or RCPU module Error Code ae 1 Error description Corrective action HEX 7656 E218H Check the target station number and perform the operation Transient data target station number error FFFFE218H again 4 e The target station number is incorrect 7672 If the error occurs after performing the above corrective action The target station number is 0 i 208 please consult your local Mitsubishi representative FFFFE208H 8193 DFFFH FFFFDFFFH io Errors detected in the CC Link IE Field network Refer to the CC Link IE Field Network Board and CC Link IE 12288 System Field Network Master Local Module User s Manual 0000 FFFFDO00n 4
116. lues of LCN100 and LCN101 LCN100 is Ox1 and LCN101 is 0x10000 Randomly specified devices dev dev 0 1 One specified range LCN100 to LCN101 dev 1 DevLCN dev 2 100 dev 3 2 2 points LCN100 to LCN101 LCN100 and later Number of bytes of read data bufsize Specify the number of bytes of array variable buf which stores the read data buf 1 to buf 4 4 x 2 8 bytes Enter 8 for this example Read data buf buf 0 0x1 Lower 1 word of LCN100 buf 1 0x0 Upper 1 word of LCN100 buf 2 0x0 Lower 1 word of LCN101 buf 3 Ox1 770008 Upper 1 word of LCN101 Y Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes 1C 126 CHAPTER 6 E Related function mdOpen mdClose mdRandW 114 4 3 25 mdDevSet setting bit devices lf Function Set the bit devices on the target station to ON L Format Visual ret mdDevSet path stno devtyp devno CHAPTER 4 FUNCTIONS short ret Return value OUT long path Path of channel IN short stno Station number IN short devtyp Device type IN short devno Specified device number IN Visual Basic NET ret mdDevSet path stno devtyp devno Short ret Return value OUT Integer path Path of channel IN Short stno Station number IN Short devtyp Device type IN Short devno Specified device number IN Visual Basic 5 0 Visual Basic 6 0 ret mdDevSe
117. mation to see whether you need an x86 32 bit or x64 64 bit version of the program and then contact the software publisher 9 Service applications The MELSEC data link library cannot be accessed from Windows Service applications Access the MELSEC data link library from a user application 10 Board reset When executing the mdBdRst function or mdBdModSet function using a user program the board rest process of each function completes at the time when the value is returned Create a program which checks the returned value of the function 11 SAFESEH Image has Safe Exception Handlers Do not use SAFESEH Image has Safe Exception Handlers option The project cannot be built normally 12 Influence of operating system and other applications When the system resource of the operating system is insufficient due to the automatic start of the update program of the operating system or other applications or the devices are accessed from other applications Board Driver I F error 102 0066H may occur during executing a MELSEC data link library function Take the following measures as necessary Retry process of a MELSEC data link library function Disable the automatic update of the operating system and other applications Stop other applications 14 CHAPTER 2 PROGRAMMING 2 2 2 Precautions when accessing own station link devices and other station s programmable controller devices It is necessary to establish an in
118. mber IN Long size Written byte size IN OUT Any data n Written data single precision integer array IN 51 Argument Description Specify the path of channel whose communication line is opened path Path of channel which i u wi xecuti Use the path which is returned when executing mdOpen ree een iret er Specify the network number of target station Wi u E Page 43 Section 4 2 3 rer Stationn rber Specify the station number of target station i u E Page 43 Section 4 2 3 Specify the type of device to which the data is written devtyp Device type iud m vty vice ty C Page 45 Section 4 2 4 Specify the start device number of device to which the data is written Specify the start device number with a multiple of 8 for the access to a devno Start device number bit device except for LTT LTC LSTT and LSTC Specify the start device number with a multiple of 16 0 16 32 for the access to a bit device RX RY SB of CC Link other station link device Specify the byte size to be written in even number When the specified byte size to be written exceeds the device range size Written byte size 5 size error the applicable size is returned to size When a double word device LZ LTN LCN or LSTN is specified to devtyp specify the size in multiples of 4 Written data E data MD Specify the data to be written in single precision integer array single prec
119. mming and troubleshooting for MELSEC L series CC Link IE Field Network master local modules MELSEC L CC Link IE Field Network Head Module User s Manual lt SH 080919ENG 13JZ48 gt Overview of specifications procedures before operation system configuration installation wiring settings and troubleshooting for head module CC Link IE Field Network Ethernet Adapter Module User s Manual lt SH 080939ENG 13JZ50 gt Overview of specifications procedures before operation system configuration installation wiring settings and troubleshooting for Ethernet adapter module User s manuals of each type of boards are stored on the CD ROM of the software package in a PDF file format Manuals in printed form are sold separately for a single purchase Order a manual by quoting the manual number model code listed in the above table Memo CONTENTS SAEEDWSBREGAUTIONSTSUCRC TETUER 1 COND li GO NN STO RWS Est IO ID UL GTP 2 P I E 3 MAN WALES rests ce sete wr Tc T 3 HOW TOIREADTHISIMANUAL EE E uc 9 STEERS epee ese ea on eee ee ane ey M 10 CHAPTER 1 OVERVIEW 11 1 4 MELSEGC Data Link Libraty peer e See dn ee pee ar 11 12 SupportedBoards ios stes hee dA odd A cea d des 11 CHAPTER 2 PROGRAMMING 12 2 14 Programming 12 2 2 Precautions when Using MELSEC Data Link
120. mmunication line x 5 Page 40 Section 4 2 1 3 mode Dummy Specify 1 3 path Opened line path pointer Return the opened line path 2 5 o Explanation A path of the channel used for argument of another function is returned to the opened line path pointer When using multiple communication lines opening for each channel number is necessary Y Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes 5 Page 126 CHAPTER 6 C gt Related function mdClose 49 4 3 2 mdClose closing communication lines Lf Function Close a communication line by specifying a communication line path A Format Visual C ret mdClose path short ret Return value OUT long path Path of channel IN Visual Basic NET ret mdClose path Short ret Return value OUT Integer path Path of channel IN Visual Basic 5 0 Visual Basic 6 0 ret mdClose path amp Integer ret Return value OUT Long path Path of channel IN Argument Description path Path of channel Specify the path of channel whose communication line is opened Use the path which is returned when executing mdOpen C Explanation When using multiple communication lines they need to be closed for each channel number Y Return value Success Return the value O Error Return the value other than 0 Refer to the list of error codes 5 126
121. nditions are not satisfied the processing of writing reading data to from the CC Link IE Field Network board ends normally b Other station transient access remote operation and device access of other station s programmable controller CPU While the access is validated for the devices which check the link device accesses the other station transient access can be performed when the bits of the handshake status in accessed station the bits in the accessed station correspond to SWAO to A7 read from the own station and the bits of the data link status the bits in the accessed station correspond to SWBO to B7 read from the own station are OFF normal communication CHAPTER 2 PROGRAMMING 2 3 Settings for Using Functions This section explains how to set the development tool to use the MELSEC data link library functions For programming languages supported by boards refer to the user s manual corresponds to the board IS Page 3 RELATED MANUALS Point mE To create 64 bit version user application a project needs to be configured to set the 64 bit platform as a target platform For configuring a project and setting a target platform refer to Help How to Configure Projects to Target Platforms in Visual Studio When creating 64 bit version user programs using Visual Basic NET Framework 4 0 or NET Framework compatible with NET Framework 4 0 is required Use Visual
122. ng devices lf Function Batch read data from the devices on the target station for the number of read data bytes from the start device number L Format Visual C ret mdReceive path stno devtyp devno size data short long short short short short short Visual Basic NET ret path stno devtyp devno size data J Return value Path of channel Station number Device type Start device number Read byte size Read data single precision integer array ret mdReceive path stno devtyp devno size data 0 Short Integer Short Short Short Short Short ret path stno devtyp devno size data n Return value Path of channel Station number Device type Start device number Read byte size Read data single precision integer array Visual Basic 5 0 Visual Basic 6 0 ret mdReceive path amp stno devtyp devno size data 0 Integer Long Integer Integer Integer Integer Integer 104 ret path stno devtyp devno size data n Return value Path of channel Station number Device type Start device number Read byte size Read data single precision integer array IN OUT OUT IN OUT OUT IN OUT OUT CHAPTER 4 FUNCTIONS Argument Description Specify the path of channel whose communication line is opened path Path of channel 2l Use the path which is returned when executing mdOpen Specify the station
123. nk IE Controller Network board 1to8 own station 6 CC Link IE Field Network board 1to2 Y Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes 5 126 CHAPTER 6 D Related function mdOpen mdClose mdSend mdReceive mdReceiveEx 54 CHAPTER 4 FUNCTIONS 4 3 4 mdReceiveEx batch reading extended devices RECV function 1 Batch reading extended devices LY Function Batch read data from the devices on the target station for the number of read data bytes from the start device number L Format Visual C ret mdReceiveEx path netno stno devtyp devno size data long ret Return value OUT long path Path of channel IN long netno Network number IN long stno Station number IN long devtyp Device type IN long devno Start device number IN long size Read byte size IN OUT short data J Read data single precision integer array OUT Visual Basic NET ret mdReceiveEx path netno stno devtyp devno size data 0 m T Integer ret Return value OUT S Integer path Path of channel IN 5 Integer netno Network number IN Integer stno Station number IN Integer devtyp Device type IN Integer devno Start device number IN Integer size Read byte size IN OUT Short data n Read data single precision integer array OUT Visual Basic 5 0 Visual Basic 6 0 ret mdReceiveEx path amp ne
124. nnel IN short stno Station number IN short buf Command code IN Visual Basic NET ret mdControl path stno buf Short ret Return value OUT Integer path Path of channel IN Short stno Station number IN Short buf Command code IN Visual Basic 5 0 Visual Basic 6 0 ret mdControl path amp stno buf Integer ret Return value OUT Long path Path of channel IN Integer stno Station number IN Integer buf Command code IN Argument Description path Path of channel Specify the path of channel whose communication line is opened Use the path which is returned when executing mdOpen stno Station number Specify the station number of target station I Page 41 Section 4 2 2 Specify the command code remote RUN STOP PAUSE for remote buf C d cod operation of CPU For details refer to Explanation shown below Explanation The following table shows the command codes and the corresponding descriptions Command code Description 0 Remote RUN 1 Remote STOP 2 Remote PAUSE Y Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes 15 Page 126 CHAPTER 6 gt Related function mdOpen mdClose 79 ASNVd dOLS NNY spejeq uogounj 4 3 13 mawaitBdEvent waiting for event occurrence Lf Function Wait an occurrence of event until the time out A
125. nsient request was transmitted to the station Specify the station number for the intelligent device station FFFFB774H that is not an intelligent device station Check the device type Processing code error f Check the request destination station number and the processing A processing code that cannot be processed by 25056 the request destination station was set QUPD Do not execute the function other than mdTypeRead to the other 9E20H Request destination link module check station board FFFF9E20H The process was requested with a 64 bit When accessing a CPU module other than QCPU Q mode or RCPU module use 32 bit version user application 131 Error Code Error description Corrective action HEX Reset error 26334 Reset was executed by another task that uses the same channel when accessing to the own 9922 Retry the operation station or the other station FFFF9922H Reset was executed when monitoring with the utility Routing request error on routing function 26336 unsupported station 9920H A routing to another loop was requested to the Check the Routing Parameter Setting FFFF9920H station which does not support the routing function 28140 Incorrect mode setting error 9214 An incorrect mode was specified when setting the Check the mode FFFF9214H mode 28141 System sleep error Exit the program and
126. nt Sample programs for MTEST folder of NetVB This sample program cannot be used as a 64 bit version user application In order to use this sample program on a 64 bit version operating system select x86 for Target CPU and build the program as a 32 bit version user application MSFlexGrid is used in the sample program If MSFlexGrid is not installed a warning occurs however the operation of sample program is not affected Sample programs for MTEST2 folder of NETVB This sample program cannot be used as a 64 bit version user application In order to use this sample program on a 64 bit version operating system select x86 for Target CPU and build the program as a 32 bit version user application A warning occurs because a controller created by the Visual basic 6 0 is used for this sample program However there is no effect for the operation of the sample program 120 CHAPTER 5 SAMPLE PROGRAMS 5 2 2 Programming language Sample programs are stored on the following folders for each programming language to be used 1 NetVb folder Sample programs for the following Visual Basic Visual Basic NET 2003 e Visual Studio 2005 Visual Basic e Visual Studio 2008 Visual Basic e Visual Studio 2010 Visual Basic e Visual Studio 2012 Visual Basic Sample programs are created in Visual Basic NET 2003 project format Convert the project when using Visual Basic other than Visual Basic NET 2003 Md
127. nterface Board User s Manual For SW1DNC MNETG B SH 080691ENG 13JZ02 gt Overview of system configuration specifications functions handling wiring and troubleshooting for CC Link IE Controller Network interface board MELSEC Q CC Link IE Controller Network Reference Manual lt SH 080668ENG 13JV16 Overview of system configuration performance specifications functions handling wiring and troubleshooting for CC Link IE Controller Network 4 Related manuals of CC Link IE Field Network board Manual name Manual number model code Description CC Link IE Field Network Interface Board User s Manual For SW1DNC CCIEF B lt SH 080980ENG 13JZ58 gt Overview of system configuration specifications functions handling wiring and troubleshooting for CC Link IE Field Network interface board MELSEC Q CC Link IE Field Network Master Local Module User s Manual lt SH 080917ENG 13JZ47 gt Overview of CC Link IE Field Network and specifications procedures before operation system configuration installation wiring settings functions programming and troubleshooting for MELSEC Q series CC Link IE Field Network master local module MELSEC L CC Link IE Field Network Master Local Module User s Manual lt SH 080972ENG 13JZ54 gt Overview of the CC Link IE Field Network and specifications procedures before operation system configuration installation wiring settings functions progra
128. o devtyp devno Short ret Return value OUT Integer path Path of channel IN Short stno Station number IN Short devtyp Device type IN Short devno Specified device number IN Visual Basic 5 0 Visual Basic 6 0 ret mdDevRst path amp stno devtyp devno Integer ret Return value OUT Long path Path of channel IN Integer stno Station number IN Integer devtyp Device type IN Integer devno Specified device number IN Argument Description Specify the path of channel whose communication line is opened path Path of channel 2l Use the path which is returned when executing mdOpen stno Station number Specify the station number of target station 41 Section 4 2 2 Specify the type of device to be reset OFF devtyp Device type oe Page 45 Section 4 2 4 devno Specified device number Specify the device number of device to be reset OFF Explanation This function is a dedicated function for bit devices such as link relays B and internal relays M Y Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes 126 CHAPTER 6 D Related function mdOpen mdClose mdDevSet 116 CHAPTER 5 SAMPLE PROGRAMS CHAPTER 5 SAMPLE PROGRAMS This chapter explains the sample programs that are included on the CD ROM of the software package Sample programs are provided as a reference for creating
129. of target station stno Station number RAM E Page 43 Section 4 2 3 Specify the start address of the remote device station buffer memory to be offset Offset written size Written byte size Specify the byte size to be written in even number 2 to 480 Written data single precision integer LA sg ES data Specify the data to be written in single precision integer array array 70 CHAPTER 4 FUNCTIONS Explanation This function writes data only to the buffer memory of the remote device station on a CC Link IE Field Network Data cannot be written to the buffer memory of an intelligent function module controlled by a CC Link IE Field Network Head module When writing data to an intelligent function module controlled by a CC Link IE Field Network Head module use mdSendEx mdSend function Be sure that the write byte size from offset does not exceed the buffer memory range of the remote device station Failure to do so may cause a timeout error For the buffer memory range of a remote device station refer to the manuals of each remote device station This function is applicable only for 32 bit version user application Y Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes Page 126 CHAPTER 6 E Related function mdOpen mdClose mdRemBufReadEx spejeq uogounj uoneis s ynq eye
130. on handshaking status SB47 and own station data link status SB49 are OFF normal communication and the bit of the own station module status SB20 is OFF normal communication However even if the above conditions are not satisfied the processing of writing reading data to from the CC Jeujo uonejs ZZ Link IE Controller Network board ends normally b Other station transient access remote operation and device access of other station s programmable controller CPU While the access is validated for the devices which check the link device accesses the other station transient access can be performed when the bits of the handshake status in accessed station the bits in the accessed station correspond to SWAO to A7 read from the own station and the bits of the data link status the bits in the accessed station correspond to SWBO to B7 read from the own station are OFF normal communication DISTIN Busy ueuw zz 15 16 3 CC Link IE Field Network a Accessing to own station link devices RX RY RW Writing reading data to from the own station link devices are validated only when the bits of the own station handshaking status SB47 and own station data link status SB49 are OFF normal communication However even if the above co
131. ose error Retry the operation The communication cannot be closed Exit the program and restart the personal computer FFFFFFD6H 43 ROM operation error FFD5H A TC setting value was written to the CPU during Change the TC setting value during RAM operation FFFFFFD5H ROM operation 61 Number of events error The number of events which is specified in the a FFC3H Check the number of events that sets the user application to wait mdWaitBdEvent function to set the user FFFFFFC3H 129 Error Code Error description Corrective action HEX 62 Event number error The event number which is specified in the M 2 Check the event number that sets the user application to wait mdWaitBdEvent function to set the user FFFFFFC2n PES x application to wait is out of the range 63 Event number overlapped registration error 1 The event number which is specified in the Specify the event numbers that set the user application to wait mdWaitBdEvent function to set the user not to overlap FFFFFFC1H LU application to wait is overlapped 64 Timeout time error FFCOH The timeout time specified in the mdWaitBdEvent Check the time out value FFFFFFCOH function is out of the range 65 ipai Event wait time out error FFBFH T Retry the operation The event did not occur within the timeout time FFFFFFBFH 66 Event initialization error
132. p x3eiuunguespul eev 171 4 3 10 mdRemBufReadEx reading data from buffer memory of remote device station Lf Function Read data from the buffer memory of a target station remote device station of CC Link IE Field Network L Format Visual C ret mdRemBufReadEx path netno stno offset size data long ret Return value OUT long path Path of channel IN long netno Network number IN long stno Station number IN long offset Offset IN long size Read byte size IN short data Read data single precision integer array OUT Visual Basic NET ret mdRemBufReadEx path netno stno offset size data 0 Integer ret Return value OUT Integer path Path of channel IN Integer netno Network number IN Integer stno Station number IN Integer offset Offset IN Integer size Read byte size IN Short data n Read data single precision integer array OUT Argument Description path Path of channel Specify the path of channel whose communication line is opened Use the path which is returned when executing mdOpen Specify the network number of target station netno Network number NN E Page 43 Section 4 2 3 Specify the station number of target station stno Station number M E Page 43 Section 4 2 3 Specify the start address of the remote device station buffer memory to be offset Offset read size Read byte size Specify the byte size to be read in even number 2 to 480 R
133. pecified is within 1 to 32767 The following shows an example when writing data to multiple devices Example When all bits of M100 to M115 are set to OFF and 10 200 300 and 400 are written to D10 D11 D12 and D13 respectively spejeq uogounj Randomly specified devices dev Two specified ranges M100 to M115 D10 to D13 dev 1 DevM dev 2 100 dev 3 16 16 points M100 to M115 dev 4 DevD dev 5 10 dev 6 4 4 points D10 to D13 M100 and later Ajuijopuei Buyum Mpuespul ez v 010 and later Written data buf buf 0 70 All bits are OFF buf 1 10 Stores 10 to D10 buf 2 200 Stores 11 to D200 buf 3 300 Stores 12 to D300 buf 4 400 Stores 13 to D400 109 The following shows an example when writing data to one of the double word devices LZ LTN LCN or LSTN Example When writing Ox1 to LCN100 and 0x10000 to LCN101 Randomly specified devices dev dev 0 1 One specified range LCN100 to LCN101 dev 1 DevLCN dev 2 100 dev 3 2 2 points LCN100 to LCN101 LCN100 and later Written data buf buf 0 0x1 Lower 1 word of LCN100 buf 1 0x0 Upper 1 word of LCN100 buf 2 0x0 Lower 1 word of LCN101 buf 3 0x1 Upper 1 word of LCN101 Y Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes 1C Page 126 CHAPTER 6 D Related function mdOpen mdClose mdRandR 110
134. programmable controller CPU Page 74 Section 4 3 11 R t ti f bl troll macontrol emote operation of programmable controller _ Page 79 Section 4 3 12 CPU RUN STOP PAUSE mdWaitBdEvent Waits for an event occurrence Page 80 Section 4 3 13 mdBdRst Resets the board Page 83 Section 4 3 14 mdBdModSet Sets the mode of the board Page 84 Section 4 3 15 mdBdModRead Reads the mode of the board Page 86 Section 4 3 16 mdBdLedRead Reads the LED information of the board Page 88 Section 4 3 17 mdBdSwRead Reads the switch status of the board Page 94 Section 4 3 18 mdBdVerRead Reads the version information of the board Page 96 Section 4 3 19 Initializes programmable controller information mdlnit Page 99 Section 4 3 20 table CHAPTER 4 FUNCTIONS 1 Applicable to CC Link IE Controller Network boards and CC Link IE Field Network boards 2 Supported by the 1 08J or later version of CC Link IE Controller Network board 3 A function in which the access range is extended according to the extension of the device points at the access target It is accessible to all device numbers Use extended functions when creating a new program 4 Applicable to CC Link IE Field Network boards 5 functions can be used for CC Link IE Field Network board with a serial number whose first five digits are 15102 or higher and SW1DNC CCIEF B Ver 1 06G or later 6 Applicable only for 32 bit version use
135. r application 2 List of conventional compatible functions Conventional compatible functions are functions used for programs created conventionally Function name Description Remarks Reference Batch writes devices mdSend Page 100 Section 4 3 21 Sends data SEND function Batch reads devices mdReceive Page 104 Section 4 3 22 Receives data RECV function 12 mdRandW Writes devices randomly Page 108 Section 4 3 23 mdRandR Reads devices randomly Page 111 Section 4 3 24 mdDevSet Sets a bit device Page 115 Section 4 3 25 mdDevRst Resets a bit device Page 116 Section 4 3 26 1 Applicable to MELSECNET H boards CC Link IE Controller Network boards and CC Link IE Field Network boards 2 Supported by the 1 08J or later version of CC Link IE Controller Network board Point When using the conventional compatible functions the accessible device numbers are from 0 to 32767 suogounj Jo 1917 39 4 2 4 2 1 Common Specifications of Functions This section explains the definitions of arguments commonly used with the MELSEC data link library functions Specifying channel number The following table shows the channels used with the MELSEC data link library Channel ANF Channel name Description number 51 MELSECNET H 1 slot 52 MELSECNET H 2 slot MELSECNET H board 53 M
136. restart the personal computer 9213 Entering sleep mode hibernation mode or fast Change the setting of the power option to prevent the system FFFF9213H startup was detected from entering sleep mode hibernation mode or fast startup 28142 Mode error Check if the parameters are set 9212H A request which cannot be used in the currently Check the currently set mode FFFF9212H set mode was executed Check the system log of event viewer and take a corrective 28143 action on the registered error 9211 Exit the program and restart the personal computer FFFF9211H Take anti noise measures for a personal computer Put the connector in and out after turning off the personal Hardware self diagnosis error computer An error was detected by the hardware self Check the mounting condition of the board 28144 diagnosis A personal computer error is suspected if the board operates 92104 normally on other personal computers Repair or replace the ersonal computer FFFF9210H P pu When the same error occurs on other personal computers replace the board Consult your local Mitsubishi representative Data link disconnected device access error Check the specified device start number and size or the device 28150 An access was attempted to the device ranges of range of the parameter on the master station 920 own station devices RX RY RWw RWr which f ae The data w
137. rite read function can be performed even when this error FFFF920AH assigned to the data link interrupted station or the BN occurs but the function of the data security is not guaranteed reserved station Check for errors in the target station and on the programmable 28151 controller CPU in the target station If they are normal request a Abnormal data reception error 9209 process again An incorrect response data was received FFFF9209H Check the network status by referring to the manuals of each product Driver WDT error Driver WDT error is occurring Reset the board A driver WDT error may occur from the temporary Restart the personal computer 28158 system overload by the following factors Remove the factor of system overload 9202H e Windows activation process when starting the Clear Use driver WDT function with the utility to disable WDT FFFF9202H personal computer Or extend the Driver WDT monitoring time Operation of a device driver such as a graphic board Operation of other software applications By changing the graphic board an environment in which a driver WDT error does not occur may be created 132 CHAPTER 6 ERROR CODES Error Code er 1 Error description Corrective action HEX Channel busy dedicated instruction error 7 28622 Wait for a little while and retry it The channel specified for Channel used by the 9032 i
138. rm for Q80BD J71GP21 SX Q80BD J71GP21S SX Q81BD J71GP21 SX and Q81BD J71GP21S SX CC Link IE Controller Network interface board CC Link IE Field Network board Generic term for Q80BD J71GF11 T2 and Q81BD J71GF11 T2 CC Link IE Field Network interface board GX Developer Generic product name for SW8D5C GPPW E SW8D5C GPPW EA SW8D5C GPPW EV and SW8D5C GPPW EVA GX Works2 Generic product name for SWnDNC GXW2 E and SWnDNC GXW2 EA n version MX Component 10 Generic product name for SWnD5C ACT E and SWnD5C ACT EA n version CHAPTER 1 OVERVIEW CHAPTER 1 overview This chapter explains overview of the MELSEC data link library 1 1 MELSEC Data Link Library MELSEC data link library is a library used to access own station link devices of the board and device memory of other station s programmable controller CPU which uses the board With the MELSEC data link library programs to access devices or device memories can be created easily without concern for communication routes 1 2 Supported Boards The following table shows the boards supported by the MELSEC data link library Board Model Name CC Link Ver 2 board Q80BD J61BT11N Q81BD J61BT11 Q80BD J71LP21 25 Q81BD J71LP21 25 Q80BD J71LP21S 25 Q80BD J71LP21G Q80BD J71LP21GE Q80BD J71BR11 Q80BD J71GP21 SX Q80BD J71GP21S Sx Q81BD J71GP21 SX Q81BD J71GP21S SX CC Link IE Field Network board Q80BD J71GF11 T2 Q81BD J71GF11 T2 MELSE
139. s additional tems to add to the Ink command Ine Le kernel32 hb E Additional Dependencies MdFunc32 lib Inherited values kernel32 lib user32 lib gdi32 lib winspool lib comdlg32 lib Inherit from parent or project defaults 9 Select Additional Dependencies Click and select lt Edit gt 10 On the Additional Dependencies screen enter MdFunc32 lib 27 ZLOZ O IENSIA 0L0Z O IenstA Bust g e z suonoun Burs 104 sPumes ez When SAFESEH Image has Safe Exception Handlers option is set to the linker option the project cannot be built normally For Visual Studio 2012 Visual C delete the SAFESEH option following the procedure shown below because it is set as a default The screens of Visual Studio 2012 Visual C are used for the explanation in this section These screens are slightly different from other Visual C48 CAD DU CTUM xu 1 Open the project to create a user application and select Kl Solution Explorer Ctrl Alt L View Property Manager 1 Team Explorer Ctrl Ctrl M gt SQL Server Object Explorer Ctrl Ctrl S remm eem GIU 1 The menu configuration may differ depending on the Call Hierarchy CtrlealteK development setting or customized setting 4 Class View Ctrl Shift C El Code Definition Window Ctrl Shift V EZ Object Browser Ctrl Alt d Error List Ctrl Ke Output Al
140. seoov uonounj AO3 uoun ANAS 5 9292 966 37 CHAPTER 4 Functions 4 1 38 This chapter explains the MELSEC data link library functions List of Functions The following table shows the list of the functions in the MELSEC data link library that is provided with the software package 1 List of the functions Function name Description Remarks Reference mdOpen Opens a communication line Page 49 Section 4 3 1 mdClose Closes a communication line Page 50 Section 4 3 2 Batch writes devices Extended mdSendEx EE Page 51 Section 4 3 3 Sends data SEND function 12 function Batch reads devices Extended mdReceiveEx a Eu Page 55 Section 4 3 4 Receives data RECV function 12 function Extended mdRandWEx Writes devices randomly Page 59 Section 4 3 5 function Extended mdRandREx Reads devices randomly Page 62 Section 4 3 6 function Extended mdDevSetEx Sets a bit device Page 66 Section 4 3 7 function Extended mdDevRstEx Resets a bit device 3 Page 68 Section 4 3 8 function Writes data to the buffer memory of a remote Extended mdRemBufWriteEx 4 5 6 m Page 70 Section 4 3 9 device station 5 function Reads data from the buffer memory of a remote Extended mdRemBufReadEx 14 5 6 m Page 72 Section 4 3 10 device station 4 5 function mdTypeRead Reads the type of
141. series module 0 0 0 0 eee 35 3 3 4 Access to Ethernet adapter module Head module and CC Link IE Field remote device Station 4 dno woe ee eee TE En S 36 3 3 5 Access to other station buffer memory of 36 3 3 6 Access using the SEND function or the RECV function 37 CHAPTER 4 FUNCTIONS 38 4 1 ListofFunctions rr 38 4 2 Specifications of Functions secera ccc ee 40 4 2 44 Specifying channelin mber eR ebore REUS usc AO decane negro 40 4 2 2 Specifying station numbers 00 0000 ccs 41 4 2 3 Specifying network numbers and station numbers for extended functions 43 4 24 Specifying device types net nh 45 4 3 Function Details 4 3 1 mdOpen opening communication 49 4 3 2 mdClose closing communication 50 4 3 8 mdSendEx batch writing extended devices SEND function 51 4 3 4 mdReceiveEx batch reading extended devices function 55 4 3 5 mdRandWEx writing extended devices 59 4 3 6 mdRandREx reading extended devices randomly 62 4 3 7 mdDevSetEx setting extended bit devices
142. ssible devices when accessing a board own station Accessible Not accessible Access target Device Access type CC LinkVer 2 MELSECNET H CC Link IE Controller CC Link IE Field board board Network board Network board Link input LX Batch Random x x Link output LY Batch Random x x Link relay LB Batch Random x w Link register LW Batch Random x gt Link special relay SB Batch Random 9 Dan Link special register SW Batch Random O S Remote input RX Batch Random x x O F lt Remote output RY Batch Random o Remote register m RWw Batch Random x O D for transmission gt Remote register ER RWr Batch Random x x O gt Buffer memory Batch Random Q x O 5 Random access buffer Batch Random x x x 3 E 9 o 3 o 5 a 33 3 3 2 Access to devices of QnA Q L and R series module The following table shows the accessible devices of QNACPU QCPU Q mode LCPU and RCPU on other station RCPU cannot be accessed via MELSECNET H board O Accessible X Not accessible 34 Access target Device Access type QnACPU QCPU LCPU E Input X Batch Random O O Output Y Batch Random O O Latch relay Batch R
143. st data 16512 The process was requested with a 64 bit 7 When accessing CPU module other than QCPU mode 4080H version user application to a CPU module other LM RCPU module use 32 bit version user application than QCPU Q mode or RCPU module Link related error The network of the number set to the routin 18944 The network of th ber set to the routing 4A00H parameters does not exist Check the routing parameter settings The network is not supported by the target Exchange the CPU with a CPU which supports the network 18945 CPU Check the network number and station number 4A01H The network number or station number of the target station is incorrect 19202 Perform the operation for a module for which the specific function The request is not for a CPU module 4B02H can be executed 1 ath error Use the pa at was returne em en function EFFFH Path Use the path that t d by the mdOpen functi e specified path is invalid Use a path of the communication line that supports the function EFFFEFFFH The specified path is invalid U path of th ication line that supports the functi Start device number error The specified start device number is out of the Check the start device number 2 range When specifying a bit device specify a start device number in When specifying bit device the start device multiples of 8 FFFFFFFEH number is not multiples of 8 Check the device number an
144. ster Local Module User s Manual SH 080394E 13JR64 Overview of system configuration performance specifications functions handling wiring and troubleshooting for Q series master local modules CC Link System Master Local Module Type AJ61BT11 A1SJ61BT11 User s Manual lt IB 66721 13J872 gt Overview of system configuration performance specifications functions handling wiring and troubleshooting for AJ61BT11 and A1SJ61BT11 CC Link System Master Local Module Type AJ61QBT11 A1SJ61QBT11 User s Manual lt IB 66722 13J873 gt Overview of system configuration performance specifications functions handling wiring and troubleshooting for AJ61QBT11 and A1SJ61QBT11 2 Related manuals of MELSECNET H board Manual name lt Manual number model code gt Description MELSECNETHH Interface Board User s Manual For SWODNC MNETH B lt SH 080128 13JR24 gt Overview of system configuration specifications functions handling wiring and troubleshooting for MELSECNET H interface boards Q Corresponding MELSECNET H Network System Reference Manual PLC to PLC network lt SH 080049 13JF92 gt Overview of system configuration performance specifications functions handling wiring and troubleshooting for the MELSECNET H network system 3 Related manuals of CC Link IE Controller Network board Manual name Manual number model code Description CC Link IE Controller Network I
145. stno dev buf bufsize mdRandW writing devices randomly short ret Return value OUT long path Path of channel IN short stno Station number IN short dev Randomly specified device IN short buff J Mritten data single precision integer array short bufsize Dummy IN Visual Basic NET mdRandW path stno dev 0 buf 0 bufsize Short ret Return value OUT Integer path Path of channel IN Short stno Station number IN Short dev n Randomly specified device IN Short buf n Written data single precision integer array IN Short bufsize Dummy IN Visual Basic 5 0 Visual Basic 6 0 ret mdRandW path amp stno dev 0 buf 0 bufsize Integer ret Return value OUT Long path Path of channel IN Integer stno Station number IN Integer dev n Randomly specified device IN Any buf n Written data single precision integer array IN Integer bufsize Dummy IN Argument Description path Specify the path of channel whose communication line is opened Use the path which is returned when executing mdOpen Specify the station number of target station stno Station number aS Page 41 Section 4 2 2 Specify the number of blocks the device type the start device number dev Randomly specified device and points of device to be written For details refer to Explanation shown on the next page Written data A AE buf M Specify the data to be written in single precision
146. switch status such as station number setting board number setting board identification I O address setting information is read Description Element Item CC Link IE Controller CC Link IE Field CC Link Ver 2 MELSECNET H Network Network Setting value of 0 to 64 buf 0 1 to 64 1 to 120 0 to 120 station number 0 master station MNET 10 mode Setting value of 0 to 9 buf 1 0 fixed 0 to 32 0 fixed group number MNET H mode 0 to 32 Setting value of buf 2 0 fixed 1 to 239 1 to 239 1 to 239 network number buf 3 RESERVE 0 fixed 0 fixed 0 fixed 0 fixed buf 4 RESERVE 0 fixed 0 fixed 0 fixed 0 fixed buf 5 RESERVE 0 fixed 0 fixed 0 fixed 0 fixed Y Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes Page 126 CHAPTER 6 gt Related function mdOpen mdClose 95 p1eoq eu jo smeis uoyws BuipeeJ peeswspgpul 8EY seed uogounj 4 3 19 mdBdVerRead read version information of the board Lf Function Read the version information of the board A Format Visual C ret mdBdVerRead path buf short ret Return value OUT long path Path of channel IN short buff J Read data OUT Visual Basic NET ret mdBdVerRead path buf 0 Short ret Return value OUT Integer path Path of channel IN Short buf n Read data OUT Visual Basic 5 0 Visual Basic 6 0 ret mdBdVerRead p
147. t 2 Resource View Ctrl Shift E Start Page Toolbox Ctrl Alt X Find Results Other Windows Toolbars Full Screen Shift Alt Enter 4 38 All Windows Shift Alt M Ctrl Shift Property Manager Property Pages 2 Right click the user property sheet and select Properties from the shortcut menu 4 MTEST N The Property Pages screen is displayed Cpp W Applic New Project Property Sheet Aa d Easting Property Sheet Core V b Release V Later in Evaluation amp Move Earlier in Evaluation Save Microsoft Cpp Win32 user Ctrl S X Remove Del X Rename F2 Properties 3 Select Common Properties Linker Advanced on the Property Pages screen Ves DYNAMICBASE Yes NXCOMPAT No MachineXb6 MACHNEXES No CLR Thread Attribute CLR image Type Default image type Promptimmediatelv ERRORREPORT PROMPT y The ENTRY option specifies an entry point function as the starting address for an exe fie or DLL 1 CHAPTER 2 PROGRAMMING 4 Select Image Has Safe Exception Handlers When the E es option has been set delete it 2 Common Properes Randomized Base Address Yes DVNAMICBASE General Fed Base Address User Macros Data Execution Prevention DEP Yes NXCOMPATI VC Directories Off Assembly Generation GC Unlo
148. t path amp stno devtyp devno Integer ret Return value OUT Long path Path of channel IN Integer stno Station number IN Integer devtyp Device type IN Integer devno Specified device number IN Argument Description Specify the path of channel whose communication line is opened path Path of channel Lae Use the path which is returned when executing mdOpen stno Station number Specify the station number of target station I Page 41 Section 4 2 2 daviyb the type of devine to be set ON Page 45 Section 4 2 4 devno Specified device number Specify the device number of device to be set ON Explanation This function is a dedicated function for bit devices such as link relays B and internal relays M Y Return value Success Return the value 0 Return the value other than 0 Refer to the list of error codes Page 126 CHAPTER 6 Error gt Related function mdOpen mdClose mdDevRst 115 seowep iq Bumes spejeq uogounj 4 3 26 mdDevRst resetting bit devices Lf Function Reset the specified bit device on the target station to OFF up Format Visual ret mdDevRst path stno devtyp devno short ret Return value OUT long path Path of channel IN short stno Station number IN short devtyp Device type IN short devno Specified device number IN Visual Basic NET ret mdDevRst path stn
149. ter Enough memory could not be reserved Increase the minimum working set size of the personal computer Page 134 Appendix 1 85 SEND RECV channel number error 00554 The channel number specified with the Check the channel number SEND RECV function is incorrect 100 Board H W resource busy Retry the operation 0064 The next processing cannot be executed because If the error occurs repeatedly please consult your local Mitsubishi of the insufficient resource on the board representative 101 Routing parameter error Check the routing parameter 0065 The routing parameter is not set correctly Check the specified network number Board Driver I F error An attempt to send request data to the board Retry the operation 102 driver is failed Check with the function such as event log whether Windows is 00664 The system resource of the operating system is operating normally insufficient Exit the program and restart the personal computer For details refer to Page 14 Section 2 2 1 e Check the mounting condition of the board 12 Retry the operation Board Driver I F error Check with the function such as event log whether Windows is 103 An attempt to receive response data from the operating normally 00674 board driver is failed Exit the program and restart the personal computer The consistency between the board and the When this error has occurred while executing the SEND function Softwar
150. terlock depending on a link status between the own station and other station Data are validated only when the following conditions are satisfied 1 MELSECNET H a Accessing to own station link devices LX LY LB LW Writing reading data to from the own station link devices are validated only when the bits of the own station handshaking status SB47 and own station data link status SB49 are OFF normal communication and the bit of the own station module status SB20 is OFF normal communication However even if the above conditions are not satisfied the processing of writing reading data to from the MELSECNET H board ends normally b Other station transient access remote operation and device access of other station s programmable controller CPU While the access is validated for the devices which check the link device accesses the other station transient access can be performed when the bits of the handshake status in accessed station the bits in the accessed station correspond to SW70 to 73 read from the own station and OFF normal communication and the bits of the cyclic transmission status the bits in the accessed station correspond to SW74 to 77 read from the own station are OFF cyclic transmission is being processed 2 CC Link IE Controller Network a Accessing to own station link devices LX LY LB LW Writing reading data to from the own station link devices are validated only when the bits of the own stati
151. the list of error codes Page 126 CHAPTER 6 gt Related function mdOpen mdClose 83 p1eoq Bumasa IsypgpU spejeq uogounj 4 3 15 mdBdModSet setting modes of board Lf Function Change the modes of a board temporarily A Format Visual ret mdBdModSet path mode short ret Return value OUT long path Path of channel IN short mode IN Visual Basic NET ret mdBdModSet path mode Short ret Return value OUT Integer path Path of channel IN Short mode Mode IN Visual Basic 5 0 Visual Basic 6 0 ret mdBdModSet path amp mode Integer ret Return value OUT Long path Path of channel IN Integer mode Mode IN Argument Description path Path of channel Specify the path of channel whose communication line is opened Use the path which is returned when executing mdOpen Specify the code corresponding to the mode to be executed mode Mode For details of modes and the corresponding codes refer to Explanation shown on the next page 84 CHAPTER 4 FUNCTIONS Explanation The board is reset when this function is executed Reset the board or restart the personal computer to recover the mode set in the utility The following table shows the modes and the corresponding codes Description Code CC Link IE Controller CC Link IE Field CC Link Ver 2 MELSECNET H Network Network 0000H Online with autom
152. tion 2 application When accessing CPU modules other than QCPU Q mode or 0002 The consistency between the board and the a RCPU use the 32 bit version user application software package cannot be identified When this error has occurred while executing the RECV function When accessing to the buffer memory of the with CC Link IE Field Network board use SW1DNC CCIEF B remote device station the offset values or offset version 1 04E or later write read byte size out of the range of the Pee T Check if the offset values or offset write read byte size is within target station buffer memory is specified b the range of the buffer memory of the target station Open the channel only once 66 Channel opened error n Since the correct value is stored to the path this error can be 0042H Specified channel is already opened regarded as normal status 68 Path error Check the path 00444 The specified path is invalid Check the driver operating condition with Device Manager No board exists at the specified path Check the mounting condition of the board Unsupported function execution error A function which is not supported by the target 69 Check the path of channel network number and station number station was executed 0045H Check if the function is supported by the target station A function which is not supported by the speci
153. tno stno devtyp devno size data 0 uonouni ADY seoep pepuerxe Buipees yoyeq x3eaieoespul pev Long ret Return value OUT Long path Path of channel IN Long netno Network number IN Long stno Station number IN Long devtyp Device type IN Long devno Start device number IN Long size Read byte size IN OUT Any data n Read data single precision integer array OUT 55 Argument Description Specify the path of channel whose communication line is opened path Path of channel Use the path which is returned when executing mdOpen ree een iret er Specify the station number of target station Wi u C Page 43 Section 4 2 3 rer Stationn rber Specify the station number of target station i u E Page 43 Section 4 2 3 devtyp Device ype Specify the type of device from which the data is read vty vice ty C Page 45 Section 4 2 4 Specify the start device number of device range to be read Specify the start device number with a multiple of 8 for the access to a devno Start device number bit device except for LTT LTC LSTT and LSTC Specify the start device number with a multiple of 16 0 16 32 for the access to a bit device RX RY SB of CC Link other station link device Specify the byte size to be read in even number When the specified byte size to be read exceeds the device range 5 size Read byte size size error the applicable size is returned to size When
154. twork module is one the CPU module cannot be set as a relay station 3 For CC Link IE Field network A2UCPU A2UCPU S1 A2USCPU A2USCPU S1 A2USHCPU S1 A3UCPU and A4UCPU can be accessed 4 When the access target is RCPU only when the own network is CC Link IE Controller Network or CC Link IE Field Network can be accessed For the accessible devices of each access target refer to the following table Access target Reference Access to devices of other station module QnACPU QCPU Q mode LCPU RCPU Page 34 Section 3 3 2 ACPU QCPU Amode Page 35 Section 3 3 3 Ethernet adapter module Head module Page 36 Section 3 3 4 Access using the SEND function or the RECV function 32 QnACPU QCPU Q mode LCPU RCPU PC interface board Page 37 Section 3 3 6 CHAPTER 3 ACCESSIBLE DEVICES AND RANGES 3 3 Accessible Devices This section explains accessible devices for boards The table in this section divides the functions used for access into Batch and Random and indicates accessibility for each of these two categories Access type Description Batch write mdSend mdSendEx Batch Batch read mdReceive mdReceiveEx Random write mdRandW mdRandWEx Random read mdRandR mdRandREx Random Bit set mdDevSet mdDevSetEx Bit reset mdDevRst mdDevRstEx 3 3 1 Access to link devices and buffer memory of own station The following table shows the acce
155. typ Device type IN long devno Channel number IN long size Send byte size IN OUT short data J Send data single precision integer array IN Visual Basic NET ret mdSendEx path netno stno devtyp devno size data 0 Integer ret Return value OUT Integer path Path of channel IN Integer netno Network number IN Integer stno Station number IN z Integer devtyp Device type IN 5 Integer devno Channel number IN Integer size Send byte size IN OUT A Short data n Send data single precision integer array IN 2 Visual Basic 5 0 Visual Basic 6 0 ret mdSendEx path amp netno stno devtyp devno size data 0 Long ret Return value OUT Long path Path of channel IN Long netno Network number IN Long stno Station number IN Long devtyp Device type IN Long devno Channel number IN Long size Send byte size IN OUT Any data n Send data single precision integer array IN uonounj ANIS seowep uojeq xgpuespui 53 Argument Description Specify the path of channel whose communication line is opened path Path of channel D Use the path which is returned when executing mdOpen Specify the network number of target station Page 43 Section 4 2 3 netno Network number Specify the station number of target station stno Station number Page 43 Section 4 2 3 Logical station numbers cannot be specified Specify whether to send data w
156. uage Sample programs are stored on the following folders for each programming language to be used 1 NETVB folder Sample programs for the following Visual Basic e Visual Basic NET 2003 e Visual Studio 2005 Visual Basic e Visual Studio 2008 Visual Basic e Visual Studio 2010 Visual Basic e Visual Studio 2012 Visual Basic Sample programs are created in Visual Basic NET 2003 project format Convert theproject when using Visual Basic other than Visual Basic NET 2003 Mdfunc vb is not included in the sample program Add Mdfunc vb before using the sample program For the setting method Page 20 Section 2 3 3 2 VB folder Sample programs for Visual Basic 6 0 Mdfunc bas is not included in the sample program Add Mdfunc bas before using the sample program For the setting method Page 17 Section 2 3 1 3 VC folder Sample programs for the following Visual C e Visual C 6 0 e Visual 2003 Visual Studio 2005 Visual C e Visual Studio 2008 Visual C e Visual Studio 2010 Visual C e Visual Studio 2012 Visual Sample programs are created in VisualC 96 0 project format Burwwes6olg ZES pseog J0M9N Je 0J1UO2 3 YUIT D4D 104 g g Convert the project when using Visual C other than Visual C 6 0 An include file and a library file are not included in the sample program Set an include file and a
157. ual C NET 2003 or when using Visual C in Visual Studio 2005 or Visual Studio 2008 The screens of Visual C in Visual Studio 2008 are used for the explanation in this section These screens are slightly different from other Visual 1 Setting include files Options Tools Window gk Attach to Process Ctri Alt P 8 Connect to Database 9H Connect to Server Code Snippets Manager Ctrl K Ctrl B Choose Toolbox Items Add in Manager Macros 2 Partner Products Catalog Dotfuscator Community Edition WCF Service Configuration Editor External Tools Import and Export Settings Customize Options 89 Environment amp Projects and Solutions General Build and Run VB Defaults VC Directories VC Project Settings 89 Source Control amp Text Editor Database Tools Debugging 88 Designer Text Templating E Windows Forms Designer E Workflow Designer Show directories for m include files CInstallDir include CInstallDirJatimFc include WindowsSdkDir include FrameworkSDKDir include i t Include Directories Corresponds to environment variable INCLUDE Path to use when searching for include files while building a VC project Show all settings Select Directory Folder Make New Folder MELSEC c3 ccru C
158. ultiple CPU system when the logical station is specified cannot be accessed O Accessible X Not accessible Device Access type Accessibility Link special relay SB Batch Link special register SW Batch Remote input RX Batch O Remote output RY Batch O Remote register RW Batch O Buffer memory Batch O Random access buffer Batch Point When the own station number is 64 other station cannot be accessed Only the own station can be accessed CHAPTER 3 ACCESSIBLE DEVICES AND RANGES 3 3 6 Access using the SEND function or the RECV function The same operation as device access the SEND function and the RECV function execute Batch write mdSend mdSendEx or Batch read mdReceive mdReceiveEx with specified device type for each function Accessible Not accessible Access target Device Access type CPU module QnA Q L R RECV function Batch O Own station PC interface board SEND function with arrival acknowledgment Batch O O SEND function without arrival acknowledgment Point The SEND function and the RECV function are not supported by CC Link The SEND function and the function are supported by SW1DNC MNETG B Version 1 08J or later The SEND function and the RECV function are not supported by the following modules A series CPU module Ethernet adapter module Head module e dis
159. um working set size in the memory area reserved in the user program Some user programs may use a larger size for the minimum working set Therefore if the minimum working set size for the personal computer board driver cannot be reserved an error code 77 is returned In this situation increase the minimum working set size in the user program before executing the MELSEC data link library function Page 135 Appendix 1 2 The minimum working set size of 200KB is reserved at startup of the personal computer When applying the sample programs introduced in this manual to the actual system ensure the applicability and confirm that they will not cause system control problems Appendix 1 1 Processing overview of sample program Obtain the user program ID with the GetCurrentProcessID function G Using the ID obtained in step CD obtain the user program handle with the OpenProcess function The current minimum and maximum working set sizes can be obtained by executing the GetProcessWorkingSetSize function Set a size larger than the minimum working set obtained in step and execute the SetProcessWorkingSetSize function G Release the user program handle with the CloseHandle function 134 APPENDIX Appendix 1 2 Sample programs 1 When setting with Visual Basic An example when the minimum working set size is 1MB and the maximum working set size is 3MB When programming with Visual Basic 5 0 or Visual Basic 6 0 change the type
160. umbers Station number Own station 0 00H 255 FFH O 00n Other 22 ees Station number 1 01H to 239 EFH 1 01 to 120 78H 125 7Dn The logical station number set with the utility 0 00H 65 41 to 239 EFH 1 Access to the control station or master station station number 0 specified with the network number on the network When accessing the control station operating as a control station and the mater station operating as a master station when using the submaster function specify the station number 2 Station numbers from 65 41H to 120 78H can be specified when using CC Link IE Controller Network 3 For CC Link IE Controller Network board Specification Network numbers Station number Own station 0 00H 255 FFH 0 00H 2 Station number 1 01H 0120 78 Other 2 1 01 to 239 125 70 station Group Number 1 to 32 129 81 to160 A0H All stations 240 F0H The logical station number set with the utility 0 00H 0 00H to 239 EFH 1 stations and group numbers can be specified when using the SEND function mdSendEx without arrival acknowledgment 2 Access to the control station or master station station number 0 specified with the network number on the network When accessing the control station operating as a control station and the mater station operating as a master station when using the submaster function specif
161. user application programs Use sample programs on a user s own responsibility 5 1 Sample Programs for CC Link Ver 2 Board Sample programs are stored on the user specified folder that is specified when installing the software package to a personal computer e lt User specified folder lt CCBD2 gt Sample 5 1 1 Description of sample programs 1 Sample Programs for MELSEC data link library The following sample programs are stored as examples of functions a Reading device data A sample program for reading device DO of a master station Folder name MDFunction folder for programming language DEMO b Testing MELSEC data link library in general A sample program for the MELSEC data link library in general Folder name MDFunction folder for programming language MTEST 1 sample programs for Visual Studio 2012 Visual Basic are stored in MTEST2 folder Point P Sample programs for MTEST folder of NETVB This sample program cannot be used as a 64 bit version user application In order to use this sample program on a 64 bit version operating system select x86 for Target CPU and build the program as a 32 bit version user application MSFlexGrid is used in the sample program If MSFlexGrid is not installed a warning occurs however the operation of sample program is not affected Sample programs for MTEST2 folder of NETVB This sample program cannot be used as a 64 bit version user application
162. vice address table which is the internal data of the MELSEC data link library L Format Visual C ret mdlnit path short ret Return value OUT long path Path of channel IN Visual Basic NET ret mdlnit path Short ret Return value OUT Integer path Path of channel IN Visual Basic 5 0 Visual Basic 6 0 ret mdlnit path amp Integer ret Return value OUT Long path Path of channel IN Argument Description Specify the path of channel whose communication line is opened path Path of channel Use the path which is returned when executing mdOpen Explanation Programmable controller device information acquired at the initial access to the programmable controller CPU is spejeq uogounj discarded After the execution of the mdlnit function programmable controller device information is reacquired at the initial access to the programmable controller CPU Therefore after the execution of the mdlnit function a longer function execution time is required at the initial access Y Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes 126 CHAPTER 6 e qey uoneuuojur 1ej oujuoo ejqeuuueJ60ud Burzijeniur puppua Oz v C gt Related function mdOpen mdClose 99 4 3 21 masend batch writing devices SEND function 1 Batch writing devices lf Function Batch write data to the d
163. when using Visual Basic in Visual Studio 2005 Visual Studio 2008 Visual Studio 2010 or Visual Studio 2012 The screens of Visual Studio 2008 visual Basic 2008 are used for the explanation in this section These screens are slightly different from other Visual Basic 1 cation Microsoft Visual Studio Build Debug Data Format To Add Windows Form Add User Control Add Component Add Module Add Class Ctri Shift A Ctrl D Add New Item Add Existing Item E E Exclude From Project Show All Files liy Add Reference Add Service Reference WindowsApplication1 Properties Add Existing Item WindowsApplication1 bj 2 in INCLUDE Te Mdfunc vb Desktop Projects My Computer Object name 4 Objects of type VB Code Files vb 1esx settings xsd wsdl 20 Start Visual Basic For other than Visual Basic NET 2003 Select Project Add Existing Item For Visual Basic NET 2003 Select File Add Existing Item On the Add Existing Item screen select Mdfunc vb Mdfunc vb is stored in the following directory at installation lt User specified folder COMMON INCLUDE 2 3 4 CHAPTER 2 PROGRAMMING Using Visual C NET 2003 Visual 2005 Visual 200 8 This section explains the setting operation when using Vis
164. y the station number 43 pepueixe JOJ sjequinu uonejs pue siequinu yomu BurAioeds ez Jo suoneouimeds uouuo zr 44 4 For CC Link IE Field Network board Specification Network numbers Station number Own station 0 00 255 FFH 0 00 to120 78H Station number Other 125 7DH 1 01H to 239 EFH station Group Number 1 to 32 2 129 81 to160 A0H All stations 240 F0H The logical station number set with the utility 0 00H 0 00H to 239 EFH 1 stations and group numbers can be specified when using the SEND function mdSendEx without arrival acknowledgment 2 Group numbers can be specified when using MELSECNET H network or CC Link IE Controller Network 3 Access to the control station or master station station number 0 specified with the network number on the network When accessing the control station operating as a control station and the mater station operating as a master station when using the submaster function specify the station number 4 2 4 Specifying device types CHAPTER 4 FUNCTIONS Device types specified in the MELSEC data link library can be either a code number or a device name 1 Link devices and buffer memory of own station Device type Device Code specification Device name Decimal Hex
Download Pdf Manuals
Related Search
Related Contents
Battery Solutions & Innovations, Inc. Manual do utilizador Tecumseh AVD5535EXN Performance Data Sheet Harman Kardon AVR 154 User's Manual "取扱説明書" E-One Teleboom (SGT) Copyright © All rights reserved.
Failed to retrieve file