CORT_buffer_allocation (Side 3 af 3)

CAN-002 / Buffer allocation : CORT_buffer_allocation
Basic function / Allocation of the send and receive buffers
(definition of the memory type, starts adr. and number of buffers)
Symbol /
File name / CORT_buffer_allocation.cxf
FB precautions / The FB is processed over multiple cycles
EN input condition / Connect EN to an “OR” between an upwardly differentiated condition for the start trigger and the busy output from the FB (see “SYMBOL”)

·  Variable Table

Input variables

Name / Variable name / Data type / Range / Description
EN / EN / BOOL / 1 (ON): FB started.
0 (OFF): FB not started.
Memory type for send buffer destination / Mem_typ_Send-
Buffer / WORD / 01 (hex) / CIO area (xxxx)
02 (hex) / DM area (Dxxxxx)
03 (hex) / Work area (Wxxx)
04 (hex) / Holding area (Hxxx)
08 (hex) / EM bank 0 (E0-xxxxx)
09 (hex) / EM bank 1 (E1-xxxxx)
0A (hex) / EM bank 2 (E2-xxxxx)
0B (hex) / EM bank 3 (E3-xxxxx)
0C (hex) / EM bank 4 (E4-xxxxx)
0D (hex) / EM bank 5 (E5-xxxxx)
0E (hex) / EM bank 6 (E6-xxxxx)
0F (hex) / EM bank 7 (E7-xxxxx)
10 (hex) / EM bank 8 (E8-xxxxx)
11 (hex) / EM bank 9 (E9-xxxxx)
12 (hex) / EM bank A (EA-xxxxx)
13 (hex) / EM bank B (EB-xxxxx)
14 (hex) / EM bank C (EC-xxxxx)
Start adr. for Send buffer . / Start_adr_Send-
Buffer / UINT / 0 to max no of memory area / Start adr for the send buffer.
(each buffer occupies 5 words)
Memory type for send trigger desti- nation / Mem_type_Send-trigger / WORD / See the list under Memory type for send buffer destination.
(Only useful if a send buffer is setup to send a message by trigger)
Start adr for send trigger / Start_adr_Send-trigger / UINT / 0 to max no of memory area / Start adr for the send trigger.
(One bit for each send buffer. Turn this bit ON for sending data in a specific send buffer. The unit reset the bit again after sending)
Occupies 40 words maximum = 640 buffers
(Only useful if a send buffer is setup to send a message by trigger)
Number of send buffers / Number_of_Send-
Buffer / UINT / 1 to 640 / Number of Send buffers (number of different Identifier)
Memory type for recv. buffer destination / Mem_typ_Recv-
Buffer / WORD / See the list under Memory type for send buffer destination.
.
Start adr. for receive buffer / Start_adr_Recv-
Buffer / UINT / 0 to max no of memory area / The start adr for the Receive buffer.
(each buffer occupies 5 words)
Memory type for receive flag desti- nation / Mem_type_Recv-trigger / WORD / See the list under Memory type for send buffer destination.
Start adr for receive flag / Start_adr_Recv-trigger / UINT / 0 to max no of memory area / Start adr for the receive flag.
(One bit for each recv buffer. This bits turns ON in one cycle when receive data in a specific receive buffer)
Occupies 40 words maximum = 640 buffers
Number of receive buffers / Number_of_Recv-
Buffer / UINT / 1 to 640 / Number of Receive buffers (number of different Identifier)
Unit No / Unit_nr / INT / &0 to &15 / The unit No of the CAN unit
Destination network adr / Destinations_
network / UINT / 1 to 127 / Depend of routingtabel

Output Variables

Name / Variable name / Data type / Range / Description
ENO / ENO / BOOL / 1 (ON): FB processed normally
0 (OFF): FB not processed
Busy flag / Busy / BOOL / Automatically turns OFF when processing is completed
Normal end / OK / BOOL / Turns ON for one cycle when processing ends normally
Error end / Error / BOOL / Turns ON when processing ends in an error. This bits turn OFF after a new execution of the FB.
Response code / Response_code / WORD / After processing is complete (normally or error) FB response with an response code for the command:
0001 / Normal completion
1001 / Command length exceeds maximum command length
1002 / The command length is insufficient for the smallest command
1101 / No area type
(memory not defined)
1104 / Address range over
1109 / Mutual relation error
(memory address overlap)
110C / Parameter error
2201 / not executable in current mode