Vimba C Manual操作手册
- 格式:pdf
- 大小:310.96 KB
- 文档页数:57
MaaXBoard (EM-MC-SBC-IMX8M) Hardware User ManualV1.2Copyright Statement:The MaaXBoard single board computer (partnumber: EM-MC-SBC-IMX8M) and its relatedintellectual property are owned by Avnet Manufacturing Services.Avnet Manufacturing Services has the copyright of this document and reserves all rights. Any part ofthe document should not be modified, distributed or duplicated in any approach and form with the written permission issued by Avnet Manufacturing Services.Disclaimer:Avnet Manufacturing Services does not take warranty of any kind, either expressed or implied, as tothe program source code, software and documents provided along with the products, and including, but not limited to, warranties of fitness for a particular purpose; The entire risk as to the quality or performance of the program is with the user of products.Regulatory Compliance:MaaXBoard single board computer has passed the CE, FCC & SRRC certification.Revision HistoryRev. Description Author DateV1.0 Update description Hugo 20190815Hugo 20191121 V1.1 Update block diagram, picture anddescriptionV1.2 Add SRRC description Hugo 20200527CatalogRevision History (3)Chapter 1Product Overview (8)1.1Brief Introduction (8)1.2System Block Diagram (8)1.3Packing List (9)1.4Product Specifications (9)1.5Other Customer Provide Parts (10)1.6Interface Locations (11)1.7Product Dimensions (mm) (12)1.8Height Distribution (mm) (13)Chapter 2Introduction of Hardware System (14)2.1MaaXBoard Hardware Installation and Start up (14)2.1.1Installation (14)2.1.2Booting Configuration (14)2.2Details of Interfaces (15)2.2.1POWER IN (15)2.2.2Button (16)2.2.3HDMI (17)2.2.4USB Host (19)2.2.5RJ-45 (21)2.2.6Camera (23)2.2.740 Pin Expansion Pin Header (26)2.2.8Wi-Fi/Bluetooth (Optional) (30)2.2.9Micro SD Card (TF Card) (32)2.2.10Extend Interface J26 (34)2.2.11Extend Interface J23 (36)2.2.12MIPI-DSI (37)2.3Introduction of Peripheral Chips (40)2.3.1AR8035 (40)2.3.2BD71837 (40)2.3.3AW-CM256SM (40)Chapter 3Appendix (41)3.1Software (41)Chapter 4Technical Support and Warranty (42)4.1Technical Support (42)4.2Warranty Conditions (42)Chapter 5Contact Information (44)FigureFigure 1.1 MaaXBoard System Block Diagram (8)Figure 1.2 MaaXBoard Top View (11)Figure 1.3 MaaXBoard Bottom View (11)Figure 1.4 Product Dimensions (12)Figure 1.5 Height Distribution (13)Figure 2.1 USB Type C Slot (15)Figure 2.2 Button (16)Figure 2.3 HDMI Connector (17)Figure 2.4 Double-layer USB Host connector (19)Figure 2.5 RJ45 Connector (21)Figure 2.6 Camera Connector (23)Figure 2.7 2.54mm Double Row Pin Header (26)Figure 2.8 40Pin Pin Header Pin1 Position (27)Figure 2.9 IPEX Antenna Connector (30)Figure 2.10 Onboard Ceramic Antenna (31)Figure 2.11 Micro SD Card Slot (32)Figure 2.12 12Pin Wafer Connector (34)Figure 2.13 12Pin Wafer Connector (36)Figure 2.14 30 Pin FPC Connector (MIPI-DSI) (37)TableTable 2.1 HDMI Pin Definitions (18)Table 2.2 USB Interface Pin Definition (20)Table 2.3 Ethernet Interface Pin Definition (22)Table 2.4 Camera Connector Pin Definition (24)Table 2.5 40 Pin Expansion Pin Header Definition (27)Table 2.6 Antenna Connector Pin Definition (30)Table 2.7 Micro SD Card Slot Pin Definition (33)Table 2.8 12Pin Definition (35)Table 2.9 J23 Pin Definition (36)Table 2.10 J16 Pin Definition (38)Chapter 1 Product Overview1.1 Brief IntroductionMaaXBoard is a development board for makers, designed by Avnet Manufacturing Services. The MaaXBoard is a single board computer based on NXP IMX8M SOC series, which can be used for the areas such as medical instruments, video surveillance, communications, IOT, makers and so on.In the design of a compact body size, it is provided with rich resources of peripheral interface, include: Gigabit Ethernet interface, USB 3.0 interface, MIPI-DSI interface, MIPI-CSI interface, HDMI interface, Micro SD Card interface, UART interface, GPIO interface, Wi-Fi/Bluetooth interface, etc.1.2 System Block DiagramFigure 1.1 MaaXBoard System Block Diagram1.3 Packing List1 ×MaaXBoard1 × Desiccant1 × Anti-static Bag1 × Safety Flyer1 × Quick Start Guide2 × Electrostatic Foam1 × Box1.4 Product SpecificationsGeneral Specifications:Operating Temperature: 0~70°C (When the CPU loads heavy, need a heatsink)Power Supply: 5V/3A (Power Adapter)Operating Humidity: 20% ~ 90% (non-condensing)Dimensions: 85mm × 55mmPCB Layers:10LayersCommunication Interface:1 × 40 Pin IO Interface (Expand I2C, SPI, UART, I2S Interface)1 × MIPI-CSI Camera Interface1 × MIPI-DSI Display Interface1 ×Gigabit Ethernet interface (RJ45)2 × USB3.0 Host1 × Micro SD Card (TF Card) Interface1 × 8bits and 1x 7bits GPIO Interface (Support Audio peripheral expand)1 × HDMI 2.0 Interface1 × Power Interface (USB Type C Connector)1 × Power Button2 × User Button1 × Wi-Fi/Bluetooth2 × User LED1.5 Other Customer Provide PartsTo use the various functions of MaaXBoard, customer should also provide the following parts which are not contained in MaaXBoard Packages.1 × USB to serial cable (TTL)1 × 1Gbps Network Cable1 × Camera Module1 × MIPI-DSI Displayer1 × 5V/3A Power Supply (USB Type C Interface)1 × HDMI Cable1 × HDMI DisplayerOther tools needed to implement related function1.6 Interface LocationsFigure 1.2 MaaXBoard Top ViewFigure 1.3 MaaXBoard Bottom View1.7 Product Dimensions (mm)Figure 1.4 Product Dimensions1.8 Height Distribution (mm)Figure 1.5 Height Distribution Note: There is tolerance in height due to mechanical treatment.Chapter 2 Introduction of Hardware SystemThis chapter will introduce the structure, expansion and peripheral interfaces of MaaXBoard hardware system in details.2.1 MaaXBoard Hardware Installation and Start upBefore power up MaaXBoard, you need to connect all necessary peripheral devices, then power on the board.According to the manufactured configuration, MaaXBoard supports two boot mode: boot from Micro SD card or boot from eMMC. These two boot mode is mutual exclusion. If users choose to boot from Micro SD card, they should burn the latest image to the card on PC, then install the card to the board, refer to the software user manual. If users choose to boot from eMMC, just power on the board.Note: If the eMMC firmware is destroyed by accident, users could update the eMMC image in USB Download mode. Please operate carefully and follow the steps in software user manual strictly to avoid damaging the product.2.2 Details of InterfacesThis section will introduce the constructions, principles, interface definitions and considerations of use of MaaXBoard peripherals in detail, so that users may have a deep understanding of the hardware circuitry of the board.MaaXBoard use a USB Type C interface as the +5V power in. Note that the USB Type C interface only provides power supply function, do not support data communication.The Power adapter should support 3A or above current output.Figure 2.1 USB Type C SlotThere are 3 buttons on the MaaXBoard, S2 as the system power button for the board, S3 and S4 as user button.Figure 2.2 ButtonPowerful video display is an important feature of MaaXBoard. The HDMI 2.0 interface support up to 4096 x 2160 at 60Hz display output.J9 is the interface for connecting an HDMI display device on the MaaXBoard, which is a standard HDMI 19Pin connector. Its specification and dimension as follows:Figure 2.3 HDMI ConnectorTable 2.1 HDMI Pin DefinitionsMaaXBoard provides a Double-layer USB Host connector (J5), the two USB port are two independent controllers, and each one could provide full speed USB3.0 data communication function, used to extend external devices in USB protocol.Figure 2.4 Double-layer USB Host connectorTable 2.2 USB Interface Pin DefinitionJ13 is the physical interface of Gigabit Ethernet, the interface information is shown in the following picture:Figure 2.5 RJ45 ConnectorTable 2.3 Ethernet Interface Pin DefinitionJ12 on the MaaXBoard is a 30-pin FPC connector that supports MIPI 2Lane Camera input. The following picture shows the information of J12:Figure 2.6 Camera ConnectorTable 2.4 Camera Connector Pin DefinitionJ10 on the MaaXBoard is a 40 pin Extend Interface, used to support external devices. The following picture shows the information of the 40 Pin expansion connector J10:Figure 2.7 2.54mm Double Row Pin HeaderFigure 2.8 40Pin Pin Header Pin1 Position Table 2.5 40 Pin Expansion Pin Header DefinitionMaaXBoard employs a Wi-Fi/Bluetooth module to support Wi-Fi 2.4G/5G Frequency, and Bluetooth V4.2 standard. The Wi-Fi/Bluetooth antennas have two type: onboard ceramic antenna or IPEX antenna.IPEX antenna (customized version)IPEX antenna is empty welding in default, if the customer needs to use this interface, please contact the Avnet Manufacturing Services to customize.IPEX antenna connector’s specification as follows:Figure 2.9 IPEX Antenna ConnectorTable 2.6 Antenna Connector Pin DefinitionOnboard Ceramic Antenna (Default)Onboard Ceramic Antenna’s specification as follows:Figure 2.10 Onboard Ceramic AntennaMicro SD card (TF Card) is used to start the code, the program system curing storage, or provide external storage function.Figure 2.11 Micro SD Card SlotTable 2.7 Micro SD Card Slot Pin DefinitionJ26 on the MaaXBoard is a 12 pin Wafer connector, used to support GPIO function. The following picture shows the information of the 12 pin Wafer connector J26:Figure 2.12 12Pin Wafer ConnectorTable 2.8 12Pin DefinitionJ23 on the MaaXBoard is a 12 pins Wafer connector, used to support GPIO function. The following picture shows the information of the 12 pins Wafer connector J23:Figure 2.13 12Pin Wafer ConnectorTable 2.9 J23 Pin DefinitionJ16 on the MaaXBoard is a 30 pin FPC connector that supports MIPI-DSI high-definition and small size screen.The following picture shows the information of 30-pin FPC connector J16:Figure 2.14 30 Pin FPC Connector (MIPI-DSI)Table 2.10 J16 Pin Definition2.3 Introduction of Peripheral ChipsAR8035 Integrated 10/100/1000 Mbps Ethernet Transceiver. The AR8035 is a single port 10/100/1000 Mbps Tri-speed Ethernet PHY, which provides a low power, low BOM (Bill of Materials) cost solution for comprehensive applications including consumer, enterprise, carrier and home networks, etc.AR8035 supports IEEE 802.3az Energy Efficient Ethernet (EEE) standard and Atheros proprietary SmartEEE, which allows legacy MAC/SoC devices without 802.3az support to function as the complete 802.3az system.BD71837MWV integrated all the power voltage for iMX8M, include the peripheral power voltage, which significantly reduce the difficulty when customer develop the system, shorten the development cycle and the manufacture period of the product.BD71837MWV is Power Management IC specially designed for iMX8M by ROHM Semiconductor. It integrates 8 Buck regulators and 7 LDOs, support the processor to dynamically adjust the power to achieve the goal of energy saving. The chip provides 1.8V/3.3V optional MMC card power supply at the same time. Users could choose 1.8V or 3.3V output by change the resistor, to fit multimedia card with various type and protocol. It provides a 32.768 kHz Crystal Oscillator Driver which could power to the clock circuit directly. It also provides several protection modes: output short circuit, output overvoltage/current, over thermal protection, etc.The AW-CM256SM wireless module is compliant with the IEEE 802.11a/b/g/n/ac standard, support connection up to 433.3Mbps transmit/receive (connect to WLAN using 802.11 ac protocol).AW-CM256SM module provide SDIO interface Wi-Fi, UART/PCM interface Bluetooth Function. It enables a low power consumption and high performance solution that fit for IOT and other application field.Chapter 3 Appendix3.1 SoftwareMaaXBoard support Linux Yocto system and Android system, for the detail software introduction, please refer to related user manual.LinuxMaaXBoard Linux Software Release NoteMaaXBoard Linux Software User ManualMaaXBoard Linux Software Development GuideAndroidMaaXBoard Android Software Release NoteMaaXBoard Android Software User ManualMaaXBoard Android Development GuideChapter 4 Technical Support and Warranty4.1 Technical SupportAvnet Manufacturing Services provides its product with one-year free technical support including:Providing software and hardware resources related to the embedded products of AvnetManufacturing Services;Helping customers properly compile and run the source code provided by Avnet ManufacturingServices;Providing technical support service if the embedded hardware products do not function properlyunder the circumstances that customers operate according to the instructions in the documents provided by Avnet Manufacturing Services;Helping customers troubleshoot the products.The following conditions will not be covered by our technical support service. We will take appropriatemeasures accordingly:Customers encounter issues related to software or hardware during their development process;Customers encounter issues caused by any unauthorized alter to the embedded operatingsystem;Customers encounter issues related to their own applications;Customers encounter issues caused by any unauthorized alter to the source code provided byAvnet Manufacturing Services.4.2 Warranty Conditions12-month free warranty on the PCB under normal conditions of use since the sales of the product;The following conditions are not covered by free services; Avnet Manufacturing Services will chargeaccordingly:Customers fail to provide valid purchase vouchers or the product identification tag is damaged,unreadable, altered or inconsistent with the products;Not according to the user's manual operation causes damage to the product;Products are damaged in appearance or function caused by natural disasters (flood, fire,earthquake, lightning strike or typhoon) or natural aging of components or other force majeure;Products are damaged in appearance or function caused by power failure, external forces, water,animals or foreign materials;Products malfunction caused by disassembly or alter of components by customers or, productsdisassembled or repaired by persons or organizations unauthorized by Avnet ManufacturingServices, or altered in factory specifications, or configured or expanded with the componentsthat are not provided or recognized by Avnet Manufacturing Services and the resulted damage in appearance or function;Product failures caused by the software or system installed by customers or inappropriatesettings of software or computer viruses;Products purchased from unauthorized sales;Warranty (including verbal and written) that is not made by Avnet Manufacturing Services andnot included in the scope of our warranty should be fulfilled by the party who committed. Avnet Manufacturing Services has no any responsibility.Within the period of warranty, the freight for sending products from customers to AvnetManufacturing Services should be paid by customers; the freight from Avnet Manufacturing Services to customers should be paid by us. The freight in any direction occurs after warranty period should be paid by customers;Please contact technical support if there is any repair request.Avnet Manufacturing Services will not take any responsibility on the products sent backwithout the permission of the company.Chapter 5 Contact InformationTel: +86-755-33190846/33190847/33190848E-mail:Technicalsupport:***********************Salescontact:**************************Fax: +86-755-25616057Website: /Address: Tower B 4/F, Shanshui Building, Nanshan Yungu Innovation Industry Park, LiuxianAve.No.4093,Nanshan District, Shenzhen, Guangdong, China。
VIM命令手册Vim(Vi IMproved)命令1.打开文件操作 (1)2.存储及退出文件 (1)3.模式转换 (3)4.光标移动 (3)5.插入 (5)6.删除 (5)7.复制和黏贴 (6)8.查找 (7)9.替换 (7)10.编辑多个文件 (9)11.其他命令 (9)12分屏操作 (10)13 vim的帮助指令 (12)1.打开文件操作2.存储及退出文件3.模式转换1) 命令行模式(command mode)控制屏幕光标的移动,字符、字或行的删除,移动复制某区段及进入Insert mode下,或者到last line modea i o 进入插入模式:进入底行模式2) 插入模式(Insert mode)<i/a/o/O> Insert 2Insert只有在Insert mode下,才可以做文字输入按「ESC」键可回到命令行模式。
3) 底行模式(last line mode)Normal模式将文件保存或退出vi,也可以设置编辑环境,如寻找字符串、列出行号……等,使用命令执行编辑操作等可缩写(:set :se) 补齐(tab键的功效+CTRL-D) 历史记录(借助CTRL-UP)/ (查找) ?(反查)4)Visual模式<v / V / CTRL-v /r>4.光标移动BP:hkjl作为移动光标【important,同方向键,建议使用这四个】5.插入6.删除7.复制和黏贴8.查找9.替换10.编辑多个文件11.其他命令【set 可以简写为se 】 附录:set 的所有选项12分屏操作关闭分割窗口可以用:close 其实用:q也行13 vim的帮助指令 &警告信息Vim 拥有一个细致全面的在线帮助系统,进入帮助VIM操作模式转换图补充:从命令模式到底行模式,可以直接: ?两个搜索符号,不需要先按冒号14 七个习惯•快速移动•不要两次键入同样的东西•错误修复•经常需要编辑不止一个文件•协同作业•文本是结构化的•养成习惯1. 快速移动在文本中随意漫游是非常常见的操作。
VIM 编辑器VIM 和Emacs 是Linux 上最知名和最受程序员喜爱的两种编辑器。
VI追求的是快捷启动程序迅速,编辑文本高效,功能专注,而Emacs追求的是功能的丰富强大以及集成带来的方便,在Emacs里头可以发邮件,上新闻组,听mp3,浏览网页,玩游戏,几乎可以login—>emacs—〉logout了,VI和Emacs都是程序员的编辑器,相比而言,Emacs更是提供了一种程序员的生活氛围。
VIM引入了很多模式,主要的有如下几种:➢Normal mode 即通常所谓的命令模式,在此模式使用a、i、A、I、o、O等进入Insert mode➢Insert mode 即通常所谓的编辑模式,在此模式使用ESC进入Normal mode或者Ctrl—c临时进入Normal mode➢Command—line mode 命令行模式,在Normal mode下按冒号进入,按ESC取消执行命令或者回车执行命令,然后回到Normal mode。
➢Visual mode 即选择模式(注意跟用鼠标选择不同),用v,V,C—v或C-q进入➢Select mode 鼠标选择➢Replace mode 在Normal mode下按R进入,按ESC返回Normal mode,相当于Windows下命令行中按Insert键进入的覆盖模式1. 基本操作1) 移动光标(Normal mode)可以用下面的键来移动光标H (左), j (下),k (上),l (右)2) 删除(Normal mode)当你想删除一个字符时,把光标移动到它上面,然后按下x键,它就会消失。
dd命令会删除当前所在的一行内容。
dw 删除当前光标所在字符d$ 删除从当前光标所在位置到当前行结尾的所有内容d^ 删除从当前光标所在位置到行首的所有内容3) 合并行(Normal mode)使用J命令可以合并当前行和下一行4) 撤消和重做(Normal mode)按下u会撤消上一步的操作,U(大字)是一个特殊的撤消键,它会撤消在在最后编辑的行上所作的所有操作。
VIM编辑器操作详解1 vim 使⽤介绍1.1 vim 安装# CentOS 安装:yum install -y vim# Ubuntu 安装:sudu apt-get install vim安装完成后,可使⽤ vim -v 查看版本号1.2 vim 命令格式vim [OPTION]... FILE...常⽤选项选项说明+n打开⽂件后,直接让光标处于第 n ⾏的⾏⾸;+默认⾏尾 ;vim + filename 末⾏⾏⾸+/PATTERN打开⽂件后,直接让光标处于第⼀个被PATTERN匹配到的⾏的⾏⾸;vim +/for filename ⽂件第⼀个for所在⾏的⾏⾸-b file⼆进制⽅式打开⽂件-d file1 file2...⽐较多个⽂件,相当于 vimdiff-m file只读打开⽂件-e file直接进⼊ ex 模式,相当于执⾏ ex file-y file Easy mode (like "evim", modeless),直接可以操作⽂件,`ctrl+o:wq说明:如果该⽂件存在,⽂件被打开并显⽰内容如果该⽂件不存在,当编辑后第⼀次存盘时创建它1.3 vim:模式化编辑器vim 是⼀个模式编辑器,击键⾏为是依赖于 vim的的“模式”三种常见模式:命令或普通(Normal)模式:默认模式,可以实现移动光标,剪切/粘贴⽂本插⼊(Insert)或编辑模式:⽤于修改⽂本扩展命令(extended command)或命令(末)⾏模式:保存,退出等模式转换命令模式 --> 插⼊模式命令解释i insert在光标所在处输⼊I在当前光标所在⾏的⾏⾸输⼊a append在光标所在处后⾯输⼊A在当前光标所在⾏的⾏尾输⼊o在当前光标所在⾏的下⽅打开⼀个新⾏O在当前光标所在⾏的上⽅打开⼀个新⾏插⼊模式 --- ESC-----> 命令模式命令模式 ---- : ----> 扩展命令模式扩展命令模式 ----ESC,enter----> 命令模式⽰例:插⼊颜⾊字符1 切换⾄插⼊模式2 按ctrl+v+[ 三个键,显⽰^[3 后续输⼊颜⾊信息,如:^[[32mhello^[[0m4 切换⾄扩展命令模式,保存退出5 cat ⽂件可以看到下⾯显⽰1.4 扩展命令模式按“:”进⼊Ex模式,创建⼀个命令提⽰符: 处于底部的屏幕左侧1.4.1 扩展命令模式基本命令命令解释w写(存)磁盘⽂件wq写⼊并退出x写⼊并退出X加密q退出q!不存盘退出,及时更改都将丢失r filename读⽂件内容到当前⽂件中w filename将当前⽂件内容写⼊另⼀个⽂件!command执⾏命令r!command读⼊命令的输出1.4.2 地址定界格式:start_pos,end_pos CMD1.4.2.1 地址定界格式命令解释| 表⽰特定的第#⾏,例如5即表⽰第5⾏,# | 指定⾏范围,从左侧 # 表⽰起始⾏,到右侧 # 表⽰结尾⾏,+# | 指定⾏范围,左侧为起始⾏绝对编号,右侧为相对左侧⾏号的偏移量,例如:3,+7,意思是从第3⾏开始,再向后加7⾏. | 表⽰当前⾏;如 :.,$y 表⽰复制从当前⾏开始到最后⼀⾏$ | 最后⼀⾏.,$-1 | 当前⾏到倒数第⼆⾏% | 表⽰全⽂, 相当于1,$/pattern/ | 从光标所在处起始向⽂件尾部,第⼀次被模式所匹配到的⾏,例,/first/,$ 表⽰从第⼀次能被first匹配的⾏开始到最后⼀⾏结束/pat1/,/pat2/ | 从光标所在处起始,第⼀次由 pat1 匹配到的⾏开始,⾄第⼀次由 pat2 匹配到的⾏结束之间的所有⾏,/pat/ | 从指定⾏开始,⼀直找到第⼀个匹配 pattern 的⾏结束/pat/,$ | 向下找到第⼀个匹配 patttern 的⾏到整个⽂件的结尾的所有⾏1.4.2.2 地址定界后跟⼀个编辑命令命令解释d删除y复制w file将范围内的⾏另存⾄指定⽂件中r file在指定位置插⼊指定⽂件中的所有内容可同编辑命令⼀同使⽤,实现编辑操作:d,y,c,w /path/to/somefile(将范围内的⽂本保存⾄指定的⽂件中)合并两个⽂件vim /etc/fstab:5r /tmp/test.txt将⽂件/tmp/test.txt写⼊到⽂件/etc/fstab第5⾏后⾯1.4.3 查找并替换格式s/要查找的内容/替换为的内容/修饰符说明要查找的内容:可使⽤基末正则表达式模式替换为的内容:不能使⽤正则表达式,如果“要查找的内容”部分在模式中使⽤分组符号,在“替换的内容”中使⽤后可以使⽤\1, \2, ...等后向引⽤符号;还可以使⽤“&”引⽤前⾯查找时查找到的整个内容直接引⽤查找模式匹配到的全部⽂本修饰符命令说明i查找时忽略⼤⼩写g全局替换,意味着⼀⾏中如果匹配多次,则均替换,默认情况下,每⼀⾏只替换第⼀次出现gc全局替换,每次替换前询问⽰例# 将⽂本中所有的this替换为This:%s/this/This/gi# 将⽂本中1到20⾏的this替换为This:1,20s/this/This/gi# 将⽂本中所有的t替换为T,还要保持t后⾯的字符不变:%s@\<t\([[:alpha:]]\+\)\>@T\1@g# 将⽂本中所有的t开头的,后⾯加上er:%s@\<t[[:alpha:]]\+\>@&er@g# 将⽂件中所有的enable=0替换为enable=1,将所有的gpgcheck=0替换为gpgcheck=1:%s@\(enable\|gpgcheck\)=0@\1=1@g查找替换中的分隔符/可替换为其它字符,如:#,@⽰例s@/etc@/var@gs#/boot#/#i1.4.4 定制 vim 的⼯作特性每个⼈都有⾃⼰喜欢的配置,⽐如背景颜⾊,空格缩进⼤⼩等,vim 提供配置⽂件供使⽤者保存⾃⼰的偏好,下⾯经常使⽤的配置⽂件:编辑:前登录⽤户的宿主⽬录下,⽐如root ⽤户就是/root/,⽂件为.vimrc注意:在末⾏模式下的设定,仅对当前vim进程有效扩展命令模式的配置只是对当前vim进程有效,可将配置存放在⽂件中持久保存配置⽂件/etc/vimrc # 全局~/.vimrc # ⽤户个⼈,可能需要创建命令说明⾏号显⽰set number,简写set nu⾏号取消显⽰set nomber,简写set nonu忽略字符⼤⼩写启⽤set ignorecase,简写 set ic忽略字符⼤⼩写禁⽤set noic括号匹配⾼亮匹配set showmatch,简称为set sm括号匹配⾼亮取消set noshowmatch,简称为set nosm⾃动缩进启⽤set autoindent,简写 set ai ⾃动缩进取消set noai复制保留格式启⽤set paste复制保留格式禁⽤set nopaste显⽰ Tab ^I 和换⾏符和 $ 显⽰set list取消 Tab ^I 和换⾏符和 $ 显⽰set nolist⾼亮搜索启⽤set hlsearch⾼亮搜索取消set nohlsearch 简写:nohl 语法⾼亮启⽤syntax on语法⾼亮取消syntax off⽂件格式启⽤windows格式:set fileformat=dos 启⽤unix格式:set fileformat=unix简写 set ff=dosTab ⽤空格代替启⽤set expandtab 默认为8个空格代替Tab Tab ⽤空格代替禁⽤set noexpandtab,简写:set etTab⽤指定空格的个数代替启⽤:set tabstop=# 指定#个空格代替Tab简写:set ts=4设置⽂本宽度set textwidth=65 (vim only) #从左向右计数set wrapmargin=15 #从右到左计数设置光标所在⾏的标识线启⽤set cursorline,简写 set cul设置光标所在⾏的标识线禁⽤set nocursorline加密启⽤set key=password机密禁⽤set key=命令说明了解更多set 帮助:help option-list:set or :set all⽰例cat ~/.vimrcset nu # ⾏号set sm # 括号匹配⾼亮set ai # ⾃动缩进set hlsearch # ⾼亮搜索syntax on # 语法⾼亮set colorscheme default # 设置颜⾊主题set nocompatible # vi 和 vim 兼容set noerorbells # 错误铃声set showmatch # 括号匹配查找set ignorecase # 查找忽略⼤⼩写set incsearch # 搜索时⾃动跳转光标set tabstop=4 # 空格set guifont=Menlo:h10 # 字体set autowrite # ⾃动存盘set history=3000set colorcolumn=821.5 命令模式命令模式,⼜称为Normal模式,功能强⼤,只是此模式输⼊指令并在屏幕上显⽰,所以需要记忆⼤量的快捷按键才能更好的使⽤1.5.1 退出 vim命令说明ZZ保存退出ZQ不保存退出1.5.2 光标跳转字符间跳转(Ncommand 跳转由 N 指定的个数的字符)命令说明h左命令说明l右j下k上单词间跳转(Ncommand 由 N 指定⼀次跳转的单词数)命令说明w下⼀个单词的词⾸e当前或下⼀个单词的词尾b当前或前⼀个单词的词⾸当前页跳转命令说明H页⾸M页中间⾏L页底zt将光标所在当前⾏移到屏幕顶端zz将光标所在当前⾏移到屏幕中间zb将光标所在当前⾏移到屏幕底端⾏⾸⾏尾跳转命令说明^跳转⾄⾏⾸的第⼀个⾮空⽩字符0跳转⾄⾏⾸$跳转⾄⾏尾⾏间跳转命令说明G | 跳转⾄由 # 号指定的⾏:# | 跳转⾄由第 # ⾏1G 和 gg | 跳转⾄第⼀⾏G | 跳转⾄最后⼀⾏句间跳转命令说明)跳转到下⼀句(跳转到上⼀句段落间跳转命令说明}下⼀段{上⼀段命令模式翻屏操作命令说明Ctrl+f向⽂件尾部翻⼀屏,相当于 PagedownCtrl+b向⽂件⾸部翻⼀屏,相当于 PageupCtrl+d向⽂件尾部翻半屏Ctrl+u向⽂件⾸部翻半屏Enter按⾏向后翻1.5.3 字符编辑命令说明x删除光标所在处的字符命令说明x | 删除光标所在处起始的 # 个字符xp | 交换光标所在处的字符与其后⾯的字符的位置,如serach,将光标放在r上,按xp,可以换成search | 转换⼤⼩写J | 删除当前⾏后的换⾏符1.5.4 替换命令(replace)命令说明r替换光标所在处的字符,如:将⼩写n替换为⼤写N,命令为 r 后⾯跟上NR切换成 REPLACE 模式(在末⾏出现-- REPLACE -- 提⽰),按 ESC 回到命令模式1.5.5 删除命令(delete)命令说明d删除命令,可结合光标跳转字符,实现范围删除d$删除当前字符⾄⾏尾的字符d^删除当前字符⾄⾮空⾏⾸的字符d0删除当前字符⾄⾏⾸的字符dwdw | 删除 # 个单词de |db |dd | 删除光标所在处的⾏,也⽀持加数字,如3dd是删除光标所在处的⾏起始的共3⾏dd | 多⾏删除D | 从当前光标位置⼀直删除到⾏尾,等同于d$1.5.6 粘贴命令(paste)命令说明p缓冲区中的内容如果为整⾏,则粘贴在当前光标所在⾏的下⽅,否则,则粘贴⾄当前光标所在处的后⽅P缓冲区中的内容如果为整⾏,则粘贴在当前光标所在⾏的上⽅,否则,则粘贴⾄当前光标所在处的前⽅1.5.7 复制命令(yank)命令说明y复制,⼯作⾏为相似于d命令y$y0y^yeywybyy复制⼀整⾏yy | 复制#⾏Y | 复制整⾏1.5.8 改变命令(change)从编辑模式-->输⼊模式,实际实现删除操作命令说明c$c^c0cbcecwcw |cc | 删除光标所在的⾏,并转换为输出模式,即删除当前⾏并输⼊新内容,相当于S cc | 删除#⾏C | 删除当前光标到⾏尾,并切换成插⼊模式,相当于c$1.5.9 查找命令说明/PATTERN从当前光标所在处向⽂件尾部查找能够被当前模式匹配到的所有字符串PATTERN 从当前光标所在处向⽂件⾸部查找能够被当前模式匹配到的所有字符串n 下⼀个,与命令⽅向相同N 上⼀个,与命令⽅向相反1.5.10 撤销(undo)操作命令说明u撤销最近的更改,相当于windows中ctrl+zu | 撤销此前的 # 个操作U | 撤消光标落在这⾏后所有此⾏的更改Ctrl+r | 撤销此前的撤销,相当于windows中crtl+y. | 重复执⾏前⼀个编辑操作. | 重复执⾏前 # 个编辑操作1.5.11 ⾼级⽤法<start position><command><end position>常见Command:y 复制、d 删除、gU 变⼤写、gu 变⼩写⽰例0y$ 命令0 →先到⾏头y →从这⾥开始拷贝$ →拷贝到本⾏最后⼀个字符⽰例:粘贴 song 100 次100isong [ESC]命令说明di"光标在” “之间,则删除” “之间的内容yi(光标在()之间,则复制()之间的内容vi[光标在[]之间,则选中[]之间的内容dtx删除字符直到遇见光标之后的第⼀个 x 字符ytx复制字符直到遇见光标之后的第⼀个 x 字符1.6 可视化模式在末⾏有”-- VISUAL -- “指⽰,表⽰在可视化模式允许选择的⽂本块命令说明v按字符选定,⾯向字符,-- VISUAL --V按⾏选定,⾯向整⾏,-- VISUAL LINE --ctrl-v⾯向块,-- VISUAL BLOCK --可视化键可⽤于与移动键结合使⽤w ) } 箭头等突出显⽰的⽂字可被删除,复制,变更,过滤,搜索,替换等⽰例:在⽂件指定⾏的⾏⾸插⼊#1、先将光标移动到指定的第⼀⾏的⾏⾸2、输⼊ctrl+v 进⼊可视化模式3、向下移动光标,选中希望操作的每⼀⾏的第⼀个字符4、输⼊⼤写字母 I 切换⾄插⼊模式5、输⼊ #6、按 ESC 键⽰例:在指定的块位置插⼊相同的内容1、光标定位到要操作的地⽅2、CTRL+v 进⼊“可视块”模式,选取这⼀列操作多少⾏3、SHIFT+i(I)4、输⼊要插⼊的内容5、按 ESC 键1.7 多⽂件模式命令说明:next下⼀个:prev上⼀个:first第⼀个:last最后⼀个:wall保存所有:qall不保存退出所有:wqall保存所有⽂件并退出例:vim file1 file2 file3在file1中 :next 切换到file2在file1中 :last 切换到file3在file3中 :prev 切换到file2在file3中 :first 切换到file1注:file1 和 file2 和 file3可以实现跨⽂件复制1.8 多窗⼝模式1.8.1 多⽂件分割命令说明-o⽔平或上下分割窗⼝-O垂直或左右分割窗⼝(vim only)⽰例vim -o|-O FILE1 FILE2 ...在窗⼝间切换,Ctrl+w <h|j|k|l>注意:单个⽂件也可以分割为多个窗⼝进⾏查看1.8.2 单⽂件窗⼝分割命令说明Ctrl+w,s split, ⽔平分割,上下分屏命令说明Ctrl+w,v vertical, 垂直分割,左右分屏ctrl+w,q取消相邻窗⼝ctrl+w,o取消全部窗⼝:wqall退出1.9 vim的寄存器有26个命名寄存器和1个⽆命名寄存器,常存放不同的剪贴版内容,可以在同⼀个主机的不同会话(终端窗⼝)间共享寄存器名称 a,b,...,z,格式: 寄存器放在数字和命令之间⽰例3"tyy 表⽰复制3⾏到t寄存器中,末⾏显⽰`3 lines yanked into "t`"tp 表⽰将t寄存器内容粘贴未指定,将使⽤⽆命名寄存器有10个数字寄存器,⽤0,1,...,9表⽰,0存放最近复制内容,1存放最近删除内容。
Vim the Six Billion Dollar editorBetter, Stronger, Faster.学习 vim 并且其会成为你最后一个使用的文本编辑器。
没有比这个更好的文本编辑器了,非常地难学,但是却不可思议地好用。
我建议下面这四个步骤:存活感觉良好觉得更好,更强,更快使用VIM的超能力当你走完这篇文章,你会成为一个vim的 superstar。
在开始学习以前,我需要给你一些警告:学习vim在开始时是痛苦的。
需要时间需要不断地练习,就像你学习一个乐器一样。
不要期望你能在3天内把vim练得比别的编辑器更有效率。
事实上,你需要2周时间的苦练,而不是3天。
第一级 – 存活安装 vim启动 vim什么也别干!请先阅读当你安装好一个编辑器后,你一定会想在其中输入点什么东西,然后看看这个编辑器是什么样子。
但vim不是这样的,请按照下面的命令操作:启 动Vim后,vim在 Normal 模式下。
让我们进入 Insert 模式,请按下键 i 。
(陈皓注:你会看到vim左下角有一个–insert–字样,表示,你可以以插入的方式输入了)此时,你可以输入文本了,就像你用“记事本”一样。
如果你想返回 Normal 模式,请按 E S C 键。
现在,你知道如何在 Insert 和 Normal 模式下切换了。
下面是一些命令,可以让你在 Normal模式下幸存下来:i → Insert 模式,按 E S C 回到 Normal 模式.x → 删当前光标所在的一个字符。
:w q → 存盘 + 退出 (:w 存盘, :q 退出) (陈皓注::w 后可以跟文件名)d d → 删除当前行,并把删除的行存到剪贴板里p → 粘贴剪贴板推荐:h j k l (强例推荐使用其移动光标,但不必需) →你也可以使用光标键 (←↓↑→). 注: j 就像下箭头。
:h e l p<c o m m a n d> → 显示相关命令的帮助。
第14章管理工具现在的问题是选择命令行还是G U I?这要看我们是愿意忍受U N I X命令的斜杠和箭头,还是G U I管理工具使用时的麻烦。
在管理复杂的软件系统时,使用图形界面似乎是一种趋势。
We b的平台无关特征使得基于浏览器的管理工具界面成为首选界面。
但是仍有一部分人喜欢通过命令行方式进行系统管理。
然而,许多系统管理员都承认基于G U I的工具减少了复杂表格的配置错误。
它们还可以帮助新的系统管理员定制不熟悉的应用。
现在,为简化S a m b a配置而出现的G U I管理工具越来越多,本章我们将简要讨论其中的一些。
在开始讨论彩色的基于表格的G U I工具之前,我们先来看看老式的命令行工具。
14.1 命令行工具1. testparmS a m b a的t e s t p a r m命令是一个很棒的检验s m b.c o n f文件是否正确的命令行工具。
t e s t p a r m并不能保证某个特定的共享或节能按预想的方式工作,但它会验证你的配置文件中每一节所指定的语法和参数是否正确。
调用t e s t p a r m时参数是目标s m b.c o n f文件中的绝对路径名。
如果还提供了主机名或I P地址,它还会检查对指定主机的访问权限。
参见testparm (1)联机帮助可以获得更多的信息。
$ testparm <-s 配置文件名> <主机名或I P地址>2. smbclient我们曾多次讨论使用s m b c l i e n t命令验证对服务器和服务的访问是否有效。
s m b c l i e n t可用于在共享文件之间移动、修改文件和目录,在远程打印机上打印文件以及完成从N e t B I O S名到I P地址的转换。
参见第1 3章以及smbclient (1)联机帮助可以得到关于s m b c l i e n t选项的详细信息。
$ smbclient -L <服务器> -N3. smbstatuss m b s t a t u s命令是一个简单的工具,可以显示出当前服务器上所有活跃连接的信息。
Vimba tools for every purposeVimba is the all-in-one solution for working with Allied Vision cameras.•Vimba Viewer: The fastest way to get an image•Development : APIs for C, C++, and .NET with source code examples•Third-party applications : GenICam-compliant transport layers, Vimba Cognex AdapterVimba ViewerWith Vimba Viewer, you can instantly view images from your Allied Vision camera and try out camera features without programming. To setup your camera with Vimba Viewer, see the Vimba Viewer Guide .Using Vimba Viewer1.Connect the camera to the host.2.Start Vimba Viewer.The Camera Selector window opens.3.Click the camera you want to open.The Main window opens.4.To start image acquisition, click the Freerun button.Figure 1: Opening a cameraFigure 2: Main window, starting image acquisitionGigE/CL cameras, grayed out Freerun buttonGigE camerasIn this case, the Main window is in Config Mode to allow the configuration of the GigE settings.1.Correct the GigE settings (you can find instructions in the GigE Installation Manual).2.After correcting the GigE settings, close the Main window.3.In the Camera Selector window, right-click the camera.4.Click Open FULL ACCESS .The Main window opens.5.Start image acquisition, see Step 4.Goldeye CL camerasYou can use Vimba Viewer to configure Goldeye CL cameras and to set features. To acquire images, use the software provided by the frame grabber manufacturer.Figure 3: Main window, configuring the GigE settingsFigure 4: Camera Selector, opening a cameraMore information on camera installationDevelopmentDepending on the API, operating system, and the camera interface, different documents are relevant.In any case, read the Vimba Manual first. To ease programming with Vimba, read the documentation in the order suggested in the table below.Download technical documentationSelect your Allied Vision camera on our website and find detailed technical documentation:https:///en/support/technical-documentation.htmlDocumentation availabilityDocumentation is available for the installed components only.Reading orderComponent Documentation x = necessary / o = optional CC++.NET IEEE 1394GigE USBCL1Vimba Vimba Manual.pdf x x x2Vimba C API Vimba C Manual.pdf xVimba C++ API Vimba CPP Manual.pdf xVimba .NET APIVimba NET Manual.pdfx3Camera FeaturesVimba1394TLFeaturesManual.pdf xGigE_Features_References.pdf xUSB_Features_Reference.pdf xGoldeye_Features_Reference.pdfx5Vimba Image Transform Library Vimba ImageTransform Manual.pdf oo6Transport LayerVimba1394TLFeaturesManual.pdf oVimbaGigETLFeaturesManual.pdf oVimbaUSBTLFeaturesManual.pdf oVimbaCLConfigTLFeaturesManual.pdfoTable 1: Manuals for the developerWindows onlyProgramming examplesFor a quick start, programming examples are included in the Vimba installation.WindowsVimba programming examples are listed in the Allied Vision Vimba app overview.Vimba Examples Overview provides links to the programming examples.Linuxyou can find the programming examples in the Vimba installation directory:•VimbaCPP/Examples •VimbaC/ExamplesFigure 5: Allied Vision Vimba app, access to Vimba ExamplesFigure 6: Examples Overview (Windows only)Third-party applicationsVimba provides GenICam-compliant TLs (transport layers) for GigE, USB, 1394, and Goldeye CL cameras from Allied Vision. To use these cameras with a third-party application, read the documentation in the order suggested in Table 2.Applications not compliant with GenICamAfter the Vimba installation, GenICam-compliant third-party applicationsautomatically find and use the Vimba TL.For third-party applications not compliant with GenICam, read the correspondingmanual.Readingorder Component Documentation x = necessaryo = optionalIEEE1394GigE USB CL1GenICam-compliant third-party applications Please read the documentation of the third-party application. Depending on the third-party application, also see the following:2Camera Features Vimba1394TLFeaturesManual.pdf xGigE_Features_References.pdf xUSB_Features_Reference.pdf xGoldeye_Features_Reference.pdf x 3Transport Layer Vimba1394TLFeaturesManual.pdf oVimbaGigETLFeaturesManual.pdf oVimbaUSBTLFeaturesManual.pdf oVimbaCLConfigTLFeaturesManual.pdf o Table 2: Manuals for the third-party application userWindows onlyCognex AdapterCognex VisionPro is supported by the Vimba Cognex Adapter (Windows only).For more information, see Vimba Cognex Manual.pdf.Contact usConnect with Allied Vision by functionhttps:///en/meta-header/contact-us.htmlSupporthttps:///en/support/contact-support-and-repair.htmlHeadquartersAllied Vision Technologies GmbHTaschenweg 2a07646 Stadtroda, GermanyTel: +49 36428-677-0Fax: +49 36428-677-28Email:*********************DisclaimerAll trademarks are acknowledged as property of their respective owners. Copyright © 2017 Allied Vision Technologies GmbH.。
1封面________________||\//\//\/|\/|\|||////__///||/|||||///\__\///|||//||||||///___//|||//||||||/////\///|||///||||||/////////|||///||||||/////////||///||||||/////////|//||||||/////////|//||||||/////////|//|||||/////////|__//||||////////\__\/||||////////||||////////||||__///__///__//|__||\__\/\__\/\__\/\__\|用户手册作者:Bram Moolenaar翻译:ZhaoRuFei<slimzhao@>版本:7.21译者前言不要试图从本手册中去获取什么知识,使用Vim更多的是一种技能而不是一种知识,Vim的学习需要的更多的不是头脑而是双手,经常按书中的指示进行示例性的操作,在学习Vim众多精致的技巧时,不要贪图一下子全都掌握,最好是看一条技巧后,马上在编辑器上进行操作,这样在以后实际的编辑操作时你的手指就会建立一种自然的反应而不是由头脑来搜索该使用哪一条操作技巧。
建议读者不动手来不读书。
如果手边没有一个合适的Vim编辑器环境可供操练,那么建议读者还是不要在这里浪费时间。
如果读者是在气温比较低的条件下阅读此书从而增加了你动手的惰性时,也请不要浪费时间,这会严重影响学习的效果。
虽然本书鼓励读者多动手,但也绝非说一点不要动脑,相反,Vim中多达几百个的命名与操作方式有它自己的规律可循,在你的手指能对要完成的编辑任务形成条件反射之前,最好还是由头脑做一点辅助。
经常总结自己最经常进行的操作。
为这些操作找出最有效的方法,在每学习一条新的操作之前与自己以前的编辑经验比较一下,找出节省你敲击键盘次数的捷径来。
Vi/Vim常用命令手册vi/vim(以下简称vi)一般情况下有三个操作模式一般模式(Normal Mode):vi处理文件时,默认就是一般模式。
在这个模式输入任何字符皆被视为指令。
可以进行“删除”“复制”“粘贴”等操作插入模式(Insert Mode):可以对文本进行编辑操作,如写入、修改文本。
命令行模式(Ed Mode):实现搜索,替换,保存等功能。
关于vi其他的信息我就不写了,我重点写一下vi(m)的用法。
目录Vi/Vim常用命令手册 (1)第一章 在一般模式的操作 (3)1.1 光标移动 (3)1.2 光标跳转 (3)1.3 删除和剪切操作 (4)1.4 复制与粘贴 (4)1.5 重复与取消操作 (4)1.6 查找与替换命令 (4)1.7 一般模式中的Visual block 模式(块操作模式) (5)第二章 Ed Mode(命令行模式) (8)1.保存,退出命令 (8)2.环境设置 (8)3.多文件、多窗口编辑 (8)4. 其他重要编辑命令 (8)第一章 在一般模式的操作1.1 光标移动附注一个经常遇到的问题是你用"j"命令向下移动了若干行后当前光标已经处于屏幕的底端了。
而你又想查看当前行前后的几行内容。
"zz"命令会把当前行置为屏幕正中央。
"zt"命令会把当前行置于屏幕顶端(t表示top),"zb"则把当前行置于屏幕底端(b表示bottom)1.2 光标跳转当你用"G"命令从一个地方跳转到另一个地方时,Vim会记得你起跳的位置,这个位置在Vim中是一个标记,使用下面的命令可以使你跳回到你刚才的出发点''这个符号是两个单引号。
再次使用上面的这个命令你就会又跳回来了。
这是因为''也是一个跳转命令,所以上次跳转时的起跳位置现在被标记为'了。
更一般地说,只要你执行一个命令使光标定位于当前行之外的某行上去,这都叫一个跳转。
Vimba C API Programmer's ManualV1.32014-07-10Legal NoticeTrademarksUnless stated otherwise,all trademarks appearing in this document of Allied Vision Technologies are brands protected by law.WarrantyThe information provided by Allied Vision Technologies is supplied without any guarantees or warranty whatsoever,be it specific or implicit.Also excluded are all implicit warranties concerning the negotiability,the suitability for specific applications or the non-breaking of laws and patents.Even if we assume that the information supplied to us is accurate,errors and inaccuracy may still occur. CopyrightAll texts,pictures and graphics are protected by copyright and other laws protecting intellectual property. It is not permitted to copy or modify them for trade use or transfer,nor may they be used on websites. Allied Vision Technologies GmbH08/2014All rights reserved.Managing Director:Mr.Frank GrubeTax ID:DE184383113Headquarters:Taschenweg2aD-07646Stadtroda,GermanyTel.:+49(0)364286770Fax:+49(0)36428677-28e-mail:info@Contents1Contacting Allied Vision Technologies8 2Introduction92.1Document history (9)2.2Conventions used in this manual (9)2.2.1Styles (9)2.2.2Symbols (9)3General aspects of the API10 4API usage104.1API Version (10)4.2API Startup and Shutdown (10)4.3Listing available cameras (11)4.4Opening and Closing a Camera (13)4.5Accessing Features (14)4.6Image Capture(API)and Acquisition(Camera) (18)4.6.1Image Capture and Image Acquisition (18)4.6.2Image Capture (19)4.6.3Image Acquisition (20)4.7Using Events (22)4.8Additional configuration:Listing Interfaces (24)4.9Troubleshooting(GigE cameras) (25)4.10Error Codes (26)5Function reference275.1Callbacks (28)5.1.1VmbInvalidationCallback (28)5.1.2VmbFrameCallback (28)5.2API Version (29)5.2.1VmbVersionQuery() (29)5.3API Initialization (30)5.3.1VmbStartup() (30)5.3.2VmbShutdown() (30)5.4Camera Enumeration&Information (31)5.4.1VmbCamerasList() (31)5.4.2VmbCameraInfoQuery() (31)5.4.3VmbCameraOpen() (32)5.4.4VmbCameraClose() (32)5.5Features (33)5.5.1VmbFeaturesList() (33)5.5.2VmbFeatureInfoQuery() (33)5.5.3VmbFeatureListAffected() (34)5.5.4VmbFeatureListSelected() (34)5.5.5VmbFeatureAccessQuery() (35)5.6Integer (36)5.6.1VmbFeatureIntGet() (36)5.6.2VmbFeatureIntSet() (36)5.6.3VmbFeatureIntRangeQuery() (36)5.6.4VmbFeatureIntIncrementQuery() (37)5.7Float (38)5.7.1VmbFeatureFloatGet() (38)5.7.2VmbFeatureFloatSet() (38)5.7.3VmbFeatureFloatRangeQuery() (38)5.8Enum (40)5.8.1VmbFeatureEnumGet() (40)5.8.2VmbFeatureEnumSet() (40)5.8.3VmbFeatureEnumRangeQuery() (40)5.8.4VmbFeatureEnumIsAvailable() (41)5.8.5VmbFeatureEnumAsInt() (41)5.8.6VmbFeatureEnumAsString() (42)5.8.7VmbFeatureEnumEntryGet() (42)5.9String (43)5.9.1VmbFeatureStringGet() (43)5.9.2VmbFeatureStringSet() (43)5.9.3VmbFeatureStringMaxlengthQuery() (43)5.10Boolean (45)5.10.1VmbFeatureBoolGet() (45)5.10.2VmbFeatureBoolSet() (45)5.11Command (46)5.11.1VmbFeatureCommandRun() (46)5.11.2VmbFeatureCommandIsDone() (46)5.12Raw (47)5.12.1VmbFeatureRawGet() (47)5.12.2VmbFeatureRawSet() (47)5.12.3VmbFeatureRawLengthQuery() (48)5.13Feature invalidation (49)5.13.1VmbFeatureInvalidationRegister() (49)5.13.2VmbFeatureInvalidationUnregister() (49)5.14Image preparation and acquisition (50)5.14.1VmbFrameAnnounce() (50)5.14.2VmbFrameRevoke() (50)5.14.3VmbFrameRevokeAll() (50)5.14.4VmbCaptureStart() (51)5.14.5VmbCaptureEnd() (51)5.14.6VmbCaptureFrameQueue() (51)5.14.7VmbCaptureFrameWait() (52)5.14.8VmbCaptureQueueFlush() (52)5.15Interface Enumeration&Information (53)5.15.1VmbInterfacesList() (53)5.15.2VmbInterfaceOpen() (53)5.15.3VmbInterfaceClose() (54)5.16Ancillary data (55)5.16.1VmbAncillaryDataOpen() (55)5.16.2VmbAncillaryDataClose() (55)5.17Memory/Register access (56)5.17.1VmbMemoryRead() (56)5.17.2VmbMemoryWrite() (56)5.17.3VmbRegistersRead() (56)5.17.4VmbRegistersWrite() (57)List of TablesList of Tables1Struct VmbCameraInfo_t (12)2Feature types and functions for reading and writing them (14)3Struct VmbFeatureInfo_t (15)4Basic features found on all cameras (17)5Struct VmbInterfaceInfo_t (24)6Error codes returned by Vimba (26)ListingsListings1Get Cameras (11)2Open Camera (13)3Close Camera (13)4Get Features (15)5Reading a camera feature (16)6Writing features and running command features (16)7Streaming (20)8Getting notified about camera list changes (22)9Getting notified about feature changes (22)10Getting notified about camera events (22)11Get Interfaces (24)1Contacting Allied Vision Technologies1Contacting Allied Vision TechnologiesNote L•Technical Information •Supportsupport@Allied Vision Technologies GmbH(Headquarters) Taschenweg2a07646Stadtroda,GermanyTel.:+4936428-677-0Fax.:+4936428-677-28Email:info@Allied Vision Technologies Canada Inc.101-3750North Fraser WayBurnaby,BC,V5J5E9,CanadaTel:+1604-875-8855Fax:+1604-875-8856Email:info@Allied Vision Technologies Inc.38Washington StreetNewburyport,MA01950,USAToll Free number+1877-USA-1394Tel.:+1978-225-2030Fax:+1978-225-2029Email:info@Allied Vision Technologies Asia Pte.Ltd.82Playfair Road#07-02D'LithiumSingapore368001Tel.+656634-9027Fax:+656634-9029Email:info@Allied Vision Technologies(Shanghai)Co.,Ltd. 2-2109Hongwell International Plaza1602#ZhongShanXi RoadShanghai200235,ChinaTel:+86(21)64861133Fax:+86(21)54233670Email:info@2Introduction2Introduction2.1Document history2.2Conventions used in this manualTo give this manual an easily understood layout and to emphasize important information,the following typographical styles and symbols are used:2.2.1Styles2.2.2SymbolsNoteL This symbol highlights important information.Cautiona This symbol highlights important instructions.You have to follow these instruc-tions to avoid malfunctions.wwwÝThis symbol highlights URLs for further information.The URL itself is shown inblue.Example:4API usage3General aspects of the APIThe purpose of AVT Vimba APIs is to enable programmers to interact with AVT cameras independent of the interface technology(1394,Gigabit Ethernet).To achieve this,Vimba API utilizes GenICam transport layer modules to connect to the various camera interfaces and is therefore generic in terms of camera interfaces.For accessing functionality of either Vimba or the connected cameras,you have two ways of control:the fixed set of API functions on the one hand and on the other hand using GenICam Features by calling functions like e.g.VmbFeatureXXXSet or VmbFeatureXXXGet on entities like Vimba or the cameras.This manual mainly deals with the API functions.NoteL The Vimba User Guide contains a description of the API concepts.NoteL For GigE camera features,see the AVT GigE Camera and Driver Features Manual,for1394camera features,see the AVT1394TL Manual,and for a general refer-ence to features and Vimba system features,see the Vimba Feature Manual. 4API usage4.1API VersionEven if new features are introduced to Vimba C API,your software remains backward e VmbVersionQuery to check the version number of Vimba C API.4.2API Startup and ShutdownIn order to start and shut down Vimba API,use these paired functions:•VmbStartup initializes Vimba API.•VmbShutdown shuts down Vimba API(as soon as all callbacks arefinished).VmbStartup and VmbShutdown must always be paired.Calling the pair several times within the same program is possible,but not recommended.Only VmbVersionQuery can be run without initializing Vimba API.In order to free resources,shut down Vimba API when you don’t use it.4.3Listing available camerasNoteL For a quick start,see ListCameras example of the Vimba SDK. VmbCamerasList enumerates all cameras recognized by the underlying transport layers.With this command,the programmer can fetch all static details of a camera such as:•Camera ID•Camera model•Name or ID of the connected interface(for example,the network or1394adapter)1394cameras:On the1394bus,changes to the plugged cameras are detected automatically.Consequently,any changes to the camera list are announced via discovery event.GigE cameras:Listing cameras over the network is a two-step process:1.To enable camera discovery events,run one of the following commands:•GeVDiscoveryAllOnce discovers all connected cameras once.•GeVDiscoveryAllAuto continually emits discovery packets and thus constantly consumes e it only if you need to stay aware of changes to your network structure and newcameras.Both commands require a certain amount of time(GevDiscoveryAllDuration)before returning.2.To stop the camera discovery,run command GeVDiscoveryAllOff.All listed commands are applied to all network interfaces,see the example Listing1.Listing1:Get Cameras1bool bGigE;2VmbUint32_t nCount;3VmbCameraInfo_t*pCameras;45//We ask Vimba for the presence of a GigE transport layer6VmbError_t err=VmbFeatureBoolGet(gVimbaHandle,"GeVTLIsPresent",&bGigE);7if(VmbErrorSuccess==err)8{9if(true==bGigE)10{11//We use all network interfaces using the global Vimba handle12err=VmbFeatureCommandRun(gVimbaHandle,"GeVDiscoveryAllOnce");13}14}15if(VmbErrorSuccess==err)16{//Get the number of connected cameras17err=VmbCamerasList(NULL,0,&nCount,sizeof*pCameras);1819if(VmbErrorSuccess==err)20{21//Allocate accordingly22pCameras=new VmbCameraInfo_t[nCount];23//Get the cameras24err=VmbCamerasList(pCameras,nCount,&nCount,sizeof*pCameras);25//Print out each camera's name26for(VmbUint32_t i=0;i<nCount;++i)27{28printf("%s\n",pCameras[i].cameraName);29}30}31}Struct VmbCameraInfo_t provides the entries listed in Table1for obtaining information about a camera.Table1:Struct VmbCameraInfo_tEnable notifications for changed camera statesTo get notified whenever a camera is detected,disconnected,or changes its open state:•Run command feature GeVDiscoveryAllAuto on the System entity(GigE cameras only).•Use VmbFeatureInvalidationRegister to register a callback with the Vimba System that gets executed on the according event.The function pointer to the callback function has to be of type VmbInvalidationCallback*.NoteL VmbShutdown blocks until all callbacks havefinished execution.Caution a Functions that must not be called within the camera notification callback:•VmbStartup•VmbShutdown•VmbFeatureIntSet(and any other VmbFeature*Set function)•VmbFeatureCommandRun4.4Opening and Closing a CameraA camera must be opened to control it and to capture images.Call VmbCameraOpen and provide the ID of the camera as well as the desired access mode.Vimba API provides several access modes:•VmbAccessModeFull-read and write e this mode to configure the camera features and to acquire images•VmbAccessModeConfig–enables configuring the IP address of your GigE camera•VmbAccessModeRead–only read access.When a camera has been opened successfully,a handle for further access is returned.An example for opening a camera retrieved from the camera list is shown in Listing2.Listing2:Open Camera1VmbCameraInfo_t*pCameras;2VmbHandle_t hCamera;34//Get all known cameras as described in chapter"Listing available cameras"56//Open the first camera7if(VmbErrorSuccess==VmbCameraOpen(pCameras[0].cameraIdString,8VmbAccessModeFull,hCamera))9{10printf("Camera opened,handle[0x%p]retrieved.\n",hCamera);11}Listing3shows how to close a camera using VmbCameraClose and the previously retrieved handle.Listing3:Close Camera1if(VmbErrorSuccess==VmbCameraClose(hCamera))2{3printf("Camera closed.\n");4}4.5Accessing FeaturesNoteL For a quick start,see ListFeatures example of the Vimba SDK.GenICam-compliant features control and monitor various aspects of the drivers and cameras.For more details on features,see Vimba Feature Manual,the1394Transport Layer Feature Description(if the AVT1394TL has been installed)or the GigE Vision Transport Layer Feature Description(if the AVTGigETL has been installed).Vimba API provides several feature types,which all have their specific properties and functionalities,as shown in Table2.Table2:Feature types and functions for reading and writing themLike shown in Table2,Vimba API provides its own set of access functions for every feature data type.Thestatic properties of a feature are held in struct VmbFeatureInfo_t as listed in Table3.It may befilled by calling VmbFeatureInfoQuery for an individual feature,or by calling VmbFeaturesList for the whole list of features.Since not all features are available all the time,it is necessary to query their current accessibility by calling function VmbFeatureAccessQuery.Table3:Struct VmbFeatureInfo_tTo query all available features of a camera,use VmbFeaturesList.This list does not change while the camera is opened as shown in Listing4.Listing4:Get Features1VmbFeatureInfo_t*pFeatures;2VmbUint32_t nCount=0;3VmbHandle_t hCamera;45//Open the camera as shown in chapter"Opening a camera"67//Get the number of features8VmbError_t err=VmbFeaturesList(hCamera,NULL,0,&nCount,sizeof*pFeatures); 910if(VmbErrorSuccess==err&&0<nCount)11{12//Allocate accordingly13pFeatures=new VmbFeatureInfo_t[nCount];1415//Get the features16err=VmbFeaturesList(hCamera,pFeatures,nCount,&nCount,17sizeof*pFeatures);1819//Print out their name and data type20for(int i=0;i<nCount;++i)21{22printf("Feature'%s'of type:%d\n",pFeatures[i].name,23pFeatures[i].featureDataType);24}25}For an example of reading a camera feature,see Listing5.Listing5:Reading a camera feature1VmbHandle_t hCamera;23//Open the camera as shown in chapter"Opening a camera"45VmbInt64_t nWidth;67if(VmbErrorSuccess==VmbFeatureIntGet(hCamera,"Width",&nWidth))8{9printf("Width:%ld\n",nPayloadSize);10}As an example for writing features to a camera and running a command feature,see Listing6.Listing6:Writing features and running command features1VmbHandle_t hCamera;23//Open the camera as shown in chapter"Opening a camera"45if(VmbErrorSuccess==VmbFeatureEnumSet(hCamera,"AcquisitionMode", 6"Continuous"))7{8if(VmbErrorSuccess=VmbFeatureCommandRun(hCamera,"AcquisitionStart"))9{10printf("Acquisition successfully started\n");11}12}Table4introduces basic features of all cameras.A feature has a name,a type,and accessflags such as read-permitted and write-permitted.To get notified whenever a feature's value changes,use VmbFeatureInvalidationRegister to register a callback that gets executed on the according event.For camera features,use the camera handle for registration.The function pointer to the callback function has to be of type VmbInvalidationCallback*.NoteL Please note that VmbShutdown only returns after all callbacks havefinished ex-ecution.Table4:Basic features found on all camerasCaution a Functions that must not be called within a feature invalidation callback:•VmbStartup•VmbShutdown•VmbFeatureIntSet(and any other VmbFeature*Set function)•VmbFeatureCommandRun4.6Image Capture(API)and Acquisition(Camera)NoteL The Vimba User Guide describes the principles of synchronous and asynchronousimage acquisition.NoteL For a quick start,see SynchronousGrab example of the Vimba SDK.4.6.1Image Capture and Image AcquisitionImage capture and image acquisition are two independent operations:Vimba API captures images,the camera acquires images.To obtain an image from your camera,setup Vimba API to capture images before starting the acquisition on the camera:Make Vimba aware ofbuffers VmbFrameAnnounce()Start the captureVmbCaptureStart()engineHand buffers overto VimbaVmbCaptureFrameQueue()Run cameracommand featureAcquisiƟonStartRequeue frame VmbCaptureFrameQueue() Run camera commandfeatureAcquisiƟonStopStop the capture engine VmbCaptureEnd()Revoke all frames VmbFrameRevokeAll()Flush the capture queueVmbCaptureQueueFlush()Figure1:Typical asynchronous application using Vimba C4.6.2Image CaptureNoteL The bracketed tokens in this chapter refer to Listing7.To enable image capture,frame buffers must be allocated and the API must be prepared for incoming frames:To capture images sent by the camera,follow these steps:1.Open the camera as described in chapter Opening and Closing a Camera2.Query the necessary buffer size through the feature PayloadSize(A).Allocate frame buffers of thissize(B).3.Announce the frame buffers(1).4.Start the capture engine(2).5.Queue the frame you have just created with VmbCaptureFrameQueue,so that the buffer can befilled when the acquisition has started(3).The API is now ready.Start and stop image acquisition on the camera as described in chapter Image Acquisition.How you proceed depends on the acquisition model you need:•Synchronous:Use VmbCaptureFrameWait to receive an image frame while blocking your execution thread.•Asynchronous:Register a callback(C)that gets executed when capturing is e the camera handle for registration.The function pointer to the callback function has to be oftype VmbFrameCallback*.Within the callback routine,queue the frame again after you haveprocessed it.6.Call VmbCaptureQueueFlush to cancel all frames on the queue.7.Stop the capture engine with VmbCaptureEnd.8.Revoke the frames with VmbFrameRevokeAll to clear the buffers.To assure correct continuous image capture,queue at least two or three frames.The appropriate number of frames to be queued in your application depends on the frames per second the camera delivers and on the speed with which you are able to re-queue frames(also taking into consideration the operating system load).The image frames arefilled in the same order in which they were queued.NoteL Always check that VmbFrame_t.receiveStatus equalsVmbFrameStatusComplete when a frame is returned to ensure the data isvalid.Caution a Functions that must not be called within the Frame callback routine.•VmbStartup•VmbShutdown•VmbCameraOpen•VmbCameraClose•VmbFrameAnnounce•VmbFrameRevoke•VmbFrameRevokeAll•VmbCaptureStart•VmbCaptureStop4.6.3Image AcquisitionAs soon as the API is prepared(see chapter Image Capture),you can start image acquisition on your camera:1.Set the feature AcquisitionMode(e.g.to Continuous).2.Run the command AcquisitionStart(4).To stop image acquisition,run command AcquisitionStop.Listing7shows a simplified streaming example(without error handling).Listing7:Streaming1#define FRAME_COUNT3//We choose to use3frames2VmbError_t err;//Vimba functions return an error code that the 3//programmer should check for VmbErrorSuccess4VmbHandle_t hCamera//A handle to our opened camera5VmbFrame_t frames[FRAME_COUNT];//A list of frames for streaming6VmbUInt64_t nPLS;//The payload size of one frame78//The callback that gets executed on every filled frame9void VMB_CALL FrameDoneCallback(const VmbHandle_t hCamera,VmbFrame_t*pFrame) 10{11if(VmbFrameStatusComplete==pFrame->receiveStatus)12{13printf("Frame successfully received\n");14}15else16{17printf("Error receiving frame\n");18}19VmbCaptureFrameQueue(hCamera,pFrame,FrameDoneCallback);20}2122//Get all known cameras as described in chapter"List available cameras"23//and open the camera as shown in chapter"Opening a camera"2425//Get the required size for one image26err=VmbFeatureIntGet(hCamera,"PayloadSize",&nPLS);(A) 27for(int i=0;i<FRAME_COUNT;++i)28{29//Allocate accordingly30frames[i].buffer=new char[nPLS];(B) 31frames[i].bufferSize=nPLS;(B) 32//Anounce the frame33VmbFrameAnnounce(hCamera,frames[i],sizeof(VmbFrame_t));(1) 34}3536//Start capture engine on the host37err=VmbCaptureStart(hCamera);(2) 3839//Queue frames and register callback40for(int i=0;i<FRAME_COUNT;++i)41{42VmbCaptureFrameQueue(hCamera,frames[i],(3) 43FrameDoneCallback);(C) 44}4546//Start acquisition on the camera47err=VmbFeatureCommandRun(hCamera,"AcquisitionStart");(4)4.7Using EventsEvents serve many purposes and can have several origins,e.g.generic camera events or just feature changes.All of these cases are handled in Vimba C uniformly with the same mechanism:You simply register anotification callback with VmbFeatureInvalidationRegister for the feature of your choice which gets called when there is a change to that feature.Three examples are listed in this chapter,one for camera list notifications,one for camera event features, and one for tracking invalidations of features.See Listing8for an example of being notified about camera list changes.(For more details about System features see the Vimba SDK Feature Manual)Listing8:Getting notified about camera list changes1// 1.define callback function2void VMB_CALL CameraListCB(VmbHandle_t handle,const char*name,void*context)3{4char cameraName[255];56VmbFeatureStringGet(handle,"DiscoveryCameraIdent",cameraName);7printf("Event was fired by camera%s\n",cameraName);8}910// 2.register the callback for that event11VmbFeatureInvalidationRegister(gVimbaHandle,"DiscoveryCameraEvent",12CameraListCB,NULL);1314// 3.for GigE cameras,invoke"GeVDiscoveryAllOnce"15VmbFeatureCommandRun(gVimbaHandle,"GeVDiscoveryAllOnce");See Listing9for an example of being notified about feature changes.Listing9:Getting notified about feature changes1// 1.define callback function2void VMB_CALL WidthChangeCB(VmbHandle_t handle,const char*name,void*context)3{4printf("Feature changed:%s\n",name);5}67// 2.register callback for changes to Width8VmbFeatureInvalidationRegister(cameraHandle,"Width",WidthChangeCB,NULL);910//as an example,binning is changed,so the callback will be run11VmbFeatureIntegerSet(cameraHandle,"Binning",4);Camera events are also handled with the same mechanism of feature invalidation.See Listing10for an example.For more details about camera events,see the AVT GigE Camera and Driver Features Manual(if the AVTGigETL has been installed)or the1394Transport Layer Feature Manual(if the AVT1394TL has been installed).Listing10:Getting notified about camera events1// 1.define callback function2void VMB_CALL EventCB(VmbHandle_t handle,const char*name,void*context)3{4printf("Event was fired:%s\n",name);5}67// 2.select"AcquisitionStart"event8VmbFeatureStringSet(cameraHandle,"EventSelector","AcquisitionStart"); 910// 3.switch on the event notification11VmbFeatureEnumSet(cameraHandle,"EventNotification","On");1213// 4.register the callback for that event14VmbFeatureInvalidationRegister(cameraHandle,"EventAcquisitionStart", 15EventCB,NULL);4.8Additional configuration:Listing Interfaces VmbInterfacesList enumerates all Interfaces(GigE or1394adapters)recognized by the underlying transport layers.See Listing11for an example.Listing11:Get Interfaces1VmbUint32_t nCount;2VmbInterfaceInfo_t*pInterfaces;34//Get the number of connected interfaces5VmbInterfacesList(NULL,0,&nCount,sizeof*pInterfaces);67//Allocate accordingly8pInterfaces=new VmbInterfaceInfo_t[nCount];910//Get the interfaces11VmbInterfacesList(pCameras,nCount,&nCount,sizeof*pInterfaces);Struct VmbInterfaceInfo_t provides the information about an interface as listed in Table5.Table5:Struct VmbInterfaceInfo_tTo get notified whenever an interface is detected or disconnected,use VmbFeatureInvalidationRegister to register a callback that gets executed on the according event. Use the global Vimba handle for registration.The function pointer to the callback function has to be of type VmbInvalidationCallback*.NoteL VmbShutdown blocks until all callbacks havefinished execution.Caution a The list of functions that must not be called within the callback routine:•VmbStartup•VmbShutdown•VmbFeatureIntSet(and any other VmbFeature*Set function)•VmbFeatureCommandRun4.9Troubleshooting(GigE cameras)Make sure to set the PacketSize feature of GigE cameras to a value supported by your network card.If you use more than one camera on one interface,the available bandwidth has to be shared between the cameras.•GVSPAdjustPacketSize configures GigE cameras to use the largest possible packets.•StreamBytesPerSecond enables to configure the individual bandwidth if multiple cameras are used.•The maximum packet size might not be available on all connected cameras.Try to reduce the packet size.Further readings:The AVT GigE Installation Manual provides detailed information on how to configure your system.4.10Error CodesAll Vimba API functions return an error code of type VmbErrorType.Typical errors are listed with each function in chapter Function reference.However,any of the error codes listed in Table6might be returned.Table6:Error codes returned by Vimba5Function referenceIn this chapter,you canfind a complete list of all methods that are described in VimbaC.h.All function and type definitions are designed to be portable from other languages and other operating systems.General conventions:•Method names are composed in the following manner:–Vmb"Action".Example:VmbStartup()–Vmb"Entity""Action".Example:VmbInterfaceOpen()–Vmb"ActionTarget""Action".Example:VmbFeaturesList()–Vmb"Entity""SubEntity""Action".Example:VmbFeatureCommandRun()•Methods dealing with features,memory,or registers accept a handle from the following entity list as first parameter:System,Camera,Interface,and AncillaryData.All other methods taking handles accept only a specific handle.•Strings(generally declared as"const char*")are assumed to have a trailing0character.•All pointer parameters should of course be valid,except if stated otherwise.•To ensure compatibility with older programs linked against a former version of the API,all struct* parameters have an accompanying sizeofstruct parameter.•Functions returning lists are usually called twice:once with a zero buffer to get the length of the list, and then again with a buffer of the correct length.Methods in this chapter are always described in the same way:•The caption states the name of the function without parameters•Thefirst item is a brief description•The parameters of the function are listed in a table(with type,name,and description)•The return values are listed•Finally,a more detailed description about the function is given。