VCI V4 C-CanFD Software Design Guide English.pdf

(1388 KB) Pobierz
VCI: C-API for CAN-FD
SOFTWARE DESIGN GUIDE
4.02.0250.20023
1.0
ENGLISH
Important User Information
Liability
Every care has been taken in the preparation of this document. Please inform HMS Industrial Networks of any inac-
curacies or omissions. The data and illustrations found in this document are not binding. We, HMS Industrial Net-
works, reserve the right to modify our products in line with our policy of continuous product development. The
information in this document is subject to change without notice and should not be considered as a commitment by
HMS Industrial Networks. HMS Industrial Networks assumes no responsibility for any errors that may appear in this
document.
There are many applications of this product. Those responsible for the use of this device must ensure that all the
necessary steps have been taken to verify that the applications meet all performance and safety requirements in-
cluding any applicable laws, regulations, codes, and standards.
HMS Industrial Networks will under no circumstances assume liability or responsibility for any problems that may
arise as a result from the use of undocumented features, timing, or functional side effects found outside the docu-
mented scope of this product. The effects caused by any direct or indirect use of such aspects of the product are
undefined, and may include e.g. compatibility issues and stability issues.
The examples and illustrations in this document are included solely for illustrative purposes. Because of the many
variables and requirements associated with any particular implementation, HMS Industrial Networks cannot as-
sume responsibility for actual use based on these examples and illustrations.
Intellectual Property Rights
HMS Industrial Networks has intellectual property rights relating to technology embodied in the product described
in this document. These intellectual property rights may include patents and pending patent applications in the USA
and other countries.
VCI: C-API for CAN-FD Software Design Guide
4.02.0250.20023
1.0
1
User Guide ........................................................................................................................ 5
1.1
1.2
1.3
1.4
Related Documents .......................................................................................................5
Document History ..........................................................................................................5
Conventions ..................................................................................................................6
Glossary........................................................................................................................7
2
System Overview ............................................................................................................ 8
2.1
2.2
Subcomponents and Functions of the Programming Interface ...........................................9
Programming Examples .................................................................................................9
3
Device Management and Device Access ................................................................ 10
3.1
3.2
3.3
Listing Available Devices .............................................................................................. 11
Searching Individual Devices ........................................................................................12
Accessing Devices.......................................................................................................13
4
Accessing the Bus ........................................................................................................ 14
4.1
Accessing the CAN Bus................................................................................................14
4.1.1
4.1.2
4.1.3
4.1.4
Message Channels ............................................................................................... 15
Control Unit ......................................................................................................... 20
Message Filter ..................................................................................................... 22
Cyclic Transmitting List .......................................................................................... 24
Message Monitors ................................................................................................ 27
Control Unit ......................................................................................................... 30
4.2
Accessing the LIN Bus .................................................................................................27
4.2.1
4.2.2
VCI: C-API for CAN-FD Software Design Guide
4.02.0250.20023
1.0
Table of Contents
5
Functions ........................................................................................................................ 34
5.1
General Functions........................................................................................................34
5.1.1
5.1.2
5.1.3
5.1.4
5.1.5
5.1.6
5.1.7
5.1.8
5.1.9
vciInitialize .......................................................................................................... 34
vciGetVersion ...................................................................................................... 34
vciFormatErrorA ................................................................................................... 35
vciFormatErrorW .................................................................................................. 35
vciDisplayErrorA................................................................................................... 36
vciDisplayErrorW.................................................................................................. 36
vciCreateLuid ...................................................................................................... 37
vciLuidToCharA.................................................................................................... 37
vciLuidToCharW ................................................................................................... 38
5.1.10 vciCharToLuidA.................................................................................................... 38
5.1.11 vciCharToLuidW ................................................................................................... 39
5.1.12 vciGuidToCharA ................................................................................................... 39
5.1.13 vciGuidToCharW .................................................................................................. 40
5.1.14 vciCharToGuidA ................................................................................................... 40
5.1.15 vciCharToGuidW .................................................................................................. 41
5.2
Functions for the Device Management...........................................................................42
5.2.1
5.2.2
Functions for Accessing the Device List ..................................................................... 42
Functions for Accessing VCI Devices ........................................................................ 46
Control Unit ......................................................................................................... 49
Message Channel................................................................................................. 58
Cyclic Transmit List ............................................................................................... 73
Control Unit ......................................................................................................... 79
Message Monitor .................................................................................................. 83
5.3
Functions for CAN Access ............................................................................................49
5.3.1
5.3.2
5.3.3
5.4
Functions for LIN Access ..............................................................................................79
5.4.1
5.4.2
VCI: C-API for CAN-FD Software Design Guide
4.02.0250.20023
1.0
Table of Contents
6
Data Types....................................................................................................................... 89
6.1
VCI-Specific Data Types...............................................................................................89
6.1.1
6.1.2
6.1.3
6.1.4
6.1.5
6.1.6
6.1.7
VCIID................................................................................................................. 89
VCIVERSIONINFO ............................................................................................... 89
VCILICINFO ........................................................................................................ 90
VCIDRIVERINFO ................................................................................................. 90
VCIDEVICEINFO ................................................................................................. 91
VCIDEVICECAPS ................................................................................................ 91
VCIDEVRTINFO .................................................................................................. 92
CANBTP............................................................................................................. 93
CANBTPTABLE ................................................................................................... 93
CANCAPABILITIES2............................................................................................. 94
CANINITLINE2 .................................................................................................... 95
CANLINESTATUS2............................................................................................... 96
CANCHANSTATUS2 ............................................................................................. 96
CANRTINFO ....................................................................................................... 97
CANSCHEDULERSTATUS2 ................................................................................... 97
CANMSGINFO .................................................................................................... 98
6.2
CAN-Specific Data Types .............................................................................................93
6.2.1
6.2.2
6.2.3
6.2.4
6.2.5
6.2.6
6.2.7
6.2.8
6.2.9
6.2.10 CANMSG2 .......................................................................................................... 99
6.2.11 CANCYCLICTXMSG2 ........................................................................................... 99
6.3
LIN-Specific Data Types ............................................................................................. 100
6.3.1
6.3.2
6.3.3
6.3.4
6.3.5
LININITLINE...................................................................................................... 100
LINCAPABILITIES .............................................................................................. 100
LINLINESTATUS ................................................................................................ 101
LINMONITORSTATUS......................................................................................... 101
LINMSG ........................................................................................................... 102
VCI: C-API for CAN-FD Software Design Guide
4.02.0250.20023
1.0
Zgłoś jeśli naruszono regulamin