A Code Generation Metamodel for ULF-Ware
Generating Code for SDL and
Interfacing with the Runtime Library
Michael Piefel and Toby Neumann
Institut f¨u r Informatik
Humboldt-Universit¨a t zu Berlin
Unter den Linden6
10099Berlin,Germany
{piefel|tneumann}@informatik.hu-berlin.de
Abstract.Models can be used in many stages of many di?erent pro-
cesses,but in software engineering,the ultimate purpose of modelling is
often code generation.While code can be generated from any model,we
propose to use an intermediate model that is tailored to code generation
instead.In order to be able to easily support di?erent target languages,
this model should be general enough;in order to support the whole pro-
cess,the model has to contain behavioural as well as structural aspects.
This paper introduces such a model and the ideas behind it.
When the model is to cover several languages,di?erences occur also in
the available library functions.Furthermore,the input languages(e.g.
SDL)may contain high-level concepts such as signal routing that are not
easily mapped into simple instructions.We propose a runtime library to
address both challenges.
1Introduction
Models,in general,do not relate to programs at all.However,in software en-gineering models do refer to systems and their components,which may be executable code.Ideally,model-driven development(such as embodied in the OMG’s Model Driven Architecture(MDA))eventually leads to code generation.
Our research group has been involved in simulation and modelling for a long time.We developed SITE[1],a compiler and runtime environment for the Speci?cation and Description Language of the ITU-T,SDL.This compiler uses conventional techniques of a hidden representation of the abstract syntax tree and code generation(to C++).
Lately,we proposed an open framework for integrated tools for ITU-T lan-guages that is provisionarily called ULF-Ware[2].An overview of its architecture can be seen in?g.1on the following page.
Oversimplifying,ULF-Ware contains a model-based compiler for SDL.The input(in this case,a textual SDL speci?cation)is parsed and a model in the SDL repository is generated from it that adheres to the SDL metamodel.The next step transforms this to a new model in the Java/C++repository adhering
Fig.1.ULF-Ware overview
to the Java/C++metamodel.Finally,code generators turn this model into C++ or Java.
This paper shortly introduces the Java/C++metamodel,a metamodel that is applicable to both Java and C++and that comprises structural as well as behavioural aspects.The requirements for such a metamodel which is geared towards code generation are not obvious.
Similar metamodels exist,each with strengths and weaknesses.At the end of the next section,we will give a short overview of them.Mostly,they are concerned with structural aspects only.There is,however,a need for a new metamodel to cover all aspects of a programming language.
The second part of this paper is concerned with the runtime libraries.In SITE,we originally had only one output language(C++)and one https://www.doczj.com/doc/544841710.html,ter, we added experimental support for Java[3].In general,for n input languages and m output languages,you need n·m libraries and just as many di?erent com-pilers/code generators.With the CeeJay metamodel as a common intermediate, this number should ideally decrease to just n transformations and m libraries.
Later,we added more C++libraries that supported di?erent needs:one library for simulation(including model time,stopping of the simulation,inspec-tion of variables)and another for execution(only speed matters);also libraries that used di?erent middle-ware platforms.These extra libraries did not require a new code generator,as they had the same interface as the old one.Generally, adding another library with the same interface does not require new transfor-mations.
Therefore,this paper shows why a code generation metamodel and accom-panying libraries are useful and simplify the task of translating SDL.
Section2will present general choices that had to be made in order to de-termine the shape of the metamodel in connection with the runtime library. Section3on page5presents the metamodel in detail.Finally,sec.4on page7
describes runtime libraries as they are and how they will be interfacing with the CeeJay metamodel in order to simulate or run SDL systems.
2Design considerations for CeeJay
The code-generation metamodel is conceived to be useful to generate C++as well as Java from it.Therefore we have named it CeeJay.
2.1The meta-metamodel
It is advantageous to employ the same meta-metamodel for all steps–this is a novel point of view:A conventional compiler might use BNF for the parser,but builds its abstract syntax tree using other means such as Kimwitu++[4]or in an ad-hoc fashion.
We have chosen to use MOF as the meta-metamodel.It is used in many OMG standards,most prominently as the meta-metamodel for the UML.MOF is closely tied to UML,in fact there is a number of packages called the UML Infrastructure that are shared between MOF and UML.
MOF,however,is not than just a meta-metamodel,but it provides a meta-data management framework.There are a number of mappings from MOF to di?erent platforms,such as a mapping to XML for model interchange and a mapping to Java which gives interfaces to create,navigate and modify models.
Using MOF and an appropriate tool for it gives a standard way to access models.First,you de?ne a metamodel based on the MOF meta-metamodel.The tool then generates interfaces for models of this metamodel and an implementa-tion to store the models.There are a number of tools,but the only one adhering to the new MOF2.0standard is“A MOF2.0for Java”[5].
2.2Generic or specifc
High-level models are quite di?erent from programs in conventional program-ming languages.They abstract from most of the detail that a programming language exhibits.Once you want to generate real code,all this detail has to be ?lled in.This makes code generation from those models a di?cult task.More-over,many decisions in this process are similar for di?erent target languages, but it is hard to make use of these commonalities.Finally,the way back,i.e. from program text to high-level models,is very hard.Note that most tools that promise to do this(e.g.reverse engineering of Java to UML)only capture the structural aspects of the language(i.e.they only produce UML class diagrams).
The reverse approach is to use models that are very low-level and close to a speci?c language.There have been a number of papers such as[6]implement-ing this.The metamodel obtained this way is close to the original BNF of the language,they are grammars in disguise.Models like this are di?cult to obtain. They would be the result of a model transformation from a high-level model. Here,the intelligence would have to lie in the transformations.
Thus the level of detail of the metamodel of a programming language de-termines whether there will be more work to do in the code generator or the model transformator.We have chosen a level of abstraction that allows true object-oriented models(as opposed to models closely relating to the syntax of a language)while still being close enough to programming to make code generation a straightforward process.
We will add another criterion to the decision as to how close to the target language the model should be:Can we use one metamodel for many languages?
2.3Commonalities of object-oriented programming languages Many languages share common concepts,such as the quite abstract concept of namespace.For programming languages,the similarities go even further.
Many di?erences in those languages are purely syntactical or for simple static semantics,such as the declaration of variables before use.The most important di?erences are support for crash-avoidance and the extent of the available li-braries,neither of which a?ect the metamodel.
Java and C++in particular are very similar to each other.Still,a complete metamodel would exhibit a number of?ne di?erences such as the(non-)existence of multiple inheritance.However,we want to use Java and C++as output lan-guages only.This allows us to build a metamodel that can represent only the intersection of features from Java and C++.
Since Java and C++have so much in common,the combined metamodel is still expressive enough to allow arbitrarily complex models.In fact,other object-oriented languages share the same concepts in very similar ways.
Some of the di?erences between languages are evened out because we want to use the models only for code generation.In Python,for instance,variables do not have a declared type.While generating code from a model containing type information,it is easy to just suppress generation of type names.
2.4The Role of the Runtime Environment
The runtime environment serves two purposes:It hides di?erences between target languages and facilitates code generation for complex concepts.
While the target languages that we consider are semantically similar and exhibit mostly syntactical di?erences which are easily covered by the code gen-erator,they have vastly di?ering standard libraries.The problem is already ob-vious in a simple Hello-World program.While C++uses printf or cout,Java instead has System.out.println.How will this be represented in the model in a uniform fashion?One way is to have special metamodel-elements for print-ing text,and similarly for all the other library calls that di?er;this also means changes to the metamodel if we want to include another call.The other way is to use a common runtime library that o?ers a uniform interface to the model and encapsulates di?ering functionality;clearly,this approach is superior.
In theory,code generation can generate code down to the most basic level. This would have the advantage of a minimal runtime library;this library would
be speci?c to the target language,but unconnected to the source language. But,as outlined in sec.2.2on page3,it is preferable not to burden the code generator with too much detail.Instead,the runtime library contains support for the advanced concepts of the source language.While this results in di?erent libraries for di?erent source languages,it greatly simpli?es the code generator. In the past,this approach was proven to be very successful in SITE.
The concepts of the library will be elaborated in sec.4on page7.
2.5Related Work
There are a number of metamodels for di?erent languages around.However, the public availability of these metamodels is limited.Further,the focus of the metamodels can be quite di?erent,as mentioned above.
There is a project called jnome[7].The metamodel developed therein is tai-lored to generating documentation for Java?les.It lacks support for the imple-mentation of methods and is as such not suitable for complete code generation.
Both the Netbeans IDE and Eclipse seem to use a Java metamodel internally. Both IDEs bring their own repository functionality:Netbeans MDR,a MOF 1.4repository,and Eclipse EMF,a repository and metamodel that is similar to MOF.Both metamodels are not MOF2.0metamodels and do not cover dynamic aspects.
The Object Management Group has a speci?cation containing a Java meta-model[8].which seems to have been abandoned in an early stage of development.
Numerous other works are concerned with automatically generating meta-models from grammars.The results are usually close to the grammar and,nat-urally,speci?c to the language they are based on.They are not suitable for a more general approach.
A metamodel that captures some common features of Java and Smalltalk is presented in[9].This metamodel is concerned with common refactoring opera-tions in those two languages.
3The CeeJay Metamodel
This is a condensed overview of the metamodel.For a more elaborate description, please refer to[10].
3.1Basic building blocks
The basis for the CeeJay metamodel is a number of classes that are not shown in a diagram here.They have self-explanatory names such as NamedElement and are modeled very closely to the elements of the same name as in the UML Infrastructure.
In fact,these classes can be viewed as a stripped-down version of the Infras-tructure.It remains to be seen whether it is advantageous to have them here, which will aid in understanding the concepts because it is simple,or whether we should rather use the Infrastructure itself.
3.2Packages
An important structural concept of Java is the package.In C++,there is the concept namespace.The two concepts are equivalent.The di?erences in usage are of no concern to the metamodel of the languages.While generating code, care is taken that every generated C++namespace has an associated header?le declaring everything,such that the inclusion of it is equivalent to the import of a package in Java;in Java,?les are distributed into directories of the package’s name.
Consequently,a single metaclass Package(a specialization of Namespace) su?ces for both Java packages and C++namespaces.They will be mapped accordingly,but see also3.5on the next page for an exception.
3.3Class
Java does not allow multiple inheritance,so CeeJay can only support single inheritance for CeeJayClass.Java does,however,have interfaces.Those are GeneralizableElement s,and a CeeJayClass or an Interface can implement or enhance any number of Interface s.
While C++does not have interfaces,they can be represented by abstract 3.4
integers and booleans are used.The third primitive type here is void,which is used in functions(see3.5on the next page)as the return value.
There is a constraint on the primitive types that is not expressed formally: There may be only one instance of the metamodel element PrimitiveType for each PrimitiveTypeKind,and there always has to be exactly one.This means that there will have to be a number of model elements in CeeJay models that are always supposed to be there,just as the package Predefined in SDL.
The second variety of types is CeeJayClass itself.In both Java and C++, each class is also a type.
Collections are mentioned explicitly in this metamodel.In order to use the built-in collections of C++or Java although they have di?erent names(and di?erent semantics and usage),there has to be a speci?c representation to unify them.
3.5Functions and variables
As can be seen in?g.2on the facing page,both variables and functions are model elements that have a name and a type.Additionally,functions have parameters (ie.they inherit from ParameterizedElement and a body.
Variables can be marked as being constant.This,however,necessitates initial values,and those can imply an order for the variables,which is not desired. Function bodies It is not yet completely clear how to represent the body–is it a nested namespace containing,among other things,the local variables,or is it only an ordered sequence of statements?The latter approach has the advantage of being simple,but it is also very close to an abstract syntax tree and as such not in the spirit of modelling.For instance,declarations of variables would just occur in the statement sequence,the variables would not truly live within the funtion’s namespace.
The choice of the representation of the body is heavily in?uenced by the way the runtime library is built.While the languages that we want to generate code for are similar,their system libraries are very di?erent.Parts of these di?erences will be covered by the metamodel,others by the supporting runtime library(cf. sec.4.2).
The requirement that each function need a type leads to the need for a type void,which has to be explicitely disallowed for variables.The respective constraint is not shown here.The alternative solution,one that was also chosen in the UML metamodel,is to have the type being optional on a TypedElement, which,unfortunately,is not intuitive at all.
4The Runtime Library
4.1Related Work
Automated code generation has become an accepted method in the design of new software systems(protocols,IT switches,control systems).There is a wide range
of code generators available which produce code of a particular programming language from a particular speci?cation or description language like SDL.
Most of them use some kind of runtime environment for the generated code for reasons of abstraction,e?ciency and adaptability.The environments could be realized quite di?erently.Some SDL code generators use a code library(like Tele-logic TAU[11]),some use precon?gured code fragments(like SINTEF ProgGen [12]),and others use runtime environments in a even broader https://www.doczj.com/doc/544841710.html,ually each code generator is quite?xed regarding its runtime environment,target language, target platform and the con?guration of the resulting executable system.
SITE[1],the SDL code generation environment once developed in our re-search group,behaves similarly.Its generated C++code depends on a runtime library.But various e?orts have been undertaken to provide more?exibility.It is possible to exchange the library when conforming to its interface,and there is a mechanism to change the code generator output without changing the generator, and additional information could be embedded directly into the SDL speci?ca-tion.We perceive the desire to be more?exible,to reuse the existing generator for a broader spectrum of application.The runtime library presented in[13]is meant as a contribution to that issue.That library allows the generated system to be adapted to di?erent communication means to the environment,that is protocols and encodings.
But restrictions remain.If we want to switch to a di?erent target program-ming language,even if close the the one used,a completely review of the code generator is needed,possibly even a new code generator.Inevitably,we need a new runtime library,too.That is,for every desired combination of source and target language we need one code generator.If we could achieve a separation of syntactical issues from abstract concepts of the target language it would be suf-?cient to have one abstract transformation per source language and one concrete code generation per target language.
4.2SDL runtime library
Elements of the library One aim of our code generation is simple and read-able code;another is a straightforward code generator.Both aims imply that the runtime library must give extensive support for the concepts of the source lan-guage.As has been previously shown in[1,3]this can be achieved by structural equivalence of the source and the target speci?cations.
The result can be seen in?g.3on the next page.The system type stype is transformed into a C++class of the same name that inherits from sdlsystem,a class de?ned in the library.Likewise,btype is a block type in SDL and inherits from sdlblock in C++.The gate and the channel are simply variables of the corresponding C++types.
To this end,the runtime provides classes for SDL concepts that the concrete classes of the speci?cation inherit.Other elements of the library not shown here are functions to route signals.
signal alive;class alive:sdlsignal;
system type stype;class stype:sdlsystem{ gate whorl out with alive;sdlgate whorl(0,alive);
channel pingpipe from b via bwhorl sdlchannel pingpipe(b,whorl, to env via whorl with alive;env,whorl,alive);
block type btype;class btype:sdlblock{ ......
endblock type;};
block b:btype;btype b;
endsystem type;};
system s;stype s;
Fig.3.SDL and corresponding C++(simpli?ed)
Interfacing models and the library In order to use the library e?ectively, the library’s interface has to be speci?ed.Often,this happens in plain English text.However,to access the library in the model,we need a formal de?nition of the interface in a package that is part of the model,just as a set of header?les for a C library become part of the program at compile time.In a similar fashion as the package Predefined in SDL,this package is considered to be in every CeeJay model.This package,however,does not contain any implementations, and no code will be generated for it;it is considered to exist in the target as well.This is necessary to use references in MOF(for specialization or function calls),as those are not by name.
Furthermore,the interface must be consistent for all the runtime libraries (for di?erent requirements and target languages).In the past,this was often not enforced,and di?erences between the libraries became apparent only when problems occured.
To de?ne the interface,we have yet to decide upon a standardized method such as IDL or eODL.Note that the interface is not limited to function calls, but also includes classes that are used as types and for inheritance.
5Conclusion
The last step in a complete model driven software engineering process is the generation of implementation artifacts,usually in the form of source code.While code can be generated directly from high-level models such as UML,this puts too much work on the code generator.Instead,a stepwise re?nement of the model into a model geared towards code generation is preferable.
To this end we have prepared a metamodel that is reasonably close to the target languages Java and C++,while still being general enough to not only cover these two languages,but other object-oriented languages as well.
This is di?erent from existing metamodels that have been published(mainly for Java),which are close to the grammar of Java.Thus,they can often hardly be called metamodels,as they are no more than a MOF representation of the abstract grammar.
The CeeJay metamodel will be used in a framework where C++is generated from SDL speci?cations.The aim of this open framework is to extend it for other
output languages,such as Java or Python,and other input languages,such as UML or domain speci?c languages.
In order to execute SDL models,infrastructure is needed that will be in-cluded in the form of runtime libraries.These facilitate the code generation by covering the remaining di?erences between our target languages and by pro-viding solutions for complex concepts of the source language(SDL).Still more importantly,an infrastructure with a well-de?ned interface allows to change the runtime library to meet speci?c new needs.
The code-generation metamodel CeeJay and its accompanying libraries will allow us to generate code for and execute or simulate arbitrary SDL systems. References
1.Schr¨o der,R.,B¨o hme,H.,von L¨o wis,M.:SDL Integrated Tool Environment(1997–
2003).URL https://www.doczj.com/doc/544841710.html,rmatik.hu-berlin.de/SITE/.Last checked:Febru-ary27,2006
2.Fischer,J.,Kunert,A.,Piefel,M.,Scheidgen,M.:ULF-Ware–an open framework
for integrated tools for ITU-T languages.In:Prinz et al.[14],1
3.Neumann,T.:Abbildung von SDL-2000nach Java.Dissertation,Humboldt-
Universit¨a t zu Berlin(2000)
4.Neumann,T.,Piefel,M.:Kimwitu++–A Term Processor(2002).URL http://
https://www.doczj.com/doc/544841710.html,rmatik.hu-berlin.de/~tneumann/https://www.doczj.com/doc/544841710.html,st checked:February 27,2006
5.Scheidgen,M.:A MOF2.0for Java.URL https://www.doczj.com/doc/544841710.html,rmatik.hu-berlin.
de/sam/meta-tools/https://www.doczj.com/doc/544841710.html,st checked:February8,2006
6.Alanen,M.,Porres,I.:A relation between context-free grammars and meta object
facility metamodels.Tucs technical report no606,Turku Centre for Computer Science(2003)
7.Dockx,J.,Mertens,K.,Smeets,N.,Steegmans,E.:jnome:A Java meta model in
detail.Report cw323,Department of Computer Science KULeuven(2001)
8.OMG:Metamodel and UML Pro?le for Java and EJB Speci?cation.Object Man-
agement Group(2004).formal/04-02-02
9.Tichelaar,S.,Ducasse,S.,Demeyer,S.,Nierstrasz,O.:A meta-model for language-
independent refactoring.In:Proceedings ISPSE2000.IEEE(2000),157–167 10.Piefel,M.:A common metamodel for code generation.In:J.Aguilar(ed.),Pro-
ceedings of the3rd International Conference on Cybernetics and Information Tech-nologies,Systems and Applications.I I I S,Orlando,USA(2006)
11.Telelogic:Communications software speci?cation and software development Tele-
logic TAU SDL Suite(2006).URL https://www.doczj.com/doc/544841710.html,/corp/products/ tau/sdl/https://www.doczj.com/doc/544841710.html,st checked:February28,2006
12.Floch,J.:ProgGen:SDL transformation Tool.SINTEF Telecom and Informatics
(1998).URL http://www.sintef.no/units/informatics/products/proggen/.
Last checked:February28,2006
13.Fischer,J.,Neumann,T.,Olsen,A.:SDL code generation for open systems.In:
Prinz et al.[14],313
14.Prinz,A.,Reed,R.,Reed,J.(eds.):SDL2005:Model Driven:12th International
SDL Forum,volume3530/2005of Lecture Notes in Computer Science.Springer-Verlag GmbH(2005).ISBN3-540-26612-7.ISSN0302-9743
讯镭Netum条码扫描枪如何使用? 来源:扫描网 讯镭Netum条码扫描枪如何使用?大多数用户应该都知道,条码扫描枪是即插即用的,直接连接电脑就可以开始扫描了,可是无线枪的连接相对来说就优点麻烦了,有些无线枪在扫描之前还需要配对,很多用户都不是很理解,下面扫描网小编以迅雷Netum条码扫描枪NT8800为例,给大家讲解一下无线枪在使用时需要注意哪些方面。 使用前须知: 1)迅镭NT-8800扫描枪的充电接口仅能进行充电操作,不能连接其他数据线: 2)充电时,迅镭NT-8800扫描枪底部指示灯为红色(请务必使用出厂标配电源适配器进行充电,否则有可能损坏设备);充电饱和时,指示灯熄灭(关机充电状态下) 3)充电时间:4小时完全饱和 4)开机后,如迅镭NT-8800扫描枪超过20秒未使用,将进行自动关机 5)出厂时迅镭NT-8800扫描枪与接收器间已建立好配对关系,如无必要,请勿自行配对。如实在需要重新配对,请先扫频道设置(设置此项之前需要将接收端的复位键长按至绿灯常亮时方可设置频道,设置好之后按复位键绿灯熄灭) 如何连接? 1)设备连接;将USB迷你接收器连接到数据终端(如电脑) 2)开启扫描枪;按扫描枪的按键开关。听到滴的二声后,即开启了扫描枪 常见问题: 1)问:扫描枪有“滴”一声长鸣的提示音?答:这是因为扫描枪电力不足,需要充电 2)问:机器短鸣三声答:这是因为扫描枪没有与USB迷你接口器连接上,或者是没有信号。请重新连接设备并适当调整工作范围。 3)问:扫描枪扫描正常,但数据终端不显示数据?答:未扫描“开启无线”或USB迷你接收器与扫描数据终端未正确连接,请参照本指引中的“基本操作流程””重新设置一遍。或者是数据终端的USB接口破坏或对外设支持不好,请换一个USB口或重启电脑 4)问:无线电传输是否会影响家电(如:电视机)及其他电器的使用?答;一般不会。此型号的无线激光条码扫描枪的无线功率水平在10dbm以下,且使用2.4G频段,对其他无线电的干扰较小。
条码扫描枪常见故障以及解决办法 条码扫描枪的使用操作步骤 1、插入扫描枪(默认情况下是接入电脑的USB接口) 2、鼠标打开EXCEL(或任何可以输入文本的软件) 3、在光标定位到要录入的单元格 4、扫描条码(根据需要设置条码枪的扫描模式,如扫描后回车、换行、连续扫描) 5、扫描完成,保存。 条码扫描枪不能读取条码的几种原因 1)没有打开识读这种条码的功能。 2)条码不符合规范,例如缺少必须的空白区,条和空的对比度过低,条和空的宽窄比例不合适。 3)阳光直射,感光器件进入饱和区。 4)条码表面复盖有透明材料,反光度太高,虽然眼睛可以看到条码,但是采集器识读条件严格,不能识读。 5)硬件故障,和你的经销商联系进行维修。 在笔记本电脑上,键盘接口的条码扫描器工作不正常,或扫描器正常而键盘不能工作 笔记本电脑上,键盘接口的扫描器相当于外接键盘。 笔记本电脑的键盘接口如果连接键盘之后可能的变化是∶ 1)原有键盘失效。这时扫描器正常而键盘不能工作 2)笔记本电脑的键盘正常,外接键盘不工作。这时扫描器不工作 解决办法∶ 1)通过自动方式设置BIOS使外接键盘工作 2)连接键盘接口扫描器 3)扫描器接外接键盘 4)或者直接使用串口扫描器 条码扫描枪使用常见问题 Q:计算机发出嘟嘟声,一些条码数据丢失 A:这是因为条码传输速度太快,需要减慢条码的传输速度 Q.读取一个条码后,扫描器死机 A:由于扫描器的保护功能,如果读取的条码数据传输错误,会自动进入保护状态,从而防止数据丢失。如果把没有传输成功的数据读取后,扫描器可以从新使用。 如果发生这种现象,请仔细检查连线、协议。确认无误后,拔出扫描器,然后另换别的USB接口连接设备使用
扫描枪使用规范 扫描线的链接问题: 扫描枪都是即插即用,无需驱动和软件即可正常使用。接口有分三种:USB口,键盘口,串口。不同点在于:USB接口和键盘口的枪连接电脑后,扫描到的条码信息都可在任意的常用软件的输入窗口中直接显示;而串口的扫描枪只能在特定的窗口中输入,如附件中的通讯选项中的超级终端。 扫描枪连接到电脑上的时候都会有电源提示音,根据不同品牌和不同型号的扫描枪,提示音有不同。 扫描枪的使用规范: 一维扫描枪: 1.按下扫描键红色光线从枪口射出,需要用红色光线贯穿条码上的黑条。根据 条码的尺寸不同,扫描距离的远近也有不同。一般是需要拉到条码宽度占据红光的三分之二为最佳。另根据扫描枪的性能不同,该标准也有不同之处,但差距甚微。 2.扫描角度最理想为30—60度角。该标准也根据标签纸的不同材质和扫描时的 光线环境有些许不同。一般国内常见扫描枪,多以45度角为最佳。调整角度的同时也可适当的调整距离,已达到最佳扫描位置。 注:上述要求根据常见的一维激光扫描枪而定,另有一种红光扫描枪,于本标准有较大差异。红光扫描枪扫描距离需要很近,且对于角度方面要求不高,一般距离在1-5CM不等,可根据实际情况调整到最佳位置。 二维扫描枪: 二维扫描枪所射出的光线是呈区域型的,正中会有一个红色的十字形图案做定
位。四周有四个角确定范围大小。扫描时应将红色十字最准二维码,大概居中即可,扫描角度以90度直角为最佳。区域范围根据条码大小有不同,以条码占据区域的二分之一到三分之二为最佳。另根据不同品牌不同型号的扫描枪,以上标准略有差异,同样,差异度不大,可适当调节以达到最佳扫描位置。 注意事项: 因串口扫描枪比较少用,故此处着重说明USB口和键盘口扫描枪使用中的问题。原理类似。 在您正常使用前需要做的检查工作有:硬件是否有损坏;配件是否齐全;接口是否是您所指定的。如有发现问题,请尽快联系本商城的在线客服。 1.检查无误后,连接电脑相应的接口,听到电源提示音为正常,可以开始扫描 工作。如无提示音,请先更换接口,重新连接。如是键盘口扫描枪,可直接更换电脑测试一下。如任无反应,请联系本商城在线售后人员帮您查看问题,并解决。 2.上述一切正常后,开始扫描测试工作。可在桌面新建一份记事本文档,打开 后点击文档空白处,即可开始扫描测试。可参照扫描枪的使用规范来操作。 正常情况下,按键扫描后,条码信息即会显示在先前打开的记事本文档中。 如果扫描的是一维码,可根据条形码下方的数字来核对扫描的信息是否有误; 如是二维码,可根据先前所编辑的信息来核对是否正确。 3.如果您使用的是其他软件,则需要先选中软件中可输入的窗口,光标停留在 输入位置,扫描相应的条码即可在输入窗口中键入所扫描到的条码信息。
CLV 条码阅读器使用指南
目录 1.条码阅读器的安装步骤----------------------------- (1) 2.条码阅读器扫描频率设定方法----------------------- (4) 3.CVL Setup软件使用说明--------------------------- (5) 4.附录1:CLV44X动态聚焦功能使用方法--------------- (23) 5.附录2:SICK CAN-SCANNER-NETWORK介绍------------- (29)
一、条码阅读器的安装步骤 1.条码阅读器的对准 条码阅读器安装的第一步首先需要将条码阅读器的激光与被阅读的条码对准,这样才能保证阅读效果。 上图所示为三种不同类型的扫描器的对准方法。 (1)单线式条码阅读器,首先使条码阅读器的光 线垂直于条码方向,同时条码阅读器将激光的中心位置对准条码。 (2)多线式条码阅读器,首先使条码阅读器的光线平行于条码方向,同时调整条码阅读器使激光对准条码的中心位置。 (3)对于摆动镜式阅读器,首先使条码阅读器的光线平行于条码方向,同时调整条码阅读器以保证所有的条码都位于激光的阅读区域内。 2.安装距离和角度 扫描器的安装距离是指从扫描器的窗口到条码表面的距离。下图所示为阅读距离的测量方法,每种型号的条码阅读器的阅读距离都不同,因此安装过程中阅读距离的确定需要查阅相关型号的技术参数。 为了避免条码表面对激光直接的反射,条码阅读器一般不采取垂直于条码表面的安装方式,扫描器的安装角度有如下要求。