Example Code

Offline QR Code Generator v1.1

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

 

Overview
This VI demonstrates how to automatically generate offline QR Code based on the user's input.

 
Description
The QR Code Generator is based on the source code provided by ZXing Team.

https://github.com/zxing/zxing/

Credits to Thonky for providing detailed concept behind QR Code Encoding and Error Correction.

You can refer to the link below for more information.

http://www.thonky.com/qr-code-tutorial/

en.wikipedia.org/wiki/QR_code

  

Requirements

  1. LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Download and open the attached.llb file.
  2. Open the QR Code Generator Main UI.vi
  3. Run the VI.
  4. Select the appropriate parameters.

(Side note: If Automatic is selected, it will only check if the string that you used is numeric, alphanumeric or plain text)

  1. Insert the message of your choice and observe the changes in the QR Code.
  2. (Optional) Select your preferred directory, filename and image size to save the image. Click Save.

 

Additional Information or References

VI Snippet

QR Code Generator Main UI.docx.png

 

 **This document has been updated to meet the current required format for the NI Code Exchange.**



See that button on the left side of this post...

If you feel my post is helpful, all you need is just (at most) 2 seconds to click that button, to show your appreciation. Thank you~~



Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Hong.Zhang@agresearch.co.
Member
Member
on

Thanks for this VI.

But I have a problem, When using my cellphone to read the QC I have got Unknow QR Code. Why? How to fix it.

Image1.jpg

ongeelim
Member
Member
on

Hi Hong, 

Thanks for the input.

May I know what is the mobile app that you're using to scan and read the QC?

I've used the Barcode Scanner app by Zxing Team and I managed to read your QC from your attached image.

Screenshot_2015-03-10-21-43-43.jpg

Try use that app and see if that works.

https://play.google.com/store/apps/details?id=com.google.zxing.client.android&hl=en

Thanks.



See that button on the left side of this post...

If you feel my post is helpful, all you need is just (at most) 2 seconds to click that button, to show your appreciation. Thank you~~



alexderjuengere
Active Participant
Active Participant
on

ongeelim, your vi's also work perfectly (I did test "Automatic" and "Numeric") with

https://itunes.apple.com/us/app/easy-scanner/id546599922?mt=8

which I use on a Nokia Lumia Windowsphone.

m_m_m
Member
Member
on

Great work! What is the licence of your code?

joezhang
Member
Member
on

Nice work. I noticed that the right edge and bottom edge in the saved image was cropped compared with the previous image in the screen. Is this normal?

In addition, it seems that only jpg file format is used even though bmp or png is selected.

Thanks, Joseph

567.jpg

Rob_Calhoun
Member
Member
on

Hi ongeelim,

 

Nice job! I have the same question as "m_m_m" above re: license. Under what license are you releasing this? (It looks like the Zxing library is released under the Apache license.)

 

Re: feedback on the code: I'm not familiar with the QR spec but I think you want to change the feedback node in "QR Code Encoder" from uninitialized to initialized. (You've got a loop, so just use a regular shift register.) Otherwise, you're storing state between calls. I assume it always hit the "true" case when i=0, but no need to run the risk of unintended side-effects by using a static var. 

 

Have a great day!

 

Rob Calhoun

quade
Member
Member
on
Hello Community, this QR code generator is really great. Unfortunately, I can't create QR codes that contain more than 424 characters. A code is created, but it is no longer recognized as QR code. I tried two QR scanners with my Android and USB scanners "Michael Krug MK-5400 and MK 5500". Has anyone dealt with this problem? Thank you very much for your support.
GaryGC
Member
Member
on

Hi,

I am looking for a QR Code generator that will place an image in the centre of the QR Code.

 

Any suggestions?