 |
|
ขอความช่วยเหลือการใช้งาน Function ใน SDK เครื่องสแกนนิ้ว Tomura 130 ครับ |
|
 |
|
|
 |
 |
|
ผมใช้ VB2010 เขียนโปรแกรมระบบงานผลิตของโรงงาน และมีความต้องการข้อมูลเวลา เข้า-ออก ของพนักงานมาคิดเป็นค่าแรงเฉพาะงาน
ซึ่งใช้เครื่อง Tomura 130 เป็นเครื่องแสกนนิ้ว
ผมได้ SDK มาจากตัวแทนแล้วแต่ยังไม่เข้าใจว่าจะเรียก Function ใช้งานอย่างไรเนื่องจากไม่เคยใช้มาก่อน Function มีค่าพารามิเตอร์
ชนิด Long FAR* ซึ่งผมไม่เคยใช้มาก่อน เข้าใจว่าเป็น Data Type ใน C
SDK มีหลาย Function แต่ผมคงใช้แค่ 2 Function เท่านั้น ตามมนี้นะครับ
[center]SB100PC OCX
User’s Manual
2008. 4 [/center]
FK526KMS OCX Manual
==========================================================================================
1.1 Function “ReadAllGLogData”
[Function] Function “ReadAllGLogData” is used to read all of the recorded attendance data from the specified terminal and store them in the internal memory.
[Format] BOOL ReadAllGLogData ( Long dwMachineNumber )
[Parameter] dwMachineNumber : It stands for the ID number of the terminal to read the data from.
[Return Value] It is TRUE when the efficient data has been read from the specified terminal.
It would be FALSE if the specified terminal does not exist, it does not have any attendance data recorded on it or an error has occurred to the data communication.
[Attention] Function “ReadAllGLogData” reads all of the attendance data out from the specified terminal and stores them in the internal memory.
Unlike “ReadGeneralLogData”, this function also reads the attendance data which have ever been read before as well as the newly-recorded ones as long as they have not been deleted.
Using function “GetAllGLogData”, the user can get the data stored in the internal memory.
==========================================================================================
1.2 Function “GetDrAllGLogData”
[Function] Function “GetDrAllGLogData” is used to get all of the attendance data from the internal memory.
[Format] BOOL GetDrAllGLogData (
Long dwMachineNumber,
Long FAR* dwTMachineNumber ,
Long FAR* dwEnrollNumber ,
Long FAR* dwEMachineNumber ,
Long FAR* dwVerifyMode ,
Long FAR* dwYear,
Long FAR* dwMonth,
Long FAR* dwDay,
Long FAR* dwHour,
Long FAR* dwMinute
LongFAR* dwEvent);
[Attention] The function gets the data which function “ReadAllGLogData” read from the specified terminal and stored in the internal memory.
The method of using this function is the same as that of “GetDrGeneralLogData”.
Execution of this function has nothing to do with the value of “ReadMark property”.
==========================================================================================
Function “ReadAllGLogData” พอเข้าใจว่าอ่านข้อมูลเข้าหน่วยความจำจากนั้นใช้ Function “GetDrAllGLogData” อ่านข้อมูลจาก memory Parameter ต่างๆที่เป็น Long FAR* ต้องเขียนอย่างไร, ค่า dwVerifyMode , ค่า Long FAR* dwEMachineNumber ,,LongFAR* dwEvent พวกนี้ต้องกำหนดอย่างไร รบกวนท่านที่มีความรู้ช่วยด้วยครับ
Tag : .NET, Win (Windows App), VB.NET
|
|
 |
 |
 |
 |
Date :
2015-07-18 15:49:18 |
By :
somchaiasko |
View :
1614 |
Reply :
6 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมกำลังมีปัญหาเรื่องนี้เหมือนกันเลยครับ ผมต้องเขียน VB ให้บริษัท ใช้ Function ReadAllGLogData และ GetDrAllGLogData เช่นกันครับ ยังไม่รู้จะหาคำตอบได้ยังไง รบกวนผู้รู้ช่วยหน่อยนะครับ  
|
 |
 |
 |
 |
Date :
2015-07-20 09:04:54 |
By :
Dr.Q |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ดู ๆ แล้วคงเป็นงานที่ยากลำบากหน่อยนะครับ เพราะ Function ที่ว่านี้ คุณไม่ได้เขียนขึ้นมาเอง แต่อย่างไรก็ดี
ในความมืดนั้น ก็คงพอที่จะมีแสงสว่าง หรือทางออกอยู่บ้างนะครับ
1. คุณควรเอาคู่มือ ของบริษัท มาอ่านรายละเอียด ถึงการ Input และการ ขบวนการ Process
2. คุณลองเอา Function ที่ว่ามานี้ ทดลองใส่ค่าอะไรก็ได้เข้าไป แล้ว Run โปรแกรมทดสอบดู ว่า Function มัน Return
ค่าอะไรออกมาให้คุณบ้าง
3. การทดสอบโปรแกรมผมคิดว่าคุณคงต้อง ทดสอบร่วมกัน Hardware ด้วยนะครับ
อันนี้พอเป็นแนวทางนะครับ เพราะจริง ๆ แล้วมันเป็นเช่นไรบ้างผมก็ไม่ทราบ และขอให้โปรแกรมของคุณประสพผลสำเร็จนะครับ
|
 |
 |
 |
 |
Date :
2015-07-20 17:54:33 |
By :
noonkamfunt |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ฮ่าๆๆ เจอเพื่อนที่มีปัญหาเดียวกันแล้วครับ
แต่ยังไม่พบผู้มีประสพการณ์มาแนะนำ
ยังรอคำตอบอยู่ะครับ
และขอบคุณ คุณ noonkamfunt ที่ให้กำลังใจ คู่ทือ SDK อ่านๆๆๆ มากกว่า 10 ตรั้งแล้วครับ และหาจากช่องทางอื่นๆเท่าที่มีความสามารถ
เมื่อผมแก้ปัญหาได้ จะเอาCode มาเผยแพร่ครับ
|
ประวัติการแก้ไข 2015-07-21 21:18:57
 |
 |
 |
 |
Date :
2015-07-21 21:13:31 |
By :
somchaiasko |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
หลักการคือต้อง wrap unmanaged code ก่อนเรียกใช้งานที่จุดอื่นภายใน .net
โดยการ map ทั้งชื่อ function และ parameter ทีนี้ความยุ่งยากมันอยู่ที่
attribute และการเทียบเคียงประเภทตัวแปรต่างๆให้เรียกผ่านกันได้ ซึ่งออกตัวว่านานๆใช้ที
เลยแนะนนำ link นี้ อธิบายนี้ดีกว่าผมเยอะมีตัวอย่างมากมายด้วยครับ
http://www.pinvoke.net/
|
 |
 |
 |
 |
Date :
2015-07-24 10:42:58 |
By :
DOG{B} |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ทดสอบครับ
ไม่ทราบ Webเป็นอะไร กด Submit แล้วขึ้น Command Saved มา 3 ครั้งแล้วแต่ข้อความไม่ขึ้นครับ
|
 |
 |
 |
 |
Date :
2015-07-24 19:04:03 |
By :
somchaiasko |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คราวนี้ขึ้นครับ
ตัวอย่าง Code ที่ผมมีนะครับ
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using zkemkeeper;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
int count = 0;
zkemkeeper.CZKEMClass axczkem1 = new zkemkeeper.CZKEMClass();
bool bIsConnected = false;
string ip = "192.168.140.254";//write here IP Address of your biomatric m/c
int port = 4370;
bIsConnected = axczkem1.Connect_Net(ip, port);
if (bIsConnected == true)
{
MessageBox.Show("Connection established!!!" );
bool ret = axczkem1.ReadAllGLogData(1);
if (ret)
{
int a = 0;
int b = 0;
int c = 0;
int d = 0;
int ee = 0;
int f = 0;
int g = 0;
int h = 0;
int i = 0;
int j = 0;
int k = 0;
int l = 0;
int m = 0;
int n = 0;
int o = 0;
while (axczkem1.GetAllGLogData (1, ref a, ref b, ref c, ref k, ref l, ref d, ref m, ref ee, ref f, ref g))
{
if (ee == 7 && m == 4 && d == 2011)
{
count++;
if (b == //any Employee No)
{
MessageBox.Show(b.ToString() + " hour: " + f + " Min: " + g);
MessageBox.Show(k.ToString() + " " + l.ToString());
}
}
}
//MessageBox.Show(count.ToString ());
}
}
else
MessageBox.Show("cannot Connection!!!");
axczkem1.Disconnect();
}
}
}
|
 |
 |
 |
 |
Date :
2015-07-24 19:06:28 |
By :
somchaiasko |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|