ProductInfoForLV
ProductInfoForLV
Take advantage of General SQLite Op COM
Also for LabVIEW use
This library is written in .Net Framework 4.8, built as for X64 platform.
A LabVIEW version provided in this package. The developing LabVIEW is of x86 version in LabVIEW Q2023.
You can send me email to tell which versions you want.
The infrastructure is in PowerPoint (in attached file ProductInfoStructure.pptx)
The source code of LabVIEW project is provided, which demonstrates how to use this library (ProductInfoForLV.dll).
Also, the source code of the whole library ProductInfoForLV and the unit test is provided too.
This library just exports limited functions like below:
1.Open 2.Close 3.ClearAllData 4.RetrieveMultiple 5.RetrieveSingle 6.GetRecordCount 7.Insert 8.InsertOrUpdate 9.DeleteBySql 10.ExecuteNonQueryDirectly 11.CheckBarcodeMatchs
The previous 10 functions just operate the table Products using GeneralSQLiteOp_v2.COM.dll (a necessary COM component), and use JSON string to represent the Product data struct since there are difficulties to convert data between LabVIEW and .Net. The last function is used in factory automation frequently, the scenario is that factory clients always scan a product to test or production and required to check if the bar code of the product is valid or invalid. This function assumes clients can make a barcode rule very simplified like this:
1. %Y, this means Year4, like 2023
2. %y, this means Year2, like 23
3. %M1, this means MonthNoPadding, 1 or 2 characters, like 9 (September)
4. %M2, this means Month2, like 09 (September)
5. %d, this means DayNoPadding, 1 or 2 characters, like 8 (day 8 of a month)
6. %D, this means Day2, like 08 (day 8 of a month)
7. %D8, this means Date8, this is a combination of %Y%M2%D, like 20231123
8. %H, this means Hour, 2 characters, in factory automation, no body use 1 character width
9. %m, this means Minute
10. %s, this means Second
11. %T6, this is a combination of %H%m%s, like 083859
12. %DT, this is a combination of %D8%T6, full date time like 20231123083859
13. %Fixed:ABC%%, from this format, it gets difficult, this means a fixed string ABC. In factory production, most products will have some fixed text in the barcode like the code of the facility.
14. %VarChar:12%%, this means some variable text with width (here it is 12) will be presented
15. %VarNumber:9%%, this means some number with width (here it is 9) will be presented
16. %Any, this means any text from this location will be presented, so this should be the last item in the rule.
If user wanted to set rule of barcode check, then set Product. CheckBarcodeRule = true, and set Product.BarcodeRule = something
Currently, users can only call CheckBarcodeMatchs to manually check if it really matches or not.
Hereafter you can look through the Word document ProductInfo.docx to understand how the tool works
One more thing, if you want to make it work, the prerequisite is to call regasm.exe to register the 3 COM components. Fortunately, I developed install.ps1 in sub folder ‘install’, you call run it in PowerShell, also I wrote install.bat to execute install.ps1, so you can run it instead.
Author
Patrick Gamp
For technique support or business, please call the cell phone ++0086-18603016232, email: patrickgamp@hotmail.com, WeChat(A Chinese popular chat app) id is same to the cell phone number
I am a professional with 26 years software RD experience. In 2005-2018, worked for Microsoft Windows Mobile and Windows Phone developing team, XBox One manufacturing automation team, and Surface imaging test team, after 2019, opened a small automation software corporation at the first strong manufacturing city in the world - Suzhou, China. If you have some industry automation related software project to oursource, or any Windows desktop based non-Web softare developing requirements, please send me email to contact.
Published date
November 23, 2023
v1.0.1↙ 1.3K