Home

MVI69E-LDM User Manual

image

Contents

1. Example MV1I69HANDLE handle int status MVI69 GetProcessorStatus handle status if status MVI69 RUN_MODE Processor is in Run Mode else Processor is not in Run Mode ProSoft Technology Inc Page 87 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module MVI69 GetScanCounter Syntax int MVI69 GetScanCounter MVI69HANDLE handle DWORD count Parameters handle handle returned by previous call to MVI69_Open count pointer to a variable that will be updated with the current scan count Description This function returns the current scan counter The scan counter is a 32 bit counter that is incremented with each backplane scan handle must be a valid handle returned from MVI69_Open Return Value MVI69 SUCCESS no errors were encountered MVI69 ERR _NOACCESS handle does not have access Example MVI69HANDLE handle DWORD scancount MVI69 GetScanCounter handle amp scancount Page 88 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual MVI69_SetLED Syntax int MVI69 SetLED MVI69HANDLE handle int lednum int ledstate Parameters handle handle returned by previous call to MVI69_Open lednum Specifies which of the user LED indicators is being addressed ledstate Specifies
2. 4 Conveying Verbatim Copies You may convey verbatim copies of the Program s source code as you receive it in any medium provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice keep intact all notices stating that this License and any non permissive terms added in accord with section 7 apply to the code keep intact all notices of the absence of any warranty and give all recipients a copy of this License along with the Program You may charge any price or no price for each copy that you convey and you may offer support or warranty protection for a fee 5 Conveying Modified Source Versions You may convey a work based on the Program or the modifications to produce it from the Program in the form of source code under th terms of section 4 provided that you also meet all of these conditions m a The work must carry prominent notices stating that you modified it and giving a relevant date b The work must carry prominent notices stating that it is released under this License and any conditions added under section 7 This requirement modifies the requirement in section 4 to keep intact all notices c You must license th ntire work as a whole under this ProSoft Technology Inc Page 101 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module License to anyone who comes into possess
3. Local 5 0 Data 0 2 0111_0100_0110 0101 Binay INT ASCII t e El Local 5 0 Mac coa 4B 1756_MODULE_IN f Local 5 0 Data egos ASCII INT 248 Local 0 Data 0 te ASCII INT Combined Binary Value 0111010001100101 29797 int Locat5 0 final finan AB 1756_MODULE_IN Local 5 0 Data tinea ASCII INT 248 Local 5 0 Data 0 zi EE Decimal INT ASCII INT Value 101 116 A Sere 1n eee oF Page 54 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual The sample application can have its sample ladder input tags modified via TCP Stress Tester either through the external server or the client by creating any string value up to 10 tag entries long 20 characters total including spaces Connection Closed Oma to Send String ascu 2 125215 HEX Send Fie File Click START to transmit the data from the computer into the module and backplane It is then updated in RSLogix 5000 with the appropriate number associations As mentioned earlier all character data is sent to RSLogix 5000 in sets of two per tag since each tag is 16 bits in length and each ASCII character resides in 8 bits one byte All ASCII information for each tag reads from right to left low byte to high byte as shown in the following example MVI69E LDM Running as a Server Rane DOAI Ee ALT TS IT OB EM
4. License Agr ment does not grant permiss previously distributed under the GNU General Public License GPL the law of the Commonwealth of Virginia shall govern this License Agreement only as to issues arising under or with respect to greement Nothing in this License Agreement shall be deemed to create any relationship of agency partnership or joint venture be tween CNRI and Licensee This ion to use CNRI trademarks or trade name in a trademark sense to endor services of Licensee or any third party 8 By clicking on the ACCEPT button wh installing or otherwise using Python 1 6 1 Licens agrees to b bound by the terms and conditions of this License Agreement ACCEPT CWI LICENSE AGREEMENT FOR PYTHON 0 9 0 T Copyright c 1991 1995 Stichting Mat The Netherlands All rights reserved Permission to use copy modify and dis documentation for any purpose and withou provided that the above copyright notice both that copyright notice and this perm supporting documentation and that the n Centrum or CWI not be used in advertisin distribution permission STICHTING MATHI THIS SOFTWARE INCLUDING ALL IMPLI of the software without spe El ATISCH CENTRUM DISCLAIMS se or promote products or ere indicated or by copying HROUGH 1 2 hematisch Centrum Amsterdam tribute this software and its t fee is hereby granted appear in all copies and that is
5. After verifying proper jumper placement insert the module into the CompactLogix chassis Use the same technique recommended by Rockwell Automation to remove and install CompactLogix modules Page 12 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual 1 5 1 Installing the Module in the Chassis You can install or remove CompactLogix system components while chassis power is applied and the system is operating However please note the following warning Warning When you insert or remove the module while backplane power is on an electrical arc can cause personal injury or property damage by sending an erroneous signal to your system s actuators This can cause unintended machine motion or loss of process control Electrical arcs may also cause an explosion they occur in a hazardous environment Verify that power is removed or that the area is non hazardous before proceeding Repeated electrical arcing causes excessive wear to contacts on both the module and its mating connector Worn contacts may create electrical resistance that can affect module operation 1 Align the module using the upper and lower tongue and_groove slots with the adjacent module and slide forward in the direction of the arrow ETHERNET VP CHANNEL O Upper Tongue and Groove Lower Tongue and Groove ProSoft Technology Inc Page 13 of 130 August 21 2014
6. CIP Control and Information Protocol This is the messaging protocol used for communications over the CompactLogix backplane Refer to the ControlNet Specification for information Connection A logical binding between two objects A connection allows more efficient use of bandwidth because the message path is not included after the connection is established Consumer A destination for data Controller The PLC or other controlling processor that communicates with the module directly over the backplane or via a network or remote l O adapter D DLL Dynamic Linked Library Embedded I O Refers to any I O which may reside on a CAM board ProSoft Technology Inc Page 125 of 130 August 21 2014 Glossary of Terms MVI69E LDM C Programmable Developer s Manual Linux Application Development Module ExplicitMsg An asynchronous message sent for information purposes to a node from the scanner H HSC High Speed Counter Input Image Refers to a contiguous block of data that is written by the module application and read by the controller The input image is read by the controller once each scan Also referred to as the input file Library Refers to the library file containing the API functions The library must be linked with the developer s application code to create the final executable program Linked Library Dynamically Linked Library See Library Local 1 0 Refers to any I O contained on the CPC base u
7. Connection A logical binding between two objects A connection allows more efficient use of bandwidth because the messaging path is not included after the connection is established Library Refers to the library file DLL that contains the API functions The library must be linked with the developer s application code to create the final executable program A client that establishes a connection path to a target The end node to which a connection is established by an originator 1 2 System Requirements The MVI69E LDM module requires the following hardware and software components Rockwell Automation CompactLogix processor firmware version 18 or greater depending on processor type with compatible power supply and one free slot in the rack for the module The module requires 5 VDC power Rockwell Automation RSLogix 5000 software Rockwell Automation RSLinx communication software version 2 51 or greater Pentium Il 450 MHz minimum Pentium III 733 MHz or greater recommended Supported operating systems Microsoft Windows 7 Professional 32 or 64 bit Microsoft Windows Vista Microsoft Windows XP Professional with Service Pack 1 or 2 Microsoft Windows 2000 Professional with Service Pack 1 2 or 3 o Microsoft Windows Server 2003 128 MB RAM minimum 256 MB of RAM recommended 100 MB of free hard disk space or more based on application requirements 256 color VGA graphics adapter 800 x 600 minimum resolution True Color 1024 x 7
8. Tel 971 4 214 6911 E mail mea prosoft technology com Languages spoken include English Hindi North America location in California Tel 1 661 716 5100 E mail support prosoft technology com Languages spoken include English Spanish Latin America Oficina Regional Tel 1 281 2989109 E Mail latinam prosoft technology com Languages spoken include Spanish English Latin America location in Puebla Mexico Tel 52 222 3 99 6565 E mail soporte prosoft technology com Languages spoken include Spanish Brasil location in Sao Paulo Tel 55 11 5083 3776 E mail brasil prosoft technology com Languages spoken include Portuguese English Warranty Information For complete details regarding ProSoft Technology s TERMS 8 CONDITIONS OF SALE WARRANTY SUPPORT SERVICE and RETURN MATERIAL AUTHORIZATION INSTRUCTIONS please see the documents on the Product DVD or go to www prosoft technology warranty Documentation is subject to change without notice Page 124 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Glossary of Terms Linux Application Development Module Developer s Manual 9 Glossary of Terms API Application Program Interface BIOS Basic Input Output System The BIOS firmware initializes the module at power up performs self diagnostics provides a DOS compatible interface to the console and flashes the ROM disk Byte 8 bit value Cc
9. 1 di Fe AB 1769_MODUL Ape A Locat 1 1 Fau Decmal DINT ManTas 5 GB MarProgam Locat Data la AE ria E Unschedded Programs Locat1 0 PEA P AB 1769_MODUL Monitor Tegs A Gat Tags Create Examine Off instruction 16 You can also observe this on the console port as well coms PuTTY Sox Page 66 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual 5 API Functions In This Chapter CIP API Initialization Functions 0 00 eee eeeeeeeeeeneeeeeeeeeeeeeeteeeseeeeeaes 68 Direct VO ACCESS utili e eae hee 73 e Messaging 1 28 si sicee Hides aie ad adie ita nana aiden 75 Synchronization chica ees Se SA 79 Se al Ports cui ia SI Badan iain 81 Miscellaneous FUNCTIONS eeecceeeseeeeeenneeeeeeeeeeeeeeeeeenaeeeeeeeeeesenaeeees 84 ProSoft Technology Inc Page 67 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module 5 1 CIP API Initialization Functions MVI69 Open Syntax int MVI69 Open MVI69HANDLE handle Parameters handle pointer to variable of type MVIG9HANDLE Description MVI69 Open acquires access to the API and sets handle to a unique ID that the application uses in subsequent functions This function must be called before any of the other API functions can be used with the exc
10. Ako detect 115200 Get Page 64 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual 14 You can view how the stream of data is accepted by the LDM module by untoggling the Serial_App_Sample_WriteTrigger and typing a string of characters on the console fa RSLogix 5000 MVI69ELDM in MVI69E_LDM ACD 1769 1 35E 18 11 MainProgram MainRoutine Ef Ele Edit Yiew Search Logic Communications Tools Window Help Offline 0 m RuN No Forces 5 ule No Edits alr eu a Controller Organizer Xx 3 Controller MVI69ELDM Controller Tags Controller Fault Handler E Power Up Handler SE Tasks 8 MainTask MainProgram Program Tags MainRoutine Unscheduled Programs S E Motion Groups Ungrouped Axes 2 Add On Instructions E Data Types Oi User Defined ce GA Strings Ef Add On Defined C Predefined Oy Module Defined G Trends 5 8 10 Configuration S A Backplane CompactLogix System fia 1769 L35E MVIS9ELOM E 4 1769 135E Ethernet Port LocalENB s Ethernet GHB CompactBus Local 1 1769 MODULE LOM Type Ladder Diagram Main Description Program MainProgram Number of Rungs 7 4 A tel ek E A Bee S MA oo gt Favorites AddOn K Alarms K Bk K Tmericounter KI T 0 ia A Pate PETHI 1020 Backplane y amp 2289 E AQ BASE als ar w Serial_App_Sample_WriteTrigger Serial ENET_A
11. Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module 2 Move the module back along the tongue and groove slots until the bus connectors on the MVI69E module and the adjacent module line up with each other Push the module s bus lever back slightly to clear the positioning tab and move it firmly to the left until it clicks Ensure that it is locked firmly into place DIN Rail Latches Bus Lever Free position gt Top View Move the Bus Lever to the left until it clicks Bus Lever Engaged position gt Top View 3 Close all DIN rail latches Page 14 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual 4 Press the DIN rail mounting area of the controller against the DIN rail The latches momentarily open and lock into place DIN rail clasp t Module inserted ProSoft Technology Inc Page 15 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module 1 5 2 Making Configuration Port Connections You can communicate with the module via RS232 through the Console or through the Ethernet port using Telnet RS 232 Console You access the Console through Serial Port 1 As a default the RS 232 Console port is enabled You can disable or enable this port Refer to Enabling and Disabling the Console P
12. ProSoft Technology Inc August 21 2014 Page 57 of 130 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module The following diagram shows the multi threading hierarchy All threads excluding the main thread can be removed disabled and the sample will continue to function as directed excluding the functionality of the removed thread and any child threads associated with it Main Thread runClientThread runServerThread Server IP Address clientRequestSend serverRequestReceive 4 3 2 Serial Application You cannot run this sample if Backplane_Sample is running Backplane_Sample runs by default during startup To run the serial_application sample you must kill the Backplane_Sample script See the section entitled Important Module Startup Information Please Read for information on how to kill or change the Backplane_Sample script The Serial_Application shows an example of how you can use the LDM module to communicate to an end device to transmit receive ASCII strings from the CompactLogix processor through the backplane to the LDM module on the bottom serial port default application port This same sample program Streams ASCII data into the module from the end device on the same serial port Sends the data to the backplane to the controller tags of the CompactLogix Sends out the number of bytes entered in Write_Byte_Cnt Controller tag continuously after the Seri
13. Remind Me Later Never Remind Me 3 Click OK The default workspace is pre populated with sample programs makefiles and scripts Building one of the sample projects is the recommended way to become familiar with the environment and the build process 2 2 1 Building a Project Building and using a sample application consists of the following steps 1 Compiling and linking your application 2 Downloading the application There are two ways you can do this o Use FTP transfer to download the application o Create a downloadable image and then download the image to the target device module Page 34 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual 2 2 2 Compiling and Linking 1 Start the Linux Debian virtual machine in the VM Player 2 Open a Bash Shell window by clicking on the BASH SHELL icon on the main page 3 Once in the shell change the directory to one of the samples In this case change the directory to get to the LED_sample program Type cd workspace mvi69e ldm src LDM led_sample Terminal user debian6vm workspace mvi69e ldm src idm led sample file Edit View Terminal Go Help user debian6vm workspace mvi69e ldm src ldm led samples i 4 To recompile and link simply type make In this case the executable is up to date and nothing needs to be done 5 If the source is changed the make util
14. and networking features VMware Player needs to know if this virtual machine was moved or copied If you don t know answer I copied it 7 After the image loads the VMware Player prompts you for a username and password Username user Password password The home screen appears BP OS mousepa Terminal Thunar 2 3 C a a 09 17 Be ProSoft Technology Inc August 21 2014 Page 33 of 130 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module 2 2 Starting Eclipse Eclipse is an Integrated Development Environment IDE used in the Linux environment primarily to edit source code Full documentation and downloads are available at www eclipse org To start Eclipse 1 Double click the Eclipse icon on our Windows desktop 2 When the Workspace Launcher appears choose the default workspace nome user workspace Eq Debian6VM VMware Player Non commercial use only Se xs Player BB Cm d Workspace Launcher Select a workspace Eclipse stores your projects in a folder called a workspace Choose a workspace folder to use for this session Workspace home user workspace v Browse Use this as the default and do not ask again mb a q a Eclipse The installed version of VMware Tools is not up to date Log in to the guest operating system and click Update Tools 14 15 By Update Tools
15. code on the User Product for example the work has been installed in ROM The requirement to provide Installation Information does not include a requirement to continue to provide support service warranty or updates for a work that has been modified or installed by the recipient or for the User Product in which it has been modified or installed Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and ProSoft Technology Inc Page 103 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module protocols for communication across the network Corresponding Source conveyed and Installation Information provided in accord with this section must be in a format that is publicly documented and with an implementation available to the public in source code form and must require no special password or key for unpacking reading or copying 7 Additional Terms Additional permissions are terms that supplement the terms of this License by making exceptions from one or more of its conditions Additional permissions that are applicable to th ntire Program shall be treated as though they were included in this License to the extent that they are valid under applicable law If additional permissions apply only to part of the Program that part may be used separately under
16. file the Runtime Library that bears a notice placed by the copyright holder of the file stating that the file is governed by GPLv3 along with this Exception When you use GCC to compile a program GCC may combine portions of certain GCC header files and runtime libraries with the compiled program The purpose of this Exception is to allow compilation of non GPL including proprietary programs to use in this way the header files and runtime libraries covered by this Exception 0 Definitions A file is an Independent Module if it either requires the Runtime Library for execution after a Compilation Process or makes use of an interface provided by the Runtime Library but is not otherwise based on the Runtime Library GCC means a version of the GNU Compiler Collection with or without modifications governed by version 3 or a specified later version of the GNU General Public License GPL with the option of using any subsequent versions published by the FSF GPL compatible Software is software whose conditions of propagation modification and use would permit combination with GCC in accord with the license of GCC Target Code refers to output from any compiler for a real or virtual target processor architecture in executable form or suitable for input to an assembler loader linker and or execution phase Notwithstanding that Target Code does not include data in any format that is used as a compiler intermediate represe
17. oooococccincccnicccnnonanonaanancccnno 8 Support Service 8 Warranty 8 1 Contacting Technical Support 8 2 Warranty InforMatiON ooooonccnnnnncnnnnicccnnanacncnnnnnnos 9 Glossary of Terms Index ProSoft Technology Inc August 21 2014 Page 7 of 130 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module Page 8 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual 1 1 1 Preparing the MVI69E LDM Module In This Chapter 4 MVI69E LDM IntroductiON coooocccnnnnncncnncccnnononccnnnnrn non nnarnnnnnnn cnn nana nnnnnns 9 System RequirementS oconcccincccinnccnocccnnncnnonnnnnncnnnnnnnnn cnn nn nananannncnnnc nano 10 Package ConteniS ici ie 11 Jumper Locations and SettidgS oomcinncnnnnnninncnnnccnnnccnnrnconcncnnancnnnccnnn 11 Installing and Connecting the Module ooooococinnccnnnccnnccccoccccnaccnancncnncannnos 12 Establishing Module Communications ooomncinnncnnnnnnnnccnncnonaccnarcnnancnnnnos 24 Resetting the Module ecesceeesseneeeeseneeseseeceeeeseeeeseseneesenenseeessensenes 27 lt Important Information Before Development oooccccinoccccnnconcnonannninonannnnnns 29 MVI69E LDM Introduction The MVI69E LDM module is a CompactLogix backplane compatible module that allows Rockwell Automation CompactLogix processors to interface
18. responsibilities if you distribute copies of the software or if you modify it responsibilities to respect the freedom of others For example if you distribute copies of such a program whether gratis or for a fee you must pass on to the recipients the sam freedoms that you received You must make sure that they too receive or can get the source code And you must show them these terms so they know their rights Developers that use the GNU GPL protect your rights with two steps 1 assert copyright on the software and 2 offer you this License giving you legal permission to copy distribute and or modify it For the developers and authors protection the GPL clearly explains that there is no warranty for this free software For both users and authors sake the GPL requires that modified versions be marked as changed so that their problems will not be attributed erroneously to authors of previous versions Some devices are designed to deny users access to install or run modified versions of the software inside them although the manufacturer can do so This is fundamentally incompatible with the aim of protecting users freedom to change the software The systematic pattern of such abuse occurs in the area of products for individuals to Page 98 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual use which is p
19. the Windows environment Use FileZilla to connect to the target by specifying the IP address of the MVI69E LDM s IP Download the application image to the desired directory on the LDM using the FTP transfer program Since Windows does not have the same detailed permissions as Linux you must change the file permissions on the application once in the module Use the command chmod a x filename to add the execute attribute to the application You can also download the application by creating an image and using Firmware update See Creating an Application Image 2 2 4 Creating an Application Image An image contains all of the application specific components required for your application This includes the executable s application specific shared libraries scripts web pages and data files lt does not contain the operating system or common components that are already on the target device The image is a compressed tar file of the application components Once created use the device s web page to download the firmware upgrade The tar file name is specified in IMAGE CONTENTS In the sample image the firmware file is firmware mvi69e ldm firmware revision date This firmware file is downloaded to the directory psfttmp on the target device Upon system restart the system startup scripts unpack the tar file into the psfttmp directory The script psfttmp install is executed to move the component files into their final destination A sam
20. the originator of its Contribution if any in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution Page 112 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual 4 COMMERCIAL DISTRIBUTION Commercial distributors of software may accept certain responsibilities with respect to end users business partners and the like While this license is intended to facilitate the commercial use of the Program the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors Therefore if a Contributor includes the Program in a commercial product offering such Contributor Commercial Contributor hereby agrees to defend and indemnify every other Contributor Indemnified Contributor against any losses damages and costs collectively Losses arising from claims lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement In order to qualify an Indemnified Contributor must a promptly n
21. the sample 1 2 3 Go to the default home directory psft sample Type the command client Sample ip address of server to run the program The IP address of the server node must be provided in order for the server to know which node is executing the server program The client will send a connection request to the server print the response from the server to the console and then exit Reviewing the source code for client Sample you will see that the main program registers sigquit_handler for four signals checks command line and print usage message if required opens the backplane using open backplane See the detailed description in backplane_ sample creates a socket with a call to socket initializes the server address serv_addr structure o indicates that an IP4 address is going to be used with ar _INET o sets the destination port is the well known port server_PORT_NUMBER o converts the string version of the server IP address to binary with inet_pton connect is called to create the TCP connection to the server When the sockets are connected the server sends the date and time from the server as a message back to the clients The client then uses the reaa function to receive the buffer of data and prints the contents to the console Page 48 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Man
22. to Y for most modem applications Page 92 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual 6 2 2 RS 232 Null Modem Connection Hardware Handshaking This type of connection is used when the device connected to the module requires hardware handshaking control and monitoring of modem signal lines RS 232 Application Port Cable Hardware Handshaking DB 9 Male RS 232 Device TxD RxD RxD TxD RTS CTS CTS RTS Signal Signal Common 5 Common 6 2 3 RS 232 Null Modem Connection No Hardware Handshaking This type of connection can be used to connect the module to a computer or field device communication port RS 232 Application Port Cable No Handshaking DB 9 Male RS 232 Device ro 2 to con 5 coom Note For most null modem connections where hardware handshaking is not required the Use CTS Line parameter should be set to N and no jumper will be required between Pins 7 RTS and 8 CTS on the connector If the port is configured with the Use CTS Line set to Y then a jumper is required between the RTS and the CTS lines on the port connection ProSoft Technology Inc Page 93 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module RS 232 Application Port Cable No Handshaking DB 9 Male RS 232 Device to s L w Ro 2 100 RTS RTS CTS jump
23. to the risks and costs of program errors compliance with applicable laws damage to or loss of data programs or equipment and unavailability or interruption of operations 6 DISCLAIMER OF LIABILITY EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT INDIRECT INCIDENTAL SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES INCLUDING WITHOUT LIMITATION LOST PROFITS HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY WHETHER IN CONTRACT STRICT LIABILITY OR TORT INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES ProSoft Technology Inc Page 113 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module 7 GENERAL If any provision of this Agreement is invalid or unenforceable under applicable law it shall not affect the validity or enforceability of the remainder of the terms of this Agreement and without further action by the parties hereto such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable If Recipient institutes patent litigation against any entity including a cross claim or counterclaim in a lawsuit alleging that the Program itself excluding combinations of the Program with other software
24. was received In addition after a new version of the Agreement is published Contributor may elect to distribute the Program including its Contributions under the new version Except as expressly stated in Sections 2 a and 2 b above Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement whether expressly by implication estoppel or otherwise All rights in the Program not expressly granted under this Agreement are reserved This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose Each party waives its rights to a jury trial in any resulting litigation Page 114 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Linux Application Development Module Contents Developer s Manual 7 3 Python Public License Python 2 5 license This is the official license for the Python 2 5 release A HISTORY OF THE SOFTWARE Python was created in the early 1990s by Guido van Rossum at Stichting Mathematisch Centrum CWI see http www cwi nl in the Netherlands as a successor of a language called ABC Guido remains Python s principal author although it includes many contributions from others In 1995 Guido continued his work on Python at the Corporation
25. 005 PSF yes 2 4 Do 2004 PSF yes 2 4 1 2 4 2005 PSF yes 2 4 2 2 4 2005 PSF yes 2 4 3 2 4 2 2006 PSF yes Deo 2 4 2006 PSF yes ProSoft Technology Inc August 21 2014 Page 115 of 130 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module Footnotes 1 GPL compatible doesn t mean that we re distributing Python under the GPL All Python licenses unlike the GPL let you distribute a modified version without making your changes open source The GPL compatible licenses make it possible to combine Python with other software that is released under the GPL the others don t 2 According to Richard Stallman 1 6 1 is not GPL compatible because its license has a choice of law clause According to CNRI however Stallman s lawyer has told CNRI s lawyer that 1 6 1 is not incompatible with the GPL Thanks to the many outside volunteers who have worked under Guido s direction to make these releases possible B TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 1 This LICENSE AGREEMENT is between the Python Software Foundation PSF and the Individual or Organization Licensee accessing and otherwise using this software Python in source or binary form and its associated documentation 2 Subject to the terms and conditions of this License Agree
26. 125 Building a Project 34 40 Byte 125 C Cable Connections 24 91 CIP 125 CIP API Architecture 41 CIP API Initialization Functions 68 CompactLogix Tag Naming Conventions 39 Compiling and Linking 35 Configuring Serial Communication 44 Connection 125 Consumer 125 Contacting Technical Support 123 Controller 125 Creating an Application Image 36 D DB9 to RJ45 Adaptor Cable 14 95 Development Environment 31 Direct I O Access 73 DLL 125 Downloading the Application with FTP 36 Downloading the Image with Firmware Update 37 E Eclipse Public License 111 Embedded I O 125 Enabling and Disabling the Console Port 20 Establishing a Console Connection 44 Establishing Module Communications 24 Ethernet Application 52 Ethernet Sample 46 ExplicitMsg 126 G GCC Public License 120 GNU Public License 98 Header File 39 HSC 126 Important Information Before Development 29 Important Installation Instructions 2 Input Image 126 Installing and Connecting the Module 12 Installing the Module in the Chassis 13 J Jumper Locations and Settings 11 L LED Sample 50 Library 126 Linked Library 126 Local I O 126 Long 126 M Making Configuration Port Connections 16 Messaging 75 Miscellaneous Functions 84 Module 126 Mutex 126 MVI Multi Vendor Interface Modules 2 MVI69_Close 68 69 70 MVI69 GetlOConfig 71 72 73
27. 2007 Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law 12 No Surrender of Others Freedom If conditions are imposed on you whether by court order agreement or otherwise that contradict the conditions of this License they do not excuse you from the conditions of this License If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations then as a consequence you may not convey it at all For example if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program 13 Use with the GNU Affero General Public License Notwithstanding any other provision of this License you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work and to convey the resulting work The terms of this License will continue to apply to the part which is the covered work ProSoft Technology Inc Page 107 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module but the spe
28. 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module 6 This License Agreement shall be governed by and interpreted in all respects by the law of the State of California excluding conflict of law provisions Nothing in this License Agreement shall be deemed to create any relationship of agency partnership or joint venture between BeOpen and Licensee This License Agreement does not grant permission to use BeOpen trademarks or trade names in a trademark sense to endorse or promote products or services of Licensee or any third party As an exception the BeOpen Python logos available at http www pythonlabs com logos html may be used according to the permissions granted on that web page 7 By copying installing or otherwise using the software Licensee agrees to be bound by the terms and conditions of this License Agreement CNRI LICENSE AGREEM T NT FOR PYTHON 1 6 1 1 This LICENSE AGREEMENT is between the Corporation for National Research Initiatives having an office at 1895 Preston White Drive Reston VA 20191 CNRI and the Individual or Organization Licensee accessing and otherwise using Python 1 6 1 software in source or binary form and its associated documentation 2 Subject to the terms and conditions of this License Agreement CNRI hereby grants Licensee a nonexclusive royalty free world wide license to reproduce
29. 67 5 1 CIP API Initialization FUNCIONS ooooocncccnnnnconnccnnncccnanccnn anna aran corran nn cnn 68 MVI69 ON cri etic tel hee 68 MVI69 OpenNB ici hee feats Hand tae ed a eens tiie 69 MVI69i Close ais oz 70 MV169 GetlO Cotidiana 71 MVI69 SetlOConfig atico ie cet 72 5 2 Direct I O ACCESS iii a 73 MVI69_ReadOutputlMage oocoinccccnncconnnccononnnonancconc cnn cnn 73 MVIG9 WritelmputlMage oooocccoonnoccccnnnccccnnoncccnnnnnocnnnnnnocnn crono cnn cancer nn rre a i air 74 5 3 ES A 75 MVI69_GetMsgRequestFroMBP ooocccccoccconoccconoccconcccnnnc nono conan cnn cnc 75 MVI69 SendMsgResponseTOBP cocccccnccconociconoccconcccnoncnono conan cnc nc narran 77 5 4 SYVNCHIONIZALION s 220 5 seat utac ey ail dde 79 MVI69 WaitForlnputScanc ttac cdi a dd 79 MVI69 WaitForOutputScans 0i4 ccnt een al nal do 80 5 5 Serial Ports niceties A aia ah ee ta eed eee a 81 MV169 GetSerialConfig 2 4iac dt cian el et nian id 81 MV169 SetSerial Config wac vian ical ciate ds 83 5 6 Miscellaneous Functions Iesire enara na e AEA a 84 MVI69 GetVersion MO ci A aa 84 MVI69 GetModuleldto occiso xin tea tdi valent thet nda tian tds 85 MVI69 SetModul Nios ctor iri cai tiene initia iGo thal eee dagen tae 86 MVI69 GetScanMode iio aint e tien tian tao tia ine dae an ths 87 MVI69 GetScanCounter cccccccnnenecoccnnnnnonononononnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnennnnnnnnnnnnonnnnnnnnnnnnnenonnnnnnnnannnns 88 MVI69 SetlED Sidi wna lett egtia tha add peered ala
30. 68 recommended DVD drive OB Ox O Note The Hardware and Operating System requirements in this list are the minimum recommended to install and run software provided by ProSoft Technology Other third party applications may have different requirements Refer to the documentation for any third party applications Page 10 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual 1 3 Package Contents Your MVI69E LDM package includes RJ45 to DB 9M cables for each serial port 2 DB9 to screw terminal adapter Ethernet Straight Thru Cable Null Modem Cable You can download all documentation sample code and sample ladder logic from our website for free www prosoft technology com ldmdevkit If any of these components are missing please contact ProSoft Technology Support Not Shipped with Unit LDMdevKit Linux Development Module Development Kit Available for purchase from ProSoft Technology and must be ordered separately 1 4 Jumper Locations and Settings Each module has three jumpers Setup Port 1 Port 2 RS232 ALL 3 umm Na RS232 _ ae El 7 3 3 RS232 _ RS422 e asas i ProSoft Technology Inc Page 11 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module 1 4 1 Setup Jumper The Se
31. 69_ERR_BADPARAM will be returned if an attempts is made to access the output image beyond the range configured for direct IO See the MVI69 GetIOConfig and Mv169 SetIoconfig functions for more information The output image is written by the control processor and read by the module Return Value MVI69 SUCCESS data was read from the output image successfully MVI69 ERR _NOACCESS handle does not have access MVI69 ERR_BADPARAM Parameter contains invalid value Example MVI69HANDLE handle WORD buffer 8 int rC Read 8 words of data from the output image starting with word 2 rc MVI69 ReadOutputImage Handle 2 8 buffer if rc MVI69 SUCCESS printf ERROR MVI69 ReadOutputImage failed See Also MVI69 GetlOConfig MVI69 SetlOConfig MVI69 Writelnputlimage ProSoft Technology Inc Page 73 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module MVI69 Writelnputimage Syntax int MVI69 WriteInputImage MVI69HANDLE handle WORD offset WORD length WORD buffer Parameters handle handle returned by previous call to MVI69 Open offset word offset into output image at which to begin writing length number of words to write buffer pointer to buffer of data to be written to input image Description MVI69 Writelnputlmage writes to the module s input image handle must be a valid handle returned from mv16
32. 74 76 78 MVI69_GetModuleInfo 85 86 MVI69_GetMsgRequestFromBp 75 78 MVI69_GetScanCounter 88 MVI69_GetScanMode 87 MVI69_GetSerialConfig 81 83 MVI69_GetSetupJumper 90 MVI69 GetVersionInfo 84 MVI69_Open 68 69 70 MVI69_OpenNB 68 69 70 MVI69_ReadOutputlmage 73 74 MVI69_SendMsgResponseToBp 76 77 MVI69_SetlOConfig 71 72 73 74 MVI69_SetLED 89 MVI69_SetModulelnfo 85 86 MVI69_SetSerialConfig 82 83 MVI69_WaitForlnputScan 79 MVI69_WaitForOutputScan 79 80 MVI69_Writelnputlmage 73 74 MVI69E LDM Development Tools 40 MVI69E LDM Introduction 9 O Open Source Licensing 97 Originator 126 Output Image 126 ProSoft Technology Inc August 21 2014 Page 129 of 130 Glossary of Terms MVI69E LDM C Programmable Developer s Manual Linux Application Development Module P Package Contents 11 Physically Connect to the Module 44 Pinouts 2 91 95 Port 1 and Port 2 Jumpers 12 Preparing the MVI69E LDM Module 9 Producer 126 PTO 127 PTQ Suite 127 Python Public License 115 R Resetting the Module 27 RS 232 Modem Connection Hardware Handshaking Required 92 Null Modem Connection Hardware Handshaking 93 Null Modem Connection No Hardware Handshaking 93 RS 232 Application Port s 92 RS 232 Configuration Debug Port 91 RS 422 94 RS 485 and RS 422 Tip 95 RS 485 Application Port s 94 S Sample Code 39 43 Sample Tutorial
33. 9 Open buffer must point to a buffer of at least length words in size offset specifies the word in the output image to begin reading and length specifies the number of words to write The error MVI69 ERR_BADPARAM will be returned if an attempt is made to access the input image beyond the range configured for direct lO If this error is returned no data will be written to the input image See the mv169 GetIoconfig and MVI69 SetIOConfig functions for more information The input image is written by the module and read by the control processor Return Value MVI69 SUCCESS data was written to the input image successfully MVI69 ERR_NOACCESS handle does not have access MVI69 ERR BADPARAM Parameter contains invalid value Example MVI69HANDLE handle WORD buffer 2 int rc Write 2 words of data to the input image starting with word 0 rc MVI69 WriteInputImage Handle buffer 0 2 if rc MVI69 SUCCESS printf ERROR MVI69 WriteInputImage failed See Also MVI69 GetlOConfig MVI69 SetlOConfig MVI69 ReadOutputlmage Page 74 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual 5 3 Messaging MVI69_GetMsgRequestFromBp Syntax int MVI69 GetMsgRequestFromBp MVI69HANDLE handle WORD buffer WORD length WORD reserved WORD timeout Parameters handle handle returned by
34. Ethernet Ports 1 Ethernet port 10 100 Mbps RJ45 connector Link and Activity indicators Auto sensing crossover cable detection Serial Ports Full hardware handshaking control provides radio modem and multi drop support 2 Serial Application ports RJ45 DB 9M with supplied adapter cable Configurable RS 232 hardware handshaking 500V Optical isolation from backplane RS 232 RS 422 RS 485 software configurable by the end user Rx Receive and Tx Transmit LEDs each port Agency Approvals and Certifications ATEX Zone 2 CE CSA CB Safety cULus Class 1 Div 2 CB Qu Scheme MVI69E LDM C Programmable Linux Application Development Module Contents Developer s Manual Contents Your Feedback Please civic tt 2 Important Installation INStrUCTIONS e esas ernan nE ARNEE E BAEN NETE AEEA AET EA TE RAEE AE A SERRATE T 2 MVI Multi Vendor Interface Modules ooocccoooccccconocccinononcncnanoncncnanncncnnno cnn c nano cnc cnnnn nn cc nana n cnc naar nnccinns 2 Warnings Specification and Certifications oooonnocccnnnoccconononccnnononononononnnnnonnnnnnnnnnnn nn ncnnnn nn n ran nnncnnnnss 3 1 Preparing the MVI69E LDM Module 9 1 1 MVI69E EDM Introductorio aaa 9 1 2 System Reguirem ntS soso ec 10 1 3 Package Contents ia aa nh eaea aaa an aeaa aa neve dies Eaa a int aaar Aaaa ARa aaea tes 11 1 4 Jumper Locations and SettingS ccccccceeceesseeeeeeeceeeeecaeeeeaaeseeeeeseaeeeeaesseneeesaees 11 Se
35. FOR THE PROGRAM TO THE EXTENT PERMITTED BY APPLICABLE LAW EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND OR OTHER PARTIES PROVIDE THE PROGRAM AS IS WITHOUT WARRANTY OF ANY KIND EITHER EXPRESSED OR IMPLIED INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU SHOULD THE PROGRAM PROVE DEFECTIVE YOU ASSUME THE COST OF ALL NECESSARY SERVICING REPAIR OR CORRECTION 16 Limitation of Liability IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER OR ANY OTHER PARTY WHO MODIFIES AND OR CONVEYS THE PROGRAM AS PERMITTED ABOVE BE LIABLE TO YOU FOR DAMAGES INCLUDING ANY GENERAL SPECIAL INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROG
36. I69 ERR_NOACCESS handle does not have access Example MVI69HANDLE handle MVIBPMODULEINFO modinfo print module name MVI69 GetModuleInfo handle amp modinfo printf Name is s n modinfo Name See Also MVI69 SetModulelnfo ProSoft Technology Inc Page 85 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module MVI69 SetModulelnfo Syntax int MVI69 SetModuleInfo MVI69HANDLE handle MVI69MODULEINFO modinfo Parameters handle not used set to 0 modinfo pointer to structure of type MVIG9MODULEINFO Description MVI69 SetModulelnfo allows an application to set the identity information for the module This function must be called before MVI69 Open The module information is provided in the structure modinfo handle must be a valid handle returned from MVI69_Open The MVIG9MODULEINFO structure is defined as follows typedef struct tagMVIBPMODULEINFO WORD VendorID Reserved WORD DeviceType Reserved WORD ProductCode Device model code BYTE MajorRevision Device major revision BYTE MinorRevision Device minor revision DWORD SerialNo Serial number BYTE Name 32 Device name string MVI69MODULEINFO The module serial number is set during manufacturing and cannot be edited Return Value MVI69 SUCCESS the module information was read succes
37. I69SPCONFIG Return Value MVI69 SUCCESS the configuration information was read successfully MVI69 ERR_NOACCESS handle does not have access Example MVI69HANDLE handle MVI69SPCONFIG spconfig Set up port 2 for RS232 spconfig port_ num 2 spconfig port cfg MVI69 SERIAL CONFIG RS232 MVI69 SetSerialConfig Handle amp spconfig See Also MVI69 GetSerialConfig ProSoft Technology Inc Page 83 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module 5 6 Miscellaneous Functions MVI69_GetVersionInfo Syntax int MVI69 GetVersionInfo MVI69HANDLE handle MVI69VERSIONINFO verinfo Parameters handle handle returned by previous call to MVI69 Open verinfo pointer to structure of type MVIG9VERSIONINFO Description MVI69_GetVersionInfo retrieves the current version of the API library and the backplane device driver This information is returned in the structure verinfo handle must be a valid handle returned from MVI69_Open The MVI69VERSIONINFO structure is defined as follows typedef struct tagMV1I69VERSIONINFO WORD APISeries API series WORD APIRevision API revision WORD DDSeries Device driver series WORD DDRevision Device driver revision MVI69VERSIONINFO Return Value MVI69 SUCCESS the version information was read successfully MVI69 ERR _NOACCESS
38. Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual 5 5 Serial Ports The API functions in this section can be used to access tag data withing CompactLogix controllers The prototypes for most of these functions and their associated data structure definitions can be found in the header file OCXTagDb h The tag access functions that include Db in the name are for use with a valid tag database see OCXcip_BuildTagDb MVI69 GetSerialConfig Syntax int MVI69 GetSerialConfig MVI69HANDLE handle MVI69SPCONFIG spconfig Parameters handle handle returned by previous call to MVI69 Open spconfig pointer to structure of type MVIG9SPCONFIG Description MVI69 GetSerialConfig retrieves the state of the serial port configuration jumper for the port specified The information is returned in the structure spconfig handle must be a valid handle returned from MVI69_Open The MVI69SPCONFIG structure is defined as follows typedef struct tagMVI69SPCONFIG int port num Port number 1 or 2 int port cfg Jumper position MVI69SPCONFIG port_num must be set to the desired port before calling this function Upon return port_cfg will be set to one of the following values MVI69_SERIAL_CONFIG_NONE No jumper installed MVI69_ SERIAL_CONFIG_RS232 MVI69_SERIAL_CONFIG_RS422 MVI69_ SERIAL_CONFIG_RS485 Return Value MVI69 SUCCESS
39. Lawns E o M tee tee Vow tem lege mare Tea Wadea Hey asua PLA ls nite a Fra gt de ne Ben 3 m a O O ie O l a rr ex Me Gt Poe noe cpat y o 0 tow o o BS hen to Mf e ma Y tend cow lt ar 2 Du loe to rE Ab A yey a MT ON a ope dh ns het mi ly as cage ir o oe wl Ta z ree E Dd Mone Ufo at a tenn jot 3 Apr e UD ir hate at of e mi e de theme aad A ProSoft Technology Inc Page 55 of 130 August 21 2014 Contents Developer s Manual MVI69E LDM C Programmable Linux Application Development Module n D ICP Stress Tester Host 192 168 0 250 Connection TCP C UDP Close 192 168 0 250 6000 Display Stop bond james bond yr String ASCH bond james bond jri ASCU Q HEX Send File File Single Continuous 1000 Type Chent H Milliseconds 33 32 2C 20 31 3 O 31 30 35 X E Page 56 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Linux Application Development Module Contents Developer s Manual MVI69E LDM Running as a Client F Display Stop bond james bond jr String ASCII bond james bond jrt 30 Single Continuous 1000 4Milliseconds lo 31 3 34 2C Host Connection Type Port ec ype TCP C UDP HEX 0 101 44 101 104 116 115 108 108 32 32 111 1 104 108 Send File File
40. M C Programmable Linux Application Development Module Contents Developer s Manual Corresponding Source along with the object code copy the object code is a network server may be on a different server If the place to the Corresponding Source operated by you or a third party that supports equivalent copying facilities provided you maintain clear directions next to the object code saying where to find the Corresponding Source Regardless of what server hosts the Corresponding Source you remain obligated to ensure that it is available for as long as needed to satisfy these requirements Convey the object code using peer to peer transmission provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d ct code whose source code is excluded a System Library need not be code work A separable portion of the obj from the Corresponding Source as included in conveying the object A User Product is either 1 a consumer product which means any tangible personal property which is normally used for personal family or household purposes or 2 anything designed or sold for incorporation into a dwelling In determining whether a product is a consumer product doubtful cases shall be resolved in favor of coverage For a particular product received by a particular user normally used refers to a ty
41. NTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1 6 1 WILL NOT INFRINGE ANY THIRD PARTY RIGHTS T Page 118 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Linux Application Development Module Contents Developer s Manual Pro CNRI SHALL NOT BE LIABLE TO LICENSEE 6 1 FOR ANY INCIDENTAL SPECIAL OR CO RESULT OF MODIFYING DISTRIBUTING OR OR ANY OTHER USERS OF PYTHON NSEQUENTIAL DAMAGES OR LOSS AS OTHERWISE USING PYTHON 1 6 1 OR ANY DERIVATIVE THEREOF EVEN IF ADVIS ED OF THE POSSIBILITY THEREOF 6 This License Agreement will automatically terminate upon a material breach of its terms and conditions 7 This License Agreement shall be governed by the federal intellectual property law of the United limitation the federal copyright law an U S federal Paragraphs 4 law does not apply by the States including without d to the extent such law of the Commonwealth of Virginia excluding Virginia s conflict of law provisions Notwithstanding the foregoing with rega rd to derivative works based on Python 1 6 1 that incorporate non sep arable material that was 5 and 7 of this License A
42. ProSoft TECHNO LOST Where Automation Connects MVI69E LDM C Programmable Linux Application Development Module L0 PROGRAMMABLE MODULES August 21 2014 DEVELOPER S MANUAL Your Feedback Please We always want you to feel that you made the right decision to use our products If you have suggestions comments compliments or complaints about our products documentation or support please write or call us ProSoft Technology 5201 Truxtun Ave 3rd Floor Bakersfield CA 93309 1 661 716 5100 1 661 716 5101 Fax www prosoft technology com support prosoft technology com 2014 ProSoft Technology Inc All rights reserved MVI69E LDM Developer s Manual August 21 2014 ProSoft Technology is a registered copyright of ProSoft Technology Inc All other brand or product names are or may be trademarks of and are used to identify products and services of their respective owners In an effort to conserve paper ProSoft Technology no longer includes printed manuals with our product shipments User Manuals Datasheets Sample Ladder Files and Configuration Files are provided on the enclosed DVD and are available at no charge from our web site http www prosoft technology com Important Installation Instructions Power Input and Output I O wiring must be in accordance with Class I Division 2 wiring methods Article 501 4 b of the National Electrical Code NFPA 70 for installation in the U S or as sp
43. RAL PUBLIC LICENSE Version 3 29 June 2007 Copyright C 2007 Free Software Foundation Inc lt http fsf org gt Everyone is permitted to copy and distribute verbatim copies of this license document but changing it is not allowed Preamble 3 d he GNU General Public License is a free copyleft license for software and other kinds of works 3 d he licenses for most software and other practical works are designed to take away your freedom to share and change the works By contrast the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program to make sure it remains free software for all its users We the Fr Software Foundation use the GNU General Public License for most of our software it applies also to any other work released this way by its authors You can apply it to your programs too When we speak of free software we are referring to freedom not price Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software and charge for them if you wish that you receive source code or can get it if you want it that you can change the software or use pieces of it in new free programs and that you know you can do these things To protect your rights we need to prevent others from denying you these rights or asking you to surrender the rights Therefore you have certain
44. RAMS EVEN 1F SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES 17 Interpretation of Sections 15 and 16 If the disclaimer of warranty and limitation of liability provided Page 108 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual above cannot be given local legal effect according to their terms reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program and you want it to be of the greatest possible use to the public the best way to achieve this is to make it free software which everyone can redistribute and change under these terms To do so attach the following notices to the program It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty and each file should have at least the copyright line and a pointer to where the full notice is found lt one line to give the program s name and a brief idea of what it does gt Copyright C lt year gt lt name of author gt This program is free
45. S 232 Console If you are connected to Serial Port 1 P1 establish communications with the module using the following procedure Note The following procedure uses PuTTY to establish communications You can use a different communication program 1 Open PuTTY E PuTTY Configuration Lo us Category Session Basic options for your PuTTY session i e Specify the destination you want to connect to Serial line Speed O COM3 115200 Features Connection type Window Raw Telnet Rlogin SSH Serial Load save or delete a stored session aviour Translation Saved Sessions Selection i Caen Default Settings Load Data Save Proxy Telnet Delete Rlogin SSH Close window on exit Always Never 9 Only on clean exit C a gt 2 Set SPEED to 115200 3 Set SERIAL LINE to the appropriate COM port 4 Ensure that CONNECTION TYPE is set to Serial 5 Click OPEN to open the PuTTY session 6 Enter your login and password MVI69E login root Password password Page 24 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual Ethernet Telnet You can communicate with the module through Ethernet Port 1 Eth 1 using Telnet The Ethernet Port Eth 1 on the module is programmed with ethO set to IP 192 168 0 250 and a Subnet Mask of 255 255 255 0 In order for your PC or laptop to talk to th
46. USING PYTHON OR ANY DERIVATIVE THEREOF EVEN IF ADVISED OF THE POSSIBILITY THEREOF T Page 116 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual 6 This License Agreement will automatically terminate upon a material breach of its terms and conditions 7 Nothing in this License Agreement shall be deemed to create any relationship of agency partnership or joint venture between PSF and Licensee This License Agreement does not grant permission to use PSF trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee or any third party 8 By copying installing or otherwise using Python Licensee agrees to be bound by the terms and conditions of this License Agreement BEOPEN COM LICENSE AGREEMENT FOR PYTHON 2 0 BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 1 This LICENSE AGREEMENT is between BeOpen com BeOpen having an office at 160 Saratoga Avenue Santa Clara CA 95051 and the Individual or Organization Licensee accessing and otherwise using this software in source or binary form and its associated documentation the Software 2 Subject to the terms and conditio
47. VI69E LDM API 39 3 1 A ELLOS 39 3 1 1 Header Ali e e lb 39 3 1 2 Sampe A ea Pr clado 39 3 1 3 CompactLogix Tag Naming CONVONtIONS ooooonoccconnccconcccnonnnnnonnnancccnannnn nn nnnnnncccnncnnns 39 3 2 MVI69E LDM Development TO0lS oooccconnnonccinonocccinnnoncncnnnnnn non n non cnn n nora nn nrrnnn nana 40 3 3 GIPSAPIArchitecture a e tate oll sureties eel cela ak he 41 3 4 Backplane Device Driver akir A R 42 4 Sample Code 43 4 1 Establishing a Console Connection ccccccceeseeeeeeeeceeeeeeeaeeeeeeeseeeeseaeeeeaeseeeeeeaas 44 4 1 1 Physically Connect to the Module ccccceeeeeeececeeeeeceeeeeeeaeeeeeeeseeeesaeeeeaaeeeeneeeaas 44 4 1 2 Configuring Serial COMMUNICATION ceeccceee eect eeeeee cee eeeeaeeeeeeeseaeeetaeeeeaeeteneees 44 4 1 3 Setting Up ControlLogix 5000 oooooconocccnccccconccononanononcnoncnnonnnnn non n nan nc cnn nn anar nn nana cnnncnns 45 4 2 Sample TutoralS ninenin eni aea da o aN 46 ProSoft Technology Inc August 21 2014 Page 5 of 130 Contents Developer s Manual MVI69E LDM C Programmable Linux Application Development Module 4 2 1 Ethernet SaM E a a a a a aa aaea aa aa raaa a aa aeaa T sa Es 46 4 2 2 Soma SM ed E E tt dae lla 49 4 2 3 TED Sample a ee le Dd eel en ny 50 4 2 4 Backplane SaM ple r kaar rie eA a aAa R a a aaea aaa araia 51 4 3 Application Tutorials 2 iio 52 4 3 1 Ethernet Applications li 52 4 3 2 Serial Application a a aa a rencor crecen 58 5 API Functions
48. YPE Client Subnet Example 10 1 2 x or default 192 168 1 250 2 Ensure that you use the IP address of one of the two Ethernet ports available on the MVI69E LDM as the HOST address information to access set IP addresses in the module is discussed later 3 Launch the sample ladder for the MVI69E LDM in RSLogix 5000 Please observe that the module is not proceeding with I O communications This is normal The sample program initiates backplane communication 4 Tocommunicate on the MVI69E LDM use Telnet or other terminal connection program to open a serial connection baud 115200 to the COM port of choice on either of the two computers To change Ethernet port IP addresses to use the subnets chosen temporarily 1 Type in the terminal console ifconfig eth0 x x x x where x is your IP address of choice for Ethernet Port 0 2 Navigate to the sample directory cd psft sample 3 Type command enet application without the destination IP address when testing the MVI69E LDM as a server Type command enet application x x x x where x is the destination IP address of the server running TCP Stress Tester when testing the MVI69E LDM as a client ProSoft Technology Inc Page 53 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module To initiate external client communication Click OPEN once the Ethernet Communications sample is running in RSLogix 5000 you may h
49. agate or modify a covered work except as expressly provided under this License Any attempt otherwise to propagate or modify it is void and will automatically terminate your rights under this License including any patent licenses granted under the third paragraph of section 11 However if you cease all violation of this License then your license from a particular copyright holder is reinstated a provisionally unless and until the copyright holder explicitly and finally terminates your license and b permanently if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation Moreover your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means this is the first time you have received notice of violation of this License for any work from that copyright holder and you cure the violation prior to 30 days after your receipt of the notice Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License If your rights have been terminated and not permanently reinstated you do not qualify to receive new licenses for the same material under section 10 9 Acceptance Not Required for Having Copies You are not required to accept this License in order to receive or run a copy of
50. al_ App Sample _WriteTrigger tag has been triggered from the default application port Streams in ASCII data from the end device into the Controller tag Local 1 l Data Page 58 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual To run the Serial Application sample Use HyperTerminal or a similar program to perform the following steps 1 Open HyperTerminal 2 Enter a name and choose an icon for the connection Connection Description Y New Connection Enter a name and choose an icon for the connection Name LDM_A5232_Sample Icon 3 Choose the appropriate COM port Connect To DB LDM_R5232_Sample Enter details for the phone number that you want to dial Country region Area code Phone number Connect using Y ProSoft Technology Inc Page 59 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module 4 Use the following settings for the Serial_Application program BITS PER SECOND 115200 DATA BITS 8 PARITY None STOP BITS 1 FLOW CONTROL None oO 000 0 COM1 Properties Port Settings Bits per second 115200 Data bits Parity Stop bits Flow controt 5 Under the ASCII SETUP select ECHO TYPED CHARACTER LOCALLY This allows you to see the stream data being sent to the LDM module
51. ample applications provided with the module These applications handle the data exchange between the backplane MVI69E LDM and end device s 4 3 1 Ethernet Application You cannot run this sample if Backplane_Sample is running Backplane_Sample runs by default during startup To run the enet_application sample you must kill the Backplane_Sample script See the section entitled Important Module Startup Information Please Read for information on how to kill or change the Backplane_Sample script The Ethernet Communications program illustrates how to interact with the MVIG9E LDM using its Ethernet port as both a server and a client communicating through the backplane to send and receive data The sample also uses multi threading in order to run as both a server and client asynchronously To test the MVIG9E LDM as a client 1 Set up TCP Stress Tester as a server with the following parameters o PORT 5000 o CONNECTION TCP o SEND SPEED Single o TYPE Server 2 Subnet Example 10 1 3 x or default 192 168 0 250 3 Click OPEN and allow the TCP Stress Tester to listen once the sample program launches steps to launch the sample program below Page 52 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual To test the MVIG9E LDM as a server 1 Setup TCP Stress Tester as a client o PORT 6000 o CONNECTION TCP o SEND SPEED Single o T
52. analyze test perform and or display publicly prepare derivative works distribute and otherwise use Python 1 6 1 alone or in any derivative version provided however that CNRI s License Agreement and CNRI s notice of copyright i e Copyright c 1995 2001 Corporation for National Research Initiatives All Rights Reserved are retained in Python 1 6 1 alone or in any derivative version prepared by Licensee Alternately in lieu of CNRI s License Agreement Licensee may substitute the following text omitting the quotes Python 1 6 1 is made available subject to the terms and conditions in CNRI s License Agreement This Agreement together with Python 1 6 1 may be located on the Internet using the following unique persistent identifier known as a handle 1895 22 1013 This Agreement may also be obtained from a proxy server on the Internet using the following URL http hdl handle net 1895 22 1013 32 Im th vent Licens prepares a derivative work that is based on or incorporates Python 1 6 1 or any part thereof and wants to make the derivative work available to others as provided herein then Licens hereby agrees to include in any such work a brief summary of the changes made to Python 1 6 1 4 CNRI is making Python 1 6 1 available to Licensee on an AS IS basis CNRI MAKES NO REPRESENTATIONS OR WARRANTIES EXPRESS OR IMPLIED BY WAY OF EXAMPLE BUT NOT LIMITATION CNRI MAKES NO AND DISCLAIMS ANY REPRESE
53. ave to click twice depending on your computer Once the program is running and a TCP Tester server and client information is established data is received through the backplane and to from the TCP Stress Testing applications and RSLogix 5000 The program modifies the tags within RSLogix 5000 using the sample ladder provided with any string input Input Tags 0 9 can be modified by the MVI69E LDM client for the MVI69E LDM Output Tags 0 9 can be modified by the TCP Tester server for the MVI69E LDM Input Tags 11 20 can be modified by the MVI69E LDM server of the MVI69E LDM Output Tags 10 19 can be modified by the TCP Tester client of the MVI69E LDM Please note that it is recommended to set the Style in RSLogix 5000 to ASCII instead of INT or Hex due to the way that RSLogix 5000 interprets bytes and byte order RSLogix 5000 creates a high byte and low byte for each tag in its database For example if the word Hello was typed from the TCP Stress Tester RSlogix5000 separates the values to eH I A lo Since the values are read in byte order from right most to left most there is a high byte and low byte used and RSLogix 5000 combines those byte values in you choose to view it as in INT or Hex value For example the letters te in a single tag are separated and combined as follows Binary Value 01110100 0110010 im Local 5 0 ou focal 4B 1756_MODULE_IN Locat5 0 Data EN ASCII INT 248
54. ber 2 System architecture 3 Network details If the issue is hardware related we will also need information regarding Module configuration and associated ladder files if any Module operation and any unusual behavior Configuration Debug status information LED patterns Details about the serial Ethernet or Fieldbus devices interfaced to the module if any akhON Note For technical support calls within the United States an emergency after hours answering system allows 24 hour 7 days a week pager access to one of our qualified Technical and or Application Support Engineers Detailed contact information for all our worldwide locations is available on the following page ProSoft Technology Inc Page 123 of 130 August 21 2014 Contents Developer s Manual MVI69E LDM C Programmable Linux Application Development Module 8 2 Internet Web Site www prosoft technology com support E mail address support prosoft technology com Asia Pacific Tel 603 7724 2080 location in Malaysia E mail asiapc prosoft technology com Languages spoken include Chinese English Asia Pacific location in China Tel 86 21 5187 7337 x888 E mail asiapc prosoft technology com Languages spoken include Chinese English Europe location in Toulouse France Tel 33 0 5 34 36 87 20 E mail support EMEA prosoft technology com Languages spoken include French English Europe location in Dubai UAE
55. cial requirements of the GNU Affero General Public License section 13 concerning interaction through a network will apply to the combination as such 14 Revised Versions of this License The Free Software Foundation may publish revised and or new versions of the GNU General Public License from time to time Such new versions will be similar in spirit to the present version but may differ in detail to address new problems or concerns Each version is given a distinguishing version number If the Program specifies that a certain numbered version of the GNU General Public License or any later version applies to it you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation If the Program does not specify a version number of the GNU General Public License you may choose any version ever published by the Free Software Foundation If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used that proxy s public statement of acceptance of a version permanently authorizes you to choose that version for the Program Later license versions may give you additional or different permissions However no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version 15 Disclaimer of Warranty THERE IS NO WARRANTY
56. co directory containing the Debian6VM file and click DEBIAN6VM VMX The image file icon appears in the left window E VMware Player Non commercial use only eje X Player v gt amp tome Welcome to VMware Player de Debian vM al Create a New Virtual Machine 4 Create a new virtual machine which will then be 52 added to the top of your library Open a Virtual Machine Open an existing virtual machine which will then be added to the top of your library Upgrade to VMware Workstation Get advanced features such as snapshots developer tool integration and more Help View VMware Player s help contents Ys This product is not licensed and is authorized for k non commercial use only For commercial use purchase a license Buy now The following screen appears g VMware Player Non commercial use only e E 25 Player gt y Bm Debian6VM State Powered Off OS Debian 6 Version Workstation 8 0 virtual machine RAM 512 MB PP Play virtual machine ay Edit virtual machine settings Page 32 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Linux Application Development Module Contents Developer s Manual 6 Click PLAY VIRTUAL MACHINE A dialog appears asking if the virtual machine has been moved or copied Click COPIED IT This virtual machine might have been moved or copied In order to configure certain management
57. d are distributed by that particular Contributor A Contribution originates from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor s behalf Contributions do not include additions to the Program which i are separate modules of software distributed in conjunction with the Program under their own license agreement and ii are not derivative works of the Program Contributor means any person or entity that distributes the Program Licensed Patents mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program Program means the Contributions distributed in accordance with this Agreement Recipient means anyone who receives the Program under this Agreement including all Contributors ProSoft Technology Inc Page 111 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module 2 GRANT OF RIGHTS a Subject to the terms of this Agreement each Contributor hereby grants Recipient a non exclusive worldwide royalty free copyright license to reproduce prepare derivative works of publicly display publicly perform distribute and sublicense the Contribution of such Contributor if any and such derivative works in source code and object code form b Subject to the terms of this Agreement each Contributor hereby
58. de for a work means the preferred form of the work for making modifications to it Object code means any non source form of a work A Standard Interface means an interface that either is an official standard defined by a recognized standards body or in the case of interfaces specified for a particular programming language one that is widely used among developers working in that language The System Libraries of an executable work include anything other than the work as a whole that a is included in the normal form of packaging a Major Component but which is not part of that Major Component and b serves only to enable use of the work with that Major Component or to implement a Standard Interface for which an implementation is available to the public in source code form A Major Component in this context means a major essential component kernel window system and so on of the specific operating system if any on which the executable work runs or a compiler used to produce the work or an object code interpreter used to run it The Corresponding Source for a work in object code form means all the source code needed to generate install and for an executable work run the object code and to modify the work including scripts to control those activities However it does not include the work s System Libraries or general purpose tools or generally available free programs which are used unmodified in perfor
59. e Ethernet switch as your PC ProSoft Technology Inc Page 25 of 130 August 21 2014 Contents Developer s Manual MVI69E LDM C Programmable Linux Application Development Module 3 Use a program such as PuTTY to Telnet into the module R PuTTY Configuration Mm Category Session Logging Terminal Keyboard Bell Features BdraPuTTY Window Appearance Behaviour Translation Selection 0 Y O Ol Log into the module Basic options for your PuT TY session PEN the TEMM you Well Host Name or IP address Connection type Raw Telnet Rlogin Load save or delete a stored session Saved Sessions Default Settings D SSH Close window on exit Always Never Only on clean exit Select Telnet as the CONNECTION TYPE Enter the IP ADDRESS 192 168 0 250 Port 23 should appear as the PORT number Click OPEN to establish a connection There are two methods you can use to change the module s IP address One is temporary for use in cases where you want to change the address long enough to make a quick change The other is more permanent so that the module is already programmed and is ready for full deployment Temporary IP Address Change At the Linux prompt type ifconfig eth0 x x x x This changes the IP address of the Ethernet Eth 1 port Permanent IP Address Change 1 Atthe Linux prompt change to the etc network directory Type cd etc
60. e ID Used to match responses to requests SizeofMessage WORD Size of the Message data in bytes Messagel BYTEs CIP Message packet starting with Service Code Total number of bytes is provided in the SizeofMessage field The API does not act upon any data of the Message nor does it monitor response timeouts The user application is responsible for parsing the message and generating a response ProSoft Technology Inc Page 75 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module The API can queue up to 8 requests and they remain queued after the message is given to the user application The user application must generate a response in order to free the message from the queue Return Value MVI69 SUCCESS a message has been received MVI69 ERR_NOACCESS handle does not have access MVI69 ERR_TIMEOUT the timeout occurred before a message was received MVI69 ERR_BADPARAM a parameter is invalid MVI69 ERR_BADCONFIG receive messaging is not enabled Example MVI69HANDLE handle int rc WORD buffer 250 WORD length length 250 maximum message size that can be received wait up to 5 seconds for a message rc MVI69 GetMsgRequestFromBp Handle buffer amp length 5000 if rc MVI69 SUCCESS printf Message received Length is d words n length See Also MVI69 GetlOConfig MVI69 SendMsgResponseToB
61. e Update page opens 2 MITESE LDAA Windows internat Explorer 10 x Ora TEET A x de pse Yew Frote Tock Hep de C Sharepoint Prosott 7 Engineering Home ProSoft D TeamTrack D SharePoint D VPN BOU E Get more Add ons FUNCTIONS Firmware Update Warning AA fe Continue with Update Cancel Update Process FUNCTIONS Firmware Update Warning C Users kseki Desktop ftp transfermvi69e idm firmw Browse Update Firmware Cancel Update Process 5 Click UPDATE FIRMWARE and wait for the module to reboot During rebooting the module expands the compressed file and runs the install script to move the component files to their final destination Note The IP address reverts to the default after rebooting This is a very common problem so remember to reset the IP address to the correct value See Establishing Module Communication Page 38 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual 3 Understanding the MVI69E LDM API In This Chapter o gt SARL LIDFARY 22 555 cp saseoeeesseers E E T E 39 lt MVI69E LDM Development Tools ooooocconnoccccnonccccononcncnnnancnnnnrnnanonn cnn 40 GIPLAPLArchitecture soc iia 40 Backplane Device Drivet ccccsseseeeeseeceteneeeeeeeseneeeeseneeseseneenenseeeenes 42 The MVI69E LDM CPI API Suite allows software dev
62. e appropriate chassis type to match your hardware and firmware f Controller Properties M I69ELDM E Er J 12 Download the MVI69E LDM ACD file in the CompactLogix processor by choosing COMMUNICATIONS gt WHO ACTIVE gt DOWNLOAD fo Who Active Workstation WIN7_32_KS Ez Linx Gateways Ethernet ds AB_ETH 1 Ethernet W 105 102 0 3 1769 L35E Ethernet Port 1769 L35E Ethernet Port Em Backplane CompactLogix System 05900 CompactLogix Processor MVI69ELDM o 01 1769 L35E Ethernet Port H 03 Local 1769 Bus Adapter YA1769 A ds AB_ETH 2 Ethernet H S AB_VBP 1 1789 417 A Virtual Chassis Gy USB Clear Project Path ProSoft Technology Inc Page 63 of 130 August 21 2014 Contents Developer s Manual MVI69E LDM C Programmable Linux Application Development Module 13 Trigger Serial_ENET_App_Sample_On_Trigger by right clicking the Controller tag and choosing TOGGLE BIT F RSLogix 5000 MVI69ELDM in MVI69E_LDM ACD 1769 135 18 11 MainProgram MainRoutine Bf Elle Edt View Search Logic Communications Tools Window Help O68 6 tee 64a h We aa Diline By E pun 1 Hk 4 4 1 Oy 0 os gt ok Y gt A Favorites CARTON Arms K ERA Terco AT Notas aTe do Evo 9 E A Path es_ETHIP 2v105 10200 3 Back
63. e based on the IEC 1131 Rules for Identifiers For additional information on CompactLogix CPU tag addressing please refer to the CompactLogix User Manual 3 2 MVI69E LDM Development Tools An application that is developed for the MVI69E LDM module must be executed from the module s Flash ROM disk Tools are provided with the API to build the disk image and download it to the module s Config Debug port See Building a Project page 34 Page 40 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual 3 3 CIP API Architecture The CIP API communicates with the CompactLogix modules through the backplane device driver The following illustration shows the relationship between the module application CIP API and the backplane driver CompactLogix Backplane Midrange ASIC CompactLogix Processor Backplane Driver OCX API Application MVI69E LDM Module ProSoft Technology Inc Page 41 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module 3 4 Backplane Device Driver The backplane device driver performs CIP messaging over the CompactLogix backplane using the Midrange ASIC The user application interfaces with the backplane device driver through the CIP API library The backplane device driver for the MVI69E LDM module is libocxbpeng so The driver implements the
64. e contents file To create the Install Script Before creating the image you must create and add an install script to the firmware package As noted above the firmware package is downloaded into the psfttmp directory on the device The install script copies the files in ps ttmp to their final destination on the target device You can use the install script to make backups of the current directory contents before they are overwritten The LDM sample install script in build LDM scripts illustrates how to do this To create the Image 1 Ina Linux shell change the directory to the build LDM directory 2 Run python with the following command python createimage py The python script createimage py reads and acts on the imagecontents file and then creates a new firmware image in the directory build LDM firmware Note The script build sh compiles and links all libs and executables and then invoke python to create the firmware image 2 2 5 Downloading the Image with Firmware Update 1 Ensure that the Setup Jumper is on See Setup Jumper in this manual 2 Navigate to the module homepage using a Web browser by entering the module s IP address da Linux Development Module for CompactLogix ee MVIG9E LDM h Sy ProSoft Technology Inc Page 37 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module 3 Click FIRMWARE UPGRADE Th
65. e module your PC or Laptop must be on the same subnet as the module This means that you must temporarily change the IP address and subnet mask on your PC or laptop to match that of the module You can then change the module s IP address to match your needs Follow these steps or see http windows microsoft com en us windows change tcp ip settings 1TC windows 7 http windows microsoft com en us windows change tcp ip settings 1TC windows 7 1 Change the IP address of your PC or Laptop so it matches the subnet of the module The following steps are for Windows 7 a b c d e f g Change your IP address through the router Consult your router documentation for more information Change your IP address through Windows Network Connections Click START gt CONTROL PANEL gt NETWORK AND SHARING CENTER Click the CONNECTION link for the connection you want to change and choose PROPERTIES On the Local Area Connection Properties dialog select the connection you want to change Internet Protocol Version 6 or Internet Protocol Version 4 and then click PROPERTIES In the Internet Protocol Version 4 or 6 Properties dialog click USE THE FOLLOWING IP ADDRESS Type in the IP address settings for the IP ADDRESS SUBNET MASK and DEFAULT GATEWAY Click OK to accept the changes and then close each of the dialog boxes 2 Ensure that an Ethernet cable is connected to Ethernet Port 1 Eth 1 of the module and the other end to the sam
66. ecified in Section 18 1J2 of the Canadian Electrical Code for installations in Canada and in accordance with the authority having jurisdiction The following warnings must be heeded WARNING EXPLOSION HAZARD SUBSTITUTION OF COMPONENTS MAY IMPAIR SUITABILITY FOR CLASS I DIV 2 WARNING EXPLOSION HAZARD WHEN IN HAZARDOUS LOCATIONS TURN OFF POWER BEFORE REPLACING OR WIRING MODULES WARNING EXPLOSION HAZARD DO NOT DISCONNECT EQUIPMENT UNLESS POWER HAS BEEN SWITCHED OFF OR THE AREA IS KNOWN TO BE NON HAZARDOUS THIS DEVICE SHALL BE POWERED BY CLASS 2 OUTPUTS ONLY MVI Multi Vendor Interface Modules WARNING EXPLOSION HAZARD DO NOT DISCONNECT EQUIPMENT UNLESS POWER HAS BEEN SWITCHED OFF OR THE AREA IS KNOWN TO BE NON HAZARDOUS AVERTISSEMENT RISQUE D EXPLOSION AVANT DE DECONNECTER L EQUIPEMENT COUPER LE COURANT OU S ASSURER QUE L EMPLACEMENT EST DESIGNE NON DANGEREUX Warnings Specification and Certifications North America Warnings A B Cc D E Warning Explosion Hazard Substitution of components may impair suitability for Class I Division 2 Warning Explosion Hazard When in Hazardous Locations turn off power before replacing or rewiring modules Warning Explosion Hazard Do not disconnect equipment unless power has been switched off or the area is known to be non hazardous Suitable for use in Class Division 2 Groups A B C and D Hazardous Locations or Non Hazardous Locations only The subj
67. ect devices are powered by a Switch Model Power Supply SMPS that has a regulated output voltage of 5 VDC ATEX Warnings and Conditions of Safe Usage Power Input and Output I O wiring must be in accordance with the authority having jurisdiction A B Cc D Warning Explosion Hazard When in hazardous locations turn off power before replacing or wiring modules Warning Explosion Hazard Do not disconnect equipment unless power has been switched off or the area is known to be non hazardous These products are intended to be mounted in an IP54 enclosure The devices shall provide external means to prevent the rated voltage being exceeded by transient disturbances of more than 40 This device must be used only with ATEX certified backplanes DO NOT OPEN WHEN ENERGIZED CPU Memory and OS Specifications CPU 400MHz ARM9 G20 Operating System Linux kernel 2 6 33 7 Linux Distribution BusyBox System Memory 64MB SDRAM Flash Memory 256MB NAND Flash General Specifications Backplane Current Load 500 mA 5 VDC 3mA 24 VDC Operating Temperature 0 to 60 C 32 to 140 F Storage Temperature 40 to 85 C 40 to 185 F Shock 30g non operational 15g non operational Vibration 5 g from 10 to 150 Hz Relative Humidity 5 to 95 without condensation LED Indicators ETH Application driven P1 Application Driven P2 Application driven CFG Application driven BP Application driven OK Application driven
68. edge it has sufficient copyright rights in its Contribution if any to grant the copyright license set forth in this Agreement 3 REQUIREMENTS A Contributor may choose to distribute the Program in object code form under its own license agreement provided that a it complies with the terms and conditions of this Agreement and b its license agreement i effectively disclaims on behalf of all Contributors all warranties and conditions express and implied including warranties or conditions of title and non infringement and implied warranties or conditions of merchantability and fitness for a particular purpose ii effectively excludes on behalf of all Contributors all liability for damages including direct indirect special incidental and consequential damages such as lost profits iii states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party and iv states that source code for the Program is available from such Contributor and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange When the Program is made available in source code form a it must be made available under this Agreement and b a copy of this Agreement must be included with each copy of the Program Contributors may not remove or alter any copyright notices contained within the Program Each Contributor must identify itself as
69. elopers to access the CompactLogix backplane without requiring detailed knowledge of the module s hardware design The MVI69E LDM API Suite consists of three distinct components the backplane device driver the backplane interface engine and the API library You can develop applications for the MVIG9E LDM module using industry standard Linux programming tools and the CPI API library This section provides general information pertaining to application development for the MVI69E LDM module 3 1 API Library The API provides a library of function calls The library supports any programming language that is compatible with the C calling convention The API library is a dynamic linked library that must be linked with the application to create the executable program gt Note The following compiler versions are tested and known to be compatible with the MVI69E module API CNU C C V4 4 4 for ARM9 3 1 1 Header File A header file is provided along with the API library This header file contains API function declarations data structure definitions and constant definitions The header file is in standard C format Header files for the CIP API are ocxbpapi h and ocxtagdb h 3 1 2 Sample Code The sample applications illustrate the usage of the API functions Full source for the sample application is included along with make files to build the sample programs 3 1 3 CompactLogix Tag Naming Conventions CompactLogix tags fall into two categori
70. eption of mv169 SetModuleInfo The function provides full access to the backplane and all of the API functions Only one program is allowed to call this function IMPORTANT Once the API has been opened mv169 Close should always be called before exiting the application Return Value MVI69_ SUCCESS API was opened successfully MVl69 ERR_REOPEN API is already open MVI69 ERR_NODEVICE backplane driver could not be accessed Note MVI69 ERR NODEVICE will be returned if the backplane device driver is not loaded Example MVI69HANDLE Handle if MVI69 Open Handle MVI69 SUCCESS printf Open failed n printf Open succeeded n See Also MVI69 Close MVI69_OpenNB Page 68 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual MVI69 OpenNB Syntax int MVI69 OpenNB MVI69HANDLE handle Parameters Handle pointer to variable of type MVIG9HANDLE Description MVI69 OpenNB acquires access to the API and sets Handle to a unique ID that the application uses in subsequent functions This function must be called before any of the other API functions can be used The purpose of this function is to provide access to certain API functions even if the API is already in use by another program This function does not provide access to the backplane however it does provide access t
71. er must be installed if CTS line CTS E monitoring enabled Signal Signal Common Common 6 3 RS 422 The RS 422 interface requires a single four or five wire cable The Common connection is optional depending on the RS 422 network devices used The cable required for this interface is shown below RS 422 Application Port Cable DB 9 Male RS 422 Device TxD RxD TxD RxD Signal 5 Signal Dorina conic RxD 2 ror RxD s H mo 6 4 RS 485 Application Port s The RS 485 interface requires a single two or three wire cable The Common connection is optional depending on the RS 485 network devices used The cable required for this interface is shown below RS 485 Application Port Cable DB 9 Male RS 485 Device TxD RxD 1 H TxD RxD TxD RxD 8 rono Signal 5 Signal Common Common Page 94 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual Note Terminating resistors are generally not required on the RS 485 network unless you are experiencing communication problems that can be attributed to signal echoes or reflections In these cases installing a 120 ohm terminating resistor between pins 1 and 8 on the module connector end of the RS 485 line may improve communication quality 6 4 1 RS 485 and RS 422 Tip If communication in the RS 422 or RS 485 mode does not work at first despite all attempts try switching termination pola
72. es controller tags and program tags ProSoft Technology Inc Page 39 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module Controller Tags have global scope To access a controller scope tag you only need to specify the tag controller name For example TagName Single tag Array 11 Single dimensioned array element Array 1 3 Two dimensional array element Array 1 2 3 Three dimensional array element Structure Element Structure element StructureArray 1 Element Single element of an array of structures Program Tags are tags declared in a program and scoped only within the program in which they are declared To correctly address a Program Tag you must specify the identifier PROGRAM followed by the program name A dot separates the program name and the tag name PROGRAM ProgramName TagName PROGRAM MainProgram TagName Tag TagName in program called MainProgram PROGRAM MainProgram Array 11 An array element in program MainProgram PROGRAM MainProgram Structure Element A Structure Element in program MainProgram Rules A tag name can contain up to 40 characters Atag name must start with a letter or underscore _ All other characters can be letters numbers or underscores Names cannot contain two contiguous underscore characters and cannot end in with an underscore Letter case is not significant The naming conventions ar
73. f licensors and authors of that material by anyone who conveys the material or modified versions of it with contractual assumptions of liability to the recipient for any liability that these contractual assumptions directly impose on those licensors and authors All other non permissive additional terms are considered further restrictions within the meaning of section 10 If the Program as you received it or any part of it contains a notice stating that it is Page 104 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual governed by this License along with a term that is a further restriction you may remove that term If a license document contains a further restriction but permits relicensing or conveying under this License you may add to a covered work material governed by the terms of that license document provided that the further restriction does not survive such relicensing or conveying If you add terms to a covered work in accord with this section you must place in the relevant source files a statement of the additional terms that apply to those files or a notice indicating where to find the applicable terms Additional terms permissive or non permissive may be stated in the form of a separately written license or stated as exceptions the above requirements apply either way 8 Termination You may not prop
74. following components and objects Control Bus Backplane All data exchange between the application and the backplane occurs through the Assembly Object using functions provided by the CIP API The API includes functions to register or unregister the object accept or deny Class 1 schedule connections requests access scheduled connection data and service unscheduled messages Page 42 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual 4 Sample Code In This Chapter Establishing a Console Connection cccceeeceeeeeeeeeeeeeeeeeneeeeneeeeneeeeaes 44 SamplestutoralS a nda taat tee amp 46 lt Application Tutorials a aar aae arat aaraa aaar eaea ean ar d erani ia aia 52 To help understand the use of the MVI69E LDM module several example programs are provided with the module These programs exist both as source code in the development environment as well as executable programs in the MVI69E LDM module in the psft sample directory You can build and download the sample programs to the MVI69E LDM module The sample programs are designed to show one or more sets of functionality LED Sample Opens the backplane Read and print module information Read and print version information Read and print module configuration jumpers Continuously change the state of the front panel LEDs Backplane Sample Opens the bac
75. for National Research Initiatives CNRI see http www cnri reston va us in Reston Virginia where he released several versions of the software In May 2000 Guido and the Python core development team moved to BeOpen com to form the BeOpen PythonLabs team In October of the same year the PythonLabs team moved to Digital Creations now Zope Corporation see http www zope com In 2001 the Python Software Foundation PSF see http www python org psf was formed a non profit organization created specifically to own Python related Intellectual Property Zope Corporation is a sponsoring member of the PSF All Python releases are Open Source see http www opensource org for the Open Source Definition Historically most but not all Python releases have also been GPL compatible the table below summarizes the various releases Release Derived Year Owner GPL from compatible 1 0792 0 sehr 152 1991 1995 CWI yes Tag Entra Zo 2 1995 1999 CNRI yes Tie hy Du2 2000 CNRI no 2 0 1 6 2000 BeOpen com no TGL 16 2001 CNRI yes 2 Da 2 0 1 6 1 2001 PSF no 2 0551 2 0FL 64 1 2001 PSF yes Paes Gree 23142000 1 2001 PSF yes 22 Zieh 2001 PSF yes 24 L 52 2 1 1 2002 PSF yes 2 2ra 2 2002 PSF yes Lo L 2 2 2002 PSF yes DELL Qed 2002 PSF yes Didi Dz 2003 PSF yes 233 2 2 2 2002 2003 PSF yes o el 253 2002 2003 PSF yes 2 3 2 2 3 1 2002 2003 PSF yes Bess 2362 2002 2003 PSF yes 2 3 4 PERE ES 2004 PSF yes Pea 2 3 4 2
76. grammable Developer s Manual Linux Application Development Module MVI69 WaitForOutputScan Syntax int MVI69 WaitForOutputScan MVI69HANDLE handle WORD timeout Parameters handle handle returned by previous call to MVI69 Open timeout maximum number of milliseconds to wait for scan Description MVI69_WaitForOutputScan allows an application to synchronize with the scan of the module s output image This function will return immediately after the modules output image has been written handle must be a valid handle returned from MVI69_Open timeout specifies the number of milliseconds that the function will wait for the output scan to occur Note There is no distinction in the MVI69E module between input and output scans Therefore the MVI69 WaitForlnputScan and MVI69_WaitForOutputScan functions will perform exactly the same function and are interchangeable Return Value MVI69 SUCCESS the output scan has occurred MVI69 ERR _NOACCESS handle does not have access MVI69 ERR TIMEOUT the timeout expired before an output scan occurred Example MVI69HANDLE handle int LC wait here until output scan 50ms timeout rc MVI69 WaitForOutputScan Handle 50 if rc MVI69 ERR TIMEOUT printf Output scan did not occur within 50 milliseconds n else printf Output scan has occurred n See Also MVI69_WaitForlnputScan Page 80 of 130 ProSoft Technology
77. grants Recipient a non exclusive worldwide royalty free patent license under Licensed Patents to make use sell offer to sell import and otherwise transfer the Contribution of such Contributor if any in source code and object code form This patent license shall apply to the combination of the Contribution and the Program if at the time the Contribution is added by the Contributor such addition of the Contribution causes such combination to be covered by the Licensed Patents The patent license shall not apply to any other combinations which include the Contribution No hardware per se is licensed hereunder c Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise As a condition to exercising the rights and licenses granted hereunder each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed if any For example if a third party patent license is required to allow Recipient to distribute the Program it is Recipient s responsibility to acquire that license before distributing the Program d Each Contributor represents that to its knowl
78. gured lO using MvI69 GetIOConfig o read and display the module identity using Mv169 GetModuleInfo sets each of the front panel LEDs to a default using the mv169 setED function enters a main infinite loop within this loop The program will o first read the current run program mode of the processor using MvI69 GetScanMode and prints the state if it has changed since the last time it was read o wait for an Input Scan from the CompactLogix processor using the MVI69 WaitForInputScan function Note mv169_WaitForOutputScan Could also be used o MVI69 GetScanCounter function is used to read the number of the scan The scan count modulo 5000 is used in data write i e controller input data a few lines below o read output data read data for the module from the controller using the function MVI69 ReadOutputImage o If the second element has changed since the last read the new data is copied from the read controller output data to the write controller input data If the data has not changed the data in the writer buffer is decremented The scan count read above is written to the Oth element o write the data back for the controller to read using the mv169_WriteInputImage function ProSoft Technology Inc Page 51 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module 4 3 Application Tutorials The following sections describe how to run and understand the s
79. handle does not have access Example MVI69HANDLE handle MVIBPVERSIONINFO verinfo print version of API library and driver MVI69 GetVersionInfo handle amp verinfo printf Library Series d Rev din verinfo APISeries verinfo APIRevision printf Driver Series amp d Rev d n verinfo DDSeries verinfo DDRevision Page 84 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual MVI69_GetModulelnfo Syntax int MVI69 GetModuleInfo MVI69HANDLE handle MVI69MODULEINFO modinfo Parameters handle handle returned by previous call to MVI69 Open modinfo pointer to structure of type MVIG9MODULEINFO Description MVI69_GetModulelnfo retrieves identity information for the module This information is returned in the structure modinfo handle must be a valid handle returned from MVI69_Open The MVIG9MODULEINFO structure is defined as follows typedef struct tagMVIBPMODULEINFO WORD VendorID Reserved WORD DeviceType Reserved WORD ProductCode Device model code BYTE MajorRevision Device major revision BYTE MinorRevision Device minor revision DWORD SerialNo Serial number BYTE Name 32 Device name string MVI69MODULEINFO Return Value MVI69 SUCCESS the module information was read successfully MV
80. ing text appears 7 Change to the etc directory Type cd etc P gp CONS PuTTY gt jes 7 o 9h 2h oh oF ProSoft Technology Inc Page 21 of 130 August 21 2014 Contents Developer s Manual MVI69E LDM C Programmable Linux Application Development Module 8 Type is The following appears To enable the console port The inittab con file configures the console 2 COM3 PuTTY Page 22 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual 1 Open the file in the vi editor Type vi inittab con E o gp COM PuTTY o 8 A A 2 Copy inittab con file to the inittab file Type cp f inittab con inittab 3 Save the file and reboot the module To disable the console 1 Copy inittab nocon file to the inittab file 2 Save the file and reboot the module ProSoft Technology Inc Page 23 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module 1 6 Establishing Module Communications Ensure that the module is firmly seated in the rack and that the cables connected to the module are secure Ensure that power is applied Note If you require information on cables and port pinouts please refer to the section entitled Cable Connections page 91 at the end of the manual R
81. ion of a copy This License will therefore apply along with any applicable section 7 additional terms to the whole of the work and all its parts regardless of how they are packaged This License gives no permission to license the work in any other way but it does not invalidate such permission if you have separately received it d If the work has interactive user interfaces each must display Appropriate Legal Notices however if the Program has interactive interfaces that do not display Appropriate Legal Notices your work need not make them do so A compilation of a covered work with other separate and independent works which are not by their nature extensions of the covered work and which are not combined with it such as to form a larger program in or on a volume of a storage or distribution medium is called an aggregate if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation s users beyond what the individual works permit Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate 6 Conveying Non Source Forms You may convey a covered work in object code form under the terms of sections 4 and 5 provided that you also convey the machine readable Corresponding Source under the terms of this License in one of these ways a Convey the object code in or embodied in a physical
82. ith second argument as 10 to specify the maximum number of client connections that the server will queue for this listening socket The call to 1isten makes the socket a functional listening socket Code enters an infinite while loop in which o the call to accept puts the server to sleep waiting for an incoming client request When a request is received and the three way TCP handshake is complete accept wakes up and returns the socket descriptor representing the client socket time is called to read the current system time snprint is used to put the time into the send buffer in a human readable format write is then called to send formatted time to the client close is then used to close the connection to the client sleep is invoked to yield the processor for one second 0 0000 Client ENet Sample To run the Client ENet Sample 1 Establish a command window using Telnet or similar terminal software on the PC through the Serial P1 port 2 Login as user root using password password 3 The Ethernet Port E1 will be used to communicate with the server The server and client devices must both be connected on the same IPv4 subnet 4 Set the IPv4 address and mask of the first Ethernet port using ifconfig command ProSoft Technology Inc Page 47 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module To execute
83. itially installed in the backplane the module runs a number of programs that are required in order not to fault the processor r T EP COM3 PuTTY El s Line 357 psft sample Backplane_Sample runs for the purpose of not faulting the processor The module also contains a number of sample applications that will not run if backplane sample is also running The samples affected are enet_application and serial_application You can kill the Backplane_Sample script by typing kill 357 a EP CONS PuTTY ki ProSoft Technology Inc Page 29 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module You can modify the Backplane_Sample script from this location E EP COMB PuTTY Loa The script that you want to modify is S45 prosoft fp coms PuTTY pesa You can see from this script that the Backplane_Sample is configured to run at startup Change this to suit your needs Page 30 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual 2 Development Environment In This Chapter O acest cscs ccc EE dele cates se ata ctes eee schece tectasces serene eacers 31 S StaningEclpSE sacadas 34 The MVI69E LDM development tools run under Linux In order to run these tools on a Windows based machine you mus
84. ity detects the newer time on the source file and rebuilds the application The following example uses the Touch utility to cause the date of a file 1ead_sample c to be updated as if the file had been changed and make is re invoked Make detects this change recompiles and re links the application user debian6vm workspace mvi69e ldm src ldm led sample make Preprocessing file src led sample c mkdir p Release opt timesys datm3 toolchain bin armv5l timesys linux gnueabi gcc A ara b backplane inc 1 inc 00 Wall Wstrict prototypes fmessage length 0 MMD MF Release led sample d MP MT Release led sample d o Release led sample o c src led_sample c Finished preprocessing src led sample c Linking target Release Led Sample Linking application Invoking Cygwin C Linker opt timesys datm3 toolchain bin armv5l timesys linux gnueabi g o Led Sample Release led sample o lrt lmvi69api L lib backplane Release Copy target to target directory cp f Led Sample Release Finished building target Release Led Sample user debian6vm workspace mvi69e ldm src ldm led samples i ProSoft Technology Inc Page 35 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module 2 2 3 Downloading the Application with FTP To transfer the application using FTP Transfer use any FTP transfer program such as FileZilla httos filezilla project org from
85. kplane Set up communications with the PLC Read and display module information Read and write connected data with the CompactLogix processor Server Ethernet Sample Opens the backplane Listens for a request on a well known port Responds with the date time of the module Client Ethernet Sample Opens the backplane Sends a request to another module to the server Ethernet Sample Prints the response to the terminal Serial Sample Opens the backplane Reads and modifies the serial configuration Transmits though the serial port Install LDM Sets the module identity to ProSoft LDM Opens the backplane Read and print module information ProSoft Technology Inc Page 43 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module 4 1 Establishing a Console Connection In order to run the Ethernet and Serial samples and tutorials you must set up a connection in order to communicate with the MVI69E LDM 4 1 1 Physically Connect to the Module In order to establish a console session between a PC and the MVI69E LDM you must physically connect your PC to the console serial port on the module 1 Plug in an RJ45 to DB9 cable on the module s Port 1 2 Connect the null modem cable to the DB9 end of the RJ45 to DB9 cable 3 Connect the other end of the null modem cable to the appropriate serial port USB to Serial Converter on the computer 4 1 2 Co
86. ment PSF hereby grants Licensee a nonexclusive royalty free world wide license to reproduce analyze test perform and or display publicly prepare derivative works distribute and otherwise use Python alone or in any derivative version provided however that PSF s License Agreement and PSF s notice of copyright i e Copyright c 2001 2002 2003 2004 2005 2006 Python Software Foundation All Rights Reserved are retained in Python alone or in any derivative version prepared by Licensee 3 In th vent Licens prepares a derivative work that is based on or incorporates Python or any part thereof and wants to make the derivative work available to others as provided herein then Licens hereby agrees to include in any such work a brief summary of the changes made to Python 4 PSF is making Python available to Licensee on an AS IS basis PSF MAKES NO REPRESENTATIONS OR WARRANTIES EXPRESS OR IMPLIED BY WAY OF EXAMPLE BUT NOT LIMITATION PSF MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT INFRINGE ANY THIRD PARTY RIGHTS T El 5 PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON FOR ANY INCIDENTAL SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING DISTRIBUTING OR OTHERWISE
87. ming those activities but which are not part of the work For example Corresponding Source includes interface definition files associated with source files for the work and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require such as by intimate data communication or control flow between those subprograms and other parts of the work The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source The Corresponding Source for a work in source code form is that same work 2 Basic Permissions All rights granted under this License are granted for the term of copyright on the Program and are irrevocable provided the stated conditions are met This License explicitly affirms your unlimited permission to run the unmodified Program The output from running a covered work is covered by this License only if the output given its content constitutes a covered work This License acknowledges your rights of fair use or other equivalent as provided by copyright law You may make run and propagate covered works that you do not convey without conditions so long as your license otherwise remains in force You may convey covered works to others for the sole purpose Page 100 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Applica
88. ms to make use sell offer for sale import and otherwise run modify and propagate the contents of its contributor version In the following three paragraphs a patent license is any express agreement or commitment however denominated not to enforce a patent such as an express permission to practice a patent or covenant not to sue for patent infringement To grant such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party If you convey a covered work knowingly relying on a patent license and the Corresponding Source of the work is not available for anyone to copy free of charge and under the terms of this License through a publicly available network server or other readily accessible means Page 106 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual then you must either 1 cause the Corresponding Source to be so available or 2 arrange to deprive yourself of the benefit of the patent license for this particular work or 3 arrange in a manner consistent with the requirements of this License to extend the patent license to downstream recipients Knowingly relying means you have actual knowledge that but for the patent license your conveying the covered work in a country or your recipient s use of the covered work in a country would infringe one o
89. n the left side of the page to reset the module 1 Open the web page for the module by entering the IP address of the module in the address bar If necessary set your PC to an IP address and the same sub network See To connect to the module over Ethernet above On the left side of the page under FUNCTIONS click RESCUE MODULE Follow the instructions to reset the module to its default state Note Most loaded components are left intact by this operation so it may be necessary to make enough room on the module for the rescue to work In addition the Setup Jumper must be in place for the rescue to function properly To use manual rescue If the default web page is unavailable a manual rescue may be required Perform the following steps to manually return the module to its default state 1 Establish a terminal session to the module using either the Serial or Ethernet port 2 Ensure that the packup systemrestore tgz file exists 3 Run the following command to remove any startup scripts that may be interfering with the bootup process rm f etc init d 4 Restore the configuration and executables using the following command tar xzf backup systemrestore tgz C 5 If successful reboot the module Page 28 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual 1 8 Important Information Before Development When the MVI69E LDM is in
90. nal emulation program to view configuration and status data in the module and to control the module The cable pinout for communications on this port is shown in the following diagram DB9 Female to DB9 Female null modem cable DB9 Male to RJ45 Plug ProSoft Cable 15 or other ProSoft Cable 14 PIN2 RxD TxD RxD RxD TxD RS 232 PC Serial Port Signal Signal PIN5 common Common x o 2 2 w Configuration Debug Port ProSoft Technology Inc Page 91 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module 6 2 RS 232 Application Port s When the RS 232 interface is selected the use of hardware handshaking control and monitoring of modem signal lines is user definable If no hardware handshaking will be used here are the cable pinouts to connect to the port DB9 Female to DB9 Female null modem cable DB9 Male to RJ45 Plug ProSoft Cable 15 or other ProSoft Cable 14 PIN2 RxD PIN2 s l S 5 A PN3 TxD PIN3 m Ss x 3 o ES Signal lt PIN5 common 6 2 1 RS 232 Modem Connection Hardware Handshaking Required This type of connection is required between the module and a modem or other communication device RS 232 Application Port Cable Modem Connection DB 9 Male RS 232 Device Signal Signal Common Common DTR DTR The Use CTS Line parameter for the port configuration should be set
91. network 2 Open the interfaces file int he vi editor Type vi interfaces This shows the contents of the file iface eth0 inet static address 192 168 0 250 network 192 168 0 0 netmask 255 255 255 0 broadcast 192 168 0 255 gateway 192 168 0 1 Page 26 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual 1 7 3 Using the vi editor edit the file to change the address 4 Save the file For help on using the vi editor to write and save the file refer to http www lagmonster org docs vi html 5 Change the IP address of your PC back to the original IP address and subnet 6 Telnet to the new IP Address of the module Resetting the Module In the event that it becomes necessary to revert the MVI69E LDM module back to its initial out of the box state there are a number of methods you can use depending on the condition of the module The Rescue process re installs all of the Operation System commands and configurations to their original defaults The files deleted during the rescue process are the startup scripts in the etc init d path since extra scripts in this path are automatically executed by the operating system on startup and may cause problems All other files may be overwritten to the initial state of the device Extra files are not deleted If the web pages and services for the module have been altered it may not be pos
92. nfiguring Serial Communication 1 Establish a connection to the module The following example uses PUTTY You can download PUTTY for free from http Awww chiark greenend org uk sgtatham PuTTY download html http www chiark greenend org uk sgtatham putty download html 2 MVI69E login root Password password r y P COM3 PuTTY oto A A Keep PUTTY open while you set up CompactLogix as described in the next section Page 44 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Linux Application Development Module Contents Developer s Manual 4 1 3 Setting Up ControlLogix 5000 1 Open the MVI69E LDM ACD program and then click CHANGE CONTROLLER to change the appropriate chassis type to match your hardware and firmware S Controller Date Time General Vendor Type Revision Name Description Chassis Typ Slot Properties M I69ELDM Advanced SFC Execution File Serial Port System Protocol User Protocol Major Faults Minor Faults Allen Bradley 1769 L35E CompactLogix5335E Controller 20 13 MVIBSELDM e 0 Hl Nonvolatile Memory Memory Security none gt y 10 x Change Controller id 2 Select the TYPE and REVISION of your Controller and click OK Change Controller x Changing the controller type will change delete and or invalidate the controller properties and other project data tha
93. nit or mezzanine board Long 32 bit value M Module Refers to a module attached to the backplane Mutex A system object which is used to provide mutually exclusive access to a resource O Originator A client that establishes a connection path to a target Output Image Table of output data sent to nodes on the network P Producer A source of data Page 126 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Glossary of Terms Linux Application Development Module Developer s Manual PTO Pulse Train Output PTQ Suite The PTQ suite consists of line products for Schneider Electronics platforms Quantum ProTalk S Scanner A DeviceNet node that scans nodes on the network to update outputs and inputs T Target The end node to which a connection is established by an originator Thread Code that is executed within a process A process may contain multiple threads WwW Word 16 bit value ProSoft Technology Inc Page 127 of 130 August 21 2014 MVI69E LDM C Programmable Glossary of Terms Linux Application Development Module Developer s Manual ProSoft Technology Inc Page 128 of 130 August 21 2014 MVI69E LDM C Programmable Linux Application Development Module Glossary of Terms Developer s Manual Index API 125 API Functions 67 API Library 39 Application Tutorials 52 B Backplane Device Driver 42 Backplane Sample 51 BIOS
94. ns The MsgRevBufSize and MSgSndBufSize members indicate the maximum size in words for received or sent messages respectively Return Value MVI69 SUCCESS no errors were encountered MVI69 ERR_NOACCESS handle does not have access Example MVI69HANDLE handle MVI69TOCONFIG loconfig MVI69 GetIOConfig handle amp ioconfig printf Sd words of input image available n ioconfig DirectInputSize printf Sd words of output image available n ioconfig DirectOutputSize See Also MVI69_SetlOConfig ProSoft Technology Inc Page 71 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module MVI69 SetlOConfig MV MV io io Tf Syntax int MVI69 SetIOConfig MVI69HANDLE apihandle MVI69 IOCONFIG ioconfig Parameters handle handle returned by previous call to MVI69_Open ioconfig Pointer to MVIG9IOCONFIG structure to receive configuration information Description This function may be used to set the size of the module s IO images available for direct IO access handle must be a valid handle returned from MVI69_Open The actual number of input and output words that are transferred between the controller and the MVI69E module is determined by the configuration of the generic profile The only purpose of this routine is to set maximum sizes allowed by the MVI69_ ReadOutputlmage and MVI69 Writelnputimage functions The me
95. ns of this BeOpen Python License Agreement BeOpen hereby grants Licensee a non exclusive royalty free world wide license to reproduce analyze test perform and or display publicly prepare derivative works distribute and otherwise use the Software alone or in any derivative version provided however that the BeOpen Python License is retained in the Software alone or in any derivative version prepared by Licensee 3 BeOpen is making the Software available to Licensee on an AS IS basis BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES EXPRESS OR IMPLIED BY WAY OF EXAMPLE BUT NOT LIMITATION BEOPEN MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT INFRINGE ANY THIRD PARTY RIGHTS T E 4 BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE SOFTWARE FOR ANY INCIDENTAL SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF USING MODIFYING OR DISTRIBUTING THE SOFTWARE OR ANY DERIVATIVE THEREOF EVEN IF ADVISED OF THE POSSIBILITY THEREOF T 5 This License Agreement will automatically terminate upon a material breach of its terms and conditions ProSoft Technology Inc Page 117 of 130 August 21
96. ntation or used for producing a compiler intermediate representation The Compilation Process transforms code entirely represented in non intermediate languages designed for human written code and or in Java Virtual Machine byte code into Target Code Thus for example use of source code generators and preprocessors need not be considered part of the Compilation Process since the Compilation Process can be understood as starting with the output of the generators or preprocessors Page 120 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual A Compilation Process is Eligible if it is done using GCC alone or with other GPL compatible software or if it is done without using any work based on GCC For example using non GPL compatible Software to optimize any GCC intermediate representations would not qualify as an Eligible Compilation Process 1 Grant of Additional Permission You have permission to propagate a work of Target Code formed by combining the Runtime Library with Independent Modules even if such propagation would otherwise violate the terms of GPLv3 provided that all Target Code was generated by Eligible Compilation Processes You may then convey such a combination under terms of your choice consistent with the licensing of the Independent Modules 2 No Weakening of GCC Copyleft The availability of this Exception d
97. o an integer When this function returns mode will be set to 1 if the module is in setup mode or 0 if not If the Setup Jumper is installed the module is considered to be in Setup Mode If may be useful for an application to detect Setup Mode and perform special configuration or diagnostic functions Return Value MVI69 SUCCESS no errors were encountered MVI69 ERR NOACCESS handle does not have access Example MVI69HANDLE handle int mode MVI69 GetSetupMode handle amp mode if mode Setup jumper is installed perform configuration diagnostic else Not in Setup Mode normal operation Page 90 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual 6 Cable Connections The application ports on the MVI69E LDM module support RS 232 RS 422 and RS 485 interfaces Please inspect the module to ensure that the jumpers are set correctly to correspond with the type of interface you are using Note When using RS 232 with radio modem applications some radios or modems require hardware handshaking control and monitoring of modem signal lines Enable this in the configuration of the module by setting the UseCTS parameter to 1 6 1 RS 232 Configuration Debug Port This port is physically an RJ45 connection An RJ45 to DB 9 adapter cable is included with the module This port permits a PC based termi
98. o the following functions MVI69 GetModulelnfo MVI69 GetSerialConfig MVI69 SetSerialConfig MVI69 GetSetupJumper MVI69 SetLED MVI69 GetVersionInfo IMPORTANT Once the API has been opened mv169 Close should always be called before exiting the application Return Value MVI69 SUCCESS API was opened successfully MVI69 ERR REOPEN API is already open MVI69 ERR _NODEVICE Backplane driver could not be accessed Note mvi69_ERR_NODEVICE is returned if the backplane device driver is not loaded Example MVI69 Handle Handle if MVI69 OpenNB amp handle MVI69 SUCCESS printf Open failed n else printf Open succeeded n See Also MVI69_Open MVI69 Close ProSoft Technology Inc Page 69 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module MVI69 Close Syntax int MVI69 Close MVI69HANDLE handle Parameters handle handle returned by previous call to MVI69_ Open or MVI69_OpenNB Description This function is used by an application to release control of the API handle must be a valid handle returned from mv169 Open OF MVI69 OpenNB IMPORTANT Once the API has been opened this function should always be called before exiting the application Return Value MVI69 SUCCESS API was closed successfully MVI69 ERR _NOACCESS handle does not have acce
99. oes not imply any general presumption that third party software is unaffected by the copyleft requirements of the license of GCC The Documentation GPL FDL The documentation shipped with the library and made available over the web excluding the pages generated from source comments are copyrighted by the Free Software Foundation and placed under the GNU Free Documentation License version 1 3 There are no Front Cover Texts no Back Cover Texts and no Invariant Sections For documentation generated by doxygen or other automated tools via processing source code comments and markup the original source code license applies to the generated files Thus the doxygen documents are licensed GPL ProSoft Technology Inc Page 121 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module Page 122 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual 8 Support Service amp Warranty In This Chapter Contacting Technical SUPPOFt eee eeeeeeeeeeeeneeseeeeteaeeteaeeteaeeneneeeea 123 Warranty Informatica Ai kaise 124 8 1 Contacting Technical Support ProSoft Technology Inc is committed to providing the most efficient and effective support possible Before calling please gather the following information to assist in expediting this process 1 Product Version Num
100. on the HyperTerminal screen Page 60 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual 6 Click OK but keep HyperTerminal open since you will use it again after you complete the following sections ASCII Setup ASCII Sending Send line ends with line feeds Echo typed characters locally Line delay 0 milliseconds Character delay lo milliseconds ASCII Receiving C Append line feeds to incoming line ends C Force incoming data to 7 bit ASCII Wrap lines that exceed terminal width 7 Use PuTTY or Telnet to log into the module MVI69E login root Password password Ty FB COM3 PuTTY gt O e A 8 Change to the Sample directory cd psft sample ProSoft Technology Inc Page 61 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module 9 Type and the name of the sample program that you want to run In this example type Serial Application amp 3 COM3 PuTTY a K 4 10 Keep PuTTY or Telnet open and set up the CompactLogix 5000 program as described in Setting Up the ControlLogix 5000 Page 62 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual 11 Open the MVI69E LDM ACD program and change th
101. or hardware infringes such Recipient s patent s then such Recipient s rights granted under Section 2 b shall terminate as of the date such litigation is filed All Recipient s rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance If all Recipient s rights under this Agreement terminate Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable However Recipient s obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive Everyone is permitted to copy and distribute copies of this Agreement but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner The Agreement Steward reserves the right to publish new versions including revisions of this Agreement from time to time No one other than the Agreement Steward has the right to modify this Agreement The Eclipse Foundation is the initial Agreement Steward The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity Each new version of the Agreement will be given a distinguishing version number The Program including Contributions may always be distributed subject to the version of the Agreement under which it
102. or in interest if the predecessor has it or can get it with reasonable efforts You may not impose any further restrictions on th xercise of th rights granted or affirmed under this License For example you may not impose a license fee royalty or other charge for exercise of rights granted under this License and you may not initiate litigation including a cross claim or counterclaim in a lawsuit alleging that any patent claim is infringed by making using selling offering for sale or importing the Program or any portion of it 11 Patents A contributor is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based The work thus licensed is called the contributor s contributor version A contributor s essential patent claims are all patent claims owned or controlled by the contributor whether already acquired or hereafter acquired that would be infringed by some manner permitted by this License of making using or selling its contributor version but do not include claims that would be infringed only as a consequence of further modification of the contributor version For purposes of this definition control includes the right to grant patent sublicenses in a manner consistent with the requirements of this License Each contributor grants you a non exclusive worldwide royalty free patent license under the contributor s essential patent clai
103. ork or a work based on the earlier work A covered work means either the unmodified Program or a work based on the Program To propagate a work means to do anything with it that without permission would make you directly or secondarily liable for infringement under applicable copyright law except executing it on a computer or modifying a private copy Propagation includes copying distribution with or without modification making available to the public and in some countries other activities as well To convey a work means any kind of propagation that enables other parties to make or receive copies Mere interaction with a user through a computer network with no transfer of a copy is not conveying An interactive user interface displays Appropriate Legal Notices to the extent that it includes a convenient and prominently visible feature that 1 displays an appropriate copyright notice and 2 tells the user that there is no warranty for the work except to the extent that warranties are provided that licensees may convey the work under this License and how to view a copy of this License If the interface presents a list of user commands or options such as a menu a prominent item in the list meets this criterion ProSoft Technology Inc Page 99 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module 1 Source Code The source co
104. ort in the next section 1 Connect the RJ45 end of an RJ45 DB9m cable Cable 14 to the Serial Port 1 of the module 2 Connect one end of the Null Modem Cable Cable 15 to the DB9m end Cable 14 3 Connect the other end of Cable 15 null modem cable to a serial port on your PC or laptop Ethernet Port 1 The module contains a Telnet client which you can access through Ethernet Port 1 Eth 1 as shown 2 Connect an Ethernet RJ45 cable to the Eth 1 port of the module and the other end to the Ethernet network switch Page 16 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual To enable or disable the Telnet port This example uses PuTTY which you can download for free at from http www chiark greenend org uk sgtatham putty download html 1 Start PUTTY 2 Open a PuTTY session as shown below The following screenshot shows the Telnet Port enabled o U ProSoft Technology Inc Page 17 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module To disable the Telnet port 1 Change to the s99 telneta directory Type cd etc init d S99 telnetd 2 List the files in the directory Type ls r T gp COM PuTTY o js Page 18 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Ap
105. otify the Commercial Contributor in writing of such claim and b allow the Commercial Contributor to control and cooperate with the Commercial Contributor in the defense and any related settlement negotiations The Indemnified Contributor may participate in any such claim at its own expense For example a Contributor might include the Program in a commercial product offering Product X That Contributor is then a Commercial Contributor If that Commercial Contributor then makes performance claims or offers warranties related to Product X those performance claims and warranties are such Commercial Contributor s responsibility alone Under this section the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties and if a court requires any other Contributor to pay any damages as a result the Commercial Contributor must pay those damages 5 NO WARRANTY EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT THE PROGRAM IS PROVIDED ON AN AS IS BASIS WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND EITHER EXPRESS OR IMPLIED INCLUDING WITHOUT LIMITATION ANY WARRANTIES OR CONDITIONS OF TITLE NON INFRINGEMENT MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement including but not limited
106. ou ll see that the program registers sigquit_handler for four signals using the signal function checks command line and prints usage message if needed opens the backplane using open backplane See the description in Backplane Sample initializes the LEDs on the front panel Calls the function socket to create an UN named socket inside the kernel socket returns an integer known as a socket descriptor o The function takes domain family as its first argument For Internet family of IPV4 addresses USe AF_INET o The second argument sock stream specifies that type of connection to use In this case a sequential reliable two way connection is desired o The third argument select the protocol Generally this is zero as the system normally only has one protocol for each type of connection although it is possible to have multiple protocols for a connection type Zero tells the system to use the default protocol for the specified type of connection In this case the default is TCP zeros out the send buff and serv addr variables In preparation for the call to bina the serv_addr is then set to the well known port address SERVER PORT NUMBER and any IP address This allows a connection to be accepted from any IP address as long as the well known port address is specified calls function bina to assign the address specified in the structure serv addr to the socket created by the call to socket calls function 1isten w
107. p Page 76 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual MVI69_SendMsgResponseToBp Syntax int MVI69 SendMsgResponseToBp MVI69HANDLE handle WORD buffer WORD length WORD reserved WORD timeout Parameters handle handle returned by previous call to MVI69 Open buffer pointer to buffer to send to processor length the length in words of the message to send timeout maximum number of milliseconds to wait to send message Description This function sends a response to the control processor handle must be a valid handle returned from MVI69_Open Upon calling this function length should contain the response size in words buffer must point to a buffer of at least length words in size If length exceeds the maximum response size specified by the value MsgSndBufSize see the MVI69_GetlOConfig function MVI69_ERR_BADPARAM will be returned When this function is called the buffers data must contain the message in the following format Name Data Type Description Messageld WORD Must echo MessagelD of request SizeofMessage WORD Size of the Message data in bytes Messagel BYTEs CIP Response packet starting with Service Response Total number of bytes is provided in the SizeofMessage field The API uses the Messageld field to match responses to requests from the backplane Once the API matches a
108. pical or common use of that class of product regardless of the status of the particular user or of the way in which the particular user actually uses or expects or is expected to use the product A product is a consumer product regardless of whether the product has substantial commercial industrial or non consumer uses unless such uses represent the only significant mode of use of the product Installation Information for a User Produc procedures authorization keys and execute modified versions of a covered wor a modified version of its Corresponding Source t means any methods or other information required to install k in that User Product from The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered wit modification has been made If you convey an object code work under this specifically for use in a User Product part of a transaction in which the right of po User Product is transferred to the recipient in perpetuity regardless of how the transaction is characterized conveyed under this section must be accompanied fixed term Corresponding Sourc and the conveying h solely because or with occurs as use of the or fora the section in or ssession and by the Installation Information But this requirement does not apply if neither you nor any third party retains the ability to install modified object
109. plane O Ses Controller Organizer A AS TERE 5 S Controller MVIESELOM A Controller Tags 5 Controler Fault Handler a os ae E Power Up Handler ES Tasks S E Maintask El een ose one wa g JE Program Tags Source counttimer ACC MainRoutine Dest Local1 0 Detal2 E unscheduled Programs Length 58 E Motion Groups E Ungrouped Axes Add On Instructions Ee See Oe E Data Types Gj User Defined ons_Serial_App_Sample_On_Trigger Serlal_ENET_App_Sample_On Og Strings lt o re cl Ot Add On Defined OR Predefined G Module Defined Seria ENET_App Serple_on_Trager Serial_ENET_App_Sample_On 2 5 1JO Configuration E BI Backplane CompactLogix System ons_8P_Sample_On Trigger BP_Sample_On_Trigger ff 1769 L35E MVIS9ELOM ons t E MP 1769 135E Ethernet Port LocalENB ds Ethernet clear_output_putfer ons_clr_ob LL GB CompactBus Local x JE TONS Fil Fie J ons B 1 1769 MODULE LOM Source o Dest Locat1 0 Data 0 Length El Seriel_App_Sample_WteTriguer Serial_ENET_App_Sample_On_Trigger ONS_Serial_Ajp_Sample_Wrterigger MOV 4 E ea eee ONS Move Source 28535 Dest Locat1 0 Data 0 Type adder Diagram Wain Description MOV Program MainProgram Move ET 7 Source 27762 Dest Locat1 0 Data 1 27762 MOV Move Source 8548 Daat a neant si A E e MO 2 x Enter BOOL operand Rung 2 oF 7 APP E This causes the MVI69E LDM module to send out the text world to the console p HyperTerminal Ele Edt yew Cal Trarsfer Help
110. ple install file is included with the sample applications The steps are 1 Create all of the components that are part of the system This mainly involves compiling and linking executables and shared libraries 2 Create the install script 3 Modify any web pages and data files that will be needed 4 Last update the install script To create the Image Contents Each component file to be included in the image is listed in the file imagecontents in the build directory structure for the specific application This file contains header information about the image and a list of entries describing the files to be added to the image The format of the entry is Add source destination file permissions Where The source file is the path to the file to be included The destination file is the full path name of the file on the destination on the target device The permissions are the Linux style permissions of the file on the destination Page 36 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual For example a line to add the LED_Sample application looks like Add src ldm led_sample Release Led Sample psft sample Led Sample rwxrwxr x Since builds occur in home usr workspace mvi69 e 1dm build LDM source paths are relative to this directory to simplify moving to a new directory Follow the sample provided to create a complete imag
111. plication Development Module Developer s Manual 3 Comment out the telneta file A AAA 4 To enable the port simply un comment the same line ProSoft Technology Inc Page 19 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module 1 5 3 Enabling and Disabling the Console Port Establish a connection to the module This example uses PuTTY 1 Open PuTTY E PuTTY Configuration z Lo w Category Session Basic options for your PuTTY session 1 Specify the destination you want to connect to T arman Mi Serial line Speed Bell COM3 115200 Features Connection type E Window Raw Telnet Rlogin SSH Serial Load save or delete a stored session Translation Saved Sessions Selection Pa Deiak Sakap Cia Data Save Proxy Telnet Delete Rlogin SSH Close window on exit Always Never Only on clean exit About Help Cancel E d 2 Set SPEED to 115200 3 Set the SERIAL LINE to the appropriate COM port 4 Ensure that the CONNECTION TYPE is Serial 5 Click OPEN The PuTTY session opens 6 Enter your login and password MVI69E login root Password password F SS gp COM3 PuTTY E e Page 20 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual The follow
112. pp_Sample_On_Trigger _ ONS_Serial_App_Sample_WriteTrigger TONS a MOV tc Move Source 28535 Dest Local 1 0 Data 0 28535 e MOV Move Source 27762 Dest Localt 0 Dataft 2778 Mov Move Source 8548 Dest Local 1 0 Data 2 8548 el MOV Move Source 8192 Dest Localt 0 Data 3 13 MOV Move Source 13 Dest Local1 0 Deta 3 134 MOV Move Source 10 Dest Local 1 0 Data 4 104 MOV Move Source Wrte_Byte_Cnt e Dest Locat1 0 Data S0 0 Enter BOOL operand Rung 2 of 7 APP ProSoft Technology Inc August 21 2014 Page 65 of 130 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module 15 You can see the letter h in the location Local 1 Data Make sure that the STYLE column in the CompactLogix is set to ASCII fo RSLogix 5000 MVIG9ELOM in MVI6SE_LOM_L35 _ 20 ACD 1769 135 20 13 Controller Tags Th Gott 218 x LA Fie Edt View Search Loge Communications Tools Window Help 18 x alsa S Se gt 0 x ala miel ela 2 Difime 1 F RUN E Fd Pat AB_ETH 1 105 1020 Backplane v amp e Aal y Heleg roto No Edts Bein fef NEY 2 Ca 53 Controller MVI696L0M A Controler Tags Controller Fat Mandier Locat 1 C ls fs AB 1769_MODUL Power Up Handlar Locat 1
113. previous call to MVI69 Open buffer pointer to buffer to receive message data from processor length pointer to variable containing the maximum message length in words When this function is called this should be set to the size of the indicated buffer Upon successful return this variable will contain the actual received message length timeout maximum number of milliseconds to wait for message Description This function retrieves a message sent from the control processor handle must be a valid handle returned from MVI69_Open Upon calling this function length should contain the maximum message size in words to be received buffer must point to a buffer of at least length words in size Upon successful return length will contain the actual length of the message received If length exceeds the maximum message size specified by the value MsgRcvBufSize see the MVI69 GetlOConfig function MVI69 _ERR_BADPARAM will be returned timeout specifies the number of milliseconds that the function will wait for a message To poll for a message without waiting set timeout to zero If no message has been received MVI69_ERR_TIMEOUT will be returned If the message received from the control processor is larger than length the message will be truncated to length words and MVI69_ ERR_MSGTOOBIG will be returned If the call returns MVI69_SUCCESS buffer will contain the message in the following format Name Data Type Description Messageld WORD Messag
114. product including a physical distribution medium accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange b Convey the object code in or embodied in a physical product including a physical distribution medium accompanied by a written offer valid for at least three years and valid for as long as you offer spare parts or customer support for that product model to give anyone who possesses the object cod ither 1 a copy of the Corresponding Source for all the software in the product that is covered by this License on a durable physical medium customarily used for software interchange for a price no more than your reasonable cost of physically performing this conveying of source or 2 access to copy the Corresponding Source from a network server at no charge c Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source This alternative is allowed only occasionally and noncommercially and only if you received the object code with such an offer in accord with subsection 6b d Convey the object code by offering access from a designated place gratis or for a charge and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge You need not require recipients to copy the Page 102 of 130 ProSoft Technology Inc August 21 2014 MVI69E LD
115. r The server waits for a client to request a connection replies with the local time and closes the connection The client runs with the IP4 address of the server The client opens a connection to the server receives the response message and prints the message the time on the server to the console It is recommended that you run the server on one MVI69E LDM module and the client on another Alternately either of the programs could be ported to another Linux environment Attempting to run both programs on the same MVI69E LDM is not advised due to the complexity of IP routing Server ENet Sample To run the Server ENet sample 1 Establish a command window using Telnet or similar terminal software on the PC through the Serial P1 port 2 Login as user root using password password 3 The Ethernet Port E1 is used to communicate with the client device The server and client devices must both be connected on the same IPv4 subnet 4 Set the IPv4 address and mask of the Ethernet port using the ifconfig command Page 46 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual To execute the sample 1 Navigate to the default home directory psft sample 2 Type the command server Samples to run the program as a background task The server will wait forever processing requests from clients While reviewing the source code y
116. r more identifiable patents in that country that you have reason to believe are valid If pursuant to or in connection with a single transaction or arrangement you convey or propagate by procuring conveyance of a covered work and grant a patent license to some of the parties receiving the covered work authorizing them to use propagate modify or convey a specific copy of the covered work then the patent licens you grant is automatically extended to all recipients of the covered work and works based on it A patent license is discriminatory if it does not include within the scope of its coverage prohibits the exercise of or is conditioned on the non exercise of one or more of the rights that are specifically granted under this License You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software under which you make payment to the third party based on the extent of your activity of conveying the work and under which the third party grants to any of the parties who would receive the covered work from you a discriminatory patent license a in connection with copies of the covered work conveyed by you or copies made from those copies or b primarily for and in connection with specific products or compilations that contain the covered work unless you entered into that arrangement or that patent license was granted prior to 28 March
117. recisely where it is most unacceptable Therefore w have designed this version of the GPL to prohibit the practice for those products If such problems arise substantially in other domains we stand ready to extend this provision to those domains in future versions of the GPL as needed to protect the freedom of users Finally every program is threatened constantly by software patents States should not allow patents to restrict development and use of software on general purpose computers but in those that do we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary To prevent this the GPL assures that patents cannot be used to render the program non free The precise terms and conditions for copying distribution and modification follow H ERMS AND CONDITIONS 0 Definitions vn This License refers to version 3 of the GNU General Public License Copyright also means copyright like laws that apply to other kinds of works such as semiconductor masks vn The Program refers to any copyrightable work licensed under this License Each licensee is addressed as you Licensees and recipients may be individuals or organizations To modify a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission other than the making of an exact copy The resulting work is called a modified version of the earlier w
118. response to its request the response will be forwarded to the backplane and the original request can be released The API does not act upon any data of the Message Since the API maintains an internal queue of 8 messages the user application must generate responses to allow reception of more than 8 messages If 8 requests are queued and the API receives another request it will be dropped If the SizeofMessage field is set to 0 the original request is released and no response is sent to the backplane This allows the user application to flush messages ProSoft Technology Inc Page 77 of 130 August 21 2014 Contents Developer s Manual MVI69E LDM C Programmable Linux Application Development Module Return Value MVI69 SUCCESS a message has been received MVI69 ERR_NOACCESS handle does not have access MVI69 ERR_BADPARAM a parameter is invalid MVI69 ERR_BADCONFIG send messaging is not enabled Example MVI69HANDLE handle int re WORD buffer 250 wait 5 seconds for the message to be sent rc MVI69 SendMsgResponseToBp Handle buffer if rc MVI69 SUCCESS printf Message sent n See Also MVI69 GetlOConfig MVI69 GetMsgRequestFromBp Page 78 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual 5 4 Synchronization MVI69 WaitForlnputScan Syntax int MVI69 Wai
119. rities Some manufacturers interpret and or A and B polarities differently 6 5 DB9 to RJ45 Adaptor Cable 14 i Cable Assembly 0060069 J1 Vv Vv J2 o DN DCD TXRXD TXD EN Y GY Ey RXD RXD i LS f TXD i S i i DTR 1 IS S GND GND GND 5 om 1 DSR RXD i i i RTS i 7 a 7 i 7 DO 2 i i CTS TXRXD TXD i O O NIC e NA I Wiring Diagram ProSoft Technology Inc Page 95 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module Page 96 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual 7 Open Source Licensing In This Chapter GNU Public License ua fala 98 Eclipse Public license aiii lali 111 Python Public licitante ed 115 GCG Public License i 0icc cccides ciar iaa centenas 120 This module utilizes Open Source applications available under the GNU Public License and others The following sections cover all Open Source licensing GNU Public License Eclipse Python Debian GCC ProSoft Technology Inc Page 97 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module 7 1 GNU Public License GNU GENE
120. s 46 Scanner 127 Serial Application 58 Serial Ports 81 Serial Sample 49 Setting Up ControlLogix 5000 45 Setup 31 Setup Jumper 12 27 Starting Eclipse 34 Support Service 8 Warranty 123 Synchronization 79 System Requirements 10 T Target 127 Thread 127 U Understanding the MVI69E LDM API 39 WwW Warnings Specification and Certifications 3 Warranty Information 124 Word 127 Y Your Feedback Please 2 Page 130 of 130 ProSoft Technology Inc August 21 2014
121. s 89 MVI69_GetSetupJUM Pel ceececeecceceeeeeceeeeeeeaeceeeeeceaeeecaaeseeaaeseeeeeceaeeesaaesdeaeeseaeeescaeeesaeeseneeseaees 90 6 Cable Connections 91 6 1 RS 232 Configuration Debug POrt ccceeceesceeeeeeeceeeeeeeaeeeeeeeseaeeesaeeesaeeeeneeeeaees 91 6 2 RS 232 Application Port S ccccccceceseceeeeeeeeneeceeeeecaeeesaaeeeeeeeseeeeseaeeesaeeseneeeeaees 92 6 2 1 RS 232 Modem Connection Hardware Handshaking Required c 92 6 2 2 RS 232 Null Modem Connection Hardware Handshaking 0ccssseeeseeeeees 93 6 2 3 RS 232 Null Modem Connection No Hardware Handshaking 0 ceeee 93 6 3 PRS HAD osetia t aca den sust fap tucantotee sare thane a dex etendea A A leiai sade 94 6 4 RS 485 Application Port S c ccccccceceeeceeeeeceeeeeceeeeecaeeeeaaeeeeeeeseeeeseaeeesaeeeeneeenaees 94 6 4 1 RS 485 and RS 422 Tip cecceesceceeceeceeeeeeeaeeeeeeeceeeeceaeeeeaaeseeaeeseeeesaeeseaaessaneeesaees 95 6 5 DB9 to RJ45 Adaptor Cable 14 0 eccceceeeeeeseceeeeeceeeeeaaeeeeeeeseeeesaeeeseaeeeeeeeenaees 95 7 Open Source Licensing 97 7 1 GNU Public LICE ASE naciona a eaa aa aio dic 98 7 2 Eclipse Public LICNE Eceran a A nana cnn 111 Page 6 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Linux Application Development Module Contents Developer s Manual 7 3 Python Public License oooooocoonoccccnnnocccccnnancccnnnns 7 4 GCC Public License
122. s to cycle through the LEDs and changes the state of the LED to every possible display state This uses the mv169 set Ep function 4 Exit the program by killing it CTRL C or kill 9 Page 50 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual 4 2 4 Backplane Sample The Backplane Sample program shows block transfer communication with the CompactLogix controller in slot 0 of the CompactLogix rack The CompactLogix controller must be loaded with the sample ladder logic and be configured to communicate with the MVI69E LDM module The ladder is mv169_Lpmacp To run the Backplane sample 1 2 Establish a command window using Telnet or similar terminal software on the PC through either the Ethernet or Serial P1 port Login USEF root password password To execute the sample 1 Navigate to the default home directory psft sample and type the command Backplane Samples to run this program as a background task 2 Reviewing the source code for the Backplane Sample the program registers Linux event handlers using the signa function opens a connection to the hardware via the backplane library API using the open backplane routine The open backplane will o change the module information with the mv169 SetModuleInfo routine o Call mv169 Open to get access to the LDM hardware and backplane o read the size of the confi
123. sfully MVI69 ERR _NOACCESS handle does not have access Example MVI69HANDLE handle MVIBPMODULEINFO modinfo Setup a customized module identity char new_name Widget 6900 strcpy modinfo Name new_name modinfo VendorID 774 modinfo DeviceType 30 modinfo ProductCode 42 modinfo MajorRevision 2 modinfo MinorRevision 1 MVI69 SetModulelnfo 0 smodinfo Now open the API and initialize backplane comms with new ID MVI69 Open amp Handle See Also MVI69 GetModulelnfo Page 86 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual MVI69 GetScanMode Syntax int MVI69 GetScanMode MVI69HANDLE handle int mode Parameters handle handle returned by previous call to MVI69_ Open mode pointer to a variable that will be updated with the current processor mode Description This function is used to query the state of the processor handle must be a valid handle returned from MVI69_Open mode is a pointer to an integer When this function returns this will be set to indicate the current processor status and shown in the following table Name Description MVI69 RUN_MODE Set if processor is in Run mode MVI69 PROGRAM_MODE Set if processor is in Program Mode Return Value MVI69 SUCCESS no errors were encountered MVI69 ERR_NOACCESS handle does not have access
124. sible to use the web based rescue To connect to the module over Ethernet 1 Place the onboard setup jumper to the installed state See Setup Jumper MVI69E 2 If you know the the IP address change the network mask and IP of the connected PC to compatible values For example if the MVI69E LDM is configured with the default IP address 192 168 0 250 and network mask 255 255 255 0 the the PC should have the same IP4 network mask and an IP address in the 192 168 0 xxx subnet Note that IP addresses must be unique on the network If in doubt create a physical network consisting of only the MVI69E LDM and the PC If you do not know the IP address of the MVI69E LDM module you can establish communication through the serial configuration port Port 1 upper port 1 Use Telnet or a similar terminal program to communicate with the module The default settings are 115 200 baud 8 data bits 1 stop bit No Parity xon xoff flow control 2 Use the following username and password Username root Password password 3 From the shell prompt run ifconfig to find the Ethernet IP address and network mask of device eth0 Then follow the steps under To connect to the module over Ethernet above ProSoft Technology Inc Page 27 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module To use web based rescue The web page for the MVI69E LDM module contains a command o
125. sion notice appear in ame of Stichting Mathematisch g or publicity pertaining to cific written prior ALL WARRANTIES WITH REGARD TO if FITNESS IN NO EVENT SHALL STICHTING MAT FOR ANY SPECIAL INDIRECT OR CONSEQU T NTI D WARRANTIES OF MERCHANTABILITY AND HEMATISCH CENTRUM BE LIABLE AL DAMAGES OR ANY DAMAGES WHATSOEVER RE SULTING FROM LOSS OF USE D ACTION OF CONTRACT NEGLIGENCE OR OT OF OR IN CONNECTION WITH THE USE OR ER ERF wD Bl ATA OR PROFITS WHETHER IN AN TORTIOUS ACTION ARISING OUT ORMANCE OF THIS SOFTWARE ProSoft Technology Inc August 21 2014 Page 119 of 130 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module 7 4 GCC Public License The Code GPL The source code is distributed under the GNU General Public License version 3 with the addition under section 7 of an exception described in the GCC Runtime Library Exception version 3 1 as follows or see the file COPYING RUNTIME GCC RUNTIME LIBRARY EXCEPTION Version 3 1 31 March 2009 Copyright C 2009 Free Software Foundation Inc This GCC Runtime Library Exception Exception is an additional permission under section 7 of the GNU General Public License version 3 GPLv3 It applies to a given
126. software you can redistribute it and or modify it under the terms of the GNU General Public License as published by the Free Software Foundation either version 3 of the License or at your option any later version This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE See the GNU General Public License for more details You should have received a copy of the GNU General Public License along with this program If not see lt http www gnu org licenses gt Also add information on how to contact you by electronic and paper mail If the program does terminal interaction make it output a short notice like this when it starts in an interactive mode lt program gt Copyright C lt year gt lt name of author gt This program comes with ABSOLUTELY NO WARRANTY for details type show w This is free software and you are welcome to redistribute it under certain conditions type show c for details i The hypothetical commands show w and show c should show the appropriate parts of the General Public License Of course your program s commands might be different for a GUI interface you would use an about box You should also get your employer if you work as a programmer or school if any to sign a copyright disclaimer for the program if necessary For more information on
127. ss Example MVI69HANDLE handle MVI69 Close handle See Also MVI69_OpenNB MVI69_ Open After the CIP API has been opened this function should always be called before exiting the application Page 70 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual MVI69 GetlOConfig Syntax int MVI69 GetlOConfig MVI69HANDLE apihandle MVI69 IOCONFIG ioconfig Parameters handle handle returned by previous call to MVI69_Open ioconfig Pointer to MVIG9IOCONFIG structure to receive configuration information Description This function is used to obtain the lO configuration of the MVI69E module handle must be a valid handle returned from MVI69_ Open The MVI69IOCONFIG structure is defined as shown typedef struct tagMVI69IOCONFIG WORD MappedInputWords Input words available for direct access WORD MappedOutputWords Output words available for direct access WORD MsgRcvBufSize Max size in words for received messages WORD MsgSndBufSize Max size in words for sent messages MVI69IOCONFIG The maximum sizes in words of the module s input images are returned in the MVI69IOCONFIG structure pointed to by ioconfig The MappedInputWords and MappedOutputWords members are set equal to the number of words of the respective image that is available for direct access via the MVI69 Writelnputlmage or MVIbpReadOutputimage functio
128. ssage buffer sizes are fixed Therefore the MsgRcvBufSize and MsgSndBufSize members are ignored by this function Return Value MVI69 SUCCESS no errors were encountered MVI69 ERR _NOACCESS handle does not have access MVI69 ERR _BADCONFIG Configuration is not valid Example I69HANDLE handle T69TOCONFIG ioconfig config DirectInputSize 20 20words used for input config DirectOutputSize 10 10 words used for output MVI69 SUCCESS MVI69 SetIOConfig handle ioconfig printf Error IO COnfiguration failed n See Also MVI69 GetlOConfig Page 720f 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual 5 2 Direct I O Access MVI69_ReadOutputlmage Syntax int MVI69 ReadOutputImage MVI69HANDLE handle WORD offset WORD length WORD buffer Parameters handle handle returned by previous call toMVI69 Open offset word offset into output image at which to begin reading length number of words to read buffer pointer to buffer to receive data from output image Description MVI69_ReadOutputlmage reads from the module s output image handle must be a valid handle returned from mv169 Open buffer must point to a buffer of at least length words in size offset specifies the word in the output image to begin reading and length specifies the number of words to read The error MVI
129. t 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module 4 2 3 LED Sample This program shows how to interact with the MVI69E LDM hardware at the most basic level To run the LED sample 1 Establish a command window using Telnet or similar terminal software program on the PC through either the Ethernet or Serial P1 port 2 Login as user root using password password To execute the sample 1 Navigate to the default home directory psft sample and type the command Led_ Samples This will run the Led_Sample program in the background 2 Looking at the sample source you ll see that the program O O O registers Linux event handlers using the signa1 function opens a connection to the hardware via the MVI69 library API mv169 open Although the mv169 Openns routine could be used since this sample does not communicate across the backplane reads the module information using MvI69 GetModuleInfo an displays this information to the terminal reads the version information of the MVI69 driver using MvI69 GetVersionInfo and displays this information to the terminal reads the state of the serial configuration jumpers using showSerialJumpers and prints this information to the terminal reads the state of the Setup Jumper using the function mv169 GetSetupJumper and prints this information to the console initializes all LEDs to OFF 3 The program then uses two nested loop
130. t is not valid for the new controller type M From Type 1769 L35E CompactLogix5335E Controller Revision 20 13 M To Type CompactLogix5335E Controller Revision 20 y e Cancel Help 3 Download MVI69_LDM ACD file in the CompactLogix processor by choosing COMMUNICATIONS gt WHO ACTIVE gt DOWNLOAD fo Who Active Autobrowse l Path S a AB_ETH 3 Ethernet 8 Ey AB_ETH 4 Ethernet S a AB_ETH S Ethernet dz AB_ETH 6 Ethernet le dz AB_ETHIP 1 Ethernet E da AB_ETHIP 2 Ethernet 105 102 0 110 SLC 5 05 1747 L551 C C 10 DC 3 46 HA 105 102 0 195 1756 EN2T 1756 EN2T A S 105 102 0 3 1769 L35E Ethernet Port 1769 L35E Ethernet P Backplane CompactLogix System 00 CompactLogix Processor MYI69ELDM 19 01 1769 L35E Ethernet Port f 105 102 0 96 1756 ENSTR 1756 EN3TR A EE ES AB_VBP 1 1789 A417 A Virtual Chassis E3 AB_ETHIP 24105 102 0 3 Backplane O0 Path in Project lt none gt A Set Project Path ProSoft Technology Inc August 21 2014 Page 45 of 130 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module 4 2 Sample Tutorials The following sections describe how to run and understand the sample tutorials provided with the module These samples handle the data exchange between the MVI69E LDM and end device s 4 2 1 Ethernet Sample The Ethernet sample comes as two programs a client and a serve
131. t run a Virtual Machine that hosts the Linux Operating System VMware provides a virtual machine player used to host the Linux Operating System You can find it at https my vmware com web vmware downloads 2 1 Setup The file Debian6 vM zip is part of the LDMdevkit package which you can download for free from the ProSoft Technology website www prosoft technology com Idmdevkit You can also purchase the DVD part number LDMdevkKit from ProSoft Technology 1 Copy the Debian wn zip file to your PC in the VM Player image ico directory vMwar VMware Play r ico 2 Uncompress Debian6wm zip into this directory 3 Start the VM Player by double clicking on its icon on the Windows desktop 4 Click OPEN A VIRTUAL MACHINE Welcome to VMware Player Create a New Virtual Machine ine which will then be Create a new virtual machir added to the top of your library Open a Virtual Machine Open an existing virtual machine which will then be added to the top of your library Upgrade to VMware Workstation Get advanced features such as snapshots developer tool integration and more Help View VMware Player s help con This product is not licensed and is authorized for commercial use only For commercial use purchase a license Buy now ProSoft Technology Inc Page 31 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module 5 Navigate to the i
132. tForInputScan MVI69HANDLE handle WORD timeout Parameters handle handle returned by previous call to MVI69 Open timeout maximum number of milliseconds to wait for scan Description MVI69_WaitForlnputScan allows an application to synchronize with the scan of the module s input image This function will return immediately after the input image has been read This function may also be used by a module application to determine if the backplane is active handle must be a valid handle returned from MVI69_Open timeout specifies the number of milliseconds that the function will wait for the input scan to occur Note There is no distinction in teh MVI69E module between input and output scans Therefore the MVI69 WaitForlnputScan and MVI69_WaitForOutputScan functions will perform exactly the same function and are interchangeable Return Value MVI69 SUCCESS the input scan has occurred MVI69 ERR _NOACCESS handle does not have access MVI69 ERR TIMEOUT the timeout expired before an input scan occurred Example MVI69HANDLE handle wait here until input scan 50ms timeout rc MVI69 WaitForInputScan Handle 50 if re MVI69 ERR TIMEOUT printf Message scan did not occur within 50 milliseconds n else printf Input scan has occurred n See Also MVI69 WaitForOutputScan ProSoft Technology Inc Page 79 of 130 August 21 2014 Contents MVI69E LDM C Pro
133. the Program Ancillary propagation of a covered work occurring solely as a consequence of using peer to peer transmission to receive a copy likewise does not require acceptance However nothing other than this License grants you permission to propagate or modify any covered work These actions infringe copyright if you do not accept this License Therefore by modifying or propagating a covered work you indicate your acceptance of this License to do so 10 Automatic Licensing of Downstream Recipients ProSoft Technology Inc Page 105 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module Each time you convey a covered work the recipient automatically receives a license from the original licensors to run modify and propagate that work subject to this License You are not responsible for enforcing compliance by third parties with this License An entity transaction is a transaction transferring control of an organization or substantially all assets of one or subdividing an organization or merging organizations If propagation of a covered work results from an entity transaction each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party s predecessor in interest had or could give under the previous paragraph plus a right to possession of the Corresponding Source of the work from the predecess
134. the configuration information was read successfully MVI69 ERR NOACCESS handle does not have access ProSoft Technology Inc Page 81 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module Example MVI69HANDLE handle MVI69SPCONFIG spconfig Get jumper setting for Port 2 and verify that it is RS232 spconfig port_num 2 MVI69 GetSerialConfig Handle amp spconfig if spconfig port_cfg MVI69 SERIAL CONFIG RS232 printf Port 2 is not configured for RS232 See Also MVI69 SetSerialConfig Page 82 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual MVI69_SetSerialConfig Syntax int MVI69 SetSerialConfig MVI69HANDLE handle MVI69SPCONFIG spconfig Parameters handle handle returned by previous call to MVI69 Open spconfig pointer to structure of type MVIG9SPCONFIG Description MVI69_SetSerialConfig sets the serial port configuration This function overrides the serial port configuration jumper setting The port number and configuration are specified in the structure spconfig handle must be a valid handle returned from MVI69_Open The MVI69SPCONFIG structure is defined as follows typedef struct tagMVI69SPCONFIG int port _num Port number 1 or 2 int port cfg Jumper position MV
135. the state to set Description MVI69_SetLED allows an application to set the state of the LED indicators handle must be a valid handle returned from MVI69_Open lednum must be set to MVI69 LEDID_OK MVI69_LEDID_CFG MVI69_LEDID_P1 MVI69 LEDID_P2 MVI69_LEDID_BP or MVI69_LEDID_ NET ledstate must be set to MVI69_LED_STATE_RED MVI69_LED_STATE_GREEN MVI69 LED_STATE_YELLOW or MVI69_LED_STATE_OFF Return Value MVI69 SUCCESS the LED state has been set MVI69 ERR_NOACCESS handle does not have access MVI69 ERR_BADPARAM lednum or ledstate is invalid Example MV169HANDLE handle OK LED green and NET LED yellow MVI69 SetLED Handle MVI69 LEDID OK MVI69 LED STATE GREEN MVI69 SetLED Handle MVI69 LEDID NET MVI69 LED STATE YELLOW ProSoft Technology Inc Page 89 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module MVI69 GetSetupJumper Syntax int MVI69 GetSetupJumper MVI69HANDLE handle int mode Parameters handle handle returned by previous call to MVI69 Open mode Pointer to an integer that is set to 1 if the Setup Jumper is installed or 0 if the Setup Jumper is not installed Description This function is used to query the state of the Setup Jumper handle must be a valid handle returned from MVI69_Open mode is a pointer t
136. this and how to apply and follow the GNU GPL see lt http www gnu org licenses gt The GNU General Public License does not permit incorporating your program into proprietary programs If your program is a subroutine library you ProSoft Technology Inc Page 109 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module may consider it more useful to permit linking proprietary applications with the library If this is what you want to do use the GNU Lesser General Public License instead of this License But first lt http www gnu org philosophy why not lgpl html gt please read Page 110 of 130 ProSoft Technology Inc August 21 2014 MVI69E LDM C Programmable Contents Linux Application Development Module Developer s Manual 7 2 Eclipse Public License Eclipse Public License Version 1 0 EPL 1 0 THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE AGREEMENT ANY USE REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT S ACCEPTANCE OF THIS AGREEMENT 1 DEFINITIONS Contribution means a in the case of the initial Contributor the initial code and documentation distributed under this Agreement and b in the case of each subsequent Contributor i changes to the Program and ii additions to the Program where such changes and or additions to the Program originate from an
137. those permissions but the entire Program remains governed by this License without regard to the additional permissions When you convey a copy of a covered work you may at your option remove any additional permissions from that copy or from any part of it Additional permissions may be written to require their own removal in certain cases when you modify the work You may place additional permissions on material added by you to a covered work for which you have or can give appropriate copyright permission Notwithstanding any other provision of this License for material you add to a covered work you may if authorized by the copyright holders of that material supplement the terms of this License with terms a Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License or b Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it or c Prohibiting misrepresentation of the origin of that material or requiring that modified versions of such material be marked in reasonable ways as different from the original version or d Limiting the use for publicity purposes of names of licensors or authors of the material or e Declining to grant rights under trademark law for use of some trade names trademarks or service marks or f Requiring indemnification o
138. tion Development Module Developer s Manual of having them make modifications exclusively for you or provide you with facilities for running those works provided that you comply with the terms of this License in conveying all material for which you do not control copyright Those thus making or running the covered works for you must do so exclusively on your behalf under your direction and control on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you Conveying under any other circumstances is permitted solely under the conditions stated below Sublicensing is not allowed section 10 makes it unnecessary 3 Protecting Users Legal Rights From Anti Circumvention Law No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996 or similar laws prohibiting or restricting circumvention of such measures When you convey a covered work you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work and you disclaim any intention to limit operation or modification of the work as a means of enforcing against the work s users your or third parties legal rights to forbid circumvention of technological measures
139. tup JUMPE einh tale iia 12 1 Port Tand Pon 2 JUMpOrs cusco rise 12 1 5 Installing and Connecting the Module cccsccceeceeceeeeeseeeeeeeeseeeeeseaeeeeeeseeneeeaes 12 1 5 1 Installing the Module in the Chassis ccccccesceceeceeeeeeeeeeaeeeeeeeseeeeeseaeeesaeeeeneeeaas 13 1 5 2 Making Configuration Port CONNeCtionsS ccceccceeeeceeeeeeeeeee senses seeeeseaeeseaeeseeeeee 16 1 5 3 Enabling and Disabling the Console Pott cc cccecsceceeeeeeeeeeeeseeseeeeeseaeeeeaaeseeneeeeas 20 1 6 Establishing Module Communications ccceeeeeeceeceteeeeeeceeeeeseeeeetaeeeeaaeeeneeeeaas 24 1 7 Resetting the Module eccceceeeeseneeeeeeeeeeeeeeeeeeeeeeaeeeseeaaeeeeeeaaeaeseeaeeeseesenaeseeseneees 27 1 8 Important Information Before Development ececeeeeeeceeeeeeeeeeeeeeeeeeeeeeneeeeeeeeeaees 29 2 Development Environment 31 2 1 O O O rere eae 31 2 2 Starting ECUPSO senter assonar espa und dida e 34 2 2 1 B lding A PROJ CU ssc assent aca ca aa dades te asienta 34 2 2 2 Compiling ANd LINKING ccceceeeceeeeeeneeteeeee cee eeeeae scenes nara rn cc rca 35 2 2 3 Downloading the Application with FTP eccceseeceeeeeeeceeeeseeeeeeeeeeeeeeeeeeeeeeeeeeeeees 36 2 2 4 Creating an Application Image oooonnnccinnccincconnncnnnccnnonccconrn naar nnnc cnn rca nana cnn 36 2 2 5 Downloading the Image with Firmware Update oooocccccnnicicinonoccccnnnoccccnnnanccnnnnnnccnns 37 3 Understanding the M
140. tup Jumper acts a write protection for the module s firmware In write protected mode the setup pins are not connected which prevents the module s firmware from being overwritten The module is shipped with the Setup Jumper OFF If you need to update the firmware or run a module rescue recovery apply the setup shunt over both pins W SETUP SETUP SHUNT A NOT JUMPERED 1 4 2 Port 1 and Port 2 Jumpers These jumpers located at the bottom of the module aid in configuring the port settings to RS 232 RS 422 or RS 485 The RS 232 RS 485 and RS 422 labels are there for convenience The jumpers simply send a high low signal when jumped or not jumped The jumper configuration is read by the API and the application code must change the appropriate port settings to the required mode 232 485 422 1 5 installing and Connecting the Module If you have not already done so please install and configure your CompactLogix processor and power supply Refer to the Rockwell Automation product documentation for installation instructions Warning You must follow all safety instructions when installing this or any other electronic devices Failure to follow safety procedures could result in damage to hardware or data or even serious injury or death to personnel Refer to the documentation for each device you plan to connect to verify that suitable safety procedures are in place before installing or servicing this device
141. ual 4 2 2 Serial Sample To run the Serial sample 1 2 Establish a command window using Telnet or similar terminal software on the PC through the Ethernet E1 port or Serial P1 port Login USEF root password password To execute the sample 1 2 Navigate to the default home directory psft sample Type the command Serial Sample ttySl1 test string in order to run the program with ttyS1 as the output and test string sent to that port While reviewing the source code for serial Sample you ll see that the main program registers sigquit_handler for four signals checks command line and print usage message if required opens the backplane using open backplane See the detailed description in backplane_ sample reads the serial configuration jumpers and ensures that both serial ports are configured as RS232 opens the serial port using function open serial port Examine this function o opens the serial device by calling open o reads current serial port attributes using tcgetaddr o configures serial port attributes The routine uses cfsetispeed to set the baud rate It then uses tcsetattr to set the remaining attributes initializes the LEDs on the front panel enters a for loop which transmits a test string one character at a time by calling write and sleeping for 500 msec using usleep closes the serial drive connection using close ProSoft Technology Inc Page 49 of 130 Augus
142. with relatively any Ethernet or Serial device With the supplied development tools and example applications you are the developer that controls exactly what this module can and cannot do ProSoft Technology s Linux Development modules make it possible for you to easily develop and deploy C C applications that interface with Bar Code Scanners Legacy ASCII protocols Terminal Port Emulation Printer Drivers Alarm Status printer or any other device requiring custom or proprietary Ethernet and Serial communications This document provides the information you need to develop application programs for the MVI69E LDM module This document assumes you are familiar with software development in the Linux environment using the C C programming languages This document also assumes that you are familiar with Rockwell Automation programmable controllers and the CompactLogix platform ProSoft Technology Inc Page 9 of 130 August 21 2014 Contents MVI69E LDM C Programmable Developer s Manual Linux Application Development Module You should be familiar with the following terms Application Programming Interface Backplane Refers to the electrical interface or bus to which modules connect when inserted into the rack The MVI69E LDM communicates with the control processor s through the CompactLogix backplane CIP Control and Information Protocol This is the messaging protocol used for communications over the CompactLogix backplane

Download Pdf Manuals

image

Related Search

Related Contents

evaluating the ad9656 analog-to-digital converter - Digi-Key  Interfaccia con un computer  

Copyright © All rights reserved.
Failed to retrieve file