background image

4 Protocol description

4.1.14 Command for: Filters, Filter ID, Filter Mask

You can use filters to filter the incoming CAN messages.

1. Command for setting Filter

Syntax: 

set filterX [S]

Where:

X – 0 to 7: filter number

S – 0 or 1: 0 = deactivate filter; 1 = activate filter

Example

// Request: Enable filter 0

set filter0 1

// Response: “OK”

OK

2. Command for setting Filter ID

Syntax: 

set filter idX [id]

Where:

X – 0 to 7: filter number

[id] – value for ID comparison

The bits of the filter ID are directly compared with the bits of the ID of the incoming message.

Example

// Request:

set filter_id0 0x581

// Response: “OK”

OK

3. Command for setting Filter Mask

Syntax: 

filter_maskX [id_mask]

Where:

X – 0 to 7: filter number

[id_mask] – bit mask for ID comparison

The bit mask defines which bits of the ID are taken into consideration.

Example

// Request: Set filter MaskId = 0xFFF

set filter_mask0 0xFFF

// Response: “OK”

OK

Example

set filter_id0 0x07D

set filter_mask0 0x0FF

set filter0 1

Only those messages are shown whose least significant bits correspond to the ID 0x7D.

Version: 1.0.0

16

Содержание ZK-USB-CAN-1

Страница 1: ...Operating Instructions ZK USB CAN 1 Operating Instructions Version 1 0 0...

Страница 2: ...safety 4 1 7 Numerical values 4 2 Technical details and pin assignment 5 2 1 Dimensioned drawings and installation options 5 2 2 Environmental conditions 6 2 3 Electrical properties and technical data...

Страница 3: ...Windows 98 NT ME 2000 XP 7 10 are registered trademarks of the Microsoft Corporation 1 3 Intended use ZK USB CAN 1 is used as a component of drive systems in various industrial applications where a co...

Страница 4: ...Development engineers Installers service personnel Application engineers Only specialists may install and commission the product Specialist staff are persons who have appropriate training and experien...

Страница 5: ...ings and installation options All dimensions are in millimeters You can secure the adapter using one to three M4 screws Three M4x6 threaded holes are provided for this purpose 32 5 10 10 Alternatively...

Страница 6: ...minute CAN baud rate up to 1000 KBaud 2 4 LED signaling When USB is initialized the USB status LED lights up green and the device is ready for operation If communication is taking place the LED flashe...

Страница 7: ...V 1 5 4 G 3 5 Mating connector included in scope of delivery Phoenix Contact FMC 1 5 4 ST 3 5 or equivalent Pin 1 is marked with a 1 Pin Function Note 1 CAN_GND CAN Ground 2 CAN_L CAN Low 3 CAN_SHLD C...

Страница 8: ...2 Technical details and pin assignment USB connection Type USB 2 0 type B connector A suitable USB cable is included in scope of delivery Version 1 0 0 8...

Страница 9: ...ct the adapter to the PC via USB The driver is installed automatically and the device bus is detected as a COM port 2 To find the number of the assigned COM port a Click the search icon in the task ba...

Страница 10: ...ignored by the adapter 4 1 Configuration and initialization 4 1 1 Get Device Information version state ticks name You use this command to read out the product information and e g carry out initial te...

Страница 11: ...e Version Syntax 0 r 0x1009 0 vs Example Read adapter hardware version NodeId 0 Index 0x1009 Subindex 0 Data Type visual string 0 r 0x1009 0 vs SDO Read Response hardware version W003 W003 4 1 3 Read...

Страница 12: ...alue or as a table index of the standard CANopen table Index Baud rate 1 Stop Bus 0 1000 1 800 2 500 3 250 4 125 5 100 6 50 7 20 8 10 NOTE Autobaud is not supported Example Request Initialize CAN Baud...

Страница 13: ...K OK 4 1 7 Start node NMT Syntax sequence net node start You use this command to switch the CAN network to the Operational state in which PDO transfer takes place Example Request Send Start operationa...

Страница 14: ...eop erational You use this command to switch the CAN network to the Pre Operational state in which you can change the PDO mapping Example Request Set NodeId 1 to pre operational 1 preop Response OK OK...

Страница 15: ...ormat 1 All return strings are hex values 0x00000601 8 0x40 0x63 0x20 0x00 0x00 0x00 0x00 0x00 0x00000581 8 0x43 0x63 0x20 0x00 0x01 0x00 0x00 0x00 Example Request Set the format of message to 0 set m...

Страница 16: ...for ID comparison The bits of the filter ID are directly compared with the bits of the ID of the incoming message Example Request set filter_id0 0x581 Response OK OK 3 Command for setting Filter Mask...

Страница 17: ...st Set notification 0 set notification 0 Response OK OK 4 1 16 Command for CAN Error list Syntax info CAN_ERR Returns a message in the CAN_ERR format REC TEC LEC BOFF EPVF EWGF Where REC Error counter...

Страница 18: ...quotes vs Escape sequences are also supported inside Escape Sequence Format Backslash character Single Quotation Mark character Double Quotation Mark character Question Mark character You can also use...

Страница 19: ...d rl Initiate upload SDO command for large data Syntax sequence net node rl multiplexer This command is used for reading large quantities of data and is directly linked to the NEXT command for further...

Страница 20: ...ite CAN message Syntax sequence net wm cobid dataLength value1 value8 Example Request CobId 0x00 wm 0 2 2 0 Response OK OK Incoming CAN Message with CobId 0x701 Data Length 1 Data 0x4 701 1 4 4 2 10 C...

Страница 21: ...300 and 301 are returned in this format Example Request Send wrong command wrong command Response ERROR with error code 101 ERROR 101 Internal errors Error code dec Error message 100 Request not suppo...

Страница 22: ...f memory 0601 0000 Unsupported access to an object 0601 0001 Attempt to read a write only object 0601 0002 Attempt to write a read only object 0602 0000 Object does not exist in the object dictionary...

Отзывы: