Home

MELSEC Data Link Library Reference Manual

image

Contents

1. Error Code Error description Corrective action version user application to a CPU module other than QCPU Q mode or RCPU module HEX 7656 E218 Check the target station number and perform the operation Transient data target station number error FFFFE218n TA again The target station number is incorrect F 7672 f e If the error occurs after performing the above corrective action e The target station number is 0 i Soak E2081 please consult your local Mitsubishi representative FFFFE208n 8193 DFFFn FFFFDFFFn 3 i i i a Errors detected in the CC Link IE Field network e Refer to the CC Link IE Field Network Board and CC Link IE 12288 system Field Network Master Local Module User s Manual D000 FFFFD0O00n 41683 Transient data improper D25Dn e The data over 960 bytes has been sent from e Check if the sent data using the SEND function of MELSECNETI H board to CC Link IE Field MELSECNETIH board exceeds 960 bytes FFFFD25Dn Network board Station number error e The specified station number is incorrect 11746 A process that should be requested to other D21En station was requested to the own station Or e Check the network number and station number FFFFD21En the station number corresponds to the own station 255 FFH but the network number is not 0 12128 e Check if the own station or the target station is disconnected DOAOn Trans
2. Inherited values Inherit from parent or project defaults Macros gt gt Cancel 34 CHAPTER 2 PROGRAMMING 3 Setting platform and deleting linker option that are unnecessary Set the platform by the following operations 1 to 5 Also delete unnecessary options by the following operations 6 to 7 When using Image Has Safe Exception Handlers option the project cannot be built normally 1 Open the project to create a user application and select VIEW PROJECT BUILD DEBUG TEAM TOOLS koeien eee conven VIEW Solution Explorer 8 Team Explorer Ctrl Ctrl M E Server Explorer Ctri Alt S fe SOL Server Object Explorer Ctrisy Ctrl s A Bookmark Window Ctrl K Ctrl W E Call Hierarchy Ctrl Alt K 43 Class View Ctrl Shift c E Code Definition Window Ctrl D E Object Browser Ctrl Alt 3 Error List Ctrl E Ke output Ctrl Alt O Start Page Task List Ctrl T Toolbox CtrisAlt X Y Notifications Ctrl W N Find Results Other Windows Toolbars BZ Full Screen Shift Alt Enter Shift Alt M Ctrl trl Shift Properties Window F4 Property Pages Shift F4 2 Right click the project in the Solution Explorer and select Properties from the shortcut menu The Property Pages screen is displayed New Solution Explorer View Profile Guided Opti Build Dependencies Cte Shift x Debug Source Control ELOZ t tO IENSIA Busy EZ suonouny Buisp 104
3. CHAPTER 4 FUNCTIONS 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 Ns Wi Function This function opens a communication line by specifying a communication line channel number LT Format Visual C ret mdOpen chan mode path short ret WReturn value short chan liChannel number of communication line short mode Dummy long path llOpened line path pointer Visual Basic NET 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 chan mode 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 OE FOR Specity the channel number of communication line EF Page 46 Section 4 2 1 Dummy Specify 1 Opened line path pointer Return the opened line path ff 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 FN 7 w amp Return value T Success R
4. 5 Select Platform Toolset click the v button and select Visual Studio 2013 Windows XP v120_xp 6 Onthe Property Pages screen select lt Configuration Properties gt lt Linker gt lt Advanced gt 7 Select Image Has Safe Exception Handlers and check whether the option is not set When the option has been set delete it CHAPTER 3 ACCESSIBLE DEVICES AND RANGES 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 AOJ2HCPU A1SCPU A1SJCPU A1SHCPU A1SJHCPU A1NCPU A2CCPU Ab A2CJCPU A2NCPU A2NCPU S1 A2SCPU A2SHCPU A3NCPU A2ACPU series CPU module A2ACPU S1 A3ACPU A2UCPU A2UCPU S1 A2USCPU A2USCPU S1 A2USHCPU S1 A3UCPU A4UCPU QCPU A mode Q02CPU A Q02HCPU A Q06HCPU A Q2ACPU Q2ASCPU Q2ASHCPU Q2ACPU S1 Q2ASCPU S1 Q2ASHCPU S1 Q3ACPU Q4ACPU Q4ARCPU Basic model QCPU QOOJCPU QO0CPU Q01CPU e High Performance model QCPU QO2CPU QO02HCPU QO6HCPU Q12HCPU Q25HCPU e Process CPU QO2PHCPU QO6PHCPU Q12PHCPU Q25PHCPU Q series CPU module QCPU Q mode Redundant CPU Q12PRHCPU Q25PRHCPU e Universal model QCPU QO3UDVCPU QO3UDECPU Q04UDHCPU QO4UDEHCPU QO04UDVCPU QO6UDHCPU QO6UDEHCPU QO6UDVCPU Q10UDHCPU Q10UDEHCPU Q13UDHCPU Q13UDEHCPU Q13UDVCPU Q20UDHCPU Q20UD
5. 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 124 CHAPTER 5 SAMPLE PROGRAMS 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 LAType 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 1 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 bet
6. Specifies a relative path to the output file directory can include environment variables MTEST Property Pages yx Configuration Active Debug V Bitform Active win32 Common Properties Configuration Properties General Debugging VC Directories Cire Linker Manifest Tool Resources XML Document Generator Browse Information Build Events Custom Build Step Code Analysis 4 General a Output Directory Debug Intermediate Directory Debug Target Name SProjectName Target Extension e Extensions to Delete on Clean cdfi cache obj ilk resources tib tli tih tmp Build Log File S intDin KM SBuildProjectName log Visual Studio 2013 Windows XP v120_ xp K Enable Managed Incremental Build Visual Studio 2013 120 4 Project Defaults TET Configuration Type lt inherit from parent or project defaults gt Use of MFC Use MFC a Shared Character Set Use Multi Byte Character Set B Platform Toolset Specifies the toolset used for building the current configuration If not set the default toolset is used ok Cancel Apply Configuration Active Debug b Common Properties A 4 Configuration Properties General Debugging VC Directories b C C 4 Linker General Input Manifest File Debugging System Optimization Embedded IDL Windows Metadata Entry Point No Entry Point Set Checksum Base Addr
7. 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 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 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 e The application that is forcibly terminated cannot be ended An error of MELSEC Data Link Library occurs in other application e The forcible termination affects other Mitsubishi software packages such as MX Component GX Works2 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 Static type variables Do not specify any variables which are declared in static for output arguments of the MELSEC data link library functions Service applications The MELSEC data link library cannot be accessed from Windows Service applications Access the MELSEC data l
8. NET ret mdReceiveEx path netno stno devtyp devno size data 0 Integer Integer Integer Integer Integer Integer Integer Short ret Return value path Path of channel netno Network number stno Station number devtyp Device type devno Start device number size Read byte size data n Read data single precision integer array Visual Basic 5 0 Visual Basic 6 0 ret mdReceiveEx path amp netno stno deviyp devno size data 0 Long Long Long Long Long Long Long Any ret Return value path Path of channel netno Network number stno Station number devtyp Device type devno Start device number size Read byte size data n Read data single precision integer array IN OUT OUT IN OUT OUT IN OUT OUT CHAPTER 4 FUNCTIONS Argument Description aih Path of channel Specify the path of channel whose communication line is opened p Use the path which is returned when executing mdOpen meine Aisin number Specify the station number of target station Wi u Page 50 Section 4 2 3 So T Specify the station number of target station i u Page 50 Section 4 2 3 devtyp Device type Specify the type of device from which the data is read vty vice ty Page 52 Section 4 2 4 Specify the start device number of device range to be read e Specify the start device number with a multiple of 8 for the access to a devno Start device number bit device except for LT
9. Ot 4 06H Reservation to area OOOH fixed OOOH fixed OOOH fixed OOOH 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 Q81BD J71LP21 25 Q80BD J71GP21 10H Hardware baer naie Q80BD J61BT11N Q80BD J71LP21S 25 Q80BD J71GP21S Q80BD J71GF11 T2 47H 16 bytes Q81BD J61BT11 Q80BD J71LP21G Q81BD J71GP21 Q81BD J71GF11 T2 Q80BD J71LP21GE Q81BD J71GP21S Q80BD J71BR11 2 port memory 18H j 0200H 512K bytes 0080H 128K bytes 0180H 384K bytes 0080H 128K bytes possession size 2 port s 19H 00804 fixed 00804 fixed 00804 fixed 00804 fixed attribute Applicable 1AH OOOOH fixed OOOOH fixed OOOOH fixed OOOOH fixed offset Function 1BH 1BH Function version 1BH Function version ON eee L A B L A B A B io Bux Major version 1BH 1BH 1BH of CC Link OOOOH fixed OOOOH fixed H H H 0002 1BH Machine ae Minor version i to classification 1CH OOOOH fixed 1FH 10 bytes a f CC Lnk 0000H ICh 1CH 1CH H OOOOH fixed to OOOOH fixed to OOOOH fixed 1FH 1FH 1DH to 00004 fixed 1FH 104 CHAPTER 4 FUNCTIONS Y Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes Page 133 CHAPTER 6 O gt Related function mdOp
10. 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 specifications given in the catalogs manuals or technical documents are subject to change without prior notice 145 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 146 SH NA 081035ENG H 1509 KWIX MODEL MD FUNC LIB R E MODEL CODE 13JV25 MITSUBISHI ELECTRIC CORPORATION HEAD OFFICE TOKYO BUILDING 2 7 3 MARUNOUCHI CHIYODA KU TOKYO 100 8310 JAPAN NAGOYA WORKS 1 14 YADA MINAMI 5 CHOME HIGASHI KU NAGOYA JAPAN When exported from J
11. b Code Analysis Library Directories Path to use when searching for library files while building a VC project Corresponds to environment variable LIB Caneel App 5 Select Library Directories Click M and select lt Edit gt MTEST Property Pages Configuration Active Debug Platform Active win32 v Configuration Manager b Common Properties 4 General 4 Configuration Properties Executable Directories S VC_ExecutablePath x6 8WindowsSDK Executable Pati General Include Directories CAMELSEC Com mont INCLUDE IncludePath Debugging Reference Directories VC_ReferencesPath_ x86 VC Directories Library ie NC LibraryPath x88 WindowsSDK LibraryPath x86 v gt C C Library WinRT Directories D Linker Source Directories 7 arken Exclude Directories VC_IncludePath WindowsSDK IncludePath MSBuil gt Resources gt XML Document Generator gt Browse Information gt Build Events gt Custom Build Step gt Code Analysis Library Directories Path to use when searching for library files while building a VC project Corresponds to m gt environment variable LIB ok cancel Apply 6 On the Library Directories screen click 5 and then click E Inherited values VC_LibraryPath_x86 WindowsSDK _LibraryPath_x86 Inherit from parent or project defaults Renae OK Cancel ELOZo 3
12. 200 300 and 400 are written to D10 D11 D12 and D13 respectively sead uooun4 Ey 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 M100 and later D10 and later 4 points D10 to D13 Ajwopued sasn p pepus xe Hunum xgmMmpueypu Gey Written data buf buf 0 0 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 67 The following shows an example when writing data to one of the double word devices LZ LTN LCN or LSTN Example When writing 0x1 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 LCON100 and later Written data buf Y Return value 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 Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes 15 Page 133 CHAPTER 6 C gt Related function mdOpen mdClose mdRandREx 68 CHAPTER 4 FUNCTIONS 4 3 6 mdRandREx reading extended devices randomly LY Function Read the device specified with the randomly specified devices from the target st
13. 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 s Network number IN Integer stno Station number IN Integer devtyp Device type IN RA Integer devno Specified device number IN ae 2 35 58 Visual Basic 5 0 Visual Basic 6 0 9 lt ret mdDevSetEx path amp netno stno devtyp devno A m o x Long ret Return value OUT T n Long path Path of channel IN 5 Long netno Network number IN g Long stno Station number IN a Long devtyp Device type IN amp Long devno Specified device number IN gt Argument Description 2 Specify the path of channel whose communication line is opened path Path of channel Oy f Use the path which is returned when executing mdOpen Specify the network number of target station netno Network number 2 Page 50 Section 4 2 3 Specify the station number of target station stno Station number w Page 50 Section 4 2 3 Specify the type of device to be set ON devtyp Device type a gt Page 52 Section 4 2 4 devno Specified device number Specify the device number of device to be set ON 73 OC Explanation This function is a dedicated function for bit devices such as link relays B and internal relays M Z Return value Success Return the value 0 Error Return the
14. E Object Browser Ctrlsalte th tnort Cer E Ke Output CtrisAlt 0 Start Page Task List Ctl T amp Toolbox Ctrl Alte YX Notifications Ctrl WW N Find Results Other windows Toolbars EZ Full Screen Shift Alt Enter aw P Properties Window F4 Property Pages Shift F4 v 2 Right click the project in the Solution Explorer and select Properties from the shortcut menu The Property Pages screen is displayed Chi atta A Properties AlteEnter 3 Select the configuration and the platform to be changed in Patom Pars o the Configuration and the Platform S ProjectNat o z In case that there are multiple configurations and platforms select All Configurations and All Platforms to change settings at a time To the next page 30 CHAPTER 2 PROGRAMMING From the previous page 4 Onthe Property Pages screen select lt Configuration Configuration Active Debug Y Platform ActivetWin32 Y Configuration Manager Properties gt lt VC Directories gt gt Common Properties 4 General 4 Configuration Properties Executable Directories VC_ExecutablePath_x86 WindowsSDK_ExecutablePath General Include Directories VC_IncludePath WindowsSDK_IncludePath Reference Directories VC_ReferencesPath x86 Library Directories VC_LibraryPath_86 WindowsSDK LibraryPath x86 Library WinRT Directories WindowsSDK MetadataPath
15. Source Directories VC_SourcePath n tae Exclude Directories VC_IncludePath WindowsSDK IncludePath MSBuile esources XML Document Generator Browse Information Build Events Custom Build Step Code Analysis Executable Directories Path to use when searching for executable files while building a VC project Corresponds to environment variable PATH Cancel Apply 5 Select Include Directories Click the button and select MTEST Property Pages mx Configuration Active Debug Y Platform ActiverWin32 v Configuration Manager lt Edit gt gt Common Properties 4 General 4 Configuration Properties Executable Directories 00C_ExecutablePath_x86 WindowsSDK ExecutablePath General VC_IncludePath WindowsSDK_IncludePath w Debugging Reference Directories VC Directories Library Directories a TXOU x Ae atida Library WinRT Directories WindowsSDK_MetadataPath Pinker Source Directories VC_SourcePath Po Manet Tanl Exclude Directories SVC _IncludePath WindowsSDK IncludePath MSBuild b Resources b XML Document Generator gt Browse Information b Build Events b Custom Build Step b Code Analysis Include Directories Path to use when searching for include files while building a VC project Corresponds to X gt environment variable INCLUDE OK Cancel Apply 6 On the Include Directories screen click the
16. Writes data to the buffer memory of a remote Extended mdRemBufWriteEx 496 45 4g Page 77 Section 4 3 9 device station 4 5 function Reads data from the buffer memory of a remote Extended mdRemBufReadEx 4 5 6 ag Page 79 Section 4 3 10 device station 4 5 function mdTypeRead Reads the type of programmable controller CPU Page 81 Section 4 3 11 Remote operation of programmable controller mdControl Page 86 Section 4 3 12 CPU RUN STOP PAUSE mdWaitBdEvent Waits for an event occurrence Page 87 Section 4 3 13 mdBdRst Resets the board Page 90 Section 4 3 14 mdBdModSet Sets the mode of the board Page 91 Section 4 3 15 mdBdModRead Reads the mode of the board Page 93 Section 4 3 16 mdBdLedRead Reads the LED information of the board Page 95 Section 4 3 17 mdBdSwRead Reads the switch status of the board Page 101 Section 4 3 18 mdBdVerRead Reads the version information of the board Page 103 Section 4 3 19 Initializes programmable controller information mdinit Page 106 Section 4 3 20 table 45 suogoun4 jo S7 pY 46 2 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 numbe
17. 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 A Integer buf n Read data OUT a 3 Argument Description Specify the path of channel whose communication line is opened s 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 pueog ay Jo uopewoju G47 pees peaypeTpapul J Ey 95 Explanation 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 ON 1 b8 ERR 1 Detected OFF 0 0 Not detected buf 0 b7 1 RESERVE Display the operating status of board ON 1 bO RUN 1 Operating normally OFF 0 0 Board WDT error b15 1 RESERVE buf 1 Display the detection status of switch setting error ON 1 bO SW 1 Detected OFF 0 0 Not detected b15 9 RESERVE Display the detection status of parameter err
18. 4 3 6 mdRandREx reading extended devices randomly 0000020ee eee eee 69 4 3 7 mdDevSetEx setting extended bit devices 2 0 0 000 73 4 3 8 _mdDevRstEx resetting extended bit devices 0 0 ccc cece eee eens 75 4 3 9 mdRemBufWriteEx writing data to buffer memory of remote device station 77 4 3 10 mdRemBufReadEx reading data from buffer memory of remote device station 79 4 3 11 mdTypeRead reading model names of CPU 00 0 cence 81 4 3 12 mdControl remote RUN STOP PAUSE 00000 cece eee eens 86 4 3 13 mdWaitBdEvent waiting for event occurrence 0 0 cece ence 87 4 3 14 mdBdRst resetting board 6 idrate badi hrada auan 90 4 3 15 mdBdModSet setting modes of board annor nrnna arne 91 4 3 16 mdBdModRead reading modes of board 00000 cece eee eee 93 4 3 17 mdBdLedRead read LED information of the board 0002 cece eee eee 95 4 3 18 mdBdSwRead reading switch status of the board 0 0 0 0 ccc cece eee eee 101 4 3 19 mdBdVerRead read version information of the board n snanu anann annaa 103 4 3 20 mdinit initializing programmable controller information table 000005 106 4 3 21 mdSend batch writing devices SEND function 0 0 0 0000 u cece eee ee ee 107 4 3 22 mdReceive batch read devices RECV function 0 0 00000 c cece e eee eee 111 4 3 23 mdRandW writing devices randomly 0 0 0 0c cec
19. C 12 000CH DevCN Data register D 13 000DH DevD Special register SD 14 000EH DevSD Timer setting value main T 15 OOOFH 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 Cc 17 0011H DevCM Counter setting value sub1 Cc 18 0012H DevCS CHAPTER 4 FUNCTIONS Device type Device Code specification Device name Decimal Hexadecimal specification Counter setting value sub2 Cc 18002 4652H DevCS2 Counter setting value sub3 Cc 18003 4653H DevCS3 Accumulator A 19 0013H DevA Index register E mes mete V 21 0015H DevV R 22 0016H DevR Pite regiae ZR 220 00DCH DevZR Extended file register 1 2 ER 22000 to 22256 55F0H to 56F0H DevERO to 256 Link relay B 23 0017H DevB Link register 24 0018H 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 S S Long counter c
20. Controller Network Interface Board User s Manual For SW1DNC MNETG B lt 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 gt 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 lt Manual number model code gt 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
21. FFFFFFFA d d write i tof th 8 Channel number error H e channel number specified in the mdOpen Check the channel number FFF8 The ch l b ified in the mdO Check the ch l b FFFFFFF8k _ function is invalid 12 Block number error e Check the block number device type of the file register H e block number of the specified file register is e Check if the specified device is valid on the programmable FFF4 The block ber of th ified fil ister i Check if th ified device i lid on th bl H invalid controller of the target station FFFFFFF4 invalid troller CPU of the t t stati 43 Write protect error e Check the block number device type of the extension file e block number of the specified extension file register FFF3x The block ber of the specified extension fil gist FFFFFFE3H register is overlapping with the write protect area e 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 H e specified network number or station number e Check the network number and the station number FFFO Th ified network b tati b Check th twork b d the stati b FFFFFFFOn is out of the range 135 Error Code Error description Corrective action application to wait is out of the range HEX All station specification and group number specification error e Check the network number
22. Failure occurring from inappropriate storage or handling carelessness or negligence by the user Failure caused by the user s hardware or software design 2 Failure caused by unapproved modifications etc to the product by the user 3 When the Mitsubishi product is assembled into a user s device Failure that could have been avoided if functions or structures judged as necessary in the legal safety measures the user s device is subject to or as necessary by industry standards had been provided 4 Failure that could have been avoided if consumable parts battery backlight fuse etc designated in the instruction manual had been correctly serviced or replaced 5 Failure caused by external irresistible forces such as fires or abnormal voltages and Failure caused by force majeure such as earthquakes lightning wind and water damage 6 Failure caused by reasons unpredictable by scientific technology standards at time of shipment from Mitsubishi 7 Any other failure found not to be the responsibility of Mitsubishi or that admitted not to be so by the user 2 Onerous repair term after discontinuation of production 1 Mitsubishi shall accept onerous product repairs for seven 7 years after production of the product is discontinued Discontinuation of production shall be notified with Mitsubishi Technical Bulletins etc 2 Product supply including repair parts is not available after production is discontinued 3 Overseas service
23. 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 e 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 15 Page 133 CHAPTER 6 gt Related function mdOpen mdClose mdRemBufReadEx 78 CHAPTER 4 FUNCTIONS 4 3 10 mdRemBufReadEx reading data from buffer memory of remote device station i 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 AS w w Integer stno Station number IN T E Integer offset Offset IN 3 2 Integer size Read byte size IN a 3 Short data n Read data single precision integer array OUT pe a Argument Description x Specify the path of channel whose communicatio
24. IENSIA Huisy 9 E suonouny Buisn 104 sues EZ 7 On the Select Directory screen select the folder to which q e MSc gt Common Search Common the library file is stored Organize New folder aed E Recent places A Name z Date modified Type Libros Bie see AN pd Mdfunc32 lib is stored in the following directory at 7 W inctupe 3 26 2015 1 56PM File folder E Documents J tib 3 26 20151 56PM__ File folder o Music 26 2015 1 57PM File folder i i BM fa prevent ik folder installation For creating a 32 bit version user application re lt User specified folder gt lt COMMON2 gt lt LIB gt Win8 ENG C 5 5 A 7 Wee PH For creating a 64 bit version user application a PATLEPHEY lt folden 1e lt User specified folder gt lt COMMON gt lt LIB gt lt x64 gt Select Folder Cancel 8 Homegroup To the next page 33 From the previous page S BMS aK EH o EE 8 Open the project to create a user application and select te Add Class PROJECT Properties a Class Wizard Ctrl Shift X te Add Resource O Add New Item Ctrl Shift A O Add Existing Item Shift Alt A fa NewFiter 7a HD Show All Files Unload Project Rescan Solution References HF Set as StartUp Project Build Customizations Manage NuGet Packages P Enable NuGet Package Restore Properties 7 9 Inthe folder area of the Property Pages scre
25. Object Viewer Pi Spy A MFC Tracer Customize Options t Si Macro Record Quick Macro Ctrl Shift R Play Quick Macro Ctrl Shift P Options e 2 Select lt lt Directories gt gt and specify Include files for Show directories for Editor Tabs Debug Compatibiity Build Directories Platform Show directories for Win32 bd Include files Directories D Program Files Microsoft Visual Studios VC98 INCLUDE D Program Files Microsoft Visual Studio C98 MFC INCLUDE D Program Files Microsoft Visual Studio VC9S ATLAINCLUDE 3 Double click the item to be set and browse the folder containing include files Choose Directory Directory name JD MELSEC COMMONSINCLUDE Cancel E dA Network amp MELSEC peaa E gt Common Mdfunc h is stored in the following directory at installation lt User specified folder gt lt COMMON gt lt INCLUDE gt 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 A Visual Component Manager P Register Control A Error Lookup A activex Control Test Container J OLE COM Object Viewer A Soy Pa MFC Tracer Customize Options t gt Macro Record Quick Macro Ctrl Shift R Play Quick Macro Ctrl Shift P 2 Select lt lt Directories gt
26. System Master Local Module User s Manual lt SH 080394E 13JR64 gt 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 MELSECNETHH 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 lt Manual number model code gt Description CC Link IE
27. all settings Cancel Select Directory mesec a cceu amp Common Help o a amp us Bun Easysocket S a MNETG Path to use when searching for include files while building a YC project UDE Foder INCLUDE Make New Folder 4 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 e Browse the folder containing include files Mdfunc h is stored in the following directory at installation lt User specified folder gt lt COMMON gt lt INCLUDE gt Add include lt Mdfunc h gt at the beginning of the program 21 suonoun4 Buisn 104 sues EZ B00Z t tO IENSIA G00Zg 9 IENSIA 00Z LIN g 9 IENSIA BUISN ye 2 Setting library files Environment E Projects and Solutions General Build and Run VB Defaults VC Directories VC Project Settings Source Control amp Text Editor Database Tools Debugging E HTML Designer Text Templating E Windows Forms Designer amp Workflow Designer 1 Tools Window Help 5 Attach to Process Ctri Alt P Th Connect to Database Connect to Server Code Snippets Manager Ctrl K
28. and station number 47 All stations or group number was specified fora Check if the function supports all station specification and group FFEFH function other than the SEND function number specification FFFFFFEFH e The device type with arrival acknowledgment e 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 FFEEn A command code which is not valid for mdControl Check the command code FFFFFFEE was specified 19 SEND RECV channel number error FFEDn The channel number specified for the e Check the channel number FFFFFFEDH SEND RECV function is out of the range 31 DLL load error FFE1h An attempt to load DLL required to execute the e Reinstall the software package FFFFFFE1n function failed Resource time out error e Close the user program correctly 32 e The user program was forcibly terminated e Retry the operation FFEOn e The resource is not freed within the transient e There is a possibility of a memory shortage Terminate other FFFFFFEOn timeout monitoring time because other tasks application s currently running and threads are occupying the resource e Exit the program and restart the personal computer 33 Incorrect access target error e Check whether an unsupported communicatio
29. 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 Receive data single precision integer array OUT Visual Basic NET ret mdReceiveEx 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 Integer devtyp Device type IN Integer devno Channel number IN Integer 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 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 64 CHAPTER 4 FUNCTIONS Argument Description Specify the path of channel whose communication line is opened th Path of ch l pa TRT Oean S Use the path which is returned when executing mdOpen netno Network number Specify 0 0H stno Sta
30. be deleted by writing data to the block extended file register to which the extended comment is assigned e 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 V Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes 5 Page 133 CHAPTER 6 gt Related function mdOpen mdClose mdSendEx mdReceive mdReceiveEx 108 CHAPTER 4 FUNCTIONS 2 SEND function WY 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 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 Send byte size IN OUT short data J Send data single precision integer array IN Visual Basic NET ret mdSend path stno devtyp devno size data 0 Short ret Return value OUT Integer path Path of channel IN
31. button and then click z Inherited values VC_IncludePath WindowsSDK_IncludePath Inherit from parent or project defaults Macros gt gt Cancel ELOZ ttO IENSIA Huisy 9 E Z suonouny Buisp 104 sues EZ 7 On the Select Directory screen select the folder to which 1 i MESEC Common Search Common the include file is stored Organize New folder Name Date modified Type 04 Microsoft Visual Sty ee nee eae Ia Mdfunc h is stored in the following directory at installation He Favorites d lib 3 26 2015 1 56PM File folder Roce aoe srs TE Held lt User specified folder gt lt COMMON gt lt INCLUDE gt E Recent places Bi Libraries Documents a Music E Pictures E Videos ve Folder INCLUDE Select Folder 8 Add include lt Mdfunc h gt at the beginning of the program 31 2 Setting library files 1 Open the project to create a user application and select VIEW PROJECT BUILD DEBUG TEAM TOOLS Fal Solution Explorer CtrisAlteL 2 Team Explorer cet Celeb VIEW Solution Explorer BE Server Explorer Ctrl Altes he SQL Server Object Explorer Ctrl Ctrl S 5 Bookmark Window Ctrl K Ctrl E Call Hierarchy Ctri Alt K ag Class View Ctrl Shift C E Code Definition Window Ctrl D E Object Browser Ctrl Alt J E Error List Ctrl E Ke Output Ctrl alt O Start Page Task List Ctrl
32. eet Soe a E e E Shee se ae en iets La 144 Warranty 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 EF K7 Page 3 RELEVANT MANUALS L shows reference 9 shown pages Poi P Ldshows reference oint To create a 64 bit version user application a project 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 Poin tP shows notes Studio that requires attention LI shows useful 2 3 1 Using Visual Basic 5 0 Visual Basic 6 0 f Do ka _ information This section explains the setting operation when using Visual Basic 5 0 Visual Basic 6 0 4 Start Visual Basic and select Project Add Module w project Format gebug aun Query T Add Form ES add MDI Form ie BA add class module AB add User Control fa Adi Property Page The section of the current page is shown New Exiting 2 Select lt
33. enabled while accessing the device by the random write random read function mdRandWEx mdRandW mdRandREx mdRandR 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 interlock 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
34. gt and specify Library files for Show directories for Browse the folder containing library files as in Platform Show directories for 1 on the previous page Win32 Library fies x Mdfunc32 lib is stored in the following directory at Directories xt F installation D Program Files Microsoft Visual Studio Y C98 LIB cigs D Program Files Microsoft Visual Studio VC98 MFC LIB lt User specified folder gt lt COMMON gt lt LIB gt D MELSEC COMMON LIB Options Editor Tabs Debug Compatibility Build Directories 3 Open the workspace to create a user application and select Project Build Tools Window Help Project Settings Set Active Project Add To Project gt Source Control gt suonouny Buisn 104 sues EZ Dependencies Settings Export Makefile OQgttO ENSIA O GgttO ENSIA BUSH ZEZ Insert Project into Workspace Project Settings PX 4 Select lt lt Link gt gt and specify General for the category and 7 es Ei Heart eat nee ire eit Cc enter Mdfunc32 lib in the Object library modules field ERE project Came cost ee Output file name Debug project exe Object library modules MdFunc32 iH I Generate debug info Ignore all default ibraries Link incrementally Generate mapfile I Enable profiling Project Options nologo subsystem windows incrementalyes pdb Debug project pdb debug machine 386 outDebug project e
35. lt Existing gt gt and select Mdfunc bas wanono enc Mdfunc bas is stored in the following directory at installation lt User specified folder lt COMMON gt lt INCLUDE gt suolpun BUSA 10 SUMAS Z Fle nane ckinobas Dien Filesoftype Basic Fle bas v _ Canca Hsp 0 9 9ISed ENSIA O S 9ISeq lens A BUJSN PEZ IT Dont show this dialog he future The following shows the symbols used in this manual with descriptions and examples Symbol Example Project lt lt gt gt 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 Q80BD J61BT11N and Q81BD J61BT11 CC Link system master local interface board MELSECNET H board Generic term for Q80BD J71LP21 25 Q81BD J71LP21 25 Q80BD J71LP21S 25 Q80BD J71LP21G Q80BD J71LP21GE and Q80BD J71BR11 MELSECNETH H interface board CC Link IE Controller Network board Generic term 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 Ne
36. mdOpen g Store the board switch status being read g buf Read data For details of the stored switch status refer to Explanation shown on the g next page a gt n a n Q gt oO o 0 101 Explanation The board 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 n 1 to 64 1 to 120 0 to 120 station number 0 master station MNET 10 mode Setting value of 0to9 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 Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes 5 Page 133 CHAPTER 6 gt Related function mdOpen mdClose 102 CHAPTER 4 FUNCTIONS 4 3 19 mdBdVerRead read version information of the board LY Function Read the version information of the board L Format Visual C ret mdBdVerRead path buf short ret Return value OUT long path Path of channel IN short buff Read data OUT Vis
37. mdRandWEx path netno stno dev 0 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 channel 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 eA Use the path which is returned when executing mdOpen netno Network number Specify the network number of target station Page 50 Section 4 2 3 stno Station number Specify the station number of target station Page 50 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 KRGEN Specify the data to be written to the array variable of buf 0 or later single precision integer array bufsize Dummy 66 CHAPTER 4 FUNCTIONS C Explanation The
38. not a valid Win32 application lt When using Windows 7 32 bit version gt CAMELSEC MTEST exe Ee The version of this file is not compatible with the version of Windows you re running Check your computer s system information to see whether you need an x86 32 bit or x64 64 bit version of the program and then contact the software publisher 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 OO66H may occur during executing a MELSEC data link library function Take the following measures as necessary e Retry process of a MELSEC data link library function e Disable the automatic update of the operating system and other applications Stop other applications 13 Device access when the cyclic data assurance is enabled Use the batch write batch read function mdSendEx mdSend mdReceiveEx mdReceive to access devices when enabling the cyclic data assurance 32 bit data integrity assurance and block data assurance per station The cyclic data assurance 32 bit data integrity assurance and block data assurance per station is not
39. number of blocks that can be specified is within 1 to 32767 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 D10 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 D10 and later lt 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 buff 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 50 eter re All bits of M100 to M115 are OFF sead uooun4 Ey 16 points of bit information can be stored buf 1 10 Current value of D10 buf 2 200 771e Current value of D11 buf 3 300 Current value of D12 buf 4 400 Current value of D13 buf 5 Ox3 fff All b
40. settings functions programming 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 SAREINGRREGAUIMION Sie eeu hey ware ra hare a Oe ona E ene ee nee Rae heey ete 1 CONDIMONSIORUSEE Rani Es PRODUCTES E re st ere eee 2 NAM ROT DIU KO Ne eer ee era ete crc ete aaa one ety Sy eens eee a een cuales ce De teat ae cee 3 RELATE DIMAN WALES eater ce eee se ho we ata or carr rata ear ern Een oe en 3 HOWTOREAD THIS PANIUPN We Zoran Gee pee a ee ee ners Seen eRe eee 9 SIRE EMS eee eg ee ra CS ce E te Ae eA are ay ee en Pe ree ee at 10 CHAPTER 1 OVERVIEW 11 1 1 MELSEC Data Link Library 2 0 0 eet e tenes 11 T2 Supported Bo
41. size IN OUT z Integer data n Receive data single precision integer array OUT 3 o 113 Argument Description Specify the path of channel whose communication line is opened Use the path which is returned when executing mdOpen path Path of channel stno Station number Specify the own station 255 FFH devtyp Device type Specify the RECV function 101 65n Specify the own station channel number on which the received messages are stored e MELSECNETH H board CC Link IE Controller Network board 1 to 8 e CC Link IE Field Network board 1 to2 Specify the byte size of received data in even number e 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 e 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 e The size of actual received data is received devno Channel number size Receive byte size Received actual data and send source information are stored as single Receive data data with send source information single precision integer array 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 precision integer array Reserve an area for the specif
42. 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 Library 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 gt lt COMMON gt lt LIB gt For creating a 64 bit version user application lt User specified folder gt lt COMMON gt lt LIB gt lt x64 gt 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 C 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 C eeeoeoeeeeveveeneeeseeeoeeeeeeeeeeeeseeeeeeeeeeeeveeeeeaeeeeeeeeeeeeeee ee 1 Setting include files 1 Microsoft Visual Studio View Project Buld Debug Team Data Tools T j A Solution Expl
43. value other than 0 Refer to the list of error codes Page 133 CHAPTER 6 gt Related function mdOpen mdClose mdDevRstEx 74 CHAPTER 4 FUNCTIONS 4 3 8 mdDevRstEx resetting extended bit devices LY Function Reset the specified bit device on the target station to OFF L Format Visual C ret mdDevRstEx path 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 Visual Basic NET ret mdDevRstEx path netno stno devtyp devno Integer ret Return value OUT Integer path Path of channel IN Integer netno s Network number IN Integer stno Station number IN Integer devtyp Device type IN RA Integer devno Specified device number IN ee ss 35 z 82 Visual Basic 5 0 Visual Basic 6 0 9 lt ret mdDevRstEx path amp netno stno devtyp devno g F m o x Long ret Return value OUT 7 n Long path Path of channel IN Long netno Network number IN Long stno Station number IN x Long devtyp Device type IN D Long devno Specified device number IN z a Argument Description 8 Specify the path of channel whose communication line is opened ie path Path of channel Oy f Use the path which is returned when executing mdOpen Specify the network number of target station netno Network numb
44. values of LCN100 and LCN101 LCN100 is 0x1 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 ot 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 133 CHAPTER 6 D gt Related function mdOpen mdClose mdRandW sead uooun4 Ey Ajwopued sanap Bulpeas ypueypu pzEr 121 4 3 25 mdDevSet setting bit devices LY Function Set the bit devices on the target station to ON L Format Visual C ret mdDevSet path stno devtyp devno short long short short short ret path stno devtyp devno Visual Basic NET ret mdDevSet path stno devtyp devno Short Integer Short Short Short ret path stno devtyp devno Return value OUT Path of channel IN Station number IN Device type IN Specified device number IN Return value OUT Path of channel IN Station number IN Device type IN Specified device nu
45. whose communication line is opened path Path of channel ey Use the path which is returned when executing mdOpen Specify the network number of target station netno Network number gt Page 50 Section 4 2 3 Specify the station number of target station stno Station number Page 50 Section 4 2 3 Logical station numbers cannot be specified Specify whether to send data with arrival acknowledgment or without arrival acknowledgment e With arrival acknowledgment Specify 101 65x e Without arrival acknowledgment Specify 102 66x devtyp Device type Specify a channel used by the own station and a target station channel devno Channel number f on i 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 e When accessing via MELSECNET 10 network specify the byte size within the range of 2 to 960 size Send byte size Send data TERT nh data Sack 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 e This function supports the SEND instruction of the link dedicated instruction For details of the functions refer to the manuals of each board e The following explains how to specify t
46. 10 M100 to M115 All bits are OFF D10 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 lt M100 and later D10 and later lt 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 buff which stores the read data buf 0 to buf 6 7 x 2 14 bytes Enter 14 for this example Read data buf buf O 0 s sse 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 0 Current value of T10 is 10 1 second 120 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 the current
47. 10 CHAPTER 4 FUNCTIONS 4 3 22 mdReceive batch read devices RECV function 1 Batch reading devices WY Function Batch read data from the devices on the target station for the number of read data bytes from the start device number 7 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 Start device number IN short size Read byte size IN OUT short data Read 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 3 S Short stno Station number IN N Al Short devtyp Device type IN a 2 Short devno Start device number IN Q 9 Short size Read byte size IN OUT 6 5 Short data n Read data single precision integer array OUT ig n Q Visual Basic 5 0 Visual Basic 6 0 y ret mdReceive path amp stno devtyp devno size data 0 T Integer ret Return value OUT 8 Long path Path of channel IN a Integer stno Station number IN z Integer devtyp Device type IN 5 Integer devno Start device number IN 3 Integer size Read byte size IN OUT i Integer data n Read data single precision integer array OUT 111 Argument Description Specify the path of channel whose communication line is opened path Path of channel n
48. 40 3 3 2 Access to devices of QnA Q L and R series module 0 0 0 0 0 0000 41 3 3 3 Access to devices of A series module n nunnan nannaa erer 42 3 3 4 Access to Ethernet adapter module Head module and CC Link IE Field remote device stationes thana a a are E a eee ys AA te y A hohe ETA 43 3 3 5 Access to other station buffer memory of CC Link n a sasssa erarnan rnaen 43 3 3 6 Access using the SEND function or the RECV function a oa auauua aaaea 44 CHAPTER 4 FUNCTIONS 45 44 Listof Functions niei ea a Siok Melee Bade a a ii 45 4 2 Common Specifications of Functions 0 0 00 000 cee ee 47 4 2 1 Specifying channel number 00 00 ccc cette teen eee 47 4 2 2 Specifying station numbers 0 0 00 eee 48 4 2 3 Specifying network numbers and station numbers for extended functions 50 4 2 4 Specifying device types 1 cee een e een ane 52 CHAPTER 6 ERROR CODES 133 4 3 F nction Details e dca ed epee Sede ei Gad Van ei pha Sada hina ee ss 55 4 3 1 mdOpen opening communication lines o n naaar 56 4 3 2 mdClose closing communication lines 2 0 nananana u cee eee eee 57 4 3 3 mdSendEx batch writing extended devices SEND function 4 58 4 3 4 mdReceiveEx batch reading extended devices RECV function 62 4 3 5 mdRandWEx writing extended devices randomly 000 002 ce eee eens 66
49. 6 gt Related function mdOpen mdClose sead uoyoun4 Ey NddD jo s weu japow Bulpess pe yadAlpwu pper 85 4 3 12 mdControl remote RUN STOP PAUSE LY Function Remotely operate a CPU on the target station Remote RUN STOP PAUSE iL Format Visual C ret mdControl path stno buf short ret Return value OUT long path Path of channel 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 Page 48 Section 4 2 2 Specify the command code remote RUN STOP PAUSE for remote buf C d cod u AS cee operation of CPU For details refer to Explanation shown below C 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 Succes
50. 6 CHAPTER 4 FUNCTIONS 4 3 21 mdSend batch writing devices SEND function 1 Batch writing devices WY Function Batch write data to the devices on the target station for the number of written data bytes from the start device number 7 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 dataf Return value Path of channel Station number Device type Start device number Mritten 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 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 107 uoyoUNY ANIS S8dlAep Buyum yoyeq pusspul z Ey sead uoyoun4 Ey Argument Description Specify the path
51. BB ft k the dri ted 70 Event overlapped occurrence error e Set the interval of the event occurrence longer enough for the FFBAn The event with the same event number occurred user program to process FFFFFFBAn multiple times e Check if the target station is remote device station of CC Link IE 71 Remote device station access error Field Network FFB9n Failed to access to the buffer memory of a remote Check the network number and station number H evice station e Check if the offset values or offset write read byte size is within FFFFFFB9n device stati Check if the offset val fiset ite read byte size is withi the range of the buffer memory of the target station 257 FEFFH FFFFFEFFn io Errors detected in the MELSECNET H and Refer to the MELSECNET H and MELSECNET 10 Network 4096 MELSECNET 10 network system System Reference Manuals F000 FFFFFO0On f e Check the target station number and perform the operation 2174 Transient data target station number error dan in F782n e The target station number is incorrect g F i If the error occurs after performing the above corrective action FFFFF782n e The target station number is 0 f a 4 please consult your local Mitsubishi representative 4097 EFFFH FFFFEFFFn ie Errors detected in the CC Link IE Controller e Refer to the CC Link IE Controller Network System Reference 8192 network system Manuals E000n FFFFE000n 137
52. Basic NET ret mdDevRst 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 mdDevRst path amp stno devtyp devno Specify the path of channel whose communication line is opened ASR Integer ret Return value OUT S 2 Long path Path of channel IN a 5 Integer stno Station number IN a z Integer devtyp Device type IN 2 Integer devno Specified device number IN D go Argument Description path Path of channel a f Use the path which is returned when executing mdOpen oo stno Station number Specify the station number of target station Page 48 Section 4 2 2 Q Specify the type of device to be reset OFF 2 devtyp Device type pecify the typ OFF 2 Page 52 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 Page 133 CHAPTER 6 C gt Related function mdOpen mdClose mdDevSet 123 CHAPTER 5 SAMPLE PROGRAMS This chapter explains the sample programs that are included on the CD ROM of
53. CLUDE gt 2 3 4 CHAPTER 2 PROGRAMMING Using Visual C NET 2003 Visual C 2005 Visual C 2008 This section explains the setting operation when using Visual 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 C 1 Setting include files Options Tools Window Help Attach to Process Ctrl alt P Th Connect to Database Wl Connect to Server E Code Snippets Manager Ctrl K 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 E Projects and Solutions General Build and Run VB Defaults VC Directories VC Project Settings amp Source Control amp Text Editor amp Database Tools Debugging HTML Designer Text Templating E Windows Forms Designer E Workflow Designer Platform Show directories for wing2 include fies VCInstallDir include vCinstallDir atimFc include WindowsSdhDir include FrameworkSDKDirjinclude lt i RICE gt Include Directories Corresponds to environment variable INCLUDE Show
54. Close mdRandR sead uoyoun4 Ey Ajuopue saon p Bupum Mpueypwu ezer 117 4 3 24 mdRandR reading devices randomly LY Function Read the device specified with the randomly specified devices from the target station L Format 118 Visual C ret mdRandR path stno dev buf bufsize 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 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 path Pathof 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 num
55. Ctrl B Choose Toolbox Items Add in Manager Macros gt Partner Products Catalog Dotfuscator Community Edition WCF Service Configuration Editor External Tools Import and Export Settings Customize Options Platform i Win32 v Show directories for lex Library Files CInstallDirib VCInstalDir atimfc ib VCInstalDir atimFc ib i386 WindowsSdkDir ib FrameworkSDKDirlib vSInstallDir VSInstalDirjlb a m gt Library Directories Path to use when searching for library files while building a YC project Corresponds to environment variable LIB Show all settings soft Visual Studio Project Build Debug Data Tools Add Class 3 amp J Add New Item Ctrl Shift a E Add Existing Item Ctrl D Exclude From Project Show All Files Update Managed Resources properties gi E C C Linker General Input Manifest Fle Debugging System Optimization Embedded 10L Advanced Command Line 8 Manifest Tool i Re BM EE EE E Ex Additional Dependencies Species addtional tems to add to the ink Ine ex kernel32 1b configuration spec Ignore Specific Library Module Definition Fie Force Symbol References Delay Loaded DLLs Assembly Link Resource 22 ph Start Visual C and select Tools Options Select VC Directories in
56. EHCPU QnA series CPU module QnACPU Q26UDHCPU Q26UDEHCPU Q26UDVCPU Q50UDEHCPU Q100UDEHCPU 9 LO2SCPU L02SCPU P LO2CPU LO2CPU P LO6CPU LO6CPU P L26CPU gt L skes CRumodule ECRU L26CPU P L26CPU BT L26CPU PBT 8 n Head module LJ72GF15 T2 2 iQ R series CPU module RCPU RO4CPU RO8CPU R16CPU R32CPU R120CPU g Ethernet adapter module NZ2GF ETB E AJ65BT R2 Intelligent device station a slave station on the CC Link system that can perform the transient transmission 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 Analog input module Analog output module NZ2GF2B 60AD4 NZ2GF2B 60DA4 Temperature control module NZ2GF2B 60TCTT4 NZ2GF2B 60TCRT4 High speed counter module NZ2GFCF D62PD2 CC Link IE Field remote device station CC Link Ver 2 board Q80BD J61BT11N Q81BD J61BT11 Q80BD J71LP21 25 Q81BD J71LP21 25 Q80BD J71LP218 25 Beit Pee Q80BD J71LP21G Q80BD J71LP21GE Q80BD J71BR11 board CC Link IE Controller Network Q80BD J71GP21 SX Q80BD J71GP218 SX Q81BD J71GP21 SXx board Q81BD J71GP21S SX CC Link IE Field Network board Q80BD J71GF11 T2 Q81BD J71GF11 T2 1 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 re
57. ELSECNET 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 960 e When accessing via MELSECNET 10 network specify the byte size within the range of 2 to 960 Send data p si acs aes data i EROS 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 C Explanation e This function supports the SEND instruction of the link dedicated instruction For details of the functions refer to the manuals of each board e The following explains how to specify the channel numbers 4 bytes ea Target station channel Channel number 3 2 1 0 t 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 V Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes 5 Page 133 CHAPTER 6 gt Related function mdOpen mdClose mdSend mdReceive mdReceiveEx 1
58. Field Network the buffer memory can be accessed only by the mdRemBufWriteEx function or the mdRemBufReadEx function w w w w 3 3 9 i i gt 8 J Access to other station buffer memory of CC Link gt 8 os oO The following table shows the accessible buffer memory of CC Link network module and CC LinkVer 2 board z g The multiple CPU system when the logical station is specified cannot be accessed S 2H O Accessible x Not accessible Q Device Access type Accessibility E Oo Link special relay SB Batch O 5 Link special register SW Batch Q a Remote input RX Batch O a Remote output RY Batch O 9 Remote register RW Batch O 3 Q Buffer memory Batch O 5 Random access buffer Batch Q a S x E Point 5 When the own station number is 64 other station cannot be accessed Only the own station can be accessed m oa a 3 e Qa O lt O oO n a a 43 3 3 6 44 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 O Accessible x Not accessible Access target Device Access type CPU module PC interface board QnA Q L R RECV function Batch O Own station SEND function with arrival acknowledgment Batch O O SEND function without ar
59. H The specified path is invalid e Use a path of the communication line that supports the function Start device number error e The specified start device number is out of the e Check the start device number 2 range e When specifying a bit device specify a start device number in FFFEH When specifying a bit device the start device multiples of 8 FFFFFEFEH number is not multiples of 8 e Check the device number and points e 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 y YP on yP FFFDn H hen e 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 e The set of start device number and size is over Check the device size H e device range Check the start device number and size FFFB the devi Check the start devi b d si H An access was attempted with odd number Specify even number bytes FFFFFFFB A tt ted with odd b Specif ber byti bytes 6 Number of blocks error H e number of blocks specified for the device Check the number of blocks FFFA Th ber of block ified for the devi Check th ber of block H random read write is out of the range
60. MITSUBISHI ELECTRIC Mitsubishi PC Interface Board MELSEG MELSEC Data Link Library Reference Manual Q80BD J61BT11N Q81BD J61BT11 Q80BD J71LP21 25 Q80BD J71LP21S 25 Q81BD J71LP21 25 Q80BD J71LP21G Q80BD J71BR11 Q80BD J71GP21 SX Q80BD J71GP21S SX Q81BD J71GP21 SX Q81BD J71GP21S SX Q80BD J71GF11 T2 Q81BD J71GF11 T2 SAFETY PRECAUTIONS 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 CONDITIONS OF USE FOR THE PRODUCT 1 Mitsubishi programmable controller the PRODUCT shall be used in conditions i where any problem fault or failure occurring in the PRODUCT if any shall not lead to any major or serious accident and ii where the backup and fail safe function are systematically or automatically provided outside of the PRODUCT for the case of any problem fault or failure occurring in the PRODUCT The PRODUCT has been designed and manufactured for the purpose of being used in general industries MITSUBISHI SHALL HAVE NO RESPONSIBILITY OR LIABILITY INCLUDING BUT NOT LIMITED TO ANY AND ALL RESPONSIBILITY OR LIABILITY BASED ON CONTRACT WARRANTY TORT PRODUCT LIABILITY FOR ANY INJURY OR DEATH TO PERSONS OR LOSS OR DAMAGE TO P
61. 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 Addition Section 4 3 9 Section 4 3 10 Correction Jun 2014 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 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 Addition Section 2 3 6 Apr 2015 SH 081035ENG G __ Correction Section 2 3 3 Section 3 2 1 Section 3 2 2 Section 3 3 2 Section 4 2 2 Section 4 2 3 Section 4 3 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 Chapter 6 Sep 2015 SH 081035ENG H _ COrTection Section 2 2 1 Chapter 6 Japanese Manual Version SH 081034 H This manual confers no industrial property rights or any rights of any other kind nor does it confer any patent licenses Mitsubishi Electric Corporation cannot be held responsible for any problems involving industrial property rights which may occur as a result of using the contents noted in this manual 2011 MITSUBISHI ELECTRIC CORPORATION 144 Warranty Please confirm the following product w
62. ROPERTY 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 e 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 e 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 e 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
63. Short stno Station number IN Short devtyp Device type IN RA Short devno Channel number IN 2 Short size Send byte size IN OUT 3 5 Short data n Send data single precision integer array IN D S 29 Visual Basic 5 0 Visual Basic 6 0 g ret mdSend path amp stno devtyp devno size data 0 Integer ret Return value OUT 2 Long path Path of channel IN A Integer stno Station number IN Integer devtyp Device type IN o Integer devno Channel number IN 5 Integer size Send byte size IN OUT 5 Any data n Send data single precision integer array IN S 109 Argument Description Specify the path of channel whose communication line is opened path Path of channel nage j Use the path which is returned when executing mdOpen Specify the station number of target station stno Station number Page 48 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 4 e With arrival acknowledgment Specify 101 65n e Without arrival acknowledgment Specify 102 66x 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 e Specify the byte size within the range of 2 to 1920 e When receiving the data which are transmitted by M
64. Studio 2010 Visual C e Visual Studio 2012 Visual C e Visual Studio 2013 Visual C Sample programs are created in VisualC 6 0 project format 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 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 130 CHAPTER 5 SAMPLE PROGRAMS 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 gt lt CCIEF gt lt SAMPLES gt 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 or Visual Studio 2013 Visual Basic are stored in MTEST2 folder Point Sample programs for MTEST folder of NETVB This samp
65. T LTC LSTT and LSTC e 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 ee Store the data being read single precision integer array C 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 A oO Example When devtyp is LZ and size is 8 T J Array Value z data 0 Lower 1 word of LZO 9 data 1 Upper 1 word of LZO 5 n 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 133 CHAPTER 6 gt Related function mdOpen mdClose mdReceive mdSend mdSendEx uonoun ADY S8OlAep pepue xe Huipea yoyeq xyFenleoeypw p e y 63 2 RECV function LY Function Read data of the specified channel number from the data which
66. T Toolbox Ctrl Alt x YX Notifications Ctrl W N Find Results Other Windows Toolbars EI Full Screen Shift Alt Enter All Window Shift Alt M Navig Ctrl Navigate Forwat Ctrls Shift Next Task Previous Task Properties Window F4 Property Pages Shift F4 2 Right click the project in the Solution Explorer and select Properties from the shortcut menu The Property Pages screen is displayed Rebuild Clean View Analyze Project Only Scope to This E New Solution Explorer View Profile Guided Optimization Build Dependencies Add Class Wizard Ctrl Shift Manage NuGet Packages ome Set as StartUp Project Debug Source Control cut culex Paste Clev as Remove Del FX Rename Unload Project Resan Solution Open Folder in File Explorer w Properties AlteEnter 3 Select the configuration and the platform to be changed in the Configuration All Configurations b Common Properties 4 Configuration Properties General Debugging VC Directories b C C b Linker b Manifest Tool b Resources b XML Document Generator D Browse Information p Build Events b Custom Build Step Blatform AN Platforms 4 General Output Directory Intermediate Directory Target Name Target Extension Extensions to Delete on Clean Build Log File Platform Toolset Enable Managed Incremental Build Project Defaults Configuration Type Use of MFC Configur
67. UDVCPU 0367H Q04UDVCPU 0368H QO6UDVCPU 036AH Q13UDVCPU 036CH Q26UDVCPU 2010H Q172CPU Q172CPUN Q172CPUN T 2012H Q172HCPU EE 2011H Q173CPU Q173CPUN Q173CPUN T na 2013H Q173HCPU 33 2014H Q172DCPU 3 5 2015H Q173DCPU A 3 2018H Q172DSCPU aa 2019H Q173DSCPU A e MELSEC QnA series g Model name code 3 Hexadecimal one vale 0021H Q2ACPU Q2AHCPU Q2ASCPU Q2ASHCPU 3 0022H Q2ACPU S1 Q2AHCPU S1 Q2ASCPU S1 Q2ASHCPU S1 o 0023H Q3ACPU 9 0024H Q4ACPU Q4ARCPU lt e MELSEC A series Model name code Hexadecimal e 0082H A2UCPU A2USCPU 0083H A2UCPU S1 A2USCPU S1 0084H A3UCPU A2USHCPU S1 0085H A4UCPU 0092H A2ACPU 0093H A2ACPU S1 83 84 Model name code Hexadecimal Mosel ane 0094H A3ACPU 0098H AOJ2HCPU A1SCPU A1SJCPU OO9AH A2CCPU A2CJCPU OOAOH AOJ2CPU 00A1H A1CPU A1NCPU 00A2H A2CPU A2NCPU A2SCPU 00A3H A3CPU A3NCPU A1SHCPU A1SJHCPU A2SHCPU A2SH1CPU 00A4H A3HCPU A3MCPU CHAPTER 4 FUNCTIONS Others Model name code 3 Model name Hexadecimal Q80BD J71GF11 T2 Q81BD J71GF11 T2 Q80BD J71GP21 SX Q80BD J71GP21S SX Q81BD J71GP21 SX Q81BD J71GP21S SX 0090 j 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 Page 133 CHAPTER
68. a n Written data single precision integer array Visual Basic 5 0 Visual Basic 6 0 ret mdSendEx path amp netno stno devtyp devno size data 0 Long Long Long Long Long Long Long Any 58 ret Return value path Path of channel netno Network number stno Station number devtyp Device type devno Start device number size Written byte size data n Written data single precision integer array IN OUT IN IN OUT IN IN OUT IN CHAPTER 4 FUNCTIONS 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 netno Network number Specify the network number of target station Page 50 Section 4 2 3 stno Station number Specify the station number of target station Page 50 Section 4 2 3 devtyp Device type Specify the type of device to which the data is written gt Page 52 Section 4 2 4 devno Start device number Specify the start device number of device to which the data is written e Specify the start device number with a multiple of 8 for the access to a bit device except for LTT LTC LSTT and LSTC e 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 size Written byte size Specify the byte size to be written in eve
69. age 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 Visual C NET 2003 e Visual Studio 2005 Visual C e Visual Studio 2008 Visual C e Visual Studio 2010 Visual C e Visual Studio 2012 Visual C e Visual Studio 2013 Visual C Sample programs are created in Visual C 5 0 project format 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 126 CHAPTER 5 SAMPLE PROGRAMS 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 e lt User specified folder gt 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 progra
70. age j which i u wi xecuti Use the path which is returned when executing mdOpen sino ation n mb r Specify the station number of target station i u gt Page 48 Section 4 2 2 devtyp Device type Specify the type of device from which the data is read vty vice ty Page 52 Section 4 2 4 Specify the start device number of device range to be read e 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 e 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 e 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 a Store the data being read single precision integer array C 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
71. al Studio 2010 Visual Basic Visual Studio 2012 Visual Basic Visual Studio 2013 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 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 Visual C NET 2003 e Visual Studio 2005 Visual C e Visual Studio 2008 Visual C e Visual Studio 2010 Visual C e Visual Studio 2012 Visual C e Visual Studio 2013 Visual C Sample programs are created in VisualC 5 0 project format 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 128 CHAPTER 5 SAMPLE PROGRAMS 5 3 Sample Programs for CC Link IE Controller Network Board Sample programs are stored on
72. apan this manual does not require application to the Ministry of Economy Trade and Industry for service transaction permission Specifications subject to change without notice
73. ards seco scx a ae e ev ete et Cee os lite oe tepals athletes 11 CHAPTER 2 PROGRAMMING 12 2 1 Programming Procedure aasa saaa anaana naaa eet teens 12 2 2 Precautions when Using MELSEC Data Link Library 00 000 cece eee 13 2 2 1 Precautions when programming 0 00000 aee 13 2 2 2 Precautions when accessing own station link devices and other station s programmable Controller d vicese 7 cake ye atory ete waa ede went ae eh ee oe he a eee E 15 2 3 Settings for Using Functions 0 0000 0c eee 17 2 3 1 Using Visual Basic 5 0 Visual Basic 6 0 0 0 0 0 ccc cece eee eens 17 2 3 2 Using Visual C 5 0 Visual C 96 0 0 00000 e eens 18 233 Using Visual Basic P NET eresia an NE E ENAA n ences 20 2 3 4 Using Visual C NET 2003 Visual C 2005 Visual C 2008 2 0 21 2 3 5 Using Visual C 2010 Visual C 2012 0000 e eee ees 23 2 3 6 Using Visual CREP 201 ice ics leant ae ah eit tees EE AE E eet Snok 30 CHAPTER 3 ACCESSIBLE DEVICES AND RANGES 37 3 1 sAcc ss Targets asiva sande vai bees Seas ee a ale DOES ae en aa Pa 37 3 2 Accessible RangeS 1 2 0 cece eee nent teen teens 38 3 2 1 Access target on own NetWork n 0 eee 38 3 2 2 Access target when connected via network 2 0 00 c ccc ee eens 39 3 3 r Accessible Devices 2c totic oneaalss belle a tarsi E ea E E E Ta eked tendo 40 3 3 1 Access to link devices and buffer memory of own station 0 0000
74. arranty 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 designated place Note that after manufacture and shipment from Mitsubishi the maximum distribution period shall be six 6 months and the longest gratis warranty term after manufacturing shall be eighteen 18 months The gratis warranty term of repair parts shall not exceed the gratis warranty term before repairs Gratis Warranty Range 1 The range shall be limited to normal use within the usage state usage methods and usage environment etc which follow the conditions and precautions etc given in the instruction manual user s manual and caution labels on the product 2 Even within the gratis warranty term repairs shall be charged for in the following cases 1
75. ation L Format Visual C ret mdRandREx 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 dev Randomly specified device IN short buff Read data single precision integer array OUT long bufsize Number of bytes of read data IN Visual Basic NET ret mdRandREx path netno stno dev 0 buf 0 bufsize Integer ret Return value OUT Integer path Path of channel IN Integer netno Network number IN Integer dev n Randomly specified device IN E Integer dev n Randomly selected device IN 2 Short buf n Read data single precision integer array OUT A Integer bufsize Number of bytes of read data IN 2 T Visual Basic 5 0 Visual Basic 6 0 x ret mdRandREx path amp netno stno dev 0 buf 0 bufsize Long ret Return value OUT Long path Path of channel IN Long netno Network number IN Long stno Station number IN Long dev n Randomly specified device IN Any buf n Read data single precision integer array OUT Long bufsize Number of bytes of read data IN Ajwopues seolAap pepue xe Bulpees xgypueypw OEP 69 Argument Description Specify the path of channel whose communication line is opened path Path of channel oo f Use the path which is returned when executing mdOpen Specify the network number of target station netno Network number 7 gt Pa
76. ation Manager a S ProjectName exe cdf cache obj ilk resources tlb tli tih tmp S IntDir S MSBuildProjectName log Visual Studio 2013 v120 No Application exe Configuration and the Platform In case that there are multiple configurations and platforms select All Configurations and All Platforms to change settings at a time gt Code Analysis Character Set Specifies a relative path to the output file directory can include environment variables oK Cancel To the next page 32 CHAPTER 2 PROGRAMMING From the previous page 4 Onthe Property Pages screen select lt Configuration Configuration Active Debug Platform Active Win32 v Configuration Manager Pri rti Sg lt V Dir t ri gt b Common Properties 4 General ope es C ectories 4 Configuration Properties Executable Directories S VC_ExecutablePath_x86 WindowsSDK_ExecutablePath General Include Directories CAMELSEC Com mon INCLUDESS IncludeP ath Debuagin Reference Directories S VC_ReferencesPath x89 orie Library Directories SVC LibraryPath x86 Windows SDK LibraryPath x88 b CiC Library WinRT Directories WindowsSDK_MetadataPath P Linker Source Directories SVC_SourcePath P Manitest Tao Exclude Directories VC_IncludePath WindowsSDK_IncludePath MSBuil gt Resources b XML Document Generator b Browse Information b Build Events b Custom Build Step
77. ation 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 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 Description ae Chanheinumberot communicatione Specify the channel number of communication line gt Page 47 Section 4 2 1 mode Dummy Specify 1 path Opened line path pointer Return the opened line path C Explanation A path of the channel used for argument of another function is returned to the opened line path pointer e 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 Page 133 CHAPTER 6 Bp Related function mdClose 56 CHAPTER 4 FUNCTIONS 4 3 2 mdClose closing communication lines LY Function Close a communication line by specifying a communication line path L 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 Descripti
78. ay the operating mode 1 Operating in online mode 0 Operating in offline mode bO RUN Display the operating status of board 1 Operating normally 0 Hardware error or Board WDT error buf 1 B15 0 RESERVE 99 paeog ay Jo uopewoju G47 pees peaypeTpapul Zpet sead uoyoun4 y CC Link IE Field Network Element Bit LED Description Note buf 0 b15 12 RESERVE b11 LNK2 Display the link status of PORT2 1 Linkup in progress 0 Linkdown in progress b10 LNK1 Display the link status of PORT1 1 Linkup in progress 0 Linkdown in progress b9 LER2 Display the frame loss status of PORT2 1 Frame loss occurring 0 No frame loss b8 LER1 Display the frame loss status of PORT1 1 Frame loss occurring 0 No frame loss b7 MODE Display the operating mode 1 Operating in online mode 0 Operating in offline mode b6 RD Display the network reception status 1 Data are being received 0 Data not received b5 SD Display the network sending status 1 Data are being transmitted 0 Data not transmitted b4 L ERR Display the detection status of communication error 1 Detected 0 Not detected b3 ERR Display the detection status of network board error 1 Detected 0 Not detected b2 D LINK Display the data link status cyclic transmission status 1 Data link in operat
79. ber E Page 48 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 read For details refer to Explanation shown on the next page Read data buf ie Store the data being read single precision integer array bufsize Number of bytes of read data Specify the number of bytes of read data CHAPTER 4 FUNCTIONS C 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 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 sead uooun4 Ey Ajwopued sanap Bulpeas ypueypu pzEr 119 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 T
80. 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 gt Set the development tool to use K7 Page 17 Section 2 3 the MELSEC data link library Create a user program using the MELSEC data link library Open the communication port mdOpen function gt Communicate with the programmable controller CPU and the board using functions End the program Yes Close the port that was opened by the mdOpen function mdClose function l CA Refer to the user s manual Perform debugging using of corresponding board the Device monitor utility A user program is created 12 2 2 2 2 1 1 2 3 4 5 6 7 8 9 CHAPTER 2 PROGRAMMING Precautions when Using MELSEC Data Link Library Precautions when programming 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 Opening and closing of a communication line Perform the opening and closing processes of a communication line mdOpen mdClose 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
81. connected device access error A i y e 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 920An own station devices RX RY RWw RWr which are y an The data write read function can be performed even when this error FFFF920AH assigned to the data link interrupted station or the reserved station occurs but the function of the data security is not guaranteed 139 Error Code Error description Corrective action HEX e 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 f 92091 process again An incorrect response data was received i FFFF9209n e Check the network status by referring to the manuals of each product Driver WDT error Driver WDT error is occurring e Reset the board A driver WDT error may occur from the temporary Restart the personal computer 28158 system overload by the following factors e Remove the factor of system overload 9202h e Windows activation process when starting the e Clear Use driver WDT function with the utility to disable WDT FFFF9202n personal computer Or extend the Driver WDT monitoring time Operation of a device driver such as a graphic By changing the graphic board an environment in which a drive
82. d R series module The following table shows the accessible devices of QNACPU QCPU Q mode LCPU and RCPU on other station O Accessible x Not accessible ainpow sales y pue q O WUD JO SedIAep 0 SS900Y Z EE Access target Device Access type nACPU reese a Input x Batch Random O O Output Y Batch Random O O Latch relay L Batch Random O 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 F Batch Random O O Timer contact coil current value T Batch Random O Q Long timer contact coil current value LT Batch Random x 0 2 Counter contact coil current value C Batch Random O O Long counter contact coil current value LC Batch Random x 0 2 Index register Z Batch Random O O Long index register LZ Batch Random x 0 2 Unit refresh register RD Batch Random x 0 2 File register R ZR Batch Random on O Extended file register ER Batch Random on O Link relay B Batch Random O 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 2 Edge relay V Batch Random O x Link direct device link input Jn x link output Jn Y link relay Jn B Batch Random O Q link reg
83. detail information details details 0 Receive channel 1 to 2 details 1 details 2 details 3 When the event does not occur within the timeout time a timeout error is returned as a return value V Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes 3 Page 133 CHAPTER 6 gt Related function mdOpen mdClose Point 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 thi
84. e use 32 bit version user application 138 CHAPTER 6 ERROR CODES Error Code A i Error description Corrective action HEX Reset error 26334 e Reset was executed by another task that uses the same channel when accessing to the own 9922H e Retry the operation station or the other station FFFF9922h ee e 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 FFFF9920nH station which does not support the routing function Unsupported block data assurance per station 28138 Reset or restart was performed to the CC Link nee 4 ee e Replace it with the ROM version 2B or later board 9216H Ver 2 Board of which ROM version is 1A and the f f i e Disable the block data assurance per station FFFF9216H function block data assurance per station is enabled e Reset the board The memory may be insufficient Close other applications running e Terminate the program and restart the personal computer 28139 Lan eneehmiese e Check the free space of th memory 9215H e Check the board installation status Link refresh processing did not operate normally k FFFF9215n e The personal computer is faulty when other personal computers normally operate Repair or replace the faulty personal computer When the same error
85. e block number device type and the start I O number of 16433 S t the specified device The start I O number of the specified devices is 4031 e Check with the programmable controller CPU on the target invalid e 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 134 CHAPTER 6 ERROR CODES Error Code A i HEX Error description Corrective action Request data error v e Check the content of specified request data 16512 e The process was requested with a 64 bit ag e When accessing a CPU module other than QCPU Q mode or 4080n version user application to a CPU module other f Pines RCPU module use 32 bit version user application than QCPU Q mode or RCPU module Link related error 18944 e The network of the number set to the routing 4A00H parameters does not exist e Check the routing parameter settings e The network is not supported by the target e Exchange the CPU with a CPU which supports the network 18945 CPU e Check the network number and station number 4A01H e 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 4B02n can be executed 1 FFFFH Path error e Use the path that was returned by the mdOpen function FFFFFFEF
86. e eee eens 115 4 3 24 mdRandR reading devices randomly 0 0 000 e cece eee teen eee 118 4 3 25 mdDevSet setting bit devices 00 cece e ene eae 122 4 3 26 mdDevRst resetting bit devices 2 0 0 2 ete eee 123 CHAPTER 5 SAMPLE PROGRAMS 124 5 1 Sample Programs for CC Link Ver 2 Board 0 0 neces 124 5 1 1 Description of sample programs 000 0 c cece nce ce ene eee 124 5 1 2 Programming language 0c ect n nee e ene eeeae 126 5 2 Sample Programs for MELSECNET H Board 0 000 cece nce eee nee 127 5 2 1 Description of sample programs 000 0 c cece cece nee e nee eae 127 5 2 2 Programming language 000 cece tte teens 128 5 3 Sample Programs for CC Link IE Controller Network Board 2 0 02005 129 5 3 1 Description of sample programs 0 00 c ccc cence ence e nee eae 129 5 3 2 Programming language 00 ssena naene 130 5 4 Sample Programs for CC Link IE Field Network Board 0 0000000 eee 131 5 4 1 Description of sample programs 000 ccc cect eee teen eee 131 5 4 2 Programming language 0060 00 cece teeta 132 APPENDIX 141 Appendix 1 Method for Increasing Minimum Working Set Size of Personal Computer 141 Appendix 1 1 Processing overview of sample program 00000 cece ee eeeee 141 Appendix 1 2 Sample programs 00 00 cee eect eee teens 142 REVISIONS eines eee Biers Odes ee
87. e value 0 Error Return the value other than 0 Refer to the list of error codes 15 Page 133 CHAPTER 6 gt Related function mdOpen mdClose mdRemBufWriteEx 80 CHAPTER 4 FUNCTIONS 4 3 11 mdTypeRead reading model names of CPU LY Function Read a model name codeof the CPU on the target station Lia rmat Visual C ret mdTypeRead path stno buf short ret long path short stno short buf Visual Basic NET ret mdTypeRead path stno buf Short ret Integer path Short stno Short 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 Specify the path of channel whose communication line is opened path Path of channel nar Use the path which is returned when executing mdOpen Specify the station number of target station stno Station number 2 Page 48 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 81 NdD jo seweu japow Bulpess peaysdA pw LL ey sead uooun4 Ey Explanati
88. eating 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 Studio 2010 or later as a development environment 2 3 1 Using Visual Basic 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 7 ial Add Form ES Add MDI Form amp Add Module w Add Class Module sg Add User Control p a Add Property Page 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 ee installation lt User specified folder gt lt COMMON gt lt INCLUDE gt File name Mafune bas Open Files of type Basic Files bas X Cancel Help J Don t show this dialog in the future 17 0921S ENSIA O GgrISeg ENSIA BUIN PEZ suonouny Buisn 104 sbunjes EZ 2 3 2 Using Visual C 5 0 Visual C 6 0 This section explains the setting operation when using Visual C 5 0 or Visual C 6 0 1 Setting include files et 1 Start Visual C and select Tools Options Tools Window Help Source Browser Alt F12 A Nisual Component Manager A Register Control Ba Error Lookup A ActiveX Control Test Container J OLE COM
89. ecification 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 53 54 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 Device type Device Code specification Device name Decimal Hexadecimal specification Buffer memory 32768 8000H DevRBM Random access buffer 32736 8020H DevRAB Remote input 32735 8021H DevRX Remote output 32734 8022H DevRY Remote register 32732 8024H DevRW Link special relay 32669 8063H DevSB Link special register 32668 8064H DevSW 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 1 These devices can not be used for random write ndRandW mdRandWEx random read mdRandR mdRandREx bit Device type Device Code specification Device name Decimal Hexadecimal specification RECV function 101 0065H DevMAIL SEND function with arrival acknowledgment SEND function without arrival acknowledgment 102 0066H DevMAILNC
90. eck the status of the network operation status of the access e Timeout during waiting for the response of station s and mounting condition of the module s process e Check the mounting condition of the board A CPU module other than QCPU Q mode or e Check the Target Setting of the utility RCPU is accessed from the 64 bit version user Check the Transient Timeout Monitoring Time of the utility application e Retry the operation 2 e The consistency between the board and the e When accessing CPU modules other than QCPU Q mode or 00021 software package cannot be identified RCPU use the 32 bit version user application When accessing to the buffer memory of the e When this error has occurred while executing the RECV function remote device station the offset values or offset with CC Link IE Field Network board use SW1DNC CCIEF B write read byte size out of the range of the version 1 04E or later target station buffer memory is specified e Check if the offset values or offset write read byte size is within When the own station number is 64 on the CC the range of the buffer memory of the target station Link Ver 2 board a request was made to other When requesting to other station by using CC Link Ver 2 board station set a station number other than 64 to the own station number e Open the channel only once 66 Channel opened error 3 ae e Since the correct value is stored to the path this error can be 00421 Specified chan
91. ect lt Edit gt On the Library Directories screen click E and then click Ga 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 gt lt COMMON gt lt LIB gt For creating a 64 bit version user application lt User specified folder gt lt COMMON lt LIB gt lt x64 gt CHAPTER 2 PROGRAMMING From the previous page 7 Open the project to create a user application and select rosoft Visual Studio Project Buld Debug Team Data Tools Test Window Project Properties Sg Add Class GY class Wizard ctr shit x Bg Add Resource i Add New Item Ctrl Shift A EJ Add Existing Item Shift Alt A Ei New Filter Show All Files Unload Project Rescan Solution References Set as StartUp Project Build Customizations Refresh Project Toolbox Items Properties Alt F7 Open Folder in Windows Explorer Microsoft Cpp Win32 user Property Paes PK 8 In the folder area of the Property Pages screen select Configuration WA Configuration Properties Linker Input E Common Properties Addtional Dependencies General Ignore Al Defaut Libraries User Macros Ignore Specific Default Libraries VC Directories Module Definition File Be ich Add Module to Assembly BUrker Embed Manag
92. ectories C MELSEC Common INCLUDE IncludePath Reference Directories VCInstalDir atimfc ib VCInstalDir ib Library Directories 4 VCInstallbir ib CInstallbir atinfc lib Windowssdht Source Directories 4 VCInstallbir atlnfc srclmfc6 Clnstallbi atinfc srclm Exclude Directories VCInstalbir include VCInstallbir atimfclinclude Wir XML Document Generator 2 Browse Information Build Events 2 Custom Build Step E Managed Resources 2 Custom Build Tool E XML Data Generator Tool General Microsoft Cpp Win32 user Property Pages x Use VC Directories E C C E Manifest Tool pA eran 8 XML Document Generator Browse Information Bull Events Custom Buld Step i Managed Resources Custom Buld Tool E XML Data Generator Tool Library Directories Path to use when searching for ibrary fles while bulding a VC project Corresponds to environment variable LIB Library Directories Inherited values CInstallDirjlib CInstallDir atimFc lib WindowsSdkDir lib FrameworkSDKDir lib Inherit From parent or project defaults Select Directory S MELSEC a ccu amp Common Help INcLuDE E x64 ut amp A Easysocket Folder LIB To the next page 26 3 4 5 6 Select Common Properties VC Directories on the Property Pages screen Select Library Directories Click and sel
93. ed Resource Fle Force Symbol References sa Delay Loaded Dils Manifest Fle Debugging Assembly Link Resource system Optimization Embedded IDL Advanced Command Line 8 Manifest Tool E Resources MDL 68 XML Document Generator E Browse Information Bull Events S Custom Buld Step I Managed Resources Additional Dependencies Caston Buld Toal Specifies addtional items to add to the Ink command line i e kernel32 1b E XML Data Generator Tool ee 21x 9 Select Additional Dependencies Click and select sees l l lt Edit gt E Common Properties odbc32 ibjodbecp32 General Ignore Al Default Libraries User Macros Ignore Specific Default Libraries VC Directories Module Definition Fie C C Add Module to Assembly Linker Embed Managed Resource Fle Force Symbol References Delay Loaded Dis Assembly Link Resource General Input Manifest Fle Debugging System Optimization Embedded IDL Advanced Command Line 8 Manifest Tool Resources MDL 4 XML Document Generator Browse Information Buld Events S Custom Buld Step u fik Manapa Resouces Additional Dependencies Pona Specifies additional items to add to the link command Ine ie kernel32 ib G8 XML Data Generator Tool suonouny Buisn 104 sues EZ ZLOZ ttO IENSIA 0L0Zg 0 IENSIA BUISN GEZ ERE 10 On the Additional Dependencies screen enter atonal Dependencies MdFunc32 lib MdFunc32
94. en mdClose sead uooun4 Ey p1e0q y JO UonewoyuI UOISJSA pea PeayJeAPgPW 6p EY 105 4 3 20 mannit initializing programmable controller information table LY Function Reflesh a programmable controller device 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 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 Programmable controller device information acquired at the initial access to the programmable controller CPU is 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 A Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes Page 133 CHAPTER 6 gt Related function mdOpen mdClose 10
95. en select Gonfigursion Paapa Patton Active Win J aman vemes Configuration Properties Linker Input General a Additional Dependencies Debugging Ignore All Default Libraries VC Directories Ignore Specific Default Libraries b C C Module Definition File 4 Linker Add Module to Assembly General Embed Managed Resource File Force Symbol References Delay Loaded Dils Assembly Link Resource Manifest File Debugging All Options Command Line h Manifect Toot Additional Dependencies y Specifies additional items to add to the link command line fie kernel32 lib oK Cancel 10 Select Additional Dependencies Click v and select MTEST Property Pages x Configuration Active Debug V Bitform Activeowing2 v Configuration Manager lt Edit gt Genaral a m Debugging Ignore All Default Libraries VC e Directories Ignore Specific Default Libraries gt C C Module Definition File 4 Linker Add Module to Assembly General Embed Managed Resource File ie Force Symbol References Mna Pe Delay Loaded Dils ois Assembly Link Resource Optimization Embedded IDL Windows Metadata Advanced All Option orn kt ese pres v Specifies additional items to add to the link command line ive kernel32l gt ok Cancel Apply 11 On the Additional Dependencies screen enter MdFunc32 lib MdFunc32 lib lt
96. er 2 Page 50 Section 4 2 3 Specify the station number of target station stno Station number 7 Page 50 Section 4 2 3 p Specify the type of device to be reset OFF devtyp Device type gt i gt Page 52 Section 4 2 4 devno Specified device number Specify the device number of device to be reset OFF 15 OC Explanation This function is a dedicated function for bit devices such as link relays B and internal relays M Z Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes Page 133 CHAPTER 6 gt Related function mdOpen mdClose mdDevSetEx 76 CHAPTER 4 FUNCTIONS 4 3 9 mdRemBufWriteEx writing data to buffer memory of remote device station X 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 MWritten byte size IN short data Written data single precision integer array IN 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 AS w w Integer
97. er to the following table Access target Reference Access to link devices or buffer memory of own PC interface board station Page 40 Section 3 3 1 QnACPU QCPU Q mode LCPU RCPU ACPU QCPU A mode Ethernet adapter module Head module Page 41 Section 3 3 2 Page 42 Section 3 3 3 Page 43 Section 3 3 4 Access to devices of other station module CC Link network module CC Link Ver 2 board etc QnACPU QCPU Q mode LCPU RCPU PC interface board Access to other station buffer memory of CC Link Page 43 Section 3 3 5 Access using the SEND function or the RECV A Page 44 Section 3 3 6 function 38 CHAPTER 3 ACCESSIBLE DEVICES AND RANGES 3 2 2 Access target when connected via network The following shows the accessibility when accessing via multiple networks Own station eee eer TSS N Z RS Relay station Access target network Access target 7 v a Ss Pa 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 43 CC Link IE S O Relay Access target LCPU QCPU ACPU Field wn networ Seaton Ganon RCPU Head module Q mode QnACPU remote Ethernet adapter PC interface QCPU E module board mode station CC Link IE Controller O X O x CC Lin
98. er which is specified in the vores FFC2n f e Check the event number that sets the user application to wait FFFFFEC2H mdWaitBdEvent function to set the user application to wait is out of the range 63 Event number overlapped registration error The event number which is specified in the e Specify the event numbers that set the user application to wait FFC1h FFFFFEC1H mdWaitBdEvent function to set the user not to overlap application to wait is overlapped 64 Timeout time error FFCOn The timeout time specified in the mdWaitBdEvent Check the time out value FFFFFFCOn function is out of the range 65 pane vent wait time out error Event wait t t FFBFn i ie i e Retry the operation FFFFFFBFH The event did not occur within the timeout time 66 Event initialization error The board or the master station control station FFBEn e Retry the operation FFFFFEBEH was reset during the execution of the mdWaitBdEvent function 67 No event setting error The event setting of the event number which is e Set the event number that sets the user application to wait in the FFBDn FFFFFEBDH specified in the mdWaitBdEvent function to set utility the user application to wait does not exist 69 Unsupported function execution error i ae f ae e Check if the function is supported by the software package or the FFBBn e A function which is not supported by the Genie iver H software package or the driver was executed FFFFFF
99. ess Randomized Base Address Fixed Base Address Data Execution Prevention DEP Yes INXCOMPAT Tum Off Assembly Generation No Unload delay loaded DLL Nobind delay loaded DLL Import Library Merge Sections Target Machine Yes DYNAMICBASE MachineX86 MACHINEX86 Entry Point The ENTRY option specifies an entry point function as the starting address for an exe file or DLL oK Cancel Apply Configuration Active Debug b Common Properties A 4 Configuration Properties General Debugging VC Directories b C C 4 Linker General Input Manifest File Debugging System Optimization Embedded IDL Windows Metadata Advanced AIL Ontions v Bitform Active wind2 7 eegnen Me Merge Sections Target Machine MachineXB6 MACHINEX86 Profile No CLR Thread Attribute CLR Image Type Key File Key Container Delay Sign CLR Unmanaged Code Check Error Reporting SectionAlignment Preserve Last Error Code for Pinvake Default image type Promptimmediately ERRORREPORT PROMPT Image Has Safe Exception Handlers When SAFESEH is specified the linker will only produce an image if it can also produce a table of the image s safe exception handlers This table specifies for the operating system which exceptio 36 oK Cancel Apply 4 Onthe Property Pages screen select lt Configuration Properties gt lt General gt
100. eturn the value 0 S Error Return the value other than O Refer to the list of error codes I Page 123 CHAPTER 6 Q a N 5 2 Related function oO mdClose 0 D D an 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 Visual Basic NET 2003 e Visual Studio 2005 Visual Basic Visual Basic NET e Visual Studio 2008 Visual Basic Visual Studio 2010 Visual Basic e Visual Studio 2012 Visual Basic Visual Studio 2013 Visual Basic A format for the following Visual Basic Visual Basic 5 0 Visual Basic 6 0 e Visual Basic 5 0 Visual Basic 6 0 Describes arguments of the function Describes features of the function and details of arguments Indicates the return values Indicates related functions for programming 55 4 3 1 mdOpen opening communication lines LY 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 communic
101. 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 e 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 satisfied device is stored to the event detail information e 1 is set to the bits that correspond to the condition satisfied device e 1 is set to 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 0 1stto 16th point bitO 1st point bit15 16th point details 1 17th to 32nd point bitO 17th point bit15 32nd point details 2 33rd to 48th point bitO 33rd point bit15 48th point details 3 49th to 64th point bitO 49th point bit15 64th point 88 CHAPTER 4 FUNCTIONS Word 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 0 details 2 0 details 3 0 RECV function CC Link IE Field Network board The information on received data is stored to the event detail information Event
102. f error codes Page 133 CHAPTER 6 59 uojouny ANIS S80 Aap papuayxe Buyum y9eq XIPU SPU EEY sjlejaq uopoun4 Ey 2 SEND function WY Function Send data to the specified channel number of the target station L Format Visual C ret mdSendEx path netno stno devtyp devno size data long long long long long long long short ret Return value path Path of channel netno Network number stno Station number devtyp Device type devno Channel number size Send byte size data Send data single precision integer array Visual Basic NET ret mdSendEx path netno stno devtyp devno size data 0 Integer Integer Integer Integer Integer Integer Integer Short ret Return value path Path of channel netno Network number stno Station number devtyp Device type devno Channel number size Send byte size data n Send data single precision integer array Visual Basic 5 0 Visual Basic 6 0 ret mdSendEx path amp netno stno devtyp devno size data 0 Long Long Long Long Long Long Long Any 60 ret Return value path Path of channel netno Network number 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
103. fer to the manual of product 37 2 For CC Link IE Field network only A2UCPU A2UCPU S1 A2USCPU A2ZUSCPU S1 AZ2USHCPU 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 aN Access target Lh O Accessible x Not accessible Access target Own station Own network LCPU Ethernet QCPU Q mode 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 a CC Link O O x O O o 3 x board MELSECNET H MELSECNET H O x x O x x x board MELSECNET 10 x x O X x CC Link IE CC Link IE Controller Controller O x x O x x x Network board Network Celin gE CC Link IE Field LI l Field O O O O x x o Network Network board 1 For details of access target refer to Page 37 Section 3 1 Access Target 2 When the own station number is 64 other station cannot be accessed Only the own station can be accessed 3 Only 32 bit version user application can be accessed For the accessible devices of each access target ref
104. fication 1 All stations and group numbers can be specified when using the SEND function mdSend without arrival acknowledgment 2 Group numbers can be specified when using MELSECNET H network or CC Link IE Controller Network 3 For specifying another station set a network number in the upper byte of the station number iS Nw Upper byte Lower byte be Q Own station 255 FFH z5 2 6 0 00H to 120 78H SG Station number zs a 3 Other Network number 2 125 7DH a S O Q station Group Number 1 to 32 1 2 1 01H to 239 EFH 129 81H to 160 A0H S 2 co All stations 240 F OH a6 oO The logical station number set with the utility 0 00H to 239 EFH o dl 3 ss n lt Setting a station number when another station is specified gt Network number i Station number Upper Lower 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 49 4 2 3 functions Specifying network numbers and station numbers for extended 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 function
105. ge 50 Section 4 2 3 Specify the station number of target station stno Station number E gt Page 50 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 Read data Store the read data to the array variable of buf 0 or later buf i eee 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 70 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 e 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
106. h Random O O O O Counter Batch O O O O O setting value main Random x x x x Z Counter F Batch O O O setting value sub1 Random x x x Counter Batch 5 2 7 O setting value sub2 sub3 Random x Accumulator A Batch Random O O O O O Index register Z V Batch Random O O O O Q File register R Batch Random x O O O O Extended file register ER Batch Random x O O O Link relay B Batch Random O O O O O Link register W Batch Random O O O O O 1 Cannot be accessed from CC Link IE Field Network board 42 CHAPTER 3 ACCESSIBLE DEVICES AND RANGES 3 3 4 Access to Ethernet adapter module Head module and CC Link IE Field remote device station 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 O Accessible x Not accessible Access target A CC Link IE Field Device Access type Ethernet adapter Head module remote device module A station Input X Batch Random O O x Output Y Batch Random O O x Special relay SM Batch Random O O x Special register SD Batch Random O O x Link register Ww Batch Random O O x Link special relay SB Batch Random O O x Link special register SW Batch Random O O x Intelligent function module device Buffer memory Un G Batch Random x O o l Intelligent function module z access device 1 When accessing via CC Link IE
107. he channel numbers 4 bytes Eo 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 e CC Link IE Field Network board 1 to2 Specify a channel used by the own station channel used by the e CC Link IE Controller Network board 1to8 own station e 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 Page 133 CHAPTER 6 gt Related function mdOpen mdClose mdSend mdReceive mdReceiveEx 61 uojouny ANIS S80 Aap papua Buyum yoyeq xLIPU SPU EEY sead uUopoun4 Ey 4 3 4 LY Function 62 function 1 Batch reading extended devices mdReceiveEx batch reading extended devices RECV 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 long long long long long long short ret Return value path Path of channel netno Network number stno Station number devtyp Device type devno Start device number size Read byte size data Read data single precision integer array Visual Basic
108. he test result with the return value Y Return value Success Return the value 0 Error D gt Related function mdOpen mdClose mdBdModRead 92 Return the value other than 0 Refer to the list of error codes 5 Page 133 CHAPTER 6 CHAPTER 4 FUNCTIONS 4 3 16 mdBdModRead reading modes of board LY Function Read the mode in which the board is currently operating L Format Visual C ret mdBdModRead path mode short ret Return value OUT long path Path of channel IN short mode 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 A Integer mode Mode OUT a 3 i Argument Description Specify the path of channel whose communication line is opened ze path Path of channel 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 pieog Jo sapow BHulpesi peaypowpgpwi 9 r 93 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
109. heck if the sent data using the SEND function of 0047 Controller Network board or CC Link IE Field MELSECNETI H board exceeds 960 bytes Network board the data over 960 bytes has e When the receive station is CC Link IE Controller Network board been received from MELSECNET H restart a personal computer of the receive station e Retry the operation e There is a possibility of a memory shortage Terminate other 7 Memory reservation error resource memory application s currently running 004DH shortage error e Exit the program and restart the personal computer Enough memory could not be reserved e Increase the minimum working set size of the personal computer Page 141 Appendix 1 85 SEND RECV channel number error 0055H The channel number specified with the e Check the channel number SEND RECV function is incorrect 400 Board H W resource busy e Retry the operation 0064n The next processing cannot be executed because e If the error occurs repeatedly please consult your local Mitsubishi of the insufficient resource on the board representative 101 Routing parameter error e Check the routing parameter 0065n The routing parameter is not set correctly e Check the specified network number Board Driver I F error An attempt to send request data to the board e Retry the operation 402 driver is failed Check with the function such as event log whether Windows is 00661 The system resource of the operating system is operating norma
110. ible 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 The following table shows the accessible devices when accessing a board own station Access to link devices and buffer memory of own station O Accessible x Not accessible Access target Device Access type CC LinkVer 2 MELSECNETIH CC Link IE Controller CC Link IE Field board board Network board Network board Link input LX Batch Random x O O x Link output LY Batch Random x O O x Link relay LB Batch Random x O O x Link register LW Batch Random x O O x Link special relay SB Batch Random O O O O Link special register SW Batch Random O O O O Remote input RX Batch Random O x x O Remote output RY Batch Random Q x x O A RWw Batch Random O x x O Remote register for reception RWr Batch Random O x x O Buffer memory Batch Random O x O O Random access buffer Batch Random O x x x 40 3 3 2 CHAPTER 3 ACCESSIBLE DEVICES AND RANGES Access to devices of QnA Q L an
111. ied receive byte size and send source information 6 bytes lt Receive data with send source information data gt e 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 datay e 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 h Send source information 6 bytes data 1 Send source station number data 2 Send source channel number data 3 Receive byte size Actual data i size e 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 e 125 7Du is stored to the send source station number when the station number of the send source is 0 p Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes Page 133 CHAPTER 6 D gt Related function mdOpen mdClose mdReceiveEx mdSend mdSendEx 114 CHAPTER 4 FUNCTIONS 4 3 23 mdRandw writing devices randomly LY Function Write data to the devices on the target station specified with the randomly specified devices L Format Vis
112. ient data send response wait time out error e Check if an unsupported communication target is specified with FFFFDOAOn the network number and the station number 12289 CFFFn FFFFCFFFn to Errors detected in the Ethernet network system e Refer to the Ethernet Interface Module User s Manual 16384 C000 FFFFC000n 16385 BFFFH FFFFBFFFn i h e 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 BO00n FFFFBO00n 18560 Module mode setting error B780n A transient transmission was executed to the e Check the network number and the station number FFFFB780H remote I O station 18572 Transient unsupported error e Check the network number and the station number B774n A transient request was transmitted to the station Specify the station number for the intelligent device station FFFFB774n _ that is not an intelligent device station e Check the device type Processing code error gu ats i l j e Check the request destination station number and the processing e A processing code that cannot be processed by od 25056 the request destination station was set j TUI e Do not execute the function other than mdTypeRead to the other 9E20n Request destination link module check S 3 f station board FFFF9E20n e The process was requested with a 64 bit e When accessing a CPU module other than QCPU Q mode or RCPU modul
113. ild 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 sueiBboud jdwes jo uonduoseq 1 e S pseog YOMION JE JOUOD 3 YUIT D4D 104 swesBog ajduies g g 129 5 3 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 Visual Studio 2005 Visual Basic Visual Studio 2008 Visual Basic Visual Studio 2010 Visual Basic Visual Studio 2012 Visual Basic Visual Studio 2013 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 Visual C NET 2003 e Visual Studio 2005 Visual C e Visual Studio 2008 Visual C e Visual
114. ink library from a user application 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 13 Buluwwesboud uaym SuOHNedaId LZZ Keq yur eed DISTIN Buis ueym suonnedsaig ZZ 10 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 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 lt When using Windows xP 32 bit version gt C MELSEC MTEST exe x C MELSEC MTEST exe is
115. ion 0 No data link b1 MST Display the station type 1 Operating as the master station 0 Other than master station bO RUN Display the operating status of board 1 Operating normally 0 A board WDT error is occurring or the board is resetting ON 1 OFF 0 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 Page 133 CHAPTER 6 C gt Related function mdOpen mdClose 100 CHAPTER 4 FUNCTIONS 4 3 18 mdBdSwRead reading switch status of the board LY 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 ret 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 RAR Integer ret Return value OUT eo to Long path Path of channel IN oo a Integer buf n Read data OUT 22 E g iw Argument Description 58 o Specify the path of channel whose communication line is opened ae path Path of channel an p Use the path which is returned when executing
116. ister Jn w link special relay Jn SB link special register Jn SW Intelligent function module device Un G Batch Random O O 1 For details of access target refer to Page 37 Section 3 1 Access Target 2 Cannot be accessed from MELSECNET H board 3 Cannot be accessed with QOOJCPU 41 S8dIN9q aIqISsseo0V F E 3 3 3 Access to devices of A series module The following table shows the accessible devices of ACPU or QCPU A mode on other station O Accessible x Not accessible Access target A0J2HCPU A1SCPU A1SJCPU A1SHCPU A2UCPU A1SJHCPU A2UCPU S1 Device Access type AZCCRU A3NCPU AZUSCRU A1NcPU A2CJCPU a A2USCPU S1 A4UCPU a2ncpu SACPU A2usHcPu s1 A2NCPU S1 A3UCPU A2SCPU QCPU A mode A2SHCPU A2ACPU A2ACPU S1 Input X Batch Random O O O O O Output Y Batch Random O O O O Latch relay L Batch Random O O O Q O Internal relay M Batch Random O O O O Special relay M9000 to Batch Random O O O O Q Data register D Batch Random O O O O O Special register D9000 to Batch Random O O O O Q Annunciator F Batch Random O O O O O ee coll Batch Random O O O O O Timer Batch O O O O O setting value main Random x x x x a Timer 1 Batch O O Q setting value sub1 Random x x Z Timer Batch i O setting value sub2 sub3 Random i S x a i coil Batc
117. its of MO to M13 are ON buf 6 10 iei Current value of T10 is 10 1 second Ajwopues seolAep pepue xe Bulpees xgypueypw OEP 71 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 0x1 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 buff 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 ot 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 133 CHAPTER 6 gt Related function mdOpen mdClose mdRandWEx 72 CHAPTER 4 FUNCTIONS 4 3 7 mdDevSetEx setting extended bit devices LY Function Set the specified bit device on the target station to ON L Format Visual C ret mdDevSetEx path 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
118. k IE Controller Network Network CC Link IE Field O O O x x Network DEPE CC Link IE C Il Lin ontroller O O 7 x CC Link IE Field Network Network CC Link IE Field O O O x x Network MELSECNET H MELSECNET 10 x x x O x MELSECNET 10 QCPY CC Link IE Controller CC Link IE Controller Q mode O x O x x Network Network CC Link IE 2 Field Network C cecal TAg O O x x Network CC Link IE Field CC Link IE Field LCPU i l O O O x x Network Network QnACPU ACPU MELSECNET 10 MELSECNET 10 x x O O x QCPU A mode 1 For details of access target refer to L Page 37 Section 3 1 Access Target 2 When using a CPU module whose number of mountable network module is one the CPU module cannot be set as a relay station 3 For CC Link IE Field network A2UCPU A2ZUCPU S1 AZUSCPU A2USCPU S1 AZUSHCPU S1 ASUCPU and A4UCPU can be accessed For the accessible devices of each access target refer to the following table Reference Page 41 Section 3 3 2 Page 42 Section 3 3 3 Page 43 Section 3 3 4 Access target QnACPU QCPU Q mode LCPU RCPU ACPU QCPU Amode Ethernet adapter module Head module QnACPU QCPU Q mode LCPU RCPU PC interface board Access to devices of other station module Access using the SEND function or the RECV s Page 44 Section 3 3 6 function 39 YJOMIOU BIA p8 O UUOD USYM b1e SS900Y ZZE sobuey aiqisseooy ZE 3 3 Access
119. le 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 suesboud jdwes zo uonduoseq p s peog JOMW N PI JI YUIT OD Joy swesbosd dWeS 4 s 131 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 e Visual Basic NET 2003 e Visual Studio 2005 Visual Basic Visual Studio 2008 Visual Basic e Visual Studio 2010 Visual Basic Visual Studio 2012 Visual Basic Visual Studio 2013 Visual Basic Sample programs are created in Visual Basic NET 2003 project format Convert the project when using Visual Ba
120. lib Inherited values kernel32 lib user32 lib gdi32 lib winspool lib comdlg32 lib Inherit from parent or project defaults Macros gt gt Cancel 27 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 C GEN kok AD Dm WA Si 1 Open the project to create a user application and select Rl Solution Explorer Ctri Alt L n 4 D omo Ctrl Ctre M View Property Manager Fe SQL Server Object Explorer Ctrl Ctrl S P Pees Bera 1 The menu configuration may differ depending on the Call Hierarchy Cite AlteK development setting or customized setting 3 Class View Ctrl Shift C E Code Definition Window Ctrl Shift V ET Object Browser Ctrl Alte OA Error List Ctri E Ke Output Alt 2 Resource View Ctrl Shift E Start Page Toolbox Ctrl Alt X Find Results Other Windows gt Toolbars gt Full Screen Shift Alt Enter Shift Alt M d Ctrl tri Shift Task Property Manager Property Pages 2 Right click the user property sheet and select Properties Sue eras from the shortcut menu Be pe ee The Pr
121. link library functions 4 2 1 Specifying channel number The following table shows the channels used with the MELSEC data link library Channel Channel name Description number 51 MELSECNETIHH 1 slot 52 MELSECNETHH 2 slot MELSECNETIH board 53 MELSECNETIHH 3 slot Channel number is set with MELSECNET H utility 54 MELSECNETIHH 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 454 CC Link IE Controller Network Channel No 151 152 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 a Channel No 153 154 CC Link IE Controller Network Channel No 154 484 CC Link IE Field Network Channel No 181 jb 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 es Channel No 183 w CC Link IE Field Network Channel No 184 47 Jequinu jauueyo Buifyioeds pzy suonoun Jo suoneoyioeds uoWWOD Zy 4 2 2 Specifying station numbers The following tables show the station numbers specified in the MELSEC data link libra
122. lly 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 e Retry the operation Board Driver I F error Check with the function such as event log whether Windows is 403 An attempt to receive response data from the operating normally 00671 board driver is failed Exit the program and restart the personal computer The consistency between the board and the e When this error has occurred while executing the SEND function software package cannot be identified with CC Link IE Field Network board use SW1DNC CCIEF B version 1 04E or later 133 Parameter error e Reset the board 00851 A parameter set on the board is incorrect Correct the parameter 4096 to 16383 e Exit the program and restart the personal computer 1000H to MELSEC data link library internal error e Reinstall the software package 3FFFH Consult your local Mitsubishi representative 16384 to 20479 4000H to Error detected by the access target CPU e Refer to the user s manual of the access target CPU module 4FFFH 16432 Device enue Specify a device type des ribed in the device type list is e Check if the device number is validated on the programmable 40301 The specified device type does not exist p controller CPU of the target station Device error in e Check the device number The specified device number is out of the hgs e Check th
123. mber IN Visual Basic 5 0 Visual Basic 6 0 ret mdDevSet 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 oe Use the path which is returned when executing mdOpen stno Station number Specify the station number of target station Page 48 Section 4 2 2 Specify the type of device to be set ON devtyp Device type a Page 52 Section 4 2 4 devno Specified device number Specify the device number of device to be set ON C 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 15 Page 133 CHAPTER 6 C gt Related function mdOpen mdClose mdDevRst 122 CHAPTER 4 FUNCTIONS 4 3 26 mdDevRst resetting bit devices LY Function Reset the specified bit device on the target station to OFF L Format Visual C 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
124. mming language MTEST 1 The sample programs for Visual Studio 2012 Visual Basic or Visual Studio 2013 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 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 suesBboud jdwes zo uonduoseq 1 Z7 S pseog H LANOASTAW 04 swesbold aides Z G 127 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 e Visual Basic NET 2003 Visual Studio 2005 Visual Basic Visual Studio 2008 Visual Basic e Visu
125. n return 0 The set sizes shown here are reference sizes Adjust the sizes according to your system 143 swebosd ajdwes z xipueddy Jayndwioy euossdd JO 8ZIS 42S Buom wnwluiy Bulseesou 10 poyan xIpueddy REVISIONS The manual number is written at the bottom left of the back cover Print date 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 Apr SH 081035ENG B 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 Dec 2012 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 Sep 2013 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 Jan 2014 SH 081035ENG E
126. n line is opened gt path Path of channel Wan 9 Use the path which is returned when executing mdOpen 2 J Specify the network number of target station e netno Network number 2 S Page 50 Section 4 2 3 at Specify the station number of target station 3 stno Station number _ 3 Page 50 Section 4 2 3 o c Specify the start address of the remote device station buffer memory to be T offset Offset a read 3 size Read byte size Specify the byte size to be read in even number 2 to 480 2 KS Read data single precision integer f nae ae Q data Specify the data to be read in single precision integer array array g Q Go lt Q o n a 3 79 OC Explanation e 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 e This function is applicable only for 32 bit version user application Y Return value Success Return th
127. n number When the specified byte size to be written exceeds the device range 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 data Written data single precision integer array Specify the data to be written in single precision integer array C Expla nation 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 O gt Related function mdOpen mdClose mdSend mdReceive mdReceiveEx Return the value other than 0 Refer to the list o
128. n target is EFDFH The communication target specified by the specified by the network number and the station number FEFFFFDFH network number and the station number is a e Check the Target Setting of the utility model which is not supported e Update the software package 34 FFDEn FFFFFFDEn 35 FFDDn Registry access error e Reinstall the software package FFFFFFDDn 36 FFDCn FFFFFFDCn e Retry the operation 37 be ean ede hte e There is a possibility of a memory shortage Terminate other Communication initialization setting error or FFDBn mae A te ie application s currently running The initial setting for communication is failed FFFFFFDBn e Exit the program and restart the personal computer e Check the memory availability 42 FFD6H Close error e Retry the operation The communication cannot be closed e Exit the program and restart the personal computer FFFFFFD6n 43 ROM operation error FFD5n ATC setting value was written to the CPU during Change the TC setting value during RAM operation FFFFFFD5xH ROM operation 61 Number of events error The number of events which is specified in the wee FFC3n Check the number of events that sets the user application to wait mdWaitBdEvent function to set the user FFFFFFC3n 136 CHAPTER 6 ERROR CODES Error Code A i HEX Error description Corrective action 62 Event number error The event numb
129. nation 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 automatic 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 0004H Remote station test Reverse loop test T Setting parameter check Station to station test 5 0005H 9 Station to station test mode executing stations Station to station test F es 0006H Hardware test 9 Loop test Loop test target stations 0007H Not applicable Self loopback test 2 Self loopback test Self loopback test 0008H _ Self loopback test internal 2 0009H Hardware test 2 Hardware test 2 Hardware test 3 000EH Bus interface test 2 Bus interface test 0010H Memory test 1 Cannot be set when the target board is local station 2 For the test method and check method of the test result refer to the manuals of each board 3 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 t
130. nel is already opened regarded as normal status 68 Path error e Check the path 00441 e The specified path is invalid Check the driver operating condition with Device Manager e No board exists at the specified path e Check the mounting condition of the board Unsupported function execution error e A function which is not supported by the target 69 e Check the path of channel network number and station number station was executed pgri 00451 f Sen e Check if the function is supported by the target station e A function which is not supported by the specified channel is executed Station number error e 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 e 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 133 Error Code Error description Corrective action HEX e Check the channel number No reception data error when RECV function e Check whether the data is sent on the sending station with the e Data is not received SEND function 71 e With the RECV function of CC Link IE e C
131. ng normally 0 Hardware error or Board WDT error 97 paeog ay jo uopewoju G47 pees peoypaTpapw Zpet sjlejaq uopoun4 y 98 Element Bit LED Description Note 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 b6 F LOOP DATA 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 reverse loop side b5 R LOOP DATA 1 Detected 0 Not detected bufl1 Display the error detection status when the data link monitoring timer is ON 1 operated on the forward loop side OFF 0 b4 F LOOP TIME 1 Detected 0 Not detected Display the error detection status when the data link monitoring timer is operated on the reverse loop side b3 R LOOP TIME 1 Detected 0 Not detected Display the error detection status
132. 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 Number of blocks Device type of block number 1 Start device number of block number 1 Block number 1 Points of block number 1 Device type of block number 2 Start device number of block number 2 Block number 2 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
133. occurs on other personal computers replace the board e Consult your local Mitsubishi service center or representative 28140 Incorrect mode setting error 9214H An incorrect mode was specified when setting the Check the mode FFFF9214H mode 28141 System sleep error Exit the program and restart the personal computer 9213H Entering sleep mode hibernation mode or fast e 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 e Check if the parameters are set 9212H A request which cannot be used in the currently e Check the currently set mode FFFF9212H set mode was executed e Check the system log of event viewer and take a corrective 28143 action on the registered error 92111 Exit the program and restart the personal computer FFFF9211H e Take anti noise measures for a personal computer e Put the connector in and out after turning off the personal Hardware self diagnosis error computer An error was detected by the hardware self e Check the mounting condition of the board 28144 diagnosis e A personal computer error is suspected if the board operates 9210H normally on other personal computers Repair or replace the ersonal computer FFFF9210H eS When the same error occurs on other personal computers replace the board e Consult your local Mitsubishi representative Data link dis
134. 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 133 CHAPTER 6 gt Related function mdOpen mdClose mdReceiveEx mdSend mdSendEx 112 CHAPTER 4 FUNCTIONS 2 RECV function WY 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 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 be D Short size Receive byte size IN OUT S T Short data n Receive data single precision integer array OUT 3 3 2 0 Visual Basic 5 0 Visual Basic 6 0 lt a ret mdReceive path amp stno devtyp devno size data 0 ig i Q Integer ret Return value OUT 3 Long path Path of channel IN Integer stno Station number IN Integer devtyp Device type IN a Integer devno Channel number IN a Integer size Receive byte
135. of channel whose communication line is opened path Path of channel nage j which i u wi xecuti Use the path which is returned when executing mdOpen sino ation n mb r Specify the station number of target station i u gt Page 48 Section 4 2 2 devtyp Device type Specify the type of device to which the data is written vty vice ty lt Page 52 Section 4 2 4 Specify the start device number of device to which the data is written e 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 e 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 e 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 gt iaai peeo data NONNE Specify the data to be written in single precision integer array single precision integer array C Explanation e 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
136. on Specify the path of channel whose communication line is opened path Path of channel canon 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 sead uoyoun4 Ey V Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes Page 133 CHAPTER 6 seul UOeo UNWUWOD burso soppw z er gt Related function mdOpen 57 4 3 3 mdSendEx batch writing extended devices SEND function 1 Batch writing extended devices WY 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 long long long long long long short ret Return value path Path of channel netno Network number stno Station number devtyp Device type devno Start device number size Written byte size data J Written data single precision integer array Visual Basic NET ret mdSendEx path netno stno devtyp devno size data 0 Integer Integer Integer Integer Integer Integer Integer Short ret Return value path Path of channel netno Network number stno Station number devtyp Device type devno Start device number size Written byte size dat
137. on The following table shows the model name codes and corresponding model names e MELSEC iQ R series 82 Model name code Hexadecimal Mote namo 4800H R04CPU 4801H RO8CPU 4802H R16CPU 4803H R32CPU 4804H R120CPU e MELSEC LL series Model name code Hexadecimal ooo name 0541H LO2CPU 0543H LO2SCPU 0544H LOGCPU 0545H L26CPU 0548H L26CPU BT 0549H LO2CPU P 054AH L26CPU PBT 054BH L26CPU P 054CH LO2SCPU P 054DH LO6CPU P 0641H LJ72GF15 T2 e MELSEC Q series Model name code Model name Hexadecimal 0041H Q02CPU Q02HCPU 0042H QO6HCPU 0043H Q12HCPU 0044H Q25HCPU 0049H Q12PHCPU 004AH Q25PHCPU 004BH Q12PRHCPU 004CH Q25PRHCPU 004DH Q02PHCPU 004Ex QO6PHCPU 0141H Q02CPU A mode QO2HCPU A mode 0142H QO6HCPU A mode 0250H QO0JCPU 0251H QOOCPU 0252H Q01CPU 0260H QO0UJCPU 0261H QOOUCPU 0262H Q01UCPU CHAPTER 4 FUNCTIONS Model name code Hexadecimal Modena 0263H Q02UCPU 0266H Q10UDHCPU 0267H Q20UDHCPU 0268H Q03UDCPU 0269H QO04UDHCPU 026AH QO6UDHCPU 026BH Q13UDHCPU 026CH Q26UDHCPU 02E6H Q10UDEHCPU 02E7H Q20UDEHCPU 02E8H Q03UDECPU 02E9H QO04UDEHCPU 02EAH QO6UDEHCPU 02EBH Q13UDEHCPU 02ECH Q26UDEHCPU 02EDH Q50UDEHCPU 02EEH Q100UDEHCPU 0366H Q03
138. on integer array single precision integer array bufsize Dummy 115 Ajuopue saon p Bupum Mpueypwu ezer sjlejaq uopoun4 Ey OC 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 e 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 e 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 n
139. onAlignment Preserve Last Error Code for Pinvoke Calls Ves DVNAMICBASE Ves NXCOMPAT No Machinex8s MACHINES No Default image type Promptimmediately ERRORREPORTPROMPT Image Has Safe Exception Handlers When SAFESEH is specified the linker will oly produce an image if it can also produce a table of the image s safe exception handlers This table specifies for the operating system which exception hanclets are valid for the image ee pel 4 CHAPTER 2 PROGRAMMING Select Image Has Safe Exception Handlers When the option has been set delete it 29 ZLOZ ttO IENSIA OLOZ t O IENSIA BUISN G EZ suonouny Buisn 104 sues EZ 2 3 6 Using Visual C 2013 This section explains the setting operation when using Visual C in Visual Studio 2013 The screens of Visual C 2013 opened by converting the sample program MTEST VC on Windows 8 Professional x64 are used for the explanation in this section eeeeevneeeveeeoeeoeeeeseeeeeeeeveeeeeeseeeseeeeeeeeeeeeeaeeeeeeeeeeeeeeee 1 Setting include files Tv Eo 1 Open the project to create a user application and select Ri Solution Explorer CtrleAlteL A 3 Team Beplorer Cte CtleM VIEW Solution Explorer Server Explorer Ctrl Alt S Fe SOL Server Object Explorer Ctrl Ctrl S R Bookmark Window Ctrl k Ctrl W Call Hierarchy Ctrl AlteK Ag Class View Ctrl Shift C F Code Definition Window Cte D
140. operty Pages screen is displayed amp Microsoft Cpp Win32 user Applic J Add New Project Property Sheet 2 ven fidd Exctneg Property Shee Corew F D fil Release V Move Later in Evaluation Move Earlier in Evaluation k Save Microsoft Cpp Win32 user Ctrl S X Remove Del K Rename F2 Properties 3 Select Common Properties Linker Advanced on the Property Pages screen Ves DYNAMICBASE Yes NXCOMPAT No MachineXB6 VMACHINEXE6 No Defaultimage type Promotimmediately ERRORREPORT PROMPT v _ The ENTRY option specifies an entry point function as the starting address for an evefle or DLL A a NA latform NA Configuration Manager 4 Commen Properties General User Macros VC Directoris gt CIC Linker General Input Manifest File Debugging system Optimization Embedded IDL Windows Metadata Advanced AI Options Command Line gt Manifest Too Librarian Resources gt MDL XML Document Genera gt Browse Information Build Events gt Custom Build Step Randomized Base Address Fixed Base Address Data Execution Prevention DEP Turn Off Assembly Generation Unload delay loaded DLL Notind delay loaded DLL Import Library Merge Sections Target Machine Profile CLR Thread Attribute CLRImage Type Key File Key Container Deley Sigh CLR Unmanaged Code Check Detect One Definition Rule viclations Error Reporting Secti
141. or ON 1 b8 PRM 1 Detected 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 i OFF 0 0 Not detected b15 9 RESERVE Display the detection status of cable disconnection error ON 1 b8 LINE 1 Detected i OFF 0 0 Not detected buf 3 b7 1 RESERVE 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 ON 1 b8 L ERR 1 Detected i OFF 0 0 Not detected buf 4 b7 1 RESERVE Display the data link execution status ON 1 bO L RUN 1 Data link in operation i OFF 0 0 No data link b15 9 RESERVE Display the data reception status ON 1 b8 RD 1 Data are being received f OFF 0 0 Data not received buf 5 b7 1 RESERVE Display the data sending status ON 1 bO SD 1 Data are being transmitted i OFF 0 0 Data not transmitted 96 MELSECNET H Board CHAPTER 4 FUNCTIONS Element Bit LED Description Note Display the detection status of data import delay error on the reverse loop side b15 R LOOP OVER 1 Detected 0 Not detected Display the detection status of code check error on the forward loop side b14 F LLOOP CRC 1 Detected 0 Not detected Display the detection status of code check e
142. orer Ctri Alt L ih Team Explorer Ctrl h Ctrl M CA Bookmark Window Ctrl K Ctr Ww EB Call Hierarchy Ctrl Alt K BZ Class view Ctrl Shift C Ea Code Definition Window Ctrl Shift Z Object Browser Ctri Alt J Error List Ctrl E El Output Alt 2 BB Resource View Ctrl Shift E Start Page 3 Toolbox Ctrl Alt x Find Results Other Windows Toolbars E FullScreen Shift Alt Enter re Ctrl al Ctrl Shift r Property Manager Property Pages fal ats o id Property Manager Microsoft Cpp Win3 Y X a a mtest1 B B Debug Win32 Microsoft Cpp Win32 ueer 1 2 m C Pure MSIL CLR E A Application ta Unicode Support By Core Windows Librar Gj Release Win32 Add New Project Property Sheet Add Existing Property Sheet er in Evaluation e Earlier in Evaluatio H Save Microsoft Cpp win32 user Ctrl 5 X Remove Del Rename F2 Le Properties To the next page Open the project to create a user application and select View Property Manager 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 23 ZLOZ ttO IENSIA OLOZ t O IENSIA Huis G EZ suonoun Buisn 104 sues EZ From the previous page ft Cpp Win32 user Propert 8 Cus
143. oup Number 1 to 32 129 81H to160 A0H All stations 240 F On The logical station number set with the utility 0 00H 0 00H to 239 EFH 1 All 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 specify the station number CHAPTER 4 FUNCTIONS 4 For CC Link IE Field Network board Specification Network numbers Station number Own station 0 00n 255 FFH 0 00H to120 78H Station number Other 125 7DH 1 01H to 239 EFH station Group Number 1 to 32 2 129 81H to160 A0H All stations 240 FOH The logical station number set with the utility 0 00n 0 00n to 239 EFH 1 All 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 sta
144. path Path of channel Oe f Use the path which is returned when executing mdOpen Specify the event number of event to wait eventno Waiting event number 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 Store the bit pattern or device value when the conditions of device are details Event detail information satisfied Reserve the variable for 4 words 87 9u 1un290 JUSAS JO Hurem JUSARPAUeMAPU Ep EY sead Uopoun4 Ey OC Explanation e 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 0 to 2147483647 7FFFFFFFH Millisecond waiting e 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 ist 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
145. r board WDT error does not occur may be created Operation of other software applications Channel busy dedicated instruction error f 28622 Ki e Wait for a little while and retry it The channel specified for Channel used by the f 9032 f j e Change the setting of Channel used by the own station or own station or Target station channel is being FFFF9032n f 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 e Exit the program and restart the personal computer FFFF9026n y 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 normally on other personal computers Repair or replace the diagnosis 28636 personal computer 9024H e When the same error occurs on other personal computers FFFF9024p replace the board e Consult your local Mitsubishi representative When an error code is returned as a return value of the extended function Page 45 Section 4 1 the error codes from 1 to 28636 will be an 8 digit value FFFFFFFFH to FFFF9024n in the hexadecimal format as described in the table 140 APPENDIX APPENDIX Appendix 1 Method for Increasing Minimum Working Set Size of Personal Computer The following explain
146. redundant or other safety features which exceed the general specifications of the PRODUCTs are required For details please contact the Mitsubishi representative in your region 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 lt Manual number model code gt Description Type Q80BD J61BT11N Q81BD J61BT11 CC Link System Master Local Interface Board User s Manual For SW1DNC CCBD2 B lt SH 080527ENG 13JR77 gt 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
147. reset to the current settings with the utility function The same process as that of the board reset operation of the utility function e The board reset error 99221 which notifies the board reset is returned to other applications accessing the reset board A Return value Success Return the value 0 Error Return the value other than 0 Refer to the list of error codes Page 133 CHAPTER 6 D gt Related function mdOpen mdClose 90 CHAPTER 4 FUNCTIONS 4 3 15 mdBdModSet setting modes of board LY Function Change the modes of a board temporarily L Format Visual C ret mdBdModSet path mode short ret Return value OUT long path Path of channel IN short mode 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 gt Integer mode Mode IN a 3 se Argument Description Specify the path of channel whose communication line is opened ze path Path of channel 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 pseog jo sepow BHuljjes JeSpoy pgqpw SL e y 91 Expla
148. ri E El Output Alt 2 BB Resource View Ctrl Shift E E Start Page 3 Toolbox Ctrl Alt x Find Results Other Windows Toolbars E FullScreen Shift Alt Enter ie Ctrl 3 Ctrl Shift r Property Manager Property Pages Property Manager Microsoft Cpp Win3 5 X fala tale i a M mest B B Debug Win32 1 2 Microsoft Cpp Wina Zai Unicode Support M C Pure MSIL CLR a Add New Project Property Sheet Application Add Existing Property Sheet S Core Windows Library E Release Win32 Move Later in Evaluation Move Earlier in Evaluation X Remove Rename ld Save Microsoft Cpp Win32 user Ctrl 5 Del F2 Properties To the next page CHAPTER 2 PROGRAMMING Open the project to create a user application and select View Property Manager 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 ZLOZ ttO IENSIA OLOZ t O IENSIA Huis G EZ suonoun4 Buisn 104 sues EZ From the previous page Microsoft Cpp Win32 user Property Pages configuration N A platform NIA E Common Properties E General Executable Directories 4 VCInstallir bin WindowsSdkDir bin NETFX 4 0 Tools Include Dir
149. rival acknowledgment Point The SEND function and the RECV function are not supported by CC Link The SEND function and the RECV 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 e A series CPU module e Ethernet adapter module Head module 4 1 CHAPTER 4 FuncTIONS This chapter explains the MELSEC data link library functions List of Functions CHAPTER 4 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 56 Section 4 3 1 mdClose Closes a communication line Page 57 Section 4 3 2 Batch writes devices Extended mdSendEx PE 3 Page 58 Section 4 3 3 Sends data SEND function 12 function Batch reads devices Extended mdReceiveEx ae a Page 62 Section 4 3 4 Receives data RECV function ce function Extended mdRandWEx Writes devices randomly S Page 66 Section 4 3 5 function 3 Extended mdRandREx Reads devices randomly 13 Page 69 Section 4 3 6 function Extended mdDevSetEx Sets a bit device 13 Page 73 Section 4 3 7 function Extended mdDevRstEx Resets a bit device 3 Page 75 Section 4 3 8 function
150. rk 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 5 Station numbers from 65 41H to 120 78H can be specified when using CC Link IE Controller Network 48 CHAPTER 4 FUNCTIONS 3 CC Link IE Controller Network board eae Station number Specification Upper byte Lower byte Own station 255 FFH 0 00H Station number 1 01H to 120 78H Other 2 F i Network number 125 7D1 3 station 1 01H to 239 EFH Group Number 1 to 32 129 81H to 160 A0H All stations 240 FOH The logical station number set with the utility 0 00n to 239 EFH 1 All stations and group numbers can be specified when using the SEND function mdSend without arrival acknowledgment 2 For specifying another station set a network number in the upper byte of the station number lt Setting a station number when another station is specified gt Network number Station number Upper Lower 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 CC Link IE Field Network board Station number Speci
151. rom 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 conditions 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 Page 3 RELATED MANUALS Point To create a 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 cr
152. rror on the reverse loop side b13 R LOOP CRC 1 Detected 0 Not detected Display the detection status of loop line error on the forward loop side b12 F LLOOP 1 Detected 0 Not detected Display the detection status of loop line error on the reverse loop side b11 R LOOP 1 Detected 0 Not detected Display the data reception status on the forward loop side b10 F LOOP RD 1 Data are being received 0 Data not received Display the data reception status on the reverse loop side b9 R LOOP RD 1 Data are being received 0 Data not received Display the data sending status on the forward loop side b8 F LOOP SD 1 Data are being transmitted i ON 1 buf 0 0 Data not transmitted OFF 0 Display the data sending status on the reverse loop side b7 R LOOP SD 1 Data are being transmitted 0 Data not transmitted Display the station type b6 S MNG 1 Operating as a sub control station 0 Other than sub control station Display the station type b5 MNG 1 Operating as a control station 0 Other than control station Display the data link status cyclic transmission status b4 D LINK 1 Data link in operation 0 No data link Display the baton pass status b3 T PASS 1 Baton pass in progress 0 No baton pass Display the detection status of parameter error b2 PRM E 1 Detected 0 Not detected Display the detection status of switch setting error b1 SW E 1 Detected 0 Not detected Display the operating status of board bO RUN 1 Operati
153. rs Use extended functions when creating a new program 4 Applicable to CC Link IE Field Network boards 5 The 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 user application List of conventional compatible functions Conventional compatible functions are functions used for programs created conventionally Function name Description Remarks Reference Batch writes devices mdSend a Page 107 Section 4 3 21 Sends data SEND function 12 Batch reads devices mdReceive ae Page 111 Section 4 3 22 Receives data RECV function 12 mdRandW Writes devices randomly Page 115 Section 4 3 23 mdRandR Reads devices randomly Page 118 Section 4 3 24 mdDevSet Sets a bit device Page 122 Section 4 3 25 mdDevRst Resets a bit device Page 123 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 4 2 CHAPTER 4 FUNCTIONS Common Specifications of Functions This section explains the definitions of arguments commonly used with the MELSEC data
154. ry For specifying network numbers and station numbers for extended functions refer to Page 50 Section 4 2 3 1 CC Link Ver 2 board Specification Station number Own station 255 FFH Other station 0 00H to 63 3FH The logical station number set with the utility 65 41H to 239 EFH 1 Station number 64 cannot be specified on the CC Link Ver 2 board Also when the own station number is 64 other station cannot be specified Only the own station can be accessed 2 MELSECNETIH board ple Station number Specification Upper byte Lower byte Own station 255 FFH 0 00H 4 Station number 1 01H to 120 78H Other Network number er H station 1 01H to 239 EFH OPH Group number 1 to 32 2 129 81H to 160 A0H All stations 240 FOH The logical station number set with the utility 65 41H to 239 EFH 1 All stations and group numbers can be specified when using the SEND function mdSend without arrival acknowledgment 2 ForMELSECNET 10 mode only group numbers from 1 to 9 129 81H to 137 89H can be specified 3 For specifying another station set a network number in the upper byte of the station number lt Setting a station number when another station is specified gt Network number L Station number Upper Lower 4 Access to the control station or master station station number 0 specified with the network number on the netwo
155. s Return the value 0 Error Return the value other than 0 Refer to the list of error codes Page 133 CHAPTER 6 gt Related function mdOpen mdClose 86 CHAPTER 4 FUNCTIONS 4 3 13 mdWaitBdEvent waiting for event occurrence LY Function Wait an occurrence of event until the time out L Format Visual C ret mdWaitBdEvent path eventno timeout signaledno details short long short long short short ret path eventnof 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 Waiting 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 Specify the path of channel whose communication line is opened
156. s 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 bit pattern of each driven event is stored in details Word device This function returns The driven event overlapped 70 FFBAn 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 I Page 133 CHAPTER 6 89 9U81INDDO JUSAS 104 Huem JUSARPAUeMAPU Ep EY sjlejaq uoyoun4 Ey 4 3 14 mdBdRst resetting board LY Function Reset a board L Format Visual C 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 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 The board is
157. s other than the extended functions refer to 3 Page 48 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 00H 255 FFH 0 00H to 63 3FH 1 65 41H to 239 EFH 1 Station number 64 cannot be specified on the CC Link Ver 2 board Also when the own station number is 64 other station cannot be specified Only the own station can be accessed 2 For MELSECNET H board Specification Network numbers Station number Own station 0 00n 255 FFH 0 00H Other Station number 1 01H to 239 EFH 2 station 5 an k OAH eS 125 7Dn The logical station number set with the utility 0 00n 65 41H 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 to120 78H Other 9 1 01H to 239 EFH 125 7DH station Gr
158. s 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 minimum 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 15 Page 142 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 Using the ID obtained in step 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 Release the user program handle with the CloseHandle func
159. 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 automatic 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 0004H Remote station test Reverse loop test Setting parameter check Station to station test s 0005H f 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 000E Bus interface test Bus interface test 0010H Memory test V Return value Success Return the value 0 Error gt Related function mdOpen mdClose mdBdModSet 94 Return the value other than 0 Refer to the list of error codes 5 Page 133 CHAPTER 6 CHAPTER 4 FUNCTIONS 4 3 17 mdBdLedRead read LED information of the board LY Function Read the LED information of the board L Format Visual C ret mdBdLedRead path buf short ret Return value OUT long path Path of channel IN short buff Read data OUT Visual Basic NET
160. sic 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 C Visual C NET 2003 e Visual Studio 2005 Visual C e Visual Studio 2008 Visual C e Visual Studio 2010 Visual C e Visual Studio 2012 Visual C e Visual Studio 2013 Visual C Sample programs are created in VisualC NET 2003 project format Convert the project when using Visual C other than Visual C NET 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 132 CHAPTER 6 ERROR CODES CHAPTER 6 ERRORCODES 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 Error description Corrective action 1 Driver not started e Check the channel number e Check the driver operating condition with Device Manager e Check the error of event viewer 00011 The driver is not started i e Check the board settings e Reinstall the software package Time out error e Ch
161. st the sizes according to your system 142 2 When setting with Visual C APPENDIX An example when the minimum working set size is 1MB and the maximum working set size is 3MB define ERROR 1 short ChangeWorkingSetSize DWORD 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 hnProcess 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 retur
162. stno Station number IN Oy E Integer offset Offset IN a 2 Integer size Written byte size IN 3 3 zoon a w Short data n Written data single precision integer array IN 3 s D m x Argument Description F Specify the path of channel whose communication line is opened 5 path Path of channel we 2 Use the path which is returned when executing mdOpen o Specify the network number of target station gt netno Network number y f o Page 50 Section 4 2 3 a Specify the station number of target station T stno Station number _ 3 Page 50 Section 4 2 3 D 3 Specify the start address of the remote device station buffer memory to be Q offset Offset f lt written 9 size Written byte size Specify the byte size to be written in even number 2 to 480 g Written data single precision integer 3 ae EERE data Specify the data to be written in single precision integer array a array Q D n a 2 Tf OC Explanation e 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 e Be sure that the write byte size from offset does not exceed the buffer memory range of the remote device station
163. sues EZ A Properties ngra ME g ean Apion eee Configuration and the Platform 4 General a Sea In case that there are multiple configurations and platforms select All Configurations and All Platforms to change 3 Select the configuration and the platform to be changed in the elete sa ol ources tib Ale tih tmp Build Log File S MSBuildProjectName log Platform Toolset Visual Studio 2013 v120 settings at a time Enable Managed Incremental Build No Application exe gt Custom Build Step b Code Analysis Specifies a relative path to the output file directory can include environment variables oK To the next page 35 From the previous page Configuration Active Debug b Common Properties 4 Configuration Properties Debugging VC Directories oles Linker Manifest Tool Resources XML Document Generator Browse Information Build Events Custom Build Step Code Analysis Blatform ActivecWin32 4 General Output Directory Debugh Intermediate Directory Debugh Target Name SProjectName Target Extension Extensions to Delete on Clean r cache obj ilk resources Build Log File SUNDIN SM SBuildProjectName log Platform Toolset Visual Studio 2013 7120 Enable Managed Incremental Build No Project Defaults Configuration Type Application exe Use of MFC Use MEC in a Shared DLL Character Set Use Multi Byte Character Set
164. the software package Sample programs are provided as a reference for creating 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 gt lt CCBD2 gt lt Sample gt 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 The sample programs for Visual Studio 2012 Visual Basic or Visual Studio 2013 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
165. the user specified folder that is specified when installing the software package to a personal computer e lt User specified folder gt lt MNETG gt lt SAMPLES gt 5 3 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 or Visual Studio 2013 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 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 bu
166. tion weiBoid ajdwes jo m no Bulsse00 4 p xipueddy Jajndwioy euossad JO 8ZIS 42S Buom wnwluiy Bulseesou 10 poyan XIpuaddy 141 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 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 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 Adju
167. tion when using the submaster function specify the station number suonoun Jo suoneoyioads uoWWOD Zy SUOI OUN Pepus xXe 104 SJOquNU UOHe s pue sJequinu yomu BulkjioedsS EZY 51 4 2 4 Specifying device types 52 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 2 Device type Device Code specification Device name Decimal Hexadecimal specification Link input LX Remote input RX 1 0901 Dew Link output LY Remote output RY 2 Soh Der 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 0024H DevWw Remote register for reception RWr 37 0025H DevWr Buffer memory 50 0032H DevSPB Random access buffer 33 0021H DevMRB 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 Tk 7 0007H 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
168. tion number Specify the own station 255 FFH devtyp Device type Specify the RECV function 101 65n Specify the own station channel number on which the received messages are stored e CC Link IE Controller Network board devno Channel number 1to8 e CC Link IE Field Network board 1 to2 Specify the byte size of received data in even number e Specify the byte size within the range of 2 to 1920 e When receiving the data which are transmitted by MELSECNET H size Receive byte 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 Received actual data and send source information are stored as single precision integer array Reserve an area for the specified receive byte size and send source information 6 bytes Receive data data with send source information single precision integer array 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 e 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 e Data are stored in receive data
169. 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 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 CC S8OIASP 19 01 U09 aiqewwe6oJd s uoije s 194 0 pUe S8dIASp YUI UOLIS UMO Bulsseo0e UBYM SUO INeDeld ZZZ 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 Keq Yur eed DISTIN Busy ueym suonNedalg ZZ 15 16 3 CC Link IE Field Network a Accessing to own station link devices RX RY RW Writing reading data to f
170. tom Buld Step E Managed Resources E Custom Buld Tool E XML Data Generator Tool Microsoft Cpp Win32 user Property Pages Common Properties General User Macros Be CCH Linker Manifest Too Resources 8 XML Document Generator E Browse Information G Buld Events G Custom Buld Step Managed Resources 8 Custom Buld Tool 8 XML Data Generator Tool Patoa yten mad echelon Corresponds to environment PEE Include Directories Select Directory MELSEC ccu amp Common G Help corma us Bun Easysocket E E MNETG 24 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 TJ 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 lt User specified folder gt lt COMMON gt lt INCLUDE gt Add include lt Mdfunc h gt at the beginning of the program 2 Setting library files 1 Microsoft Visual Studio View Project Buld Debug Team Data Tools T A Solution Explorer Ctri Alt L ih Team Explorer Ctrl Ctrl M 3 Bookmark Window Ctrl K Ctr W R Call Hierarchy Ctrl Alt K class view Ctrl Shift C Code Definition Window Ctrl Shift Z Object Browser Ctri Alt J Error List Ct
171. twork 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 Generic product name for SWnD5C ACT E and SWnD5C ACT EA n version 10 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 MELSECNET H board CC Link IE Controller Network board Ayesgr yur ea OASTAW I L 11 CHAPTER 2 PROGRAMMING This chapter explains how to use the MELSEC data link library 2 1 Programming Procedure The following flow
172. ual 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 path amp buf 0 Integer ret Return value OUT Long path Path of channel IN A Integer buf n Read data OUT a 3 zi Argument Description Specify the path of channel whose communication line is opened s path Path of channel 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 pseog ay JO UOIEWJOJU UOISJOA pedal PeayJeAPgPW 6p EY 103 Explanation The following table shows the details of the version information 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 OA to 9Z OA to 9Z 0A 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 05H ONO 2 o 4 quo onz Ot 4 ynononz o O19 2
173. ual C ret mdRandW path stno dev buf bufsize short ret Return value OUT long path Path of channel IN short stno Station number IN short dev J Randomly specified device IN short buff Written data single precision integer array IN short bufsize Dummy IN Visual Basic NET ret 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 Specify the path of channel whose communication line is opened path Path of channel eke f Use the path which is returned when executing mdOpen Specify the station number of target station stno Station number gt Page 48 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 F ae eee buf SR Specify the data to be written in single precisi
174. umber 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 M100 and later D10 and later 5 10 dev 6 4 4 points D10 to D13 Written data buf buf 0 0 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 116 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 0x1 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 133 CHAPTER 6 C gt Related function mdOpen md
175. urrent value LC 46 002EH DevLCN gt Q Long retentive timer contact LST 47 002FH DevSTT z 3 Long retentive timer coil LST 48 0030H DevSTC A Long retentive timer current value LST 49 0031H DevSTN a 8 Link direct device link input 3 Jn x 1001 to 1255 03E9H to 04E7H DevLX1 to 255 5 8 Link direct device link output 3 Jn Y 2001 to 2255 07D1H to 08CFH DevLY1 to 255 3 g Link direct device link relay Jn B 23001 to 23255 59D9H to 5AD7H DevLB1 to 255 i Link direct device link register 3 Jn w 24001 to 24255 5DC1 to 5EBFH DevLW1 to 255 3 Link direct device link special relay 3 Jn SB 25001 to 25255 61A9H to 62A7H DevLSB1 to 255 a Link direct device link special register Jn SW 28001 to 28255 6D61H to 6E5FH DevLSW1 to 255 Intelligent function module device Buffer memory Intelligent function module access device Un G 29000 to 29255 7148H to 7247H DevSPG0 to 255 1 4 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 3 digits of the code specification decimal and the numerical value of the device sp
176. ween a master station and an intelligent device 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 sueiBboud jdwes zo uonduoseq p s peog ZA YUIT 99D JO swiesBolg ajdwes 1 s 125 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 e Visual Basic NET 2003 e Visual Studio 2005 Visual Basic Visual Studio 2008 Visual Basic e Visual Studio 2010 Visual Basic Visual Studio 2012 Visual Basic Visual Studio 2013 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 P
177. 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 detected 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 bO F LOOP OVER 1 Detected 0 Not detected CC Link IE Controller Network CHAPTER 4 FUNCTIONS Element Bit LED Description Note buf 0 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 ON 1 OFF 0 b2 b1 SD MODE Display the data sending status 1 Data are being transmitted 0 Data not transmitted Displ
178. 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 f size e 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 e 125 7Dx 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 5 Page 133 CHAPTER 6 gt Related function mdOpen mdClose mdReceive mdSend mdSendEx 65 uonoun ADY S8OlAep pepue xe BHulpess yoyeq xyFenleceypw yEy sead uoyoun4 Ey 4 3 5 mdRandWEx writing extended devices randomly LY 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
179. xe pdbtype sept Cancel 19 2 3 3 Using Visual Basic NET This section explains the setting operation when using Visual Basic NET 2003 or when using Visual Basic in Visual Studio 2005 Visual Studio 2008 Visual Studio 2010 Visual Studio 2012 or Visual Studio 2013 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 Ctrl Shift 4 Ctrl D Add New Item Add Existing Item HE amp 2 2 ef a Exclude From Project Show All Files Add Reference Add Service Reference WindowsApplication1 Properties Add Existing Item WindowsApplication1 2 INCLUDE Ye Mdfunc vb Desktop Projects My Computer Object name Mdfune v Objects of type VB Code Files vb resx setlings xsd wsdl M 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 gt lt COMMON gt lt IN

Download Pdf Manuals

image

Related Search

Related Contents

Full Color Animation Laser Light User Manual  User`s Manual    XG100WM User Guide - Janam Technologies  CAPITOLO 1 - INTRODUZIONE  

Copyright © All rights reserved.
Failed to retrieve file