Usage method: Copy all the test tool directory files to the cashier program directory. First, use Hisense POS scale tool, select the correct model configuration in the setting page and maintain the configuration. Required documents pos_ad_dll.dll------------third-party development interface pos_ad_dll.dll interface function return value #define HS_OK 0xf0 //Normal #define HS_ERROR 0xff //Exception Remarks: All interface functions have a copy ending with _stdcall, such as initializing printer interface The functions are int OpenPrinter(void) and int OpenPrinter_stdcall(void), The latter is mainly to solve the problem of connecting with parameters when the three parties use PowerBuilder as a development tool. The port call is abnormal. Therefore, when three parties use PowerBuilder as a development tool, please Call the interface function with the suffix _stdcall. //**********************Print related ************************** * //Format the string to be printed int PrintText(char *str,int FontSize) parameter: str length must be less than 20480 Fontsize is normally set to 24. Increase width and height to 48. return value: HS_OK HS_ERROR //Bitmap file printing int PrintBitmapFile(char *BmpFileName,int LabelAngle) parameter: BmpFileName: bitmap image file (supports bitmaps below 24-bit color) LabelAngle=0: No rotation, other values ​​are rotated 180 degrees return value: HS_OK HS_ERROR //Start printing int BeginPrint(int PrintType) parameter: PrintType PrintType 4: Paper feeding return value: HS_OK HS_ERROR //Print barcode //parameter: //barcode: barcode data //height: height, value range, 1-255, unit point. //width: width, the value range is 2-6, the default is 2 //textpositon :n print position 0 do not print 1 above the bar code 2 below the bar code 3 above and below the bar code int PrintBarCode(char *barcode,int textPosition=2,int height=50,int width=2); //Send printer instructions //parameter: //cmd: command data //len: data length DllExport int PrintCommand(char *cmd,int len); For example, the printer cash drawer command: unsigned char psCmd[] = {0x1B,0x70,0x0,0xE1,0xE1}; PrintCommand((char *)psCmd,5); //Set line spacing //parameter: //space: line spacing, printer default is 30, spaceX0.125 mm DllExport int SetLineSpace(int space); To //Cut paper command DllExport int CutPaper() To //**********************Weighing related ********************** ** //Read range information----before accessing the weighing-related interface functions, you must call this function at least once, and display the obtained relevant range information truthfully on the application program interface. int read_baseinfo(char *buf) The length of buf must be greater than or equal to 65 bytes return value: HS_OK HS_ERROR If HS_OK is returned, the range information is successfully obtained, and the data structure is as follows long max_range[3]; //Maximum weighing long min_range; //Minimum weighing long max_tare; //Maximum tare weight long max_pre_tare; //Maximum preset tare weight long resolution[3]; //Indexing char Weight_unit[4];//weight unit char money_unit[4]; //Currency unit char system_version[20];//Data transmission version //Clear int send_zero(void) return value: HS_OK succeeded 1 It is not stable and in a non-underload state, it is forbidden to clear 2 The load exceeds the tare range 3 The overload exceeds the tare range -1 exception -2 Data transmission communication is abnormal -3 Data transmission: syntax, logic/cannot be executed, internal function error -8 Failed to connect with IDNET_Service -9 Data communication error with IDNET_Service //Set the tare weight, reserved for compatibility with the old interface int send_tare(char *buf) parameter: The length of buf must be greater than or equal to 10 bytes. The value in buf is an empty string or "0" or "0.000". There are two functions: 1. If there is a tare weight, if gross weight=0, clear the tare weight, otherwise if the net weight is greater than 0, press the button to tare 2. If there is no tare weight, press the button to tare If buf is a string of tare weight, it means the preset tare, such as the string of the tare value that needs to be set, such as 20 grams, the parameter is the string "0.020". return value: HS_OK is successful, and the current tare weight is stored in buf at this time 1 Operation is prohibited if it does not comply with laws and regulations 2 Underload 3 The overload exceeds the tare range 4 Abnormal parameters 5 Abnormal data processing When HS_OK is returned, it indicates that the current tare operation is successful, and the actual tare value after the operation will be stored in buf. If the tare value is 20 grams after the tare operation, the content in buf is "00.0200". //Set the preset tare weight and tare according to the incoming tare weight parameter //The parameter buf is used both as an incoming parameter and as a return tare. The length must be greater than or equal to 10 bytes int send_pre_tare(char *buf) parameter: The string of the tare value that needs to be set, such as 20 grams, the parameter is the string "0.020". If the parameter is an empty string or equal to "0.000", the function is equivalent to clearing the tare weight. return value: HS_OK is successful, and the current tare weight is stored in buf at this time 1 Operation is prohibited if it does not comply with laws and regulations 2 Underload 3 The overload exceeds the tare range 4 Abnormal parameters 5 Abnormal data processing //Press the button to tare, and automatically tare according to the current weight on the weighing pan //The parameter buf is for returning the tare weight, and the length must be greater than or equal to 10 bytes int set_tare_bykey(char *buf) return value: HS_OK is successful, and the current tare weight is stored in buf at this time 1 Operation is prohibited if it does not comply with laws and regulations 2 Underload 3 The overload exceeds the tare range 5 Abnormal data processing //Clear the tare //The parameter buf is for returning the tare weight, and the length must be greater than or equal to 10 bytes int clear_tare(char *buf) return value: HS_OK is successful, the current tare weight is stored in buf at this time 1 Operation is prohibited if it does not comply with laws and regulations 2 Underload 3 The overload exceeds the tare range 5 Abnormal data processing //Read weight int read_standard(char *buf) The length of buf must be greater than or equal to 18 bytes return value: HS_OK success -1 underload -2 overload HS_ERROR exception If HS_OK is returned, the weight information is successfully obtained, and the data structure is as follows char status; //bit0 (the first bit) of status indicates whether it is stable, if it is 1, it means stable //bit1 (second bit) of status indicates whether it is at the zero position, if it is 1, it indicates the zero position //bit2 of status (the third digit) indicates whether there is tare weight, if it is 1, it means there is tare weight char net_weight[7]; char FixSeparator;//Fixed to "P" char tare_weight[7]; When under load, the data in net_weight is "┗━┛", and the return value is -1 When in overload state, the data in net_weight is "┏━┓", and the return value is -2 ; Open the cash box int OpenCashDrawerEx(void) Administrator mode is required for the first run ; Cash drawer status bool GetCashDrawerStatus(void); return value: true open state false closed state