13.07.2015 Views

3964R_RK512_01.lib - Wago

3964R_RK512_01.lib - Wago

3964R_RK512_01.lib - Wago

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Appendix A - Other librariesWAGO-I/O-PRO 32 library<strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong>The Library "<strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong>" contains the function modules"PROCEDURE_<strong>3964R</strong>", "<strong>RK512</strong>_ACTIVE", "<strong>RK512</strong>_ACTIVE_EN","<strong>RK512</strong>_PASSIVE", "<strong>RK512</strong>_PASSIVE_EN" und "<strong>RK512</strong>_ACTIVE_PASSiVE_EN".The module "PROCEDURE_<strong>3964R</strong>", expands the functionality of aprogrammable fieldbus controller by adding the functionality of procedure<strong>3964R</strong>.The modules "<strong>RK512</strong>_ACTIVE" and "<strong>RK512</strong>_ACTIVE_EN" work on the"PROCEDURE_<strong>3964R</strong>" and enables the sending (SEND) and fetching (FETCH)of data to and from a communication partner per <strong>RK512</strong> protocol.The modules "<strong>RK512</strong>_PASSIVE" and "<strong>RK512</strong>_PASSIVE_EN" (RECEIVE) workon "PROCEDURE_<strong>3964R</strong>" and prepare data fields for writing (SEND) andfetching (FETCH) of data by a communication partner per <strong>RK512</strong> protocol.The jobs SEND DB and FETCH DB are supported.The Module "<strong>RK512</strong>_ACTIVE_PASSIVE_EN" works on "PROCEDURE_<strong>3964R</strong>"and combines the functions SEND, FETCH, and RECEIVE.Sequence telegrams are not supported.This library is compatible with 3964r_<strong>01.lib</strong> and expands the same.WAGO-I/O-PRO 32 Version 1.0.2 <strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong> - 1


PROCEDURE_<strong>3964R</strong>2 – <strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong> ml00401d WAGO-I/O-PRO 32


Appendix A - Other librariesContent<strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong> 4PROCEDURE_<strong>3964R</strong> ................................................................................. 4typ<strong>3964R</strong>_BUFFER (data type) .................................................................. 9enum<strong>3964R</strong>_ERROR(Enum) .................................................................... 10<strong>RK512</strong>_ACTIVE ....................................................................................... 12<strong>RK512</strong>_ACTIVE_EN................................................................................ 15enum<strong>RK512</strong>_COMMAND (Enum)........................................................... 18<strong>RK512</strong>_PASSIVE...................................................................................... 19<strong>RK512</strong>_PASSIVE_EN .............................................................................. 22typDB (data type)....................................................................................... 25typ<strong>RK512</strong>_DB_Field (data type)............................................................... 26<strong>RK512</strong>_ACTIVE_PASSIVE_EN.............................................................. 27WAGO-I/O-PRO 32 Version 1.0.2 <strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong> - 3


PROCEDURE_<strong>3964R</strong><strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong>PROCEDURE_<strong>3964R</strong>WAGO-I/O-PRO 32 library elementsCategory:CommunicationName:PROCEDURE_<strong>3964R</strong>Type: Function Function block X ProgramLibrary name:<strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong>Libraries usedSerComm.libSerial_Interface_<strong>01.lib</strong>Standard.libApplicable to:Programmable fieldbus controllersexcept Modbus controller(750-812; 750–814; 750–815; 750–816)Input parameters: Data type: Comments:bCOM_PORT BYTE Port number of the interface0x01 -> service interface0x02 -> 1st plugged serial modular terminal0x03 -> 2nd plugged serial modular terminal andso oncbCOM_BAUDRATEcpCOM_PARITYcsCOM_STOPBITScbsCOM_BYTESIZEcfCOM_FLOW_CONTROLCOM_BAUDRATECOM_PARITYCOM_STOPBITSCOM_BYTESIZECOM_FLOW_CONTROLxHIGH_PRIORITY BOOL Participant priorityBAUD_1200 := 120,BAUD_2400 := 240,BAUD_4800 := 480,BAUD_9600 := 960,BAUD_19200 := 1920,BAUDRATE_TERMINAL_DEFAULT := 0x7FFFPARITY_NO:=0,PARITY_ODD:=1,PARITY_EVEN:=2,PARITY_TERMINAL_DEFAULT := 0x7FFFSTOPBITS_1 := 1,STOPBITS_2 := 2,STOPBITS_TERMINAL_DEFAULT := 0x7FFFBS_7 :=7,BS_8 :=8,BYTESIZE_TERMINAL_DEFAULT := 0x7FFFNO_FLOW_CONTROL :=0,XON_XOFF :=1,RTS_CTS:=2,FLOW_CONTROL_TERMINAL_DEFAULT :=0x7FFF4 – <strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong> ml00401d WAGO-I/O-PRO 32


Appendix A - Other librariesWAGO-I/O-PRO 32 library elementsOutput parameter: Data type: Comments:ERRORenum<strong>3964R</strong> ERR_<strong>3964R</strong>_NO_ERROR := 0,_ERROR ERR_<strong>3964R</strong>_CHAR_DELAY := 1,ERR_<strong>3964R</strong>_FRAME_TO_LONG := 2,ERR_<strong>3964R</strong>_BCC_ERROR := 3,ERR_<strong>3964R</strong>_BLOCK_DELAY := 4,ERR_<strong>3964R</strong>_RECEIPT_DELAY := 5,ERR_<strong>3964R</strong>_UNEXPECTED_CHAR := 6,ERR_<strong>3964R</strong>_CONNECT_ERROR := 7,ERR_<strong>3964R</strong>_CONFIRMATION_ERROR := 8,ERROR_RK_OUT_OF_RANGE :=16#0010,ERROR_RK_NOT_SUPPORTED :=16#0020,ERROR_RK_UNKNOWN_TELE := 16#0030,ERROR_RK_TELE_LENGTH := 16#0040,ERROR_RK_KM_BUSY := 16#0050,ERROR_RK_UNKNOWN_COMMAND :=16#0060,ERROR_RK_INVALID_QUANTITY := 16#0070,ERROR_RK_TIME_OUT_RESPONSE:= 16#0080,ERROR_RK_UNKNOWN_OBJECT := 16#0090,ERROR_RK_REMOTE_STATION := 16#0100,ERR_COMPORT:= 16#FFnnInput/output parameter: Data type: Comments:xNEW_DATA_RECEIVED BOOL Upon receipt of a telegram, this parameter is set toTRUEby the module, informing the user of thereceipt of a telegram.Upon acceptance of the data, the application mustdelete this parameter.utRECEIVE_BUFFERtyp<strong>3964R</strong>_BUFFERTYPE typ<strong>3964R</strong>_BUFFER :STRUCTCount : INT; (*Number of valid bytes*)Data : ARRAY[0..127] OF BYTE;END_STRUCTEND_TYPEutSEND_BUFFERtyp<strong>3964R</strong>_BUFFERTYPE typ<strong>3964R</strong>_BUFFER :STRUCTCount : INT; (*Number of valid bytes*)Data : ARRAY[0..127] OF BYTE;END_STRUCTEND_TYPExSEND_DATA BOOL A single setting of this parameter triggers a sendjob.The module deletes this parameter uponconclusion of the job.WAGO-I/O-PRO 32 Version 1.0.2 <strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong> - 5


PROCEDURE_<strong>3964R</strong>Graphical representation:WAGO-I/O-PRO 32 library elementsFunction description:The function module „PROCEDURE_<strong>3964R</strong>“ must be called cyclically in the main program.The module supports the communication between a serial connection and a communicationpartner using the <strong>3964R</strong> protocol.The driver operates under the following reaction times:QVZ = 2 sec acknowledgement delayZVZ = 220 ms character delayBVZ = 4 sec block delaySYZ = 1 sec synchronization delayNote:If the cycle time of the user program is too long, errors may occur in the communication(possibly use of task system at 841).6 – <strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong> ml00401d WAGO-I/O-PRO 32


Appendix A - Other librariesWAGO-I/O-PRO 32 library elementsReceive message:Via the parameter “xNEW_DATA_RECEIVED” = TRUE, the user is informedthat a telegram has been received.The user program now calls parameter “ERROR” “ERR_<strong>3964R</strong>_NO_ERROR”and assumes, if no error is present,the number of valid characters as indicated by the receive structure element “Count”from the receive structure array “Data”.Subsequently, the user program must delete the parameter“xNEW_DATA_RECEIVED”.Code example: IF xNEW_DATA_RECEIVED = TRUE THENIF ERROR = ERR_<strong>3964R</strong>_NO_ERROR THENFOR I := 0 to (utRECEIVE_BUFFER.Count – 1) DOEND_FOR(* data utRECEIVE_BUFFER.Data[ I ] accept *)xNEW_DATA_RECEIVED := FALSE;END_IF (* NO ERROR *)END_IF (* data received*)Note: If the parameter “xNEW_DATA_RECEIVED” is not deleted, thenext valid telegram will still be written to the receive buffer and previous data are overwrittenWAGO-I/O-PRO 32 Version 1.0.2 <strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong> - 7


PROCEDURE_<strong>3964R</strong>WAGO-I/O-PRO 32 library elementsSend message:Via the parameter “xSEND_DATA” = FALSE, the user checks whether the module isready to accept a send job.If the module is ready to send, the user transfers his user data in thesend structure array "Data“ as well as the number of bytes to be sent inthe send structure element "Count“ and trigger the job by setting the parameter "xSEND_DATA“ .Upon execution of the job, the module automatically triggers the parameter"xSEND_DATA“, signaling the user the execution of the job.The user can now verify the error-free execution by testing the parameter "ERROR“.Code example: IF xSEND_DATA = FALSE THEN(* prepare send data *)utSEND_BUFFER.Data[ 0 ] := 16#01;utSEND_BUFFER.Data[ 1 ] := 16#02;utSEND_BUFFER.Data[ 2 ] := 16#03;(* enter number of data to be sent *)utSEND_BUFFER.Count := 3;(* trigger job *)xSEND_DATA := TRUE;END_IF (* ready to send *)8 – <strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong> ml00401d WAGO-I/O-PRO 32


typ<strong>3964R</strong>_BUFFER (data type)Appendix A - Other librariesWAGO-I/O-PRO 32 library elementsCategory:Name:typ<strong>3964R</strong>_BUFFERType: Data type X EnumerationLibrary name:<strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong>Structure:Element: Data type: Description:Count INT Number of characters in thearrayData ARRAY[0..127] OF BYTE Byte array for user dataDeclaration:TYPE typ<strong>3964R</strong>_BUFFER :STRUCTCount : INT;Data : ARRAY[0..127] OF BYTE;END_STRUCTEND_TYPEDescription:This structure supports the data exchange to the user.WAGO-I/O-PRO 32 Version 1.0.2 <strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong> - 9


enum<strong>3964R</strong>_ERROR(Enum)enum<strong>3964R</strong>_ERROR(Enum)WAGO-I/O-PRO 32 library elementsCategory:Name:enum<strong>3964R</strong>_ERRORType: Data type Enumeration XLibrary name:<strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong>Elements: Value: Comments:ERR_<strong>3964R</strong>_NO_ERROR 16#0000 No errorERR_<strong>3964R</strong>_CHAR_DELAY 16#0001 Character delay time exceededERR_<strong>3964R</strong>_FRAME_TO_LONG 16#0002 Wrong frame lengthERR_<strong>3964R</strong>_BCC_ERROR 16#0003 Checksum errorERR_<strong>3964R</strong>_BLOCK_DELAY 16#0004 Block delay time exceededERR_<strong>3964R</strong>_RECEIPT_DELAY 16#0005 Data acknowledgement errorERR_<strong>3964R</strong>_UNEXPECTED_CHAR 16#0006 Unexpected character receivedERR_<strong>3964R</strong>_CONNECT_ERROR 16#0007 Connection errorERR_<strong>3964R</strong>_CONFIRMATION_ERROR 16#0008 Acknowledgement errorERROR_RK_OUT_OF_RANGE 16#0010 Data > data bufferERROR_RK_NOT_SUPPORTED 16#0020 Service not supportedERROR_RK_UNKNOWN_TELE 16#0030 Unknown telegramERROR_RK_TELE_LENGTH 16#0040 Unexpected telegram lengthERROR_RK_KM_BUSY 16#0050 Coupling marker not freeERROR_RK_UNKNOWN_COMMAND 16#0060 Unsupported jobERROR_RK_INVALID_QUANTITY 16#0070 Inadmissibly quantityERROR_RK_TIME_OUT_RESPONSE 16#0080 Reaction telegram not receivedERROR_RK_UNKNOWN_OBJECT 16#0090 Unknown or unsupported objectERROR_RK_REMOTE_STATION 16#0100 Error from partner in header reactiontelegramERR_COMPORT 16#FFnn Error from serial interface L-Byte ->error number from Sercom.lib10 – <strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong> ml00401d WAGO-I/O-PRO 32


Appendix A - Other librariesDeclaration:TYPE enum<strong>3964R</strong>_ERROR :( ERR_COMPORT := 16#FF00,ERR_<strong>3964R</strong>_NO_ERROR := 16#0000,ERR_<strong>3964R</strong>_CHAR_DELAY := 16#0001,ERR_<strong>3964R</strong>_FRAME_TO_LONG := 16#0002,ERR_<strong>3964R</strong>_BCC_ERROR := 16#0003,ERR_<strong>3964R</strong>_BLOCK_DELAY := 16#0004,ERR_<strong>3964R</strong>_RECEIPT_DELAY := 16#0005,ERR_<strong>3964R</strong>_UNEXPECTED_CHAR := 16#0006,ERR_<strong>3964R</strong>_CONNECT_ERROR := 16#0007,ERR_<strong>3964R</strong>_CONFIRMATION_ERROR := 16#0008,ERROR_RK_OUT_OF_RANGE := 16#0010,ERROR_RK_NOT_SUPPORTED := 16#0020,ERROR_RK_UNKNOWN_TELE := 16#0030,ERROR_RK_TELE_LENGTH := 16#0040,ERROR_RK_KM_BUSY := 16#0050,ERROR_RK_UNKNOWN_COMMAND := 16#0060,ERROR_RK_INVALID_QUANTITY := 16#0070,ERROR_RK_TIME_OUT_RESPONSE := 16#0080,ERROR_RK_UNKNOWN_OBJECT := 16#0090,ERROR_RK_REMOTE_STATION := 16#0100);END_TYPEDescription:This data type is an enumeration and describes the error codes of the procedure.WAGO-I/O-PRO 32 Version 1.0.2 <strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong> - 11


<strong>RK512</strong>_ACTIVE<strong>RK512</strong>_ACTIVEWAGO-I/O-PRO 32 library elementsCategory:CommunicationName:<strong>RK512</strong>_ACTIVEType: Function Function block X ProgramLibrary name:<strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong>Libraries usedSerComm.libSerial_Interface_<strong>01.lib</strong>Standard.libApplicable to:Programmable fieldbus controllersexcept Modbus controller(750-812; 750–814; 750–815; 750–816)Input parameters: Data type: Comments:bCOM_PORT BYTE Port number of the interface0x01 -> service interface0x02 -> 1st plugged serial modular terminal0x03 -> 2nd plugged serial modular terminal andso oncbCOM_BAUDRATEcpCOM_PARITYcsCOM_STOPBITScbsCOM_BYTESIZEcfCOM_FLOW_CONTROLenmCOMMANDCOM_BAUDRATECOM_PARITYCOM_STOPBITSCOM_BYTESIZECOM_FLOW_CONTROLenum<strong>RK512</strong>_COMMANDBAUD_1200 := 120,BAUD_2400 := 240,BAUD_4800 := 480,BAUD_9600 := 960,BAUD_19200 := 1920,BAUDRATE_TERMINAL_DEFAULT := 0x7FFFPARITY_NO:=0,PARITY_ODD:=1,PARITY_EVEN:=2,PARITY_TERMINAL_DEFAULT := 0x7FFFSTOPBITS_1 := 1,STOPBITS_2 := 2,STOPBITS_TERMINAL_DEFAULT := 0x7FFFBS_7 :=7,BS_8 :=8,BYTESIZE_TERMINAL_DEFAULT := 0x7FFFNO_FLOW_CONTROL :=0,XON_XOFF :=1,RTS_CTS:=2,FLOW_CONTROL_TERMINAL_DEFAULT :=0x7FFF<strong>RK512</strong>_SEND_DB :=1,<strong>RK512</strong>_SEND_DX := 2,<strong>RK512</strong>_FETCH_DB := 3,<strong>RK512</strong>_FETCH_DX := 4,<strong>RK512</strong>_FETCH_E := 5,<strong>RK512</strong>_FETCH_A := 6,<strong>RK512</strong>_FETCH_M := 7,<strong>RK512</strong>_FETCH_T := 8,<strong>RK512</strong>_FETCH_Z := 912 – <strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong> ml00401d WAGO-I/O-PRO 32


Appendix A - Other librariesWAGO-I/O-PRO 32 library elementsbRemoteObjectNr BYTE Object No. e.g. DB-No, DX-No, EB-No,......bRemoteObjectSubNr BYTE Sub-address, e.g., DW-NobRemoteObjectQuantity BYTE Number of objectsOutput parameter: Data type: Comments:ERRORenum<strong>3964R</strong> ERR_<strong>3964R</strong>_NO_ERROR := 0,_ERROR ERR_<strong>3964R</strong>_CHAR_DELAY := 1,ERR_<strong>3964R</strong>_FRAME_TO_LONG := 2,ERR_<strong>3964R</strong>_BCC_ERROR := 3,ERR_<strong>3964R</strong>_BLOCK_DELAY := 4,ERR_<strong>3964R</strong>_RECEIPT_DELAY := 5,ERR_<strong>3964R</strong>_UNEXPECTED_CHAR := 6,ERR_<strong>3964R</strong>_CONNECT_ERROR := 7,ERR_<strong>3964R</strong>_CONFIRMATION_ERROR := 8,ERROR_RK_OUT_OF_RANGE :=16#0010,ERROR_RK_NOT_SUPPORTED :=16#0020,ERROR_RK_UNKNOWN_TELE := 16#0030,ERROR_RK_TELE_LENGTH := 16#0040,ERROR_RK_KM_BUSY := 16#0050,ERROR_RK_UNKNOWN_COMMAND :=16#0060,ERROR_RK_INVALID_QUANTITY := 16#0070,ERROR_RK_TIME_OUT_RESPONSE:= 16#0080,ERROR_RK_UNKNOWN_OBJECT := 16#0090,ERROR_RK_REMOTE_STATION := 16#0100,ERR_COMPORT:= 16#FFnnERROR_CODE BYTE Error code from the header of the reactiontelegram from the communication partnerInput/output Data type:Comments:parameter:xStart BOOL When TRUE at this input, a parameterized job istriggered.Upon execution of the job, this variable isautomatically deleted by the <strong>RK512</strong> driver.The end of the job can be recognized.utDB ARRAY[0 ..RK_LENGTH_USER_DB]OF WORDWhen FETCH job -> Receive buffer for requesteduser dataWhen SEND job -> Send buffer for user data tobe sentWAGO-I/O-PRO 32 Version 1.0.2 <strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong> - 13


<strong>RK512</strong>_ACTIVEGraphical representation:Function description:The function module "<strong>RK512</strong>_ACTIVE" must be called cyclically in the main program.The module supports the sending (SEND) and fetching (FETCH) of data to and from thecommunication partner.Note:This module does not support sequence telegrams.Hence, the user data must be


Appendix A - Other libraries<strong>RK512</strong>_ACTIVE_ENWAGO-I/O-PRO 32 library elementsCategory:CommunicationName:<strong>RK512</strong>_ACTIVE_ENType: Function Function block X ProgramLibrary name:<strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong>Libraries usedSerComm.libSerial_Interface_<strong>01.lib</strong>Standard.libApplicable to:Programmable fieldbus controllersexcept Modbus controller(750-812; 750–814; 750–815; 750–816)Input parameters: Data type: Comments:EN BOOL TRUE -> initialize and open interfaceFALSE -> close interfacebCOM_PORT BYTE Port number of the interface0x01 -> service interface0x02 -> 1st plugged serial modular terminal0x03 -> 2nd plugged serial modular terminal andso oncbCOM_BAUDRATEcpCOM_PARITYcsCOM_STOPBITScbsCOM_BYTESIZEcfCOM_FLOW_CONTROLCOM_BAUDRATECOM_PARITYCOM_STOPBITSCOM_BYTESIZECOM_FLOW_CONTROLBAUD_1200 := 120,BAUD_2400 := 240,BAUD_4800 := 480,BAUD_9600 := 960,BAUD_19200 := 1920,BAUDRATE_TERMINAL_DEFAULT := 0x7FFFPARITY_NO:=0,PARITY_ODD:=1,PARITY_EVEN:=2,PARITY_TERMINAL_DEFAULT := 0x7FFFSTOPBITS_1 := 1,STOPBITS_2 := 2,STOPBITS_TERMINAL_DEFAULT := 0x7FFFBS_7 :=7,BS_8 :=8,BYTESIZE_TERMINAL_DEFAULT := 0x7FFFNO_FLOW_CONTROL :=0,XON_XOFF :=1,RTS_CTS:=2,FLOW_CONTROL_TERMINAL_DEFAULT :=0x7FFFWAGO-I/O-PRO 32 Version 1.0.2 <strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong> - 15


<strong>RK512</strong>_ACTIVE_ENWAGO-I/O-PRO 32 library elementsenmCOMMANDenum<strong>RK512</strong>_COMMAND<strong>RK512</strong>_SEND_DB :=1,<strong>RK512</strong>_SEND_DX := 2,<strong>RK512</strong>_FETCH_DB := 3,<strong>RK512</strong>_FETCH_DX := 4,<strong>RK512</strong>_FETCH_E := 5,<strong>RK512</strong>_FETCH_A := 6,<strong>RK512</strong>_FETCH_M := 7,<strong>RK512</strong>_FETCH_T := 8,<strong>RK512</strong>_FETCH_Z := 9bRemoteObjectNr BYTE Object No. e.g. DB-No, DX-No, EB-No,......bRemoteObjectSubNr BYTE Sub-address, e.g., DW-NobRemoteObjectQuantity BYTE Number of objectsOutput parameter: Data type: Comments:ERRORenum<strong>3964R</strong> ERR_<strong>3964R</strong>_NO_ERROR := 0,_ERROR ERR_<strong>3964R</strong>_CHAR_DELAY := 1,ERR_<strong>3964R</strong>_FRAME_TO_LONG := 2,ERR_<strong>3964R</strong>_BCC_ERROR := 3,ERR_<strong>3964R</strong>_BLOCK_DELAY := 4,ERR_<strong>3964R</strong>_RECEIPT_DELAY := 5,ERR_<strong>3964R</strong>_UNEXPECTED_CHAR := 6,ERR_<strong>3964R</strong>_CONNECT_ERROR := 7,ERR_<strong>3964R</strong>_CONFIRMATION_ERROR := 8,ERROR_RK_OUT_OF_RANGE :=16#0010,ERROR_RK_NOT_SUPPORTED :=16#0020,ERROR_RK_UNKNOWN_TELE := 16#0030,ERROR_RK_TELE_LENGTH := 16#0040,ERROR_RK_KM_BUSY := 16#0050,ERROR_RK_UNKNOWN_COMMAND :=16#0060,ERROR_RK_INVALID_QUANTITY := 16#0070,ERROR_RK_TIME_OUT_RESPONSE:= 16#0080,ERROR_RK_UNKNOWN_OBJECT := 16#0090,ERROR_RK_REMOTE_STATION := 16#0100,ERR_COMPORT:= 16#FFnnERROR_CODE BYTE Error code from the header of the reactiontelegram from the communication partnerPORT_IS_OPEN BOOL Acknowledgement whether serial port is opened16 – <strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong> ml00401d WAGO-I/O-PRO 32


Appendix A - Other librariesInput/output Data type:Comments:parameter:xStart BOOL When TRUE at this input, a parameterized job istriggered.Upon execution of the job, this variable isautomatically deleted by the <strong>RK512</strong> driver.The end of the job can be recognized.utDB ARRAY[0 ..RK_LENGTH_USER_DB]OF WORDWhen FETCH job -> Receive buffer for requesteduser dataWhen SEND job -> Send buffer for user data tobe sentGraphical representation:Function description:The function module "<strong>RK512</strong>_ACTIVE_EN" must be called cyclically in the main program.The module supports the sending (SEND) and fetching (FETCH) of data to and from thecommunication partner.Note:This module does not support sequence telegrams.Hence, the user data must be


enum<strong>RK512</strong>_COMMAND (Enum)enum<strong>RK512</strong>_COMMAND (Enum)WAGO-I/O-PRO 32 library elementsCategory:Name:enum<strong>RK512</strong>_COMMANDType: Data type Enumeration XLibrary name:<strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong>Elements: Value: Comments:<strong>RK512</strong>_SEND_DB 1 Send data to data module (DB)<strong>RK512</strong>_SEND_DX 2 Send data to extended data module(DX)<strong>RK512</strong>_FETCH_DB 3 Fetch data module (DB)<strong>RK512</strong>_FETCH_DX 4 Fetch extended data module (DX)<strong>RK512</strong>_FETCH_E 5 Fetch input byte (EB)<strong>RK512</strong>_FETCH_A 6 Fetch output byte (AB)<strong>RK512</strong>_FETCH_M 7 Fetch marker byte (MB)<strong>RK512</strong>_FETCH_T 8 Fetch timer<strong>RK512</strong>_FETCH_Z 9 Fetch counterDeclaration:TYPE enum<strong>RK512</strong>_COMMAND : (<strong>RK512</strong>_SEND_DB := 1, (* send (DB) data module *)<strong>RK512</strong>_SEND_DX := 2, (* send (DX) extended data module *)<strong>RK512</strong>_FETCH_DB := 3, (* fetch (DB) data module *)<strong>RK512</strong>_FETCH_DX := 4, (* fetch (DX) extended data module *)<strong>RK512</strong>_FETCH_E := 5, (* fetch (EB) input bytes *)<strong>RK512</strong>_FETCH_A := 6, (* fetch (AB) output bytes *)<strong>RK512</strong>_FETCH_M := 7, (* fetch (MB) marker *)<strong>RK512</strong>_FETCH_T := 8, (* fetch (T) timer *)<strong>RK512</strong>_FETCH_Z := 9 (* fetch (Z) counter *));END_TYPEDescription:This data type is an enumeration and describes the commands of <strong>RK512</strong>.18 – <strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong> ml00401d WAGO-I/O-PRO 32


Appendix A - Other libraries<strong>RK512</strong>_PASSIVEWAGO-I/O-PRO 32 library elementsCategory:CommunicationName:<strong>RK512</strong>_PASSIVEType: Function Function block X ProgramLibrary name:<strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong>Libraries usedSerComm.libSerial_Interface_<strong>01.lib</strong>Standard.libApplicable to:Programmable fieldbus controllersexcept Modbus controller(750-812; 750–814; 750–815; 750–816)Input parameters: Data type: Comments:bCOM_PORT BYTE Port number of the interface0x01 -> service interface0x02 -> 1st plugged serial modular terminal0x03 -> 2nd plugged serial modular terminal andso oncbCOM_BAUDRATEcpCOM_PARITYcsCOM_STOPBITScbsCOM_BYTESIZEcfCOM_FLOW_CONTROLCOM_BAUDRATECOM_PARITYCOM_STOPBITSCOM_BYTESIZECOM_FLOW_CONTROLBAUD_1200 := 120,BAUD_2400 := 240,BAUD_4800 := 480,BAUD_9600 := 960,BAUD_19200 := 1920,BAUDRATE_TERMINAL_DEFAULT := 0x7FFFPARITY_NO:=0,PARITY_ODD:=1,PARITY_EVEN:=2,PARITY_TERMINAL_DEFAULT := 0x7FFFSTOPBITS_1 := 1,STOPBITS_2 := 2,STOPBITS_TERMINAL_DEFAULT := 0x7FFFBS_7 :=7,BS_8 :=8,BYTESIZE_TERMINAL_DEFAULT := 0x7FFFNO_FLOW_CONTROL :=0,XON_XOFF :=1,RTS_CTS:=2,FLOW_CONTROL_TERMINAL_DEFAULT :=0x7FFFxUseRefNumber BOOL FALSE (default) -> The field index of the datastructure "utDB_Field" is interpreted as DB-No.TRUE -> The reference number in the datastructure is interpreted as DB-No.WAGO-I/O-PRO 32 Version 1.0.2 <strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong> - 19


<strong>RK512</strong>_PASSIVEWAGO-I/O-PRO 32 library elementsOutput parameter: Data type: Comments:ERRORenum<strong>3964R</strong> ERR_<strong>3964R</strong>_NO_ERROR := 0,_ERROR ERR_<strong>3964R</strong>_CHAR_DELAY := 1,ERR_<strong>3964R</strong>_FRAME_TO_LONG := 2,ERR_<strong>3964R</strong>_BCC_ERROR := 3,ERR_<strong>3964R</strong>_BLOCK_DELAY := 4,ERR_<strong>3964R</strong>_RECEIPT_DELAY := 5,ERR_<strong>3964R</strong>_UNEXPECTED_CHAR := 6,ERR_<strong>3964R</strong>_CONNECT_ERROR := 7,ERR_<strong>3964R</strong>_CONFIRMATION_ERROR := 8,ERROR_RK_OUT_OF_RANGE :=16#0010,ERROR_RK_NOT_SUPPORTED :=16#0020,ERROR_RK_UNKNOWN_TELE := 16#0030,ERROR_RK_TELE_LENGTH := 16#0040,ERROR_RK_KM_BUSY := 16#0050,ERROR_RK_UNKNOWN_COMMAND :=16#0060,ERROR_RK_INVALID_QUANTITY := 16#0070,ERROR_RK_TIME_OUT_RESPONSE:= 16#0080,ERROR_RK_UNKNOWN_OBJECT := 16#0090,ERROR_RK_REMOTE_STATION := 16#0100,ERR_COMPORT:= 16#FFnnInput/output Data type:Comments:parameter:utDB_Field typ<strong>RK512</strong>_DB_Field Multidimensional data fieldGraphical representation:20 – <strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong> ml00401d WAGO-I/O-PRO 32


Appendix A - Other librariesWAGO-I/O-PRO 32 library elementsFunction description:The function module "<strong>RK512</strong>_PASSIVE" must be called cyclically in the main program.The module passively supports [receiving] (Receive) sending (SEND) and fetching (FETCH) ofdata by a communication partner.Note:This module does not support sequence telegrams.Hence, the user data must be


<strong>RK512</strong>_PASSIVE_EN<strong>RK512</strong>_PASSIVE_ENWAGO-I/O-PRO 32 library elementsCategory:CommunicationName:<strong>RK512</strong>_PASSIVE_ENType: Function Function block X ProgramLibrary name:<strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong>Libraries usedSerComm.libSerial_Interface_<strong>01.lib</strong>Standard.libApplicable to:Programmable fieldbus controllersexcept Modbus controller(750-812; 750–814; 750–815; 750–816)Input parameters: Data type: Comments:EN BOOL TRUE -> initialize and open interfaceFALSE -> close interfacebCOM_PORT BYTE Port number of the interface0x01 -> service interface0x02 -> 1st plugged serial modular terminal0x03 -> 2nd plugged serial modular terminal andso oncbCOM_BAUDRATEcpCOM_PARITYcsCOM_STOPBITScbsCOM_BYTESIZEcfCOM_FLOW_CONTROLCOM_BAUDRATECOM_PARITYCOM_STOPBITSCOM_BYTESIZECOM_FLOW_CONTROLBAUD_1200 := 120,BAUD_2400 := 240,BAUD_4800 := 480,BAUD_9600 := 960,BAUD_19200 := 1920,BAUDRATE_TERMINAL_DEFAULT := 0x7FFFPARITY_NO:=0,PARITY_ODD:=1,PARITY_EVEN:=2,PARITY_TERMINAL_DEFAULT := 0x7FFFSTOPBITS_1 := 1,STOPBITS_2 := 2,STOPBITS_TERMINAL_DEFAULT := 0x7FFFBS_7 :=7,BS_8 :=8,BYTESIZE_TERMINAL_DEFAULT := 0x7FFFNO_FLOW_CONTROL :=0,XON_XOFF :=1,RTS_CTS:=2,FLOW_CONTROL_TERMINAL_DEFAULT :=0x7FFFxUseRefNumber BOOL FALSE (default) -> The field index of the datastructure "utDB_Field" is interpreted as DB-No.TRUE -> The reference number in the datastructure is interpreted as DB-No.22 – <strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong> ml00401d WAGO-I/O-PRO 32


Appendix A - Other librariesWAGO-I/O-PRO 32 library elementsOutput parameter: Data type: Comments:ERRORenum<strong>3964R</strong> ERR_<strong>3964R</strong>_NO_ERROR := 0,_ERROR ERR_<strong>3964R</strong>_CHAR_DELAY := 1,ERR_<strong>3964R</strong>_FRAME_TO_LONG := 2,ERR_<strong>3964R</strong>_BCC_ERROR := 3,ERR_<strong>3964R</strong>_BLOCK_DELAY := 4,ERR_<strong>3964R</strong>_RECEIPT_DELAY := 5,ERR_<strong>3964R</strong>_UNEXPECTED_CHAR := 6,ERR_<strong>3964R</strong>_CONNECT_ERROR := 7,ERR_<strong>3964R</strong>_CONFIRMATION_ERROR := 8,ERROR_RK_OUT_OF_RANGE :=16#0010,ERROR_RK_NOT_SUPPORTED :=16#0020,ERROR_RK_UNKNOWN_TELE := 16#0030,ERROR_RK_TELE_LENGTH := 16#0040,ERROR_RK_KM_BUSY := 16#0050,ERROR_RK_UNKNOWN_COMMAND :=16#0060,ERROR_RK_INVALID_QUANTITY := 16#0070,ERROR_RK_TIME_OUT_RESPONSE:= 16#0080,ERROR_RK_UNKNOWN_OBJECT := 16#0090,ERROR_RK_REMOTE_STATION := 16#0100,ERR_COMPORT:= 16#FFnnPORT_IS_OPEN BOOL Acknowledgement whether serial port is openedInput/output Data type:Comments:parameter:utDB_Field typ<strong>RK512</strong>_DB_Field Multidimensional data fieldGraphical representation:WAGO-I/O-PRO 32 Version 1.0.2 <strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong> - 23


<strong>RK512</strong>_PASSIVE_ENWAGO-I/O-PRO 32 library elementsFunction description:The function module "<strong>RK512</strong>_PASSIVE_EN" must be called cyclically in the main program.The module passively supports [receiving] (Receive) sending (SEND) and fetching (FETCH) ofdata by a communication partner.Note:This module does not support sequence telegrams.Hence, the user data must be


Appendix A - Other librariestypDB (data type)WAGO-I/O-PRO 32 library elementsCategory:Name:typDBType: Data type X EnumerationLibrary name:<strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong>Structure:Element: Data type: Description:RefNumber BYTE DB-No. in which the data fieldcan be accessed by thecommunication partner.DWARRAY[0.. RK_DB_LENGTH]OF WORDWord array for user dataDeclaration:TYPE typDB :STRUCTRefNumber : BYTE; (* DB-No. for communication *)DW : ARRAY[0..RK_DB_LENGTH] OF WORD;END_STRUCTEND_TYPEDescription:This structure mirrors a data module.The number of data words can be changed by shadowing the global constantsRK_DB_LENGTH.WAGO-I/O-PRO 32 Version 1.0.2 <strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong> - 25


typ<strong>RK512</strong>_DB_Field (data type)typ<strong>RK512</strong>_DB_Field (data type)WAGO-I/O-PRO 32 library elementsCategory:Name:typ<strong>RK512</strong>_DB_FieldType: Data type X EnumerationLibrary name:<strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong>Declaration:TYPE typ<strong>RK512</strong>_DB_Field :ARRAY[1..RK_DB_QUANTITY] OF typDB;END_TYPEDescription:This data type mirrors a quantity of data modules.The number of mirrored data modules can be changed by shadowing the globalconstant RK_DB_QUANTITY.26 – <strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong> ml00401d WAGO-I/O-PRO 32


Appendix A - Other libraries<strong>RK512</strong>_ACTIVE_PASSIVE_ENWAGO-I/O-PRO 32 library elementsCategory:CommunicationName:<strong>RK512</strong>_ACTIVE_PASSIVE_ENType: Function Function block X ProgramLibrary name:<strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong>Libraries usedSerComm.libSerial_Interface_<strong>01.lib</strong>Standard.libApplicable to:Programmable fieldbus controllersexcept Modbus controller(750-812; 750–814; 750–815; 750–816)Input parameters: Data type: Comments:EN BOOL TRUE -> initialize and open interfaceFALSE -> close interfacebCOM_PORT BYTE Port number of the interface0x01 -> service interface0x02 -> 1st plugged serial modular terminal0x03 -> 2nd plugged serial modular terminal andso oncbCOM_BAUDRATEcpCOM_PARITYcsCOM_STOPBITScbsCOM_BYTESIZEcfCOM_FLOW_CONTROLCOM_BAUDRATECOM_PARITYCOM_STOPBITSCOM_BYTESIZECOM_FLOW_CONTROLBAUD_1200 := 120,BAUD_2400 := 240,BAUD_4800 := 480,BAUD_9600 := 960,BAUD_19200 := 1920,BAUDRATE_TERMINAL_DEFAULT := 0x7FFFPARITY_NO:=0,PARITY_ODD:=1,PARITY_EVEN:=2,PARITY_TERMINAL_DEFAULT := 0x7FFFSTOPBITS_1 := 1,STOPBITS_2 := 2,STOPBITS_TERMINAL_DEFAULT := 0x7FFFBS_7 :=7,BS_8 :=8,BYTESIZE_TERMINAL_DEFAULT := 0x7FFFNO_FLOW_CONTROL :=0,XON_XOFF :=1,RTS_CTS:=2,FLOW_CONTROL_TERMINAL_DEFAULT :=0x7FFFxHIGH_PRIORITY BOOL Establishes the priority of this communicationpartner.For the resolution of possible initializationconflicts, it is required to parameterize one of thetwo communication partners to a high and theother to a low priority.TRUE -> high priorityFALSE -> low priorityWAGO-I/O-PRO 32 Version 1.0.2 <strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong> - 27


<strong>RK512</strong>_ACTIVE_PASSIVE_ENWAGO-I/O-PRO 32 library elementstJobDelay TIME Establishes the minimum delay time between theexecution of two active jobs (SEND / FETCH).This time should be set not too small, in order toavoid a permanent blockage of the interface.(Default value = t#150ms).xUseRefNumber BOOL FALSE (default) -> The field index of the datastructure "utDB_Field" is interpreted as DB-No.TRUE -> The reference number in the datastructure is interpreted as DB-No.enmCOMMANDenum<strong>RK512</strong>_COMMAND<strong>RK512</strong>_SEND_DB :=1,<strong>RK512</strong>_SEND_DX := 2,<strong>RK512</strong>_FETCH_DB := 3,<strong>RK512</strong>_FETCH_DX := 4,<strong>RK512</strong>_FETCH_E := 5,<strong>RK512</strong>_FETCH_A := 6,<strong>RK512</strong>_FETCH_M := 7,<strong>RK512</strong>_FETCH_T := 8,<strong>RK512</strong>_FETCH_Z := 9bRemoteObjectNr BYTE Object No. e.g. DB-No, DX-No, EB-No,......bRemoteObjectSubNr BYTE Sub-address, e.g., DW-NobRemoteObjectQuantity BYTE Number of objectsbLocalDB_Nr BYTE This DB contains the data fetched from theDW[0]after a successful fetch job.In the case of a send job, the data to be sentmust be present in this DB from DW[0].(See also xUseRefNumber and utDB_Field)28 – <strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong> ml00401d WAGO-I/O-PRO 32


Appendix A - Other librariesWAGO-I/O-PRO 32 library elementsOutput parameter: Data type: Comments:ERRORenum<strong>3964R</strong> ERR_<strong>3964R</strong>_NO_ERROR := 0,_ERROR ERR_<strong>3964R</strong>_CHAR_DELAY := 1,ERR_<strong>3964R</strong>_FRAME_TO_LONG := 2,ERR_<strong>3964R</strong>_BCC_ERROR := 3,ERR_<strong>3964R</strong>_BLOCK_DELAY := 4,ERR_<strong>3964R</strong>_RECEIPT_DELAY := 5,ERR_<strong>3964R</strong>_UNEXPECTED_CHAR := 6,ERR_<strong>3964R</strong>_CONNECT_ERROR := 7,ERR_<strong>3964R</strong>_CONFIRMATION_ERROR := 8,ERROR_RK_OUT_OF_RANGE :=16#0010,ERROR_RK_NOT_SUPPORTED :=16#0020,ERROR_RK_UNKNOWN_TELE := 16#0030,ERROR_RK_TELE_LENGTH := 16#0040,ERROR_RK_KM_BUSY := 16#0050,ERROR_RK_UNKNOWN_COMMAND :=16#0060,ERROR_RK_INVALID_QUANTITY := 16#0070,ERROR_RK_TIME_OUT_RESPONSE:= 16#0080,ERROR_RK_UNKNOWN_OBJECT := 16#0090,ERROR_RK_REMOTE_STATION := 16#0100,ERR_COMPORT:= 16#FFnnERROR_CODE BYTE Error code from the header of the reactiontelegram from the communication partnerPORT_IS_OPEN BOOL Acknowledgement whether serial port is openedInput/output Data type:Comments:parameter:xStart BOOL When TRUE at this input, a parameterized job istriggered.Upon execution of the job, this variable willdeleted automatically by the <strong>RK512</strong> driver.The end of the job can be recognized.utDB_Field typ<strong>RK512</strong>_DB_Field Multidimensional data field with available datamodulesWAGO-I/O-PRO 32 Version 1.0.2 <strong>3964R</strong>_<strong>RK512</strong>_<strong>01.lib</strong> - 29


<strong>RK512</strong>_ACTIVE_PASSIVE_ENGraphical representation:Function description:The function module "<strong>RK512</strong>_ACTIVE_PASSIVE EN" must be called cyclically in the mainprogram.The module supports the sending (SEND) and fetching (FETCH) of data to and from thecommunication partner, as well as the response to send and fetch jobs by the communicationpartner.Note:This module does not support sequence telegrams.Hence, the user data must be

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!