advertisement
![Function elements: receive RAW-CAN data. IFM CR0403 | Manualzz Function elements: receive RAW-CAN data. IFM CR0403 | Manualzz](http://s3.manualzz.com/store/data/065343714_1-d9a7dd699cb3fa7f1c83337e35aa8085-360x466.png)
BasicController CR0403
Function elements: receive RAW-CAN data
Content
35705
69
BasicController CR0403
CAN_RX
Unit type = function block (FB)
Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB
Symbol in CODESYS:
35412
>
Description
35369
>
CAN_RX is used for receiving a message.
The FB limits itself to a few functions and the required memory space is low.
CAN_RX filters for the set identifier. If several CAN messages with the same identifier are received in one cycle, only the last / latest message is available.
Parameters of the inputs
35221
Parameter
ENABLE
CHANNEL
ID
Data type
BOOL
BYTE
DWORD
Description
TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
CAN interface (1...n) depending on the device
Number of the data object identifier: normal frame (2 048 IDs):
0...2 047 = 0x0000 0000...0x0000 07FF extended Frame (536 868 864 IDs):
2 048...536 870 911 = 0x0000 0800...0x1FFF FFFF
>
Parameters of the outputs
35096
Parameter
DATA
RESULT
Data type
ARRAY [0..7] OF BYTE
BYTE
Description received data, (1...8 bytes) feedback of the function block
(possible messages → following table)
Possible results for RESULT:
Value dec | hex
Description
0
1
5
9
242
00
01
05
09
F2
FB is inactive function block execution completed without error
FB is being processed – still receiving
CAN is not active
Error: setting is not possible
70
BasicController CR0403
CAN_RX_ENH
= CAN RX enhanced
Unit type = function block (FB)
Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB
Symbol in CODESYS:
35415
>
>
Description
In addition, CAN_RX_ENH provides the following possibilities (as opposed to CAN_RX
• select the frame type (11 or 29 bits),
• define a mask for the evaluation of the CAN ID.
35364
Bit comparison of
ID and mask:
If ID_MASK-Bit = 0, then CAN-ID-Bit may be = 0 or 1.
If ID_MASK-Bit = 1, then CAN-ID-Bit must be = ID-Bit.
>
With the mask several identifiers can be defined as filters.
Example:
ID = 0x100 = 0b0001 0000 0000
Result
ID_MASK = 0x1F1 = 0b0001 1111 0001
The CAN IDs with the following bit pattern are evaluated:
0bxxx1 0000 xxx0 (x = any), i.e. for this example (all in [hex]):
100, 102, 104, 106, 108, 10A, 10C, 10E,
300, 302, 304, 306, 308, 30A, 30C, 30E,
500, 502, 504, 506, 508, 50A, 50C, 50E,
700, 702, 704, 706, 708, 70A, 70C, 70E
Parameters of the inputs
35227
Parameter
ENABLE
CHANNEL
ID
Extended
(optional use of the parameter)
ID_Mask
(optional use of the parameter)
Data type
BOOL
BYTE
DWORD
BOOL := FALSE
DWORD := 0
Description
TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
CAN interface (1...n) depending on the device
Number of the data object identifier: normal frame (2 11 IDs):
0...2 047 = 0x0000 0000...0x0000 07FF extended Frame (2 29 IDs):
0...536 870 911 = 0x0000 0000...0x1FFF FFFF
TRUE: extended Frame (ID = 0...2
29 -1)
FALSE: normal Frame (ID = 0...2
11 -1) filter mask for the identifier: if ID_MASK bit = 0, CAN ID bit may be = 0 or 1 if ID_MASK bit = 1, CAN ID bit must be = ID bit
71
BasicController CR0403
Parameters of the outputs
Parameter
MATCHED_ID
DATALENGTHCOUNT
DATA
RESULT
Data type
DWORD
BYTE
ARRAY [0..7] OF BYTE
BYTE
Possible results for RESULT:
Value dec | hex
Description
0
1
5
9
242
00
01
05
09
F2
FB is inactive function block execution completed without error
FB is being processed – still receiving
CAN is not active
Error: setting is not possible
Description number of the data object identifier
= Data Length Count number of the data bytes received received data, (1...8 bytes) feedback of the function block
(possible messages → following table)
34987
72
BasicController CR0403
CAN_RX_ENH_FIFO
= CAN RX enhanced with FiFo
Unit type = function block (FB)
Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB
Symbol in CODESYS:
35434
>
Description
35359
In addition, CAN_RX_ENH_FIFO provides a FiFo for the received data (as opposed to CAN_RX_ENH
(→ p. 71 )). Thus several CAN messages can be received in one cycle.
No overwriting takes place when the FiFo is full. Inbound messages will be lost.
>
In this event:
► Deactivate and reactive the FB via ENABLE.
> The FiFo is deleted and can be newly filled.
Description to the filter mask: → CAN_RX_ENH
Description
Parameters of the inputs
35227
Parameter
ENABLE
CHANNEL
ID
Extended
(optional use of the parameter)
ID_Mask
(optional use of the parameter)
Data type
BOOL
BYTE
DWORD
BOOL := FALSE
DWORD := 0
Description
TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
CAN interface (1...n) depending on the device
Number of the data object identifier: normal frame (2 11 IDs):
0...2 047 = 0x0000 0000...0x0000 07FF extended Frame (2 29 IDs):
0...536 870 911 = 0x0000 0000...0x1FFF FFFF
TRUE: extended Frame (ID = 0...2
29 -1)
FALSE: normal Frame (ID = 0...2
11 -1) filter mask for the identifier: if ID_MASK bit = 0, CAN ID bit may be = 0 or 1 if ID_MASK bit = 1, CAN ID bit must be = ID bit
73
BasicController CR0403
>
Parameters of the outputs
Parameter
MATCHED_ID
DATALENGTHCOUNT
DATA
MORE_DATA_AVAILABLE
RESULT
Data type
DWORD
BYTE
ARRAY [0..7] OF BYTE
BOOL
BYTE
Possible results for RESULT:
Value dec | hex
Description
5
9
0
1
242
250
00
01
05
09
F2
FA
FB is inactive function block execution completed without error
FB is being processed
– still receiving
CAN is not active
Error: setting is not possible
Error: FiFo is full – data was lost
Description number of the data object identifier
= Data Length Count number of the data bytes received received data, (1...8 bytes)
TRUE: further received data available in the FiFo
FALSE: no further data available in the FiFo feedback of the function block
(possible messages → following table)
34990
74
BasicController CR0403
CAN_RX_RANGE
Unit type = function block (FB)
Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB
Symbol in CODESYS:
35413
>
Description
35368
CAN_RX_RANGE provides the following settings:
select the message type (11 or 29 bits),
define an identifier range.
>
CAN_RX filters for the set identifier. If several CAN messages with the same identifier are received in one cycle, only the last / latest message is available.
Parameters of the inputs
35226
Parameter
ENABLE
CHANNEL
ID_START
ID_STOP
Extended
(optional use of the parameter)
Data type
BOOL
BYTE
DWORD
DWORD
BOOL := FALSE
Description
TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
CAN interface (1...n) depending on the device start number of the data object identifier range: normal frame (2 11 ):
0...2 047 = 0x0000 0000...0x0000 07FF extended frame (2 29 ):
0...536 870 911 = 0x0000 0000...0x1FFF FFFF end number of the data object identifier range: normal frame (2 11 ):
0...2 047 = 0x0000 0000...0x0000 07FF extended frame (2 29 ):
0...536 870 911 = 0x0000 0000...0x1FFF FFFF
TRUE: extended Frame (ID = 0...2
29 -1)
FALSE: normal Frame (ID = 0...2
11 -1)
75
BasicController CR0403
>
Parameters of the outputs
Parameter
ID
DATALENGTHCOUNT
DATA
RESULT
Data type
DWORD
BYTE
ARRAY [0..7] OF BYTE
BYTE
Possible results for RESULT:
Value dec | hex
Description
5
9
0
1
242
00
01
05
09
F2
FB is inactive function block execution completed without error
FB is being processed – still receiving
CAN is not active
Error: setting is not possible
Description
Number of the data object identifier: normal frame (2 048 IDs):
0...2 047 = 0x0000 0000...0x0000 07FF extended Frame (536 868 864 IDs):
2 048...536 870 911 = 0x0000 0800...0x1FFF FFFF
= Data Length Count number of the data bytes received received data, (1...8 bytes) feedback of the function block
(possible messages → following table)
34989
76
BasicController CR0403
CAN_RX_RANGE_FIFO
= CAN RX range with FiFo
Unit type = function block (FB)
Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB
Symbol in CODESYS:
35066
>
Description
CAN_RX_RANGE_FIFO basically works like CAN_RX_RANGE
In addition, CAN_RX_RANGE_FIFO provides a FiFo for the received data. Thus several CAN messages can be received in one cycle.
No overwriting takes place when the FiFo is full. Inbound messages will be lost.
>
In this event:
► Use ENABLE to deactivate and reactivate the function.
> The FiFo is deleted and can be newly filled.
Parameters of the inputs
Parameter
ENABLE
CHANNEL
ID_START
ID_STOP
Extended
(optional use of the parameter)
Data type
BOOL
BYTE
DWORD
DWORD
BOOL := FALSE
Description
TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
CAN interface (1...n) depending on the device start number of the data object identifier range: normal frame (2 11 ):
0...2 047 = 0x0000 0000...0x0000 07FF extended frame (2 29 ):
0...536 870 911 = 0x0000 0000...0x1FFF FFFF end number of the data object identifier range: normal frame (2 11 ):
0...2 047 = 0x0000 0000...0x0000 07FF extended frame (2 29 ):
0...536 870 911 = 0x0000 0000...0x1FFF FFFF
TRUE: extended Frame (ID = 0...2
29 -1)
FALSE: normal Frame (ID = 0...2
11 -1)
35370
35226
77
BasicController CR0403
>
Parameters of the outputs
Parameter
ID
DATALENGTHCOUNT
DATA
MORE_DATA_AVAILABLE
RESULT
Data type
DWORD
BYTE
ARRAY [0..7] OF BYTE
BOOL
BYTE
Possible results for RESULT:
Value dec | hex
Description
5
9
0
1
242
250
00
01
05
09
F2
FA
FB is inactive function block execution completed without error
FB is being processed – still receiving
CAN is not active
Error: setting is not possible
Error: FiFo is full – data was lost
Description
Number of the data object identifier: normal frame (2 048 IDs):
0...2 047 = 0x0000 0000...0x0000 07FF extended Frame (536 868 864 IDs):
2 048...536 870 911 = 0x0000 0800...0x1FFF FFFF
= Data Length Count number of the data bytes received received data, (1...8 bytes)
TRUE: further received data available in the FiFo
FALSE: no further data available in the FiFo feedback of the function block
(possible messages → following table)
34984
78
advertisement
Related manuals
advertisement
Table of contents
- 10 Available memory
- 10 FLASH memory
- 10 SRAM
- 11 FRAM
- 12 Analogue inputs
- 13 Binary inputs
- 14 Input group IN0...IN3
- 14 Input group IN4...IN7
- 15 Resistance measurement
- 16 Input group IN8...IN11
- 17 Protective functions of the outputs
- 17 Definition: overload
- 17 Definition: short circuit
- 18 Reaction of the outputs to overload or short circuit
- 18 Self-protection of the output
- 18 Reaction according to the operating mode of the output
- 18 Reaction when using PWM or CURRENT_CONTROL
- 19 Output group OUT0, OUT1
- 19 Diagnosis: binary outputs (via current and voltage measurement)
- 20 Diagnosis: overload (via current measurement)
- 20 Diagnosis: wire break (via voltage measurement)
- 20 Diagnosis: short circuit (via voltage measurement)
- 21 Output group OUT2, OUT3, OUT8, OUT9
- 21 Diagnosis: binary outputs (via voltage measurement)
- 21 Diagnosis: overload
- 21 Diagnosis: wire break (via voltage measurement)
- 21 Diagnosis: short circuit (via voltage measurement)
- 22 Output group OUT4...OUT7
- 22 Output group OUT10, OUT11
- 23 Diagnosis: binary outputs (via voltage measurement)
- 23 Diagnosis: overload
- 23 Diagnosis: wire break (via voltage measurement)
- 23 Diagnosis: short circuit (via voltage measurement)
- 25 Control the LED in the application program
- 26 CAN: interfaces and protocols
- 27 Bootloader
- 28 Runtime system
- 28 Application program
- 28 Libraries
- 29 FB, FUN, PRG in CODESYS
- 30 Note the cycle time!
- 30 Important note to program the device
- 31 Creating application program
- 32 Using ifm maintenance tool
- 32 Distribution of the application program
- 32 INIT state (Reset)
- 33 STOP state
- 33 RUN state
- 34 ERROR state
- 34 FATAL ERROR state
- 35 Watchdog behaviour
- 36 Limitations for CAN in this device
- 36 Limitations for CANopen in this device
- 36 Limitations for CAN J1939 in this device
- 41 Set up the target
- 42 Activate the PLC configuration
- 43 CAN declaration (e.g. CR1080)
- 47 Safety instructions about Reed relays
- 47 Analogue inputs: configuration and diagnosis
- 48 Configure the software filters of the inputs
- 49 Binary inputs: configuration and diagnosis
- 49 Activation of the input diagnosis
- 49 Fast inputs
- 50 Use as binary inputs
- 51 Configure the software filters of the outputs
- 52 Binary outputs: configuration and diagnosis
- 52 Configuration of the output diagnosis
- 53 PWM outputs
- 53 Availability of PWM
- 53 FBs for PWM functions
- 53 Current control with PWM (= PWMi)
- 55 Save retain variables
- 55 Read back retain variables
- 63 Function elements: RAW-CAN status
- 64 CAN_ENABLE
- 64 Description
- 64 Parameters of the inputs
- 64 Parameters of the outputs
- 65 CAN_RECOVER
- 65 Description
- 65 Parameters of the inputs
- 66 CAN_SETDOWNLOADID
- 66 Description
- 66 Parameters of the inputs
- 66 Parameters of the outputs
- 67 CAN_STATUS
- 67 Description
- 67 Parameters of the inputs
- 67 Parameters of the outputs
- 69 Function elements: receive RAW-CAN data
- 70 CAN_RX
- 70 Description
- 70 Parameters of the inputs
- 70 Parameters of the outputs
- 71 CAN_RX_ENH
- 71 Description
- 71 Parameters of the inputs
- 72 Parameters of the outputs
- 73 CAN_RX_ENH_FIFO
- 73 Description
- 73 Parameters of the inputs
- 74 Parameters of the outputs
- 75 CAN_RX_RANGE
- 75 Description
- 75 Parameters of the inputs
- 76 Parameters of the outputs
- 77 CAN_RX_RANGE_FIFO
- 77 Description
- 77 Parameters of the inputs
- 78 Parameters of the outputs
- 79 Function elements: transmit RAW-CAN data
- 80 CAN_TX
- 80 Description
- 80 Parameters of the inputs
- 80 Parameters of the outputs
- 81 CAN_TX_ENH
- 81 Description
- 81 Parameters of the inputs
- 82 Parameters of the outputs
- 83 CAN_TX_ENH_CYCLIC
- 83 Description
- 83 Parameters of the inputs
- 84 Parameters of the outputs
- 85 Function elements: RAW-CAN remote
- 86 CAN_REMOTE_REQUEST
- 86 Description
- 86 Parameters of the inputs
- 86 Parameters of the outputs
- 87 CAN_REMOTE_RESPONSE
- 87 Description
- 87 Parameters of the inputs
- 88 Parameters of the outputs
- 89 Function elements: CANopen status
- 90 CANOPEN_ENABLE
- 90 Description
- 90 Parameters of the inputs
- 91 Parameters of the outputs
- 92 CANOPEN_GETBUFFERFLAGS
- 92 Description
- 92 Parameters of the inputs
- 93 Parameters of the outputs
- 94 CANOPEN_GETSTATE
- 94 Description
- 94 Parameters of the inputs
- 95 Parameters of the outputs
- 96 CANOPEN_SETSTATE
- 96 Description
- 97 Parameters of the inputs
- 97 Parameters of the outputs
- 98 Function elements: CANopen network management
- 99 CANOPEN_GETNMTSTATESLAVE
- 99 Description
- 99 Parameters of the inputs
- 99 Parameters of the outputs
- 100 CANOPEN_NMTSERVICES
- 100 Description
- 100 Parameters of the inputs
- 101 Parameters of the outputs
- 102 Function elements: CANopen object directory
- 103 CANOPEN_GETODCHANGEDFLAG
- 103 Description
- 103 Parameters of the inputs
- 103 Parameters of the outputs
- 104 CANOPEN_READOBJECTDICT
- 104 Description
- 104 Parameters of the inputs
- 104 Parameters of the outputs
- 105 CANOPEN_WRITEOBJECTDICT
- 105 Description
- 105 Parameters of the inputs
- 106 Parameters of the outputs
- 107 Function elements: CANopen SDOs
- 108 CANOPEN_SDOREAD
- 108 Description
- 108 Parameters of the inputs
- 109 Parameters of the outputs
- 110 CANOPEN_SDOREADBLOCK
- 110 Description
- 111 Parameters of the inputs
- 111 Parameters of the outputs
- 112 CANOPEN_SDOREADMULTI
- 112 Description
- 112 Parameters of the inputs
- 113 Parameters of the outputs
- 114 CANOPEN_SDOWRITE
- 114 Description
- 114 Parameters of the inputs
- 115 Parameters of the outputs
- 116 CANOPEN_SDOWRITEBLOCK
- 116 Description
- 117 Parameters of the inputs
- 117 Parameters of the outputs
- 118 CANOPEN_SDOWRITEMULTI
- 118 Description
- 118 Parameters of the inputs
- 119 Parameters of the outputs
- 120 Function elements: CANopen SYNC
- 121 CANOPEN_GETSYNCSTATE
- 121 Description
- 121 Parameters of the inputs
- 122 Parameters of the outputs
- 123 CANOPEN_SETSYNCSTATE
- 123 Description
- 123 Parameters of the inputs
- 123 Parameters of the outputs
- 124 Function elements: CANopen guarding
- 125 CANOPEN_GETGUARDHBERRLIST
- 125 Description
- 125 Parameters of the inputs
- 125 Parameters of the outputs
- 126 CANOPEN_GETGUARDHBSTATSLV
- 126 Description
- 126 Parameters of the inputs
- 127 Parameters of the outputs
- 128 Function elements: CANopen emergency
- 129 CANOPEN_GETEMCYMESSAGES
- 129 Description
- 129 Parameters of the inputs
- 130 Parameters of the outputs
- 131 CANOPEN_GETERRORREGISTER
- 131 Description
- 131 Parameters of the inputs
- 131 Parameters of the outputs
- 132 CANOPEN_SENDEMCYMESSAGE
- 132 Description
- 132 Parameters of the inputs
- 133 Parameters of the outputs
- 134 Function elements: SAE J1939 status
- 135 J1939_ENABLE
- 135 Description
- 135 Parameters of the inputs
- 136 Parameters of the outputs
- 137 J1939_GETDABYNAME
- 137 Description
- 138 Parameters of the inputs
- 138 Parameters of the outputs
- 139 J1939_NAME
- 139 Description
- 140 Parameters of the inputs
- 140 Parameters of the outputs
- 141 J1939_STATUS
- 141 Description
- 141 Parameters of the inputs
- 141 Parameters of the outputs
- 142 Function elements: SAE J1939 request
- 143 J1939_SPEC_REQ
- 143 Description
- 143 Parameters of the inputs
- 143 Parameters of the outputs
- 144 J1939_SPEC_REQ_MULTI
- 144 Description
- 144 Parameters of the inputs
- 144 Parameters of the outputs
- 145 Function elements: receive SAE J1939
- 146 J1939_RX
- 146 Description
- 146 Parameters of the inputs
- 146 Parameters of the outputs
- 147 J1939_RX_FIFO
- 147 Description
- 147 Parameters of the inputs
- 148 Parameters of the outputs
- 149 J1939_RX_MULTI
- 149 Description
- 149 Parameters of the inputs
- 149 Parameters of the outputs
- 150 Function elements: transmit SAE J1939
- 151 J1939_TX
- 151 Description
- 151 Parameters of the inputs
- 151 Parameters of the outputs
- 152 J1939_TX_ENH
- 152 Description
- 152 Parameters of the inputs
- 153 Parameters of the outputs
- 154 J1939_TX_ENH_CYCLIC
- 154 Description
- 154 Parameters of the inputs
- 155 Parameters of the outputs
- 156 J1939_TX_ENH_MULTI
- 156 Description
- 156 Parameters of the inputs
- 157 Parameters of the outputs
- 158 Function elements: SAE J1939 diagnosis
- 159 J1939_DM1RX
- 159 Description
- 159 Parameters of the inputs
- 160 Parameters of the outputs
- 161 J1939_DM1TX
- 161 Description
- 162 Parameters of the inputs
- 163 Parameters of the outputs
- 164 J1939_DM1TX_CFG
- 164 Description
- 164 Parameters of the inputs
- 164 Parameters of the outputs
- 165 J1939_DM3TX
- 165 Description
- 165 Parameters of the inputs
- 165 Parameters of the outputs
- 167 FASTCOUNT
- 167 Description
- 167 Parameters of the inputs
- 168 Parameters of the outputs
- 169 INC_ENCODER
- 169 Description
- 170 Parameters of the inputs
- 170 Parameters of the outputs
- 171 INPUT
- 171 Description
- 172 Parameters of the inputs
- 172 Parameters of the outputs
- 173 PERIOD
- 173 Description
- 174 Parameters of the inputs
- 175 Parameters of the outputs
- 177 CURRENT_CONTROL
- 177 Description
- 178 Parameters of the inputs
- 178 Parameters of the outputs
- 179 OUTPUT
- 179 Description
- 179 Parameters of the inputs
- 180 Parameters of the outputs
- 181 PWM1000
- 181 Description
- 181 Parameters of the inputs
- 182 Parameters of the outputs
- 184 FLASH_INFO
- 184 Description
- 184 Parameters of the inputs
- 184 Parameters of the outputs
- 185 FLASH_READ
- 185 Description
- 185 Parameters of the inputs
- 185 Parameters of the outputs
- 186 GET_APP_INFO
- 186 Description
- 186 Parameters of the inputs
- 186 Parameters of the outputs
- 187 GET_HW_INFO
- 187 Description
- 187 Parameters of the inputs
- 187 Parameters of the outputs
- 188 GET_IDENTITY
- 188 Description
- 188 Parameters of the inputs
- 188 Parameters of the outputs
- 189 GET_SW_INFO
- 189 Description
- 189 Parameters of the inputs
- 189 Parameters of the outputs
- 190 GET_SW_VERSION
- 190 Description
- 190 Parameters of the inputs
- 190 Parameters of the outputs
- 191 MEM_ERROR
- 191 Description
- 191 Parameters of the inputs
- 191 Parameters of the outputs
- 192 MEMCPY
- 192 Description
- 192 Parameters of the inputs
- 193 Parameters of the outputs
- 194 OHC
- 194 Description
- 194 Parameters of the inputs
- 195 Parameters of the outputs
- 196 SET_IDENTITY
- 196 Description
- 196 Parameters of the inputs
- 196 Parameters of the outputs
- 197 SET_LED
- 197 Description
- 197 Parameters of the inputs
- 198 Parameters of the outputs
- 199 SET_PASSWORD
- 199 Description
- 199 Parameters of the inputs
- 199 Parameters of the outputs
- 200 TIMER_READ_US
- 200 Description
- 200 Parameters of the outputs
- 204 Inputs: address assignment
- 205 Outputs: address assignment
- 207 Inputs: operating modes
- 208 Outputs: operating modes
- 209 EMCY codes: CANx
- 210 EMCY codes: I/Os, system
- 210 Manufacturer-specific information (detail)