CAS Java Communication Library Guide
CAS Java Communication Library Guide
Contents
㈜ CAS
4.2.1 Set PLU 11
4.2.2 Delete PLU 14
4.2.3 Delete all PLU 15
4.3 Parameter 16
4.3.1 Set Parameter 16
4.4 Keypad 18
4.4.1 Set Keypad 18
4.5 Ingredient 30
4.5.1 Set Ingredient 30
4.5.2 Delete Ingredient 31
4.5.3 Delete all Ingredient 32
4.6 Symbol 33
4.6.1 Set Unit Symbol 33
4.6.2 Delete Unit Symbol 34
4.6.3 Delete all Unit Symobl 35
4.7 Label 36
4.7.1 Set Label 36
4.8 Weight (Only Vietnam) 37
4.8.1 Set weight transmission property 37
5. How to check Result 39
5.1 Make the class to receive the result 39
5.2 How to Check result 39
2
1. CAS Java Library
1.1 Necessary file
To operate a program to communicate with CAS label scale, five file with application
program must be existed in the same route.
A. Java Library (JRE System Library)
a. JavaSE-1.7
B. Java Library (JRE System Library)
a. [Link]
C. Other external libraray
a. [Link]
b. [Link]
c. [Link]
d. [Link]
2. Packages
3
2.1 [Link]
2.1.1 EmActionType
Element Code Description
Send 1 Send data to scale
SendAll 2 Send all data to scale
Take 3 Take data from scale
TakeAll 4 Take data from scale
Delete 5 Delete data
DeleteAll 6 Delete all data
2.1.2 EmDataType
Element Code Description
Keypad 3 Keypad
PLU 11 PLU
Symbol 21 Symbol
Ingredient 22 Ingredient
VersionInfo 58 Version Information
Parameter 1004 Parameter
2.1.3 EmCommType
Element Code Description
COMMTYPE_TCPI Tcp Tcp/Ip communication
P
COMMTYPE_SERI Serial Serial communication
AL
COMMTYPE_FTP Ftp Ftp communication
2.1.4 EmScaleModel
Element Code Description
CL5000 5000
CL5000J 5010
CL5200 5200 In china, It is called CL3000
CL5200J 5210
CL5500 5500
CL7200 7200
2.1.5 ScaleType
Element Code Description
Bench 1 Bench type
Pole 2 Pole type
2.1.6 CommState
Element Code Description
FAIL 0 Fail transmission
SUCCSESS 1 Success transmission
CONNECTION_ERRO 2 Fail connection
R
SCALE_ERR_CHECKS 217 Checksum is wrong
UM
PACKET_ERR_WRON 501 Packet is wrong
G
4
2.2 [Link]
2.2.1 Class [Link]
: You can send data to a scale using this class
(1) Constructor
Description
CasCommLib()
: Create object and initialize member
Default properties file path : INSTALL_PATH + props/[Link]
CasCommLib(String propFilePath)
: Create object and initialize member
Parameter:
propFilePath : path of “[Link]”
(2) Method
Type Method and Description
void sendToScale(Map<String, String> scaleEnv, Object sendData,
Map<String, String> scaleInfo, ResultReceive resultReceive)
: Send data to a scale.
Parameter:
scaleEnv : Environment Information of this communication
work.
sendData: Data to transfer
scaleInfo : Scale Information
resultReceive : Class to receive the communication result
2.3 [Link]
2.3.1 Class [Link]
: There are definitions used in this library. Refer to provided source code
(1) Constructor
Method and Description
ResultReceiveData()
: Create object and initialize member
5
ResultReceiveData(IRepeat repeatCallback)
: Create object and initialize member and repeat callback method
Parameter:
repeatCallback: interface of IRepeat. It has repeat method
(2) Method
Type Method and Description
void setResultData(Map<String, String> scaleEnv, int workResult,
List<Map<String, String>> resultData, Object obSendList,
Map<String, String> scaleInfo)
: Receive the communication result through this method
Parameter:
scaleEnv : Environment Information of this communication work.
workResult: Result of this communication work
resultData : Detail result
obSendList : Data you tried to send
scaleInfo : Scale Information
3.2 scaleInfo
(1) Type: Map<String, String>
(2) Map Key
Refer [Link] class
key string Field in class Description
Ip MK_IP Set scale IP
Port MK_PORT Set scale port (20304)
Model MK_MODEL Set scale model code
Refer : 2.1.4 EmScaleModel
ScaleType MK_SCALETYPE Set scale type
6
Refer : 2.1.5 ScaleType
Version MK_VERSION Firmware Version of the Scale
3.3 resultReceive
(1) Type: interface ResultReceive
: You should input the class which implements the ResultReceive Interface to this
parameter.
You can receive the communication result through this parameter
3.4 WorkResult
(1) Type: int
: You can confirm the information of each communication result through this
parameter
Refer [Link] to check Result
7
4.2.1 Set PLU
(1) Set scaleEnv property
key string Value Description(refer enum)
string
Action 1 [Link]()
DataType 11 [Link]()
Encoding MS936 Depending on Language
or Ex) for china
EUC-CN -“MS936“ for windows
-“EUC-CN“ for unix/linux
CommType Tcp EmCommType.COMMTYPE_TCPIP.getCom
mType()
decimalPointPric 2 Price decimal point(0 ~ 5)
e In China, the decimal point is 2 digits
9
mType()
10
4.3 Parameter
4.3.1 Set Parameter
(1) Set scaleEnv property
key string Value string Description(refer enum)
Action 1 [Link]()
DataType 3 [Link]()
Encoding MS936 Depending on Language
or Ex) for china
EUC-CN -“MS936“ for windows
-“EUC-CN“ for unix/linux
CommType Tcp EmCommType.COMMTYPE_TCPIP.getCom
mType()
11
DataType 3 [Link]()
Encoding MS936 Depending on Language
or Ex) for china
EUC-CN -“MS936“ for windows
-“EUC-CN“ for unix/linux
CommType Tcp EmCommType.COMMTYPE_TCPIP.getCom
mType()
– The keypad consists of a normal and shift key. The PLU key can set both
normal key and shift key. On the other hand, the function key is set only for
the normal key.
12
The following picture is a KeyV1(Value Obejct) class diagram.
13
– There are five PLU Categories. There are five pages in one category. The
page1 for the normal keypad and the page2 is for the shift keypad.
– The configure of arrFunctionPage is as follos.
– The function page1 for the normal keypad and the page2 is for the shift
keypad.
– How to assignfunction key.
– To assign a function key to the first key.
1. Set the desired category.
2. Set function key send.
3. Set page, key, code.
14
– How to assign PLU key
– To assign a function key to second key.
1. Set the desired category
2. Set function key send
3. Set PLU key send.
4. Set category, page, key, code
18
[Link]()
Individuality16 0x02D0 FunctionKeyIndividualityCode.
[Link]()
19
SpecialUse13 0x070D [Link]
e()
SpecialUse14 0x070E [Link]
e()
SpecialUse15 0x070F [Link]
e()
SpecialUse16 0x0710 [Link]
e()
SpecialUse17 0x0711 [Link]
e()
SpecialUse18 0x0712 [Link]
e()
SpecialUse19 0x0713 [Link]
e()
SpecialUse20 0x0714 [Link]
e()
SpecialUse21 0x0715 [Link]
e()
SpecialUse22 0x0716 [Link]
e()
SpecialUse23 0x0717 [Link]
e()
SpecialUse24 0x0718 [Link]
e()
SpecialUse25 0x0719 [Link]
e()
SpecialUse26 0x071A [Link]
e()
SpecialUse27 0x071B [Link]
e()
SpecialUse28 0x071C [Link]
e()
SpecialUse29 0x071D [Link]
e()
SpecialUse30 0x071E [Link]
e()
SpecialUse31 0x071F [Link]
e()
SpecialUse32 0x0720 [Link]
e()
SpecialUse33 0x0721 [Link]
e()
SpecialUse34 0x0722 [Link]
e()
SpecialUse35 0x0723 [Link]
e()
SpecialUse36 0x0724 [Link]
e()
SpecialUse37 0x0725 [Link]
e()
SpecialUse38 0x0726 [Link]
e()
SpecialUse39 0x0727 [Link]
e()
SpecialUse40 0x0728 [Link]
e()
SpecialUse41 0x0729 [Link]
20
e()
SpecialUse42 0x072A [Link]
e()
SpecialUse43 0x072B [Link]
e()
SpecialUse44 0x072C [Link]
e()
SpecialUse45 0x072D [Link]
e()
SpecialUse46 0x072E [Link]
e()
SpecialUse47 0x072F [Link]
e()
SpecialUse48 0x0730 [Link]
e()
SpecialUse49 0x0731 [Link]
e()
SpecialUse50 0x0732 [Link]
e()
SpecialUse51 0x0733 [Link]
e()
SpecialUse52 0x0734 [Link]
e()
SpecialUse53 0x0735 [Link]
e()
SpecialUse54 0x0736 [Link]
e()
SpecialUse55 0x0737 [Link]
e()
SpecialUse56 0x0738 [Link]
e()
SpecialUse57 0x0739 [Link]
e()
SpecialUse58 0x073A [Link]
e()
SpecialUse59 0x073B [Link]
e()
SpecialUse60 0x073C [Link]
e()
SpecialUse61 0x073D [Link]
e()
SpecialUse62 0x073E [Link]
e()
SpecialUse63 0x073F [Link]
e()
SpecialUse64 0x0740 [Link]
e()
SpecialUse65 0x0741 [Link]
e()
SpecialUse66 0x0742 [Link]
e()
SpecialUse67 0x0743 [Link]
e()
SpecialUse68 0x0744 [Link]
e()
SpecialUse69 0x0745 [Link]
e()
21
SpecialUse70 0x0746 [Link]
e()
SpecialUse71 0x0747 [Link]
e()
SpecialUse72 0x0748 [Link]
e()
SpecialUse73 0x0749 [Link]
e()
SpecialUse74 0x074A [Link]
e()
SpecialUse75 0x074B [Link]
e()
SpecialUse76 0x074C [Link]
e()
SpecialUse77 0x074D [Link]
e()
SpecialUse78 0x074E [Link]
e()
SpecialUse79 0x074F [Link]
e()
SpecialUse80 0x0750 [Link]
e()
SpecialUse81 0x0751 [Link]
e()
SpecialUse82 0x0752 [Link]
e()
SpecialUse83 0x0753 [Link]
e()
SpecialUse84 0x0754 [Link]
e()
SpecialUse85 0x0755 [Link]
e()
SpecialUse86 0x0756 [Link]
e()
SpecialUse87 0x0757 [Link]
e()
SpecialUse88 0x0758 [Link]
e()
SpecialUse89 0x0759 [Link]
e()
SpecialUse90 0x075A [Link]
e()
SpecialUse91 0x075B [Link]
e()
SpecialUse92 0x075C [Link]
e()
SpecialUse93 0x075D [Link]
e()
SpecialUse94 0x075E [Link]
e()
SpecialUse95 0x075F [Link]
e()
SpecialUse96 0x0760 [Link]
e()
SpecialUse97 0x0761 [Link]
e()
SpecialUse98 0x0762 [Link]
22
e()
SpecialUse99 0x0763 [Link]
e()
SpecialUse100 0x0764 [Link]
de()
4.5 Ingredient
4.5.1 Set Ingredient
(1) Set scaleEnv property
key string Value string Description(refer enum)
Action 1 [Link]()
DataType 22 [Link]()
Encoding MS936 Depending on Language
or Ex) for china
EUC-CN -“MS936“ for windows
-“EUC-CN“ for unix/linux
CommType Tcp EmCommType.COMMTYPE_TCPIP.getCom
mType()
23
Ingredient Ingredient Ingredient text
24
[Link]()
ScaleType 2 Depending on Scale Type
1 : [Link]
2 : [Link]
3 : [Link]
4 : [Link]
5 : [Link]
6 : Scaletype.LP1
[Link]()
4.6 Symbol
4.6.1 Set Unit Symbol
(1) Set scaleEnv property
key string Value string Description(refer enum)
Action 1 [Link]()
DataType 21 [Link]()
Encoding MS936 Depending on Language
or Ex) for china
EUC-CN -“MS936“ for windows
-“EUC-CN“ for unix/linux
CommType Tcp EmCommType.COMMTYPE_TCPIP.getCom
mType()
25
4.6.2 Delete Unit Symbol
(1) Set scaleEnv property
key string Value string Description(refer enum)
Action 5 [Link]()
DataType 21 [Link]()
Encoding MS936 Depending on Language
or Ex) for china
EUC-CN -“MS936“ for windows
-“EUC-CN“ for unix/linux
CommType Tcp EmCommType.COMMTYPE_TCPIP.getCom
mType()
4.7 Label
4.7.1 Set Label
(1) Set scaleEnv property
key string Value string Description(refer enum)
Action 1 [Link]()
DataType 6 [Link]()
Encoding MS936 Depending on Language
or Ex) for china
EUC-CN -“MS936“ for windows
-“EUC-CN“ for unix/linux
CommType Tcp EmCommType.COMMTYPE_TCPIP.getCom
mType()
27
4.8 Weight (Only Vietnam)
4.8.1 Set weight transmission property
(1) set scaleEnv property
key string Value string Description(refer enum)
Action 1 [Link]()
DataType 11000 [Link]()
Encoding MS936 Depending on Language
EUC-CN Ex) for china
or -“MS936“ for windows
Cp1258 -“EUC-CN“ for unix/linux
for vietnam
-“Cp1258”
CommType Tcp EmCommType.COMMTYPE_TCPIP.getCom
mType()
29