1 / 10

SPiiPlus Training Class

SPiiPlus Training Class. Host Programming. Host Programming Overview. ACS provides a C library and COM library for programming host applications in Windows C Library: Can be used with C / C++ programs (unmanaged)

wesley
Download Presentation

SPiiPlus Training Class

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SPiiPlus Training Class Host Programming

  2. Host Programming Overview • ACS provides a C library and COM library for programming host applications in Windows • C Library: • Can be used with C / C++ programs (unmanaged) • Uses remote procedure calls to the user-mode driver to communicate with the controller • COM Library: • Can be used with any .NET language and LabView • Wrapper of the C library

  3. Host Programming Overview PC COM Application COM Library C / C++ Application C Library User Mode Driver Controller

  4. Host Programming Features • Most Windows version support • C & COM library support same functions/methods • Supports multiple threads • Unified support for all communication channels (Serial, Ethernet) • A rich set of C/COM library functions/methods that are also supported by SPiiPlus Controller Simulator • Concurrent support for up to 10 communication channels in one application • Acknowledgement for each command sent to the controller • Communication history/log • Separate processing of unsolicited messages

  5. Host Programming Features • SPiiPlus C Library Features: • Waiting (synchronous) or Non-waiting (asynchronous) calls • Callback functions for predefined controller events • SPiiPlus COM Library Features: • Generates COM events for predefined controller events • Supports a COM error object to provide rich error information • Automation support for VBScript, Internet Explorer, Excel, Word and other environments

  6. Host Library Features • Communication & Communication Services • ACSPL+ Program Management • Read & Write Variables / Variable Management • Multiple Thread Synchronization • History & Unsolicited Messages Buffer Management • System Configuration • Setting & Reading Motion Parameters • Axis/Motor Management & Status • Motion Management • Multiple Motion Types • Data Collection • Input/Output Status • Safety Control • Wait-for-Condition • Callback & Event Handling • Error Diagnosis

  7. SPiiPlus C/COM Library Examples • Examples included with SPiiPlus NT Suite v2.10: • SPiiPlus C Library Examples • Visual C++ • Reciprocated_VS2008 • Terminal_VS2008 • SPiiPlus COM Library Examples • .NET • COM Library Demo VS2005 • Enable Event VS2005 • Enable Event VS2008 • ReadWriteVariable VS2005 • ReadWriteVariable VS2008 • LabVIEW 7.X/8.X • CheckError • COM Library Demo • Enable Event • PROGRAMEND Callback • ReadWriteVariable • VBScript • COM Library Demo • Enable Event • ReadWriteVariable • Visual Basic • COM Library Demo VB6 • Enable Event VB6 • ReadWriteVariable VB6

  8. Important Files / Programs • ACSCSRV.exe • User-mode driver for high-level communication support • Resides in User Mode Driver folder • ACSCL_x86.dll / ACSCL_x64.dll • Dynamic link libraries that contain API functions for C library • Resides in System32 Windows folder • ACSCL_x86.lib / ACSCL_x64.lib • Static LIB file required for a C / C++ project to access the DLLs • Resides in ACSC folder • ACSC.h • C header file with API function and constants declarations • Resides in ACSC folder • SPiiPlusCOM660_x86.dll / SPiiPlusCOM660_x64.dll • Resides in Common Files folder

  9. Host Programming Example: 1 • Write a host application that connects to the Ethernet simulator, enables axis 1, does a point-to-point motion to 1000, and disconnects. • Connect to the Ethernet simulator with the MMI Application Studio and move axis 1 to position 0. Then open a watch window and monitor the feedback position (FPOS) • Run your host application.

  10. Host Programming Example: 2 • Write a host application that connects to the Ethernet simulator, starts buffer 5 on line 1, waits for buffer 5 to finish, and reads the feedback position of axis 1 and displays it to the user. • Write an ACSPL+ program in buffer 5 that will enable axis 1, move the axis to position 1000, wait until the motion is complete, and then stop. • Run you your host application.

More Related