领胜LDS 键盘AOI检测项目
patrick.xu
2022-02-24 3322022068ab818912d6f5d9e5eb31f51cc639c2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?xml version="1.0" encoding="UTF-8"?>
<hdevelop file_version="1.1" halcon_version="12.0">
<procedure name="Go2GenTLStamp">
<interface>
<io>
<par name="Stamps" base_type="iconic" dimension="0"/>
</io>
<ic>
<par name="Index" base_type="ctrl" dimension="0"/>
</ic>
<oc>
<par name="Value" base_type="ctrl" dimension="0"/>
</oc>
</interface>
<body>
<c>* Check if we are on a 64-bit machine</c>
<l>test_value := 0xFFFFFFFF</l>
<l>if (test_value &gt; 0)</l>
<l>    is64bit := 1</l>
<l>else</l>
<l>    is64bit := 0</l>
<l>endif</l>
<c>* </c>
<l>get_grayval (Stamps, 0, (Index * 4), tempvalue0)</l>
<l>get_grayval (Stamps, 0, (Index * 4) + 1, tempvalue1)</l>
<l>get_grayval (Stamps, 0, (Index * 4) + 2, tempvalue2)</l>
<l>get_grayval (Stamps, 0, (Index * 4) + 3, tempvalue3)</l>
<c>* </c>
<c>* The actual stamp from the Gocator is 64-bit. tempvalue0 is the most significant 16-bit (i.e. the top bit is the sign bit)</c>
<c>* The code below assumes we only need the bottom 32-bit information. User need to update this conversion function if they want to</c>
<c>* return 64-bit value.</c>
<c>* </c>
<l>if (is64bit = 1)</l>
<l>    tuple_lsh (tempvalue0, 48, tempvalue0)</l>
<l>    tuple_lsh (tempvalue1, 32, tempvalue1)</l>
<l>    tuple_lsh (tempvalue2, 16, tempvalue2)</l>
<l>    tuple_lsh (tempvalue3, 0, tempvalue3)</l>
<l>    Value := tempvalue0 + tempvalue1 + tempvalue2 + tempvalue3</l>
<l>else</l>
<l>    tuple_lsh (tempvalue2, 16, tempvalue2)</l>
<l>    tuple_lsh (tempvalue3, 0, tempvalue3)</l>
<l>    Value := tempvalue2 + tempvalue3</l>
<l>endif</l>
<l>return ()</l>
</body>
<docu id="Go2GenTLStamp">
<parameters>
<parameter id="Index"/>
<parameter id="Stamps"/>
<parameter id="Value"/>
</parameters>
</docu>
</procedure>
</hdevelop>