Summary of Contents for Allen-Bradley ControlLogix 1756-CMS1B1
Page 1
User Manual Original Instructions ControlLogix Compute Modules Catalog Numbers 1756-CMS1B1, 1756-CMS1C1...
Page 2
Important User Information Read this document and the documents listed in the additional resources section about installation, configuration, and operation of this equipment before you install, configure, operate, or maintain this product. Users are required to familiarize themselves with installation and wiring instructions in addition to requirements of all applicable codes, laws, and standards.
Table of Contents Preface Summary of Changes ......... . . 7 Terminology .
Page 4
Table of Contents Chapter 3 Linux Operating Follow Design and Engineering Best Practices ....37 Connect Monitor and Peripherals Before Power-up ....38 System Overview Security Settings .
Page 5
Table of Contents Chapter 5 Backplane API Library Functions Initialization Function Category....... . 56 OCXcip_Open .
Chapter 3, Linux Operating System Overview on page The following terms and abbreviations are used throughout this manual. For Terminology definitions of terms that are not listed here, refer to the Allen-Bradley Industrial Automation Glossary, publication AG-7.1. Term Definition...
Provides declarations of conformity, certificates, and www.rockwellautomation.com/global/certification/ other certification details. overview.page You can view or download publications at http://www.rockwellautomation.com/global/literature-library/overview.page. To order paper copies of technical documentation, contact your local Allen-Bradley distributor or Rockwell Automation sales representative. Rockwell Automation Publication 1756-UM003C-EN-P - April 2018...
Chapter ControlLogix Compute Modules Topic Page Module Overview Catalog Number Explanation Module Components Module Location Status Indicators Connection Options Rotary Switches Reset Button Replacement Battery This chapter describes the ControlLogix® Compute modules. Module Overview ControlLogix Compute modules are chassis-based modules that let you communicate directly with a ControlLogix 5570 or ControlLogix 5580 controller via the system backplane and over a network.
Chapter 1 ControlLogix Compute Modules Catalog Number Explanation ControlLogix Compute module catalog numbers indicate specific information about the module. All modules use the same format, that is, 1756-CMwxyz, where the following apply: • 1756 is the Bulletin number. • CM = Compute Module •...
ControlLogix Compute Modules Chapter 1 Module Components Table 2 describes components available on ControlLogix Compute modules. Table 2 - ControlLogix Compute Module Components Component Description One of the following embedded OS: Lets you install commercially-available software and/or create custom applications while using the backplane API. •...
Page 12
Chapter 1 ControlLogix Compute Modules Figure 1 - ControlLogix Compute Module Components Front View Side View COMPUTE Four-character Display Status Indicators USR3 USR2 USR1 Reset Button RESET DISPLAY DisplayPort PORT USB 3.0 Port Ethernet ports 1 and 2 • On modules that use a Windows OS, the top port is Ethernet 2, and the bottom port is...
ControlLogix Compute Modules Chapter 1 Module Location A ControlLogix Compute module can reside in the same chassis as the controller or in a chassis that is remote from the controller with which it communicates. That is, the module can reside in either of the following: •...
Chapter 1 ControlLogix Compute Modules Remote Chassis The ControlLogix Compute module can operate in a remote ControlLogix chassis. Figure 3 shows a control system with the Compute module in a remote chassis. Figure 3 - Control Application with Compute Module in Remote Chassis ControlLogix Controller ControlLogix EtherNet/IP Adapter ControlLogix I/O Modules...
Page 15
ControlLogix Compute Modules Chapter 1 Compute Module in a Redundancy System You can use a Compute module in a ControlLogix redundancy system. When you do, the requirements apply: • The module must reside in a remote chassis. The module communicates with the ControlLogix controller over an EtherNet/IP network.
Chapter 1 ControlLogix Compute Modules Status Indicators The ControlLogix Compute module uses a 4-character display and status indicators to show the module state at any point in time. For more information on how to use the 4-character display and the status indicators, see Appendix A, Program-controlled Status Indicators on page 119.
Page 17
ControlLogix Compute Modules Chapter 1 You must use a VESA-certified DisplayPort adapter to connect some industrial monitors to the module. TIP We recommend that you connect a monitor to the DisplayPort before you power up the module. If you power up a module with the Linux OS before you connect a monitor, the monitor typically does not work.
Chapter 1 ControlLogix Compute Modules USB 3.0 Port You use the USB port to connect peripherals, for example, a wireless keyboard, to the module. The USB port supports the use of a USB hub. USB hubs let you connect more than one peripheral to the module via the USB port. TIP We recommend the following: •...
ControlLogix Compute Modules Chapter 1 Ethernet Ports There are two Ethernet ports that let you connect the ControlLogix Compute modules to EtherNet/IP networks. The Ethernet ports can communicate on an EtherNet/IP network at a maximum network communication speed of 1 Gbps. To connect the module to an EtherNet/IP network, connect an RJ45 cable to an embedded Ethernet port.
Page 20
Chapter 1 ControlLogix Compute Modules Set the Network Internet Protocol (IP) Address ControlLogix Compute module Ethernet ports require an IP address to support the Ethernet protocol. Out-of-the-box, the Ethernet ports are configured as follows: Embedded OS on the Module Port Position Port Default Name IP Address Mask...
ControlLogix Compute Modules Chapter 1 Rotary Switches There are rotary switches on the side of the module. Out-of-the-box, the switches are set to the 000 and are not used until module operation begins. Figure 8 - ControlLogix Compute Module Rotary Switches Rotary Switches The rotary switches are application-dependent.
Chapter 1 ControlLogix Compute Modules Reset Button Compute modules have a reset button behind the door on the front of the module. COMPUTE USR3 USR2 USR1 Reset Button RESET DISPLAY PORT Remember the following: • The reset button functions like the power button on a computer and is only used with the embedded OS.
Page 23
ControlLogix Compute Modules Chapter 1 This table describes the actions that you can perform with the reset button and the result of taking each action. Action Result Press and release the button when Performs an orderly shutdown of the embedded OS. the embedded OS is running.
Chapter 1 ControlLogix Compute Modules Replacement Battery Compute modules use a battery to maintain the real time clock on the module when there is no power that is applied to module. A battery is installed in the module when it ships. You can replace the battery if necessary.
Page 25
ControlLogix Compute Modules Chapter 1 2. Remove the old battery from the holder. 3. Install a new battery into the holder. The side of the battery with words and numbers is installed in the side of the holder with tabs to hold it in place. Battery Holder Tabs 4.
Chapter Windows Operating System Overview Topic Page Follow Design and Engineering Best Practices Connect Monitor and Peripherals Before Power-up Security Settings Implement a BIOS Password Information on the Module Cannot Be Erased Data Lost Due to OS Corruption Cannot Be Recovered This chapter describes the embedded Windows OS on a ControlLogix®...
Chapter 2 Windows Operating System Overview Connect Monitor and We recommend that before you apply power to the chassis within which the Compute module resides, you make all necessary module connections. For Peripherals Before Power-up example, connect a monitor to the DisplayPort and peripherals to the USB 3.0 port before you apply power to the module.
Windows Operating System Overview Chapter 2 Windows 10 OS Updates The Compute module does not automatically update the Windows OS. You must manually perform OS updates. We recommend that you update the Windows OS on your Compute module according to your organization’s IT policies with regard to OS updates. Using .NET Framework 3.5 If the application on your Compute module requires .NET Framework 3.5, you must enable the .NET Framework 3.5 feature in the Windows...
Chapter 2 Windows Operating System Overview Inactivity Lock and Screen Saver Settings The Inactivity Lock and Screen Saver policies settings are the exceptions regarding the embedded Windows OS design differing from the Microsoft Security Baseline for Windows 10 v1607. • In the Baseline, the policies are set so that a screen saver launches if no activity occurs for a specified period of time.
Windows Operating System Overview Chapter 2 Password Settings Password and account lockout settings are tied together because, if an account is locked, a password is required to unlock it. A password can help to establish and maintain a degree of security. IMPORTANT The first time you power up a Compute module, there is no enabled account.
Chapter 2 Windows Operating System Overview Account Lockout Settings To help maintain a degree of security, an account on a Compute module can be locked. Table 4 describes some of the account lockout policies. Table 4 - ControlLogix Compute Module Account Lockout Policies Policy Description Password use to unlock account...
Windows Operating System Overview Chapter 2 Internet Explorer Settings You can use Internet Explorer (IE) on your Compute module. Table 6 describes some of the IE policies. Table 6 - ControlLogix Compute Module IE Policies Policy Description Restrictions on using IE Restrictions exist to account for unsafe ActiveX controls.
Chapter 2 Windows Operating System Overview Driver Signature Enforcement The embedded Windows OS on the Compute module is designed with the driver signature enforcement feature enabled. Therefore, you can only use signed drivers that are installed correctly. If you install an unsigned driver or incorrectly install a signed driver, it does not work.
Windows Operating System Overview Chapter 2 Implement a BIOS Password To implement a BIOS password on a ControlLogix Compute module, complete these steps. IMPORTANT After you implement a BIOS password, you can change it. However, you cannot recover the BIOS password if you forget or lose it. 1.
Chapter 2 Windows Operating System Overview Information on the Module Once you load data on a Compute module, it stays on the module permanently. You cannot simply delete the data from the module. In this case, Cannot Be Erased the term data refers to an organization's intellectual property. Due to how the Windows OS manages the hard drive memory on the Compute module, deletion of a file does not completely remove the data from the hard drive.
Chapter Linux Operating System Overview Topic Page Follow Design and Engineering Best Practices Connect Monitor and Peripherals Before Power-up Security Settings Additional Considerations Implement a BIOS Password Information on the Module Cannot Be Erased Data Lost Due to OS Corruption Cannot Be Recovered This chapter describes the embedded Linux OS on a ControlLogix®...
Chapter 3 Linux Operating System Overview Connect Monitor and We recommend that before you apply power to the chassis within which the Compute module resides, you make all necessary module connections. For Peripherals Before Power-up example, connect a monitor to the DisplayPort and peripherals to the USB 3.0 port before you apply power to the module.
Linux Operating System Overview Chapter 3 Password Settings Password and account lockout settings are tied together because, if an account is locked, a password is required to unlock it. A password can establish, and help to maintain, a degree of security on the module. There is a login the first time that you power up a Compute module that uses the embedded Linux OS.
Chapter 3 Linux Operating System Overview Account Lockout Settings To help maintain a degree of security, an account on a Compute module can be locked. Table 9 describes some of the account lockout policies. Table 9 - ControlLogix Compute Module Account Lockout Policies Policy Description Password use to unlock account...
Linux Operating System Overview Chapter 3 IPTables Settings IPTables is configured by default to DROP all incoming packets except on the local host. If your application requires network access, IPTables must be configured correctly to support the ports and protocols that your application requires.
Chapter 3 Linux Operating System Overview Settings Not Implemented On the Module Some settings in the CIS Debian Linux 8 Benchmark are not implemented in the embedded Linux OS. Table 11 describes the settings that are not implemented on the embedded Linux OS in out-of-box condition.
Linux Operating System Overview Chapter 3 Additional Considerations The following apply to a Compute module that uses the embedded Linux OS: • To run an application that accesses the backplane as a non-root user, the user that runs the application must be added to the ocxdevice group. For example, if the user engineer must be added, run the following command: usermod -a -G ocxdevice engineer.
Chapter 3 Linux Operating System Overview Information on the Module Once you load data on a Compute module, it stays on the module permanently. You cannot simply delete the data from the module. In this case, Cannot Be Erased the term data refers to an organization's intellectual property. Due to how the Linux OS manages the hard disk drive memory on the Compute module, deletion of a file does not completely remove the data from the hard disk drive.
Chapter Application Development Topic Page API Architecture CIP Messaging API Library Already Installed Four-character Alphanumeric Display API Library Calling Convention Host Application This chapter describes the ControlLogix® Compute module API, including how to use the API to develop applications the modules that use the Windows OS or Linux OS.
Page 46
Chapter 4 Application Development The backplane device driver allocates device resources, directly manipulates hardware devices, and fields device interrupts. The BPIE accesses the device driver. The BPIE is provided as a 32-bit or 64-bit DLL for the Windows OS or as a shared library for the Linux OS.
Application Development Chapter 4 CIP Messaging The BPIE contains the functionality necessary to perform CIP™ messaging over the ControlLogix backplane. The BPIE implements the following CIP components and objects: • Communications Device (CD) • Unconnected message manager (UCMM) • Message router object (MR) •...
Chapter 4 Application Development API Library The ControlLogix Compute module API library files and device driver are already installed in the embedded OS when you receive the module. You must Already Installed install only the user application. You can install the ControlLogix Compute module SDK on a computer that is used to develop an application that uses the API.
Application Development Chapter 4 Four-character The ControlLogix Compute module includes a 4-character alphanumeric display. Table 12 lists the messages that are displayed to indicate the Alphanumeric Display system status. Table 12 - Display Messages Message Description <blank> or POST codes Device driver has not yet been started (or application has written to the display) INIT...
Page 50
Chapter 4 Application Development Deprecated Functions These functions appear in the header files but are not documented in this publication: • OCXcip_ClientOpen (not supported) • OCXcip_SetEmbeddedEDSFile (not supported) • OCXcip_SetUserLED (superseded by OCXcip_SetLED) • OCXcip_GetUserLED (superseded by OCXcip_GetLED) • OCXcip_SetLED3 (superseded by OCXcip_SetLED) •...
Application Development Chapter 4 Sample Code Sample source files are supplied with the SDK to provide example applications. Import Library During development, the application must be linked with an import library that provides information about the functions that are contained within the DLL.
Chapter 4 Application Development Host Application Another process, called the host application, must host the BPIE. The host application has access to the entire range of API functions. Because it runs locally and in the same process space as the BPIE, it achieves the best performance possible.
Chapter Backplane API Library Functions Topic Page Initialization Function Category Object Registration Function Category Special Callback Registration Function Category Connected Data Transfer Function Category Tag Access Functions Messaging Functions Miscellaneous Functions Callback Functions The Backplane API library functions are listed in Table 14.
Page 54
Chapter 5 Backplane API Library Functions Table 14 - Library Functions Category Name Description Page Tag Access OCXcip_AccessTagData Read and write Logix controller tag data OCXcip_AccessTagDataAbortable Abortable version of OCXcip_AccessTagData OCXcip_CreateTagDbHandle Creates a tag database handle. OCXcip_DeleteTagDbHandle Deletes a tag database handle and releases all associated resources. OCXcip_SetTagDbOptions Sets various tag database options.
Page 55
Backplane API Library Functions Chapter 5 Table 14 - Library Functions Category Name Description Page Miscellaneous OCXcip_GetIdObject Returns data from the module’ s Identity Object OCXcip_SetIdObject Lets the application to customize certain attributes of the identity object OCXcip_GetActiveNodeTable Returns the number of slots in the local rack and identifies the slots are occupied by active modules OCXcip_MsgResponse Send the response to a unscheduled message.
Chapter 5 Backplane API Library Functions Initialization Function This section describes the Initialization functions. Category OCXcip_Open Syntax OCXcip_Open(OCXHANDLE *apiHandle); Parameters apiHandle Pointer to variable of type OCXHANDLE Description OCXcip_Open acquires access to the host API and sets apiHandle 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.
Backplane API Library Functions Chapter 5 OCXcip_OpenNB Syntax OCXcip_OpenNB(OCXHANDLE *apiHandle); Parameters apiHandle Pointer to variable of type OCXHANDLE Description OCXcip_OpenNB acquires access to the API and sets apiHandle 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.
Chapter 5 Backplane API Library Functions OCXcip_Close Syntax OCXcip_Close(OCXHANDLE apiHandle); Parameters apiHandle Handle returned by previous call to OCXcip_Open Description This function is used by an application to release control of the API. apiHandle must be a valid handle returned from OCXcip_Open. IMPORTANT Once the API has been opened, this function must always be called before exiting the application.
Backplane API Library Functions Chapter 5 Object Registration This section describes the Object Registration functions. Function Category OCXcip_RegisterAssemblyObj Syntax OCXcip_RegisterAssemblyObj( OCXHANDLE apiHandle, OCXHANDLE *objHandle, DWORD reg_param, OCXCALLBACK (*connect_proc)(), OCXCALLBACK (*service_proc)() ); Parameters apiHandle Handle returned by previous call to OCXcip_Open objHandle Pointer to variable of type OCXHANDLE.
Chapter 5 Backplane API Library Functions OCXcip_UnregisterAssemblyObj Syntax OCXcip_UnregisterAssemblyObj( OCXHANDLE apiHandle, OCXHANDLE objHandle ); Parameters apiHandle Handle returned by previous call to OCXcip_Open objHandle Handle for object to be unregistered Description This function is used by an application to unregister all instances of the Assembly Object with the API. Any current connections for the object specified by objHandle are terminated.
Backplane API Library Functions Chapter 5 Special Callback Registration This section describes the Callback Registration functions. Function Category OCXcip_RegisterFatalFaultRtn Syntax OCXcip_RegisterFatalFaultRtn( OCXHANDLE apiHandle, OCXCALLBACK (*fatalfault_proc)( ) ); Parameters apiHandle Handle returned by previous call to OCXcip_Open fatalfault_proc Pointer to fatal fault callback routine Description This function is used by an application to register a fatal fault callback routine.
Chapter 5 Backplane API Library Functions Connected Data Transfer This section describes the Connected Data Transfer functions. Function Category OCXcip_Write Connected Syntax OCXcip_WriteConnected( OCXHANDLE apiHandle, OCXHANDLE connHandle, BYTE *dataBuf, WORD offset, WORD dataSize ); Parameters apiHandle Handle returned by previous call to OCXcip_Open connHandle Handle of open connection dataBuf...
Backplane API Library Functions Chapter 5 OCXcip_ReadConnected Syntax OCXcip_ReadConnected( OCXHANDLE apiHandle, OCXHANDLE connHandle, BYTE *dataBuf, WORD offset, WORD dataSize ); Parameters apiHandle Handle returned by previous call to OCXcip_Open connHandle Handle of open connection dataBuf Pointer to buffer to receive data offset Offset of byte to begin reading dataSize...
Chapter 5 Backplane API Library Functions OCXcip_ImmediateOutput Syntax OCXcip_ImmediateOutput( OCXHANDLE apiHandle, OCXHANDLE connHandle, Parameters apiHandle Handle returned by previous call to OCXcip_Open connHandle Handle of open connection Description This function causes the output data of an open connection to be queued for transmission immediately, rather than waiting for the next scheduled transmission (based on the RPI).
Backplane API Library Functions Chapter 5 OCXcip_WriteConnectedImmediate Syntax OCXcip_WriteConnectedImmediate( OCXHANDLE apiHandle, OCXHANDLE connHandle, BYTE *dataBuf, WORD offset, WORD dataSize ); Parameters apiHandle Handle returned by previous call to OCXcip_Open connHandle Handle of open connection dataBuf Pointer to data to be written offset Offset of byte to begin writing dataSize...
Chapter 5 Backplane API Library Functions Tag Access Functions The API functions in this section can be used to access tag data within ControlLogix™ controllers. The prototypes for most of these functions and their associated data structure definitions can be found in the header file OCXTagDb.h.
Page 67
Backplane API Library Functions Chapter 5 Return Value OCX_SUCCESS All of the access requests were processed (except those whose opTypes were set to OCX_CIP_TAG_NO_OP). Check the individual access result parameters for success/fail. Else An access error occurred. Individual access result parameters not set. Example OCXHANDLE apiHandle;...
Chapter 5 Backplane API Library Functions OCXcip_AccessTagDataAbortable Syntax OCXcip_AccessTagDataAbortable( OCXHANDLE handle, char * pPathStr, WORD rspTimeout, OCXCIPTAGACCESS * pTagAccArr, WORD numTagAcc, WORD * pAbortCode) Parameters pAbortCode Pointer to abort code. This lets the application pass a large number of tags and gracefully abort between accesses.
Chapter 5 Backplane API Library Functions OCXcip_SetTagDbOptions Syntax OCXcip_SetTagDbOptions( OCXHANDLE apiHandle, OCXTAGDBHANDLE tdbHandle, DWORD optFlags, WORD structAlign) Parameters apiHandle Handle returned by previous call to OCXcip_Open. tdbHandle Handle created by previous call to OCXcip_CreateTagDbHandle. optFlags Bit masked option flags field. Multiple options can be combined (with |). OCX_CIP_TAGDBOPT_NORM_STRINGS: Normalized strings are stored as <DATA><NULL>...
Backplane API Library Functions Chapter 5 OCXcip_BuildTagDb Syntax OCXcip_BuildTagDb( OCXHANDLE apiHandle, OCXTAGDBHANDLE tdbHandle, WORD * numSymbols); Parameters apiHandle Handle returned by previous call to OCXcip_Open. tdbHandle Handle created by previous call to OCXcip_CreateTagDbHandle. numSymbols Pointer to WORD value - set to the number of discovered symbols if success. Description This function is used to retrieve a tag database from the target device.
Chapter 5 Backplane API Library Functions OCXcip_TestTagDbVer Syntax OCXcip_TestTagDbVer( OCXHANDLE apiHandle, OCXTAGDBHANDLE tdbHandle); Parameters apiHandle Handle returned by previous call to OCXcip_Open. tdbHandle Handle created by previous call to OCXcip_CreateTagDbHandle. Description This function reads the program version from the target device and compares it to the device program version read when the tag database was built.
Backplane API Library Functions Chapter 5 OCXcip_GetSymbolInfo Syntax OCXcip_GetSymbolInfo( OCXHANDLE apiHandle, OCXTAGDBHANDLE tdbHandle, WORD symId, OCXCIPTAGDBSYM * pSymInfo); Parameters apiHandle Handle returned by previous call to OCXcip_Open. tdbHandle Handle created by previous call to OCXcip_CreateTagDbHandle. symId 0 through numSymbols-1. pSymInfo Pointer to symbol info variable –...
Chapter 5 Backplane API Library Functions OCXcip_GetStructInfo Syntax OCXcip_GetStructInfo( OCXHANDLE apiHandle, OCXTAGDBHANDLE tdbHandle, WORD hStruct, OCXCIPTAGDBSTRUCT * pStructInfo); Parameters apiHandle Handle returned by previous call to OCXcip_Open. tdbHandle Handle created by previous call to OCXcip_CreateTagDbHandle. hStruct Nonzero structure handle from previous OCXcip_GetSymbolInfo or OcxCip_GetStructMbrInfo call. pStructInfo Pointer to structure info variable –...
Backplane API Library Functions Chapter 5 OCXcip_GetStructMbrInfo Syntax OCXcip_GetStructMbrInfo( OCXHANDLE apiHandle, OCXTAGDBHANDLE tdbHandle, WORD hStruct WORD mbrId OCXCIPTAGDBSTRUCTMBR * pStructMbrInfo); Parameters api Handle Handle returned by previous call to OCXcip_Open. tdb Handle Handle created by previous call to OCXcip_CreateTagDbHandle. hStruct Nonzero structure handle from previous OCXcip_GetSymbolInfo or OCXcip_GetStructMbrInfo call.
Chapter 5 Backplane API Library Functions OCXcip_GetTagDbTagInfo Syntax OCXcip_GetTagDbTagInfo( OCXHANDLE apiHandle, OCXTAGDBHANDLE tdbHandle, char * tagName, OCXCIPTAGINFO * tagInfo Parameters apiHandle Handle returned by previous call to OCXcip_Open. tdbHandle Handle created by previous call to OCXcip_CreateTagDbHandle. tagName Pointer NULL terminated tag name string. tagInfo Pointer to OCXCIPTAGINFO structure.
Backplane API Library Functions Chapter 5 OCXcip_AccessTagDataDb Syntax OCXcip_AccessTagDataDb( OCXHANDLE apiHandle, OCXTAGDBHANDLE tdbHandle, OCXCIPTAGDBACCESS ** pTagAccArr, WORD numTagAcc, WORD * pAbortCode) Parameters apiHandle Handle returned by previous call to OCXcip_Open. tdbHandle Handle created by previous call to OCXcip_CreateTagDbHandle. pTagAccArr Pointer to array of pointers to tag access definitions. tagName = Pointer to tag name string (symName[x,y,z].mbr[x].etc).
Chapter 5 Backplane API Library Functions OCXcip_SetTagAccessConnSize Syntax OCXcip_SetTagAccessConnSize ( OCXHANDLE apiHandle, int connSize) Parameters handle Handle returned by previous call to OCXcip_Open. connSize Must be one of OCX_TAGACC_CONNSIZE_SM, OCX_TAGACC_CONNSIZE_MED, or OCX_TAGACC_CONNSIZE_LG Description This function allows the connection size used for tag access to be configured. A smaller connection size results in less loading on the controller and can eliminate any redundant chassis synchronization errors.
Backplane API Library Functions Chapter 5 Messaging Functions This section describes the Messaging functions. OCXcip_GetDeviceIdObject Syntax OCXcip_GetDeviceIdObject( OCXHANDLE apiHandle, BYTE *pPathStr, OCXCIPIDOBJ *idobject WORD timeout ); Parameters api Handle Handle returned from OCXcip_Open call pPathStr Path to device being read idobject Pointer to structure receiving the Identity Object data timeout...
Chapter 5 Backplane API Library Functions OCXcip_GetDeviceICPObject Syntax OCXcip_GetDeviceICPObject( OCXHANDLE apiHandle, BYTE *pPathStr, OCXCIPICPOBJ *icpobject WORD timeout ); Parameters api Handle Handle returned from OCXcip_Open call pPathStr Path to device being read icpobject Pointer to structure receiving the ICP data timeout Number of milliseconds to wait for the read to complete Description...
Backplane API Library Functions Chapter 5 OCXcip_GetDeviceIdStatus Syntax OCXcip_GetDeviceIdStatus( OCXHANDLE apiHandle, BYTE *pPathStr, WORD *status, WORD timeout ); Parameters api Handle Handle returned from OCXcip_Open call pPathStr Path to device being read status Pointer to location receiving the Identity Object status word timeout Number of milliseconds to wait for the read to complete Description...
Page 82
Chapter 5 Backplane API Library Functions Example OCXHANDLE apiHandle; WORD status; BYTE Path[]=”p:1,s:0”; // Read Id Status from controller in slot 0 OCXcip_GetDeviceIdStatus(apiHandle, &Path, &status, 5000); printf("\n\r"); switch(Status & OCX_ID_STATUS_DEVICE_STATUS_MASK) case OCX_ID_STATUS_FLASHUPDATE: // Flash update in progress printf("Status: Flash Update in Progress"); break;...
Backplane API Library Functions Chapter 5 OCXcip_GetExDevObject Syntax OCXcip_GetExDeviceObject( OCXHANDLE apiHandle, BYTE *pPathStr, OCXCIPEXDEVOBJ *exdevobject WORD timeout ); Parameters api Handle Handle returned from OCXcip_Open call pPathStr Path to device being read exdevobject Pointer to structure receiving the extended device object data timeout Number of milliseconds to wait for the read to complete Description...
Chapter 5 Backplane API Library Functions OCXcip_GetWCTime Syntax OCXcip_GetWCTime( OCXHANDLE apiHandle, BYTE *pPathStr, OCXCIPWCT *pWCT, WORD timeout ); Parameters api Handle Handle returned from OCXcip_Open call pPathStr Path to device being accessed pWCT Pointer to OCXCIPWCT structure to be filled with Wall Clock Time data timeout Number of milliseconds to wait for the device to respond Description...
Chapter 5 Backplane API Library Functions OCXcip_SetWCTime Syntax OCXcip_SetWCTime( OCXHANDLE apiHandle, BYTE *pPathStr, OCXCIPWCT *pWCT, WORD timeout ); Parameters api Handle Handle returned from OCXcip_Open call pPathStr Path to device being accessed pWCT Pointer to OCXCIPWCT structure with Wall Clock Time data to set timeout Number of milliseconds to wait for the device to respond Description...
Page 87
Backplane API Library Functions Chapter 5 Example 1 OCXHANDLE apiHandle; BYTE Path[]=”p:1,s:0”; // controller in Slot 0 // Set the controller time to the local system time rc = OCXcip_SetWCTime(apiHandle, Path, NULL, 3000); if (rc != OCX_SUCCESS) printf("\n\rOCXcip_SetWCTime failed: %d\n\r", rc); Example 2 OCXHANDLE apiHandle;...
Chapter 5 Backplane API Library Functions OCXcip_GetWCTimeUTC Syntax OCXcip_GetWCTime( OCXHANDLE apiHandle, BYTE *pPathStr, OCXCIPWCT *pWCT, WORD timeout ); Parameters api Handle Handle returned from OCXcip_Open call pPathStr Path to device being accessed pWCT Pointer to OCXCIPWCTUTC structure to be filled with Wall Clock Time data timeout Number of milliseconds to wait for the device to respond Compatibility...
Page 89
Backplane API Library Functions Chapter 5 Return Value OCX_SUCCESS WCT information has been read successfully OCX_ERR_NOACCESS apiHandle does not have access OCX_ERR_MEMALLOC Not enough memory is available OCX_ERR_BADPARAM An invalid parameter was passed OCX_ERR_NODEVICE The device does not exist OCX_CIP_INVALID_REQUEST The device does not support the WCT object Example OCXHANDLE...
Chapter 5 Backplane API Library Functions OCXcip_SetWCTimeUTC Syntax OCXcip_SetWCTimeUTC( OCXHANDLE apiHandle, BYTE *pPathStr, OCXCIPWCTUTC *pWCT, WORD timeout ); Parameters api Handle Handle returned from OCXcip_Open call pPathStr Path to device being accessed pWCT Pointer to OCXCIPWCTUTC structure with Wall Clock Time data to set timeout Number of milliseconds to wait for the device to respond Compatibility...
Page 91
Backplane API Library Functions Chapter 5 Example 1 OCXHANDLE apiHandle; BYTE Path[]=”p:1,s:0”; // controller in Slot 0 rc = OCXcip_SetWCTimeUTC(apiHandle, Path, NULL, 3000); if (rc != OCX_SUCCESS) printf("\n\rOCXcip_SetWCTimeUTC failed: %d\n\r", rc); Example 2 OCXHANDLE apiHandle; OCXCIPWCTUTC Wct; BYTE Path[]=”p:1,s:0”; // controller in Slot 0 // Set the controller time to current GMT using SystemTime GetSystemTime(&Wct.SystemTime);...
Chapter 5 Backplane API Library Functions OCXcip_PLC5TypedRead Syntax OCXcip_PLC5TypedRead( OCXHANDLE apiHandle, BYTE *pPathStr, void *pDataDest, BYTE *pSourceStr, WORD NumElements, WORD timeout ); Parameters api Handle Handle returned from OCXcip_Open call pPathStr Path to device being read pDataDest Pointer to an array into which the retrieved data is stored pSourceStr Pointer to an ASCII string representation of the desired data file in the PLC5 NumElements...
Page 93
Backplane API Library Functions Chapter 5 Example OCXHANDLE apiHandle; WORD ReadData[100]; WORD timeout; BYTE SourceStr[32]; BYTE PathStr[32]; WORD NumElements; // Read 5 elements of data from file type integer N10 in PLC5 at IP // address 10.0.104.123. Start at the fourth element of N10. sprintf((char *)PathStr, "p:1,s:3,p:2,t:10.0.104.123");// Set path sprintf((char *)SourceStr,"N10:5");...
Chapter 5 Backplane API Library Functions OCXcip_PLC5TypedWrite Syntax OCXcip_PLC5TypedWrite( OCXHANDLE apiHandle, BYTE *pPathStr, BYTE *pDataDestStr, void *pSourceData, WORD NumElements, WORD timeout ); Parameters api Handle Handle returned from OCXcip_Open call pPathStr Path to device being written pDataDest Pointer to an ASCII string representation of the desired data file in the PLC5 pSourceStr Pointer to an array from which the data to be written is retrieved NumElements...
Backplane API Library Functions Chapter 5 OCXcip_PLC5WordRangeWrite Syntax OCXcip_PLC5WordRangeWrite( OCXHANDLE apiHandle, BYTE *pPathStr, BYTE *pDataDestStr, void *pSourceData, WORD NumElements, WORD timeout ); Parameters api Handle Handle returned from OCXcip_Open call pPathStr Path to device being written pDataDestStr Pointer to an ASCII string representation of the desired data file in the PLC5 pSourceData Pointer to an array from which the data to be written is retrieved NumElements...
Chapter 5 Backplane API Library Functions OCXcip_PLC5WordRangeRead Syntax OCXcip_PLC5WordRangeRead( OCXHANDLE apiHandle, BYTE *pPathStr, void *pDataDest, BYTE *pSourceStr, WORD NumElements, WORD timeout ); Parameters api Handle Handle returned from OCXcip_Open call pPathStr Path to device being read pDataDest Pointer to an array into which the data is stored pSourceStr Pointer to an ASCII string representation of the desired data file in the PLC5 NumElements...
Page 97
Backplane API Library Functions Chapter 5 Example OCXHANDLE apiHandle; WORD ReadData[100]; WORD timeout; BYTE SourceStr[32] BYTE PathStr[32]; WORD NumElements; // Read the accumulator value of the 4th timer in file T4 // in the PLC5 at IP address 10.0.104.123 sprintf((char *)PathStr, "p:1,s:3,p:2,t:10.0.104.123");// Set path sprintf((char *)SourceStr,"T4:4.ACC");...
Chapter 5 Backplane API Library Functions OCXcip_PLC5ReadModWrite Syntax OCXcip_PLC5ReadModWrite ( OCXHANDLE apiHandle, BYTE *pPathStr, OCX_CIP_PLC5_RMW_CMD *pDataArray, WORD numAddrs, WORD timeout ); Parameters apiHandle Handle returned from OCXcip_Open call pPathStr Path to device being read pDataArray Pointer to the array containing pointers to the symbolic file addresses and their associated AND and OR masks for the read-modify-write process.
Page 99
Backplane API Library Functions Chapter 5 Example OCXHANDLE apiHandle; OCX_CIP_PLC5_RMW_CMD DataArray[2]; WORD timeout; BYTE PathStr[32]; WORD numAddrs; BYTE AddrStr1[10]; BYTE AddrStr2[10]; // Set bits 5, 10 and 11 at the PLC5 address ‘N7:9’and clear // the output bits 4,5 and 12 at the PLC5 address ‘O:167’ // in the PLC5 at IP address 10.0.104.123 sprintf((char *)PathStr, "p:1,s:3,p:2,t:10.0.104.123");// Set pat sprintf((char *)AddrStr1, "N7:9");...
Chapter 5 Backplane API Library Functions OCXcip_SLCProtTypedRead Syntax OCXcip_SLCProtTypedRead ( OCXHANDLE apiHandle, BYTE *pPathStr, void *pDataDest, BYTE *pSourceStr, WORD NumElements, WORD timeout ); Parameters apiHandle Handle returned from OCXcip_Open call pPathStr Path to device being read pDataDest Pointer to an array into which the data is stored pSourceStr Pointer to an ASCII string representation of the desired data file in the SLC NumElements...
Backplane API Library Functions Chapter 5 OCXcip_SLCProtTypedWrite Syntax OCXcip_SLCProtTypedWrite ( OCXHANDLE apiHandle, BYTE *pPathStr, BYTE *pDataDestStr, void *pSourceData, WORD NumElements, WORD timeout ); Parameters apiHandle Handle returned from OCXcip_Open call pPathStr Path to device being written pDataDestStr Pointer to an ASCII string representation of the desired data file in the SLC pSourceData Pointer to an array from which the data to be written is retrieved NumElements...
Page 102
Chapter 5 Backplane API Library Functions Example OCXHANDLE apiHandle; WORD WriteData[100]; WORD timeout; BYTE pDataDestStr[32]; BYTE PathStr[32]; WORD NumElements; // Write 5 elements of data from WriteData array to file type integer // N10 in SLC at IP address 10.0.104.123. Start at the 1st element. sprintf((char *)PathStr, "p:1,s:3,p:2,t:10.0.104.123");// Set path sprintf((char *) pDataDestStr,"N10:0");...
Backplane API Library Functions Chapter 5 OCXcip_SLCReadModWrite Syntax OCXcip_SLCReadModWrite ( OCXHANDLE apiHandle, BYTE *pPathStr, BYTE *pDataDestStr, void *pSourceData, WORD *pSourceBitMask, WORD timeout ); Parameters apiHandle Handle returned from OCXcip_Open call pPathStr Path to device being written pDataDestStr Pointer to an ASCII string representation of the desired data file in the SLC pSourceData Pointer to a WORD value containing the desired bit values for the destination pSourceBitMask...
Page 104
Chapter 5 Backplane API Library Functions Example OCXHANDLE apiHandle; WORD WriteData; WORD BitMask; WORD timeout; BYTE pDataDestStr[32]; BYTE PathStr[32]; // Set to 1 the value of bit numbers 4 and 11 of word 5 of the integer // file N7 in the SLC at IP address 10.0.104.123. Set to 0 the value // of bit 14 in that same location sprintf((char *)PathStr, "p:1,s:3,p:2,t:10.0.104.123");// Set path sprintf((char *) pDataDestStr,"N7:5");...
Backplane API Library Functions Chapter 5 Miscellaneous Functions This section describes the Miscellaneous functions. OCXcip_GetIdObject Syntax OCXcip_GetIdObject(OCXHANDLE apiHandle, OCXCIPIDOBJ *idobject); Parameters api Handle Handle returned from OCXcip_Open call idobject Pointer to structure of type OCXCIPIDOBJ Description OCXcip_GetIdObject retrieves the identity object for the module. apiHandle must be a valid handle returned from OCXcip_Open. idobject is a pointer to a structure of type OCXCIPIDOBJ.
Chapter 5 Backplane API Library Functions OCXcip_SetIdObject Syntax OCXcip_SetIdObject(OCXHANDLE apiHandle, OCXCIPIDOBJ *idobject); Parameters api Handle Handle returned from OCXcip_Open call idobject Pointer to structure of type OCXCIPIDOBJ Description OCXcip_SetIdObject lets an application customize the identity object for the module. apiHandle must be a valid handle returned from OCXcip_Open.
Backplane API Library Functions Chapter 5 OCXcip_GetActiveNodeTable Syntax OCXcip_GetActiveNodeTablet( OCXHANDLE apiHandle, int *rackSize, DWORD *ant); Parameters apiHandle Handle returned from OCXcip_Open call rackSize Pointer to integer into which is written the number of slots in the local rack Pointer to DWORD into which is written a bit array corresponding to the slot occupancy of the local rack (bit 0 corresponds to slot 0) Description OCXcip_GetActiveNodeTable returns information about the size and occupancy of the local rack.
Chapter 5 Backplane API Library Functions OCXcip_MsgResponse Syntax OCXcip_MsgResponse( OCXHANDLE apiHandle, DWORD msgHandle, BYTE serviceCode, BYTE *msgBuf, WORD msgSize, BYTE returnCode, WORD extendederr ); Parameters apiHandle Handle returned from OCXcip_Open call msgHandle Handle returned in OCXCIPSERVSTRUC serviceCode Message service code returned in OCXCIPSERVSTRUC msgBuf Pointer to buffer containing data to be sent with response (NULL if none) msgSize...
Backplane API Library Functions Chapter 5 OCXcip_GetVersionInfo Syntax OCXcip_GetVersionInfo(OCXHANDLE handle, OCXCIPVERSIONINFO *verinfo); Parameters handle Handle returned by previous call to OCXcip_Open verinfo Pointer to structure of type OCXCIPVERSIONINFO Description OCXcip_GetVersionInfo retrieves the current version of the API library, BPIE, and the backplane device driver. The information is returned in the structure verinfo.
Chapter 5 Backplane API Library Functions OCXcip_GetLED Syntax OCXcip_GetLED(OCXHANDLE handle, int lednum, int *ledstate); Parameters handle Handle returned by previous call to OCXcip_Open lednum Selects which LED to set state. For example, 0 = OK, 1 = User1, 2 = User2 ledstate Pointer to a variable to receive LED state Description...
Backplane API Library Functions Chapter 5 OCXcip_GetDisplay Syntax OCXcip_GetDisplay(OCXHANDLE handle, char *display_string); Parameters handle Handle returned by previous call to OCXcip_Open display_string Pointer to buffer to receive displayed string Description OCXcip_GetDisplay returns the string that is currently displayed on the alphanumeric display. handle must be a valid handle returned from OCXcip_Open.
Chapter 5 Backplane API Library Functions OCXcip_SetModuleStatus Syntax OCXcip_SetModuleStatus(OCXHANDLE handle, int status); Parameters handle Handle returned by previous call to OCXcip_Open status Module status Description OCXcip_SetModuleStatus lets an application set the status of the module’s status LED indicator. handle must be a valid handle returned from OCXcip_Open.
Backplane API Library Functions Chapter 5 OCXcip_CalculateCRC Syntax OCXcip_CalculateCRC ( BYTE *dataBuf, DWORD dataSize, WORD *crc ); Parameters dataBuf Pointer to buffer of data dataSize Number of bytes of data Pointer to 16-bit word to receive CRC value Description OCXcip_CalculateCRC computes a 16-bit CRC for a range of data. This can be useful for validating a block of data; for example, data retrieved from the battery-backed Static RAM.
Chapter 5 Backplane API Library Functions Callback Functions The functions in this section are not part of the API, but must be implemented by the application. The API calls the connect_proc or service_proc functions when connection or service requests are received for the registered object. The optional fatalfault_proc function is called when the backplane device driver detects a fatal fault condition.
Page 115
Backplane API Library Functions Chapter 5 Description consumerCP is the consumer connection point from the open request. This corresponds to the Output Instance on the RSLogix 5000 generic profile. lOTApi is a pointer to the originator-to-target actual packet interval for this connection, expressed in microseconds. This is the rate at which connection data packets are received from the originator.
Chapter 5 Backplane API Library Functions service_proc Syntax OCXCALLBACK service_proc( OCXHANDLE objHandle, OCXCIPSERVSTRUC *sServ ); Parameters objHandle Handle of registered object sServ Pointer to structure of type OCXCIPSERVSTRUC Description service_proc is a callback function that is passed to the API in the OCXcip_RegisterAssemblyObj call. The API calls the service_proc function when an unscheduled message is received for the registered object specified by objHandle.
Backplane API Library Functions Chapter 5 Example OCXHANDLE Handle; OCXCALLBACK service_proc( OCXHANDLE objHandle, OCXCIPSERVSTRUC *sServ ) // Select which instance is being accessed. // The application defines how each instance is defined. switch(sServ->instance) case 1: // Instance 1 // Check serviceCode and attribute; perform // requested service if appropriate break;...
Chapter 5 Backplane API Library Functions resetrequest_proc Syntax OCXCALLBACK resetrequest_proc( ); Parameters None Description resetrequest_proc is an optional callback function that can be passed to the API in the OCXcip_RegisterResetReqRtn call. If the resetrequest_proc callback has been registered, it is called if the backplane device driver receives a module reset request (Identity Object reset service).
Page 119
Appendix Program-controlled Status Indicators The ControlLogix® Compute modules have the following to indicate the module conditions: • Four-character Display • Status Indicators The user program controls the display and indicators. When the module powers up, the following occurs. 1. The right-most status indicator is solid red and the others are off. 2.
Appendix A Program-controlled Status Indicators Four-character Display The ControlLogix Compute module includes a 4-character alphanumeric display. An application uses the OCXcip_SetDisplay on page 110 function to show the 4-character message on the display. Table 15 lists the messages that are displayed. Table 15 - Display Messages Message Description...
Page 121
Appendix Specify the Communication Path To construct a communications path, enter one or more path segments that lead to the target device. Each path segment goes from one module to another module over the chassis backplane or over an EtherNet/IP network. Each path segment contains: p:x,{s,c,t}:y Where: p:x specifies the device’s port number to communicate through.
Appendix Module Tag Naming Conventions ControlLogix® tags are in the following categories: • Controller Tags • Program Tags Controller Tags Controller tags have global scope. To access a controller scope tag, you specify the tag name. Table 17 - Example Controller Tags Tag Name Single Tag Array[11]...
Appendix C Module Tag Naming Conventions Program Tags Program Tags are tags that are declared in a program and scoped only within the program in which they are declared. To address a Program Tag correctly, you must specify the identifier “PROGRAM:”...
Index … account lockout in Windows OS 32 hardware 11 4-character display 11 … battery 11 architecture 45 DisplayPort 11 components 45 Ethernet ports 11 functions 47 memory 11 … library 48 … module connections 16 reset button 11 rotary switches 11 status indicators 11 battery USB 3.0 port 11...
Page 126
Index network connections screen saver connect to an EtherNet/IP network 19 Windows OS 30 set the IP address 20 network policies in Windows OS 32 install 48 remove 48 security settings … Linux OS 38 … Windows OS 28 out-of-box configuration set the IP address 20 embedded OS 28 system status...
Page 128
How Are We Doing? form at http://literature.rockwellautomation.com/idc/groups/literature/documents/du/ra-du002_-en-e.pdf. Rockwell Automation maintains current product environmental information on its website at http://www.rockwellautomation.com/rockwellautomation/about-us/sustainability-ethics/product-environmental-compliance.page. Allen-Bradley, ControlLogix, Rockwell Automation, Rockwell Software are trademarks of Rockwell Automation, Inc. Trademarks not belonging to Rockwell Automation are property of their respective companies.
Need help?
Do you have a question about the ControlLogix 1756-CMS1B1 and is the answer not in the manual?
Questions and answers