1.1 GMC card functions overview
GMC板卡是由深圳市大族思特科技有限公司自主研發(fā)的振鏡運動控制卡,目前該控制卡實現(xiàn)的主要功能有:
GMC board card is a galvanometer control card independentlydeveloped by Shenzhen Han’s Scanner S&T, co., LTD. The main functions ofthe control card are as follow
1、 支持2D,3D以及飛行打標(試行)功能。
Supports 2D, 3D and flight marker functions
2、 支持三種振鏡數(shù)據(jù)通信協(xié)議,分別是XY2-100,SPI以及SL2通信協(xié)議。用戶可以根據(jù)方頭的協(xié)議,用上位機軟件進行協(xié)議切換。
Three kinds ofmirror data communication protocols are supported, namely xy2-100, SPI andSL2.Users can use software to switch protocols according to actual needs
3、 通過高速以太網(wǎng)與打標軟件進行通信,提高數(shù)據(jù)通信以及打標效率。只需改電腦IP,無需其他需要配置的東西;
High speedEthernet is used to communicate with marking software to improve datacommunication and marking efficiency. In addition, the user can communicatewith the board card through the network cable without installing the board carddriver, which is convenient for installation and use.
4、 提供C++、C#兩種二次開發(fā)語言DEMO,用戶可根據(jù)熟悉的編程語言選擇開發(fā);
Provide C ++, C# two secondary development languages DEMO, users can choose to developaccording to the familiar programming language
5、 支持光纖激光器(如IPG、SPI、銳科、JPT等)、CO2激光器、紫外激光器、綠光激光器。
Support fiberlaser (such as IPG, SPI, Ruike, JPT, etc.), CO2 laser, UV laser, green laser.
6、 自帶高精度校正軟件,校正一次,即可永久使用,無需二次開發(fā)人員頻繁的加載校正文件。本控制卡校正文件保存在控制卡里,斷電重啟也不會丟失,不需要其他軟件再次加載校正文件。
Comes withhigh-precision calibration software. Once calibrated, it can be usedpermanently, without the need for secondary developers to frequently loadcalibration files. This control card calibration file is stored in the controlcard, and it will not be lost after restarting the power supply. No othersoftware is required to load the calibration file again.
Chapter 2: IP setting
因為本控制卡是通過以太網(wǎng)與電腦進行通訊的,因此在使用本控制卡之前,需要對電腦的IP進行設置,IP地址設置網(wǎng)段為172.18.34.2~172.18.34.255均可,子網(wǎng)掩碼255.255.255.0,不過要避免電腦的IP與卡的IP一致,控制卡初始IP地址為172.18.34.227(此IP地址可以更改,不過網(wǎng)段不能改變),另外控制卡在上電時會產(chǎn)生一個臨時的172.18.34.226的地址,等卡上電初始化完成之后此IP就會消失,也避免使用此初始化的IP地址。因此除了卡的IP(172.18.34.227)與初始化IP(172.18.34.226)之外,其他IP隨意設置。
Because thecontrol card communicates with the computer via Ethernet, you need to set thecomputer's IP before using the control card. The IP address can be set from172.18.34.2 to 172.18.34.255. The subnet mask 255.255.255.0, but the IP of thecomputer and the IP of the card should be avoided. The initial IP address ofthe control card is 172.18.34.227 (this IP address can be changed, but thenetwork segment cannot be changed). In addition, the control card will generatea temporary The IP address of 172.18.34.226 will disappear after the card ispowered on and initialized. Avoid using this initialized IP address. Therefore,in addition to the card's IP (172.18.34.227) and initialization IP (172.18.34.226),other IPs can be set at will.
另外,本控制卡可以支持一個上位機軟件同時控制多張控制卡打不同圖形的功能,若要實現(xiàn)此功能,需要將其中一張卡默認的172.18.34.227地址改變一下,可以為172.18.34.228。若多張卡的IP地址一樣,上位機軟件是無法區(qū)分不同的卡。在有多張控制卡的情況下,需要使用路由器或者交換機,在電腦上插入不同的網(wǎng)卡可能會出問題,因此盡量用交換機或者路由器。
In addition, the control card can support one PC software to controlmultiple control cards to play different graphics at the same time. To achievethis function, you need to change the default address of one of the cards to172.18.34.227, which can be 172.18.34.228. If the IP addresses of multiplecards are the same, the host software cannot distinguish between differentcards. When there are multiple control cards, you need to use a router orswitch. Inserting different network cards into the computer may cause problems,so try to use a switch or router.
Chapter 3 SecondaryDevelopment Instructions
3.1 Basicdocument description
GMC控制卡除了提供配套的激光打標軟件以外,還給用戶提供了用于二次開發(fā)的動態(tài)連接庫。所用的文件包括:
In addition to supporting laser marking software, GMC control cardalso provides users with a dynamic link library for secondary development. Thefiles used include
HM_Comm.dll:該DLL主要負責上位機軟件與控制卡之間的數(shù)據(jù)交換,同時也是HM_HashuScan.dll所依賴的連接庫;
HM_Comm.dll: This DLL is mainly responsible for the data exchangebetween the host computer software and the control card, and is also theconnection library on which HM_HashuScan.dll depends;
HM_HashuScan.dll:本文件主要有兩個作用,①生成打標所需要的UDM.BIN 文件;②與控制卡進行數(shù)據(jù)交互,傳送數(shù)據(jù)等;
HM_HashuScan.dll: This file has two main functions: ① generating the UDM.BIN filerequired for marking; ② interacting with the control card to transmit data, etc.
頭文件HM_HashuUDM.h:主要包含用來生成打標數(shù)據(jù),其中包含設置方頭協(xié)議、方頭電機參數(shù)、激光器參數(shù)、基本圖形(點、線、多邊形、圓等)等函數(shù)接口;
Header file HM_HashuUDM.h: Mainly used to generate marking data,which includes setting the square head protocol, square head motor parameters,laser parameters, basic graphics (points, lines, polygons, circles, etc.) andother functional interfaces
頭文件HM_HashuScan.h:主要包含尋找控制卡IP、連接控制卡、發(fā)送數(shù)據(jù)、啟動打標、停止打標等函數(shù)接口;
Header file HM_HashuScan.h: It mainly contains function interfacesuch as finding control card IP, connecting control card, sending data,starting marking, stopping marking, etc .;
System.ini:配置文件,用戶只需要放在EXE所在目錄下即可,缺少此配置文件可能會導致無法找到卡的IP地址
System.ini: configuration file, users only need to put it in thedirectory where the EXE is located. The lack of this configuration file maylead to the failure to find the IP address of the card.
另外還包含對應的兩個LIB文件HM_HashuScan.lib、HM_Comm.lib;
It also contains the corresponding two LIB files HM_HashuScan.lib,HM_Comm.lib
本軟件基礎開發(fā)庫使用VS2010編譯完成,用戶盡可能使用高于2010版本測VS進行開發(fā),支持C++、C#兩種語言。
This software's basic development library is compiled with VS2010.Users should try to develop with VS higher than 2010 version, and support C ++and C # languages.
注意:HM_HashuScan.dll、HM_Comm.dll、System.ini跟EXE程序必須放在同一個目錄下。
用戶如果想快速應用,可以跳過本章,直接看第四章的DEMO開發(fā)指南,可以在DEMO的基礎上快速開發(fā)應用,本章函數(shù)說明可以在不懂的時候再查看。