David Boyd Posted May 8, 2023 Report Share Posted May 8, 2023 View File Data Matrix Generator v1.0 LV2020 This project library enables conversion from string data to a 2-D integer array encoding Data Matrix ECC200 symbology. The library includes demo code to render the output to a LabVIEW picture indicator. Submitter David Boyd Submitted 05/07/2023 Category *Uncertified* License Type MIT 2 Quote Link to comment
Neil Pate Posted May 8, 2023 Report Share Posted May 8, 2023 Thanks for sharing @David Boyd How did you do this? Quote Link to comment
Yair Posted May 8, 2023 Report Share Posted May 8, 2023 1 hour ago, Neil Pate said: How did you do this? There's a private method called Convert to Stub which does this. I never used it, but I understand it does have some caveats. 1 Quote Link to comment
Neil Pate Posted May 8, 2023 Report Share Posted May 8, 2023 Thanks, I did not know about this. I am not sure I will ever use it, but I like to know such a feature exists (or not). Reading that thread, I am not 100% in agreement with the comments that moving to class solves everything. Not everything needs to be a class, sometimes a plain old cluster is really ok. Even for biggish clusters. Anyway, completely separate discussion 🙂 1 Quote Link to comment
David Boyd Posted May 8, 2023 Author Report Share Posted May 8, 2023 Meh, I just used the stub to save some real estate on front panels (which are generally never going to be called directly by consumers of the library, so not really important). I'm aware that stubs have caveats, chiefly that they hold no actual default value, but that shouldn't be an impact here. Where used, they pass all the metrics of the pattern being generated (as a typedef). If it's bothersome/objectionable, the solution is simple - replace the stubs with instances of the control. But really, I was hoping the discussion would tend more to the "wow, cool..." or "when would you ever need to make these symbols..." or even "hey, there's already libraryX that does this...". I'm looking forward to hearing any discussion of the merits of having a pure-G implementation. Thanks all! Dave Quote Link to comment
hooovahh Posted May 8, 2023 Report Share Posted May 8, 2023 Very cool stuff. I don't know much about 2D barcode encoding, but how does this differ from the code posted by Darin here? Yours looks more polished, but I didn't know if one encoding is better or if both are the same. My users generally don't care at all and just want something that if they scan types what is in the barcode and it seems my QR Code scanning app works with either. Quote Link to comment
David Boyd Posted May 8, 2023 Author Report Share Posted May 8, 2023 (edited) 23 minutes ago, hooovahh said: Very cool stuff. I don't know much about 2D barcode encoding, but how does this differ from the code posted by Darin here? Yours looks more polished, but I didn't know if one encoding is better or if both are the same. My users generally don't care at all and just want something that if they scan types what is in the barcode and it seems my QR Code scanning app works with either. Brian, Darin's library implements QR, mine does Data Matrix; they're both popular 2-D barcode symbologies. QR seems to be ubiquitous (looks like most phone cameras now natively identify and decode it). Data Matrix (actually, the very specific GS1 implementation) is used throughout industry (especially med/pharm) to encode serialization/batch identification, use-by/expire-by dates, etc. I think every imaging scanner out there will read both QR and DM along with the endless variety of linear barcodes. I do believe DM encodes more data, at least it supports pretty large patterns with more capacity. When I came across Darin's QR library, it did inspire me to offer up a solution for Data Matrix. As I noted in my readme/release notes, I thought "how tough could it be?". After reading the ISO 16022 standard I think I nearly had a brain hemorrhage! Dave Edited May 8, 2023 by David Boyd Quote Link to comment
Rolf Kalbermatter Posted May 8, 2023 Report Share Posted May 8, 2023 4 hours ago, David Boyd said: When I came across Darin's QR library, it did inspire me to offer up a solution for Data Matrix. As I noted in my readme/release notes, I thought "how tough could it be?". After reading the ISO 16022 standard I think I nearly had a brain hemorrhage! I'm not entirely sure if that applies to every ISO standard, but that reaction is usually mine too. They tend to be complicated, involved, lengthy and almost incomprehensible. RFC's also have a tendency to contain a lot of verbiage and not really come to the actual meat of it very soon, but they at least have usually some actual description and even occasional examples. ISO often just seems like a lot of bla bla and it is rather difficult to distill the actual useful information out of it. Quote Link to comment
David Boyd Posted May 8, 2023 Author Report Share Posted May 8, 2023 29 minutes ago, Rolf Kalbermatter said: I'm not entirely sure if that applies to every ISO standard, but that reaction is usually mine too. They tend to be complicated, involved, lengthy and almost incomprehensible. RFC's also have a tendency to contain a lot of verbiage and not really come to the actual meat of it very soon, but they at least have usually some actual description and even occasional examples. ISO often just seems like a lot of bla bla and it is rather difficult to distill the actual useful information out of it. Rolf, I must say that at least this ISO did have some example code written in C which I found helpful (and I quoted from on some block diagrams where the LabVIEW code might otherwise have been incomprehensible). I also included a link in my library documentation to the GitHub repository for the Zebra Crossing (zxing) Data Matrix encoder sources (Java). I will say that the LabVIEW is far from a "straight port" of either of those. Quote Link to comment
huipeng8 Posted May 19, 2023 Report Share Posted May 19, 2023 There is also a Datamatrix Code generated here( https://forums.ni.com/t5/Example-Code/Datamatrix-generate-by-labview/ta-p/4073613 ),But there is a bug inside that can cause problems when generating indexes larger than 44 * 44 symbols. I didn't study the code carefully, but I tried and there was no similar issue here, and the execution speed was faster.👍 Quote Link to comment
David Boyd Posted May 19, 2023 Author Report Share Posted May 19, 2023 It amazes me that I never found that bit of code, and it's right there on NI's site. I'll need to download it and have a look. Especially because I noticed that it claims support for all the encoding methods (ASCII, C40, X12, EDIFACT, etc), whereas I've left that for a future implementation - my 1.0 upload only supports ASCII. Just to be clear what that means - my library will encode any arbitrary string of 8-bit chars, it just means that there may be more optimal (meaning: shorter run length) alternatives. I did implement ISO 16022's rather arcane "look-ahead" test which tells you when to switch in/out of the other encodings for optimized length; I just don't have them implemented, so I don't make use of "look-ahead". Thanks, @huipeng8, for alerting me to this code, and for the good report on execution speed. Dave Quote Link to comment
hooovahh Posted May 22, 2023 Report Share Posted May 22, 2023 On 5/19/2023 at 12:19 AM, David Boyd said: It amazes me that I never found that bit of code, and it's right there on NI's site. I know right? I was looking for a 2D barcode generator not that long ago which is why I mentioned Darin's post that I found, which I presumed you had seen. I searched the forums a bunch and the only other code I found would send it to a website to get generated. I also saw a semi-hacky method using a Zebra printer API, but I never found that NI post either. Quote Link to comment
David Boyd Posted May 22, 2023 Author Report Share Posted May 22, 2023 I downloaded the code linked to by @huipeng8and looked at it a little over the past weekend, and I can tell you that I'm not especially impressed. It appears to be based off an older open source project (written in C) called libdmtx, started by Mike Laughton, but long since moved to GitHub and maintained there by others. I found that code to be harder to follow than the Zebra Crossing open source project (which I perused during my development; linked as reference code in my lvlib). Though likely I just didn't look at libdmtx long enough to grok it. My main grief with the LabVIEW code (written by NI user carroll-chan) is that it has absolutely zero BD comments, nor VI descriptions, so far as I've seen (s/ though it does have an endless variety of "interesting" VI Icons /s). And for any effort like this, implementing a very exacting ISO standard, IMO it needs to have some ties back to the standards doc. Also, please don't ask me how I feel about LLB packaging/distribution in the modern era. Quote Link to comment
tomboy - Posted June 20, 2023 Report Share Posted June 20, 2023 hello , can you lower it to the version below 2018 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.