Receiving a user defined CAN message
Section 5-8
83
Word n in the buffer structure indicates how many new messages have been
received since the last time the buffer was transferred to the PLC. If the value
received in the PLC memory exceeds 15, messages were shifted out of the
buffer without being transferred to the PLC.
Clearing the buffer
After a reset, or after power-on, the buffer is cleared when an IOWR
message with control code #0004 is successfully executed, even if the
content of the IOWR is the same as a previous IOWR.
Example
The following example shows how an arbitrary CAN message is read. In this
example, the Machine number is set to ‘1’. Note that the C200H syntax of the
IOWR instruction is used.
Assume that:
•
a 32-bit counter unit on the network transmits its actual counter value
every time the count changes. On average, the count changes every 2
ms. The identifier of the message is 280h.
•
a second node transmits its 8-bit input value every 4 ms with identifier
282h.
•
a third node transmits its 16-bit clock value every 200
µ
s with identifier
281h.
•
the scan time of the PLC is (fixed to) 8 ms.
The C200HW-CORT21-V1 should be programmed to only receive the 32-bit
counter value and the 8-bit input value. The Unit should ignore the clock
messages, which would overflow the buffer (40 messages per PLC scan).
The received messages must be transferred to DM0600.
14.00
IOWR (-)
Filter needs to be set only once
Indicate_Identifier
#0004
DM0500
#1004
255.06
12.00
EQ_FLAG
ERROR
PLC memory address
Contents
Meaning
DM0500
0280
Minimum identifier
DM0501
0282
Maximum identifier
DM0502
0001
Identifier mask (only even ID's)
DM0503
0600
Messages to DM0600
|
|
DM0600
0006
6 messages since last IO refresh
DM0601
0280
Message with ID = 0280
DM0602
0004
Length = 4 bytes
DM0603
1004
DM0604
000F
Data = 000F1004h
DM0605
0000
DM0606
0000
Ignore
Summary of Contents for C200HW-CORT21-V1
Page 2: ...C200HW CORT21 V1 CANopen Slave Unit OPERATION MANUAL OMRON Cat No W904 E2 2 ...
Page 3: ......
Page 4: ......
Page 5: ......
Page 6: ...C200HW CORT21 V1 CANopen Slave Unit Operation Manual Produced June 2001 ...
Page 7: ...iv ...
Page 9: ...vi ...
Page 13: ...x ...
Page 47: ...Performance Section 2 3 30 ...
Page 85: ...Control and Status area Section 4 3 68 ...
Page 113: ...Flow diagrams Section 6 6 96 ...
Page 123: ...Maintenance Section 7 3 106 ...
Page 133: ...116 ...
Page 135: ...118 ...
Page 139: ...122 ...
Page 141: ......