|
Is it possible to do a RFC call from SAP directly
to a PLC? Or does that depend on the PLC?
Suggestion: This will depends on the PLC (sounds an interesting project). If the language used to control the PLC is RFC or CPIC enabled it should work. As for an example of an RFC enabled function module, the only real difference between that and any other module is that the RFC Enabled radio button is checked in the attributes, and all parameters are passed by Value. It is also a good idea to use strings for your parameters rather than binary data (ie convert your numbers to strings). To give you some idea of programming from the PLC end, here are some functions in VBA that will point you in the right direction: Logon to SAP: ***************************************************************************
Function Logon_To_Sap(System As String, Client As String, User As String, Password As String, Router As String) As Object Dim Sap
As Object
iUser
= User
Set Sap = CreateObject("SAP.Functions") Sap.Connection.ApplicationServer
= iSystem
Set Logon_To_Sap
= Sap
And finally, an RFC call using standard and table parameters: *
Function SAP_Read_Abap_Source(Abap_Name As String) As String() *
Dim R3
As Object
Call Push_Status("Reading Source For " & Abap_Name) If Not R3 Is Nothing Then
Set Table_Factory = CreateObject("Sap.TableFactory.1")
If Source_Table.CreateFromR3Repository(R3.Connection, "ZSOURCE_LINE", "T_SOURCE_LINES")
= True Then
Set Table_Row
= Nothing
Call Pop_Status SAP_Read_Abap_Source = Module_Source() End Function Notes: What are PLCs and how do they work? PLCs are often defined as miniature industrial computers that contain hardware and software that is used to perform control functions. A PLC consists of two basic sections: the central processing unit (CPU) and the input/output interface system. The CPU, which controls all PLC activity, can further be broken down into the processor and memory system. The input/output system is physically connected to field devices (e.g., switches, sensors, etc.) and provides the interface between the CPU and the information providers (inputs) and controllable devices (outputs). To operate, the CPU "reads" input data from connected field devices through the use of its input interfaces, and then "executes", or performs the control program that has been stored in its memory system. Programs are typically created in ladder logic, a language that closely resembles a relay-based wiring schematic, and are entered into the CPU's memory prior to operation. Finally, based on the program, the PLC "writes", or updates output devices via the output interfaces. This process, also known as scanning, continues in the same sequence without interruption, and changes only when a change is made to the control program. |
|
Read Also
Get help for your ABAP problems
ABAP Books
More ABAP Tips
SAP ERP Modules, Basis, ABAP and Other IMG Stuff All the site contents are Copyright © www.erpgreat.com
and the content authors. All rights reserved.
|