Jump to content

Wouter

Members
  • Posts

    129
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Wouter

  1. There are several .dll availables for .NET. You can use them also in LabVIEW. http://www.google.nl/search?q=qr+code+generator+dll. Further when you google on "ISO/IEC 18004:2006" you may or may not find a .PDF file containing the ISO/IEC specification of QR code, enabling you to fully implement QR code in LabVIEW. However note that the .PDF is actually not the latest edition "ISO/IEC 18004:2006" but the previous "ISO/IEC 18004:2000".

  2. VI Name:

    IP Validation

    Total VIs:

    strpos.vi, strrpos.vi, substr_count.vi, valid_ipv6.vi, test,vi, unittest.vi, ip2long.vi, long2ip.vi, valid_ipv4.vi

    Description:

    I saw in the svn of OpenG that there was a candidate for IP validation. But however I think I have a better one. One for IPv4 and one for IPv6, credits for the IPv6 algo goes to http://crisp.tweakbl...d-caveats).html

    Note:

    -

    Blockdiagram:

    -

    What are you thoughts on this VI?

    • Would you like to see such a function in OpenG?
    • Can you optimize the code?
    • In which package should it be included?
    • Should it be rejected?

    -edit- ups I forgot to set the unittests data I inputed in the control as default value... well you can now enter them by hand.

    $unitTests = array(    '2001:0db8:0000:0000:0000:0000:1428:57ab'    => true,    '2001:0DB8:0000:0000:0000:0000:1428:57AB'    => true,    '2001:00db8:0000:0000:0000:0000:1428:57ab'    => false,    '2001:0db8:xxxx:0000:0000:0000:1428:57ab'    => false,    '2001:db8::1428:57ab'    => true,    '2001:db8::1428::57ab'    => false,    '2001:dx0::1234'    => false,    '2001:db0::12345'    => false,    ''            => false,    ':'            => false,    '::'            => true,    ':::'            => false,    '::::'            => false,    '::1'            => true,    ':::1'            => false,    '::1.2.3.4'        => true,    '::256.0.0.1'        => false,    '::01.02.03.04'        => false,    'a:b:c::1.2.3.4'    => true,    'a:b:c:d::1.2.3.4'    => true,    'a:b:c:d:e::1.2.3.4'    => true,    'a:b:c:d:e:f:1.2.3.4'    => true,    'a:b:c:d:e:f:1.256.3.4'    => false,    'a:b:c:d:e:f::1.2.3.4'    => false,    'a:b:c:d:e:f:0:1:2'    => false,    'a:b:c:d:e:f:0:1'    => true,    'a::b:c:d:e:f:0:1'    => false,    'a::c:d:e:f:0:1'    => true,    'a::e:f:0:1'        => true,    'a::e:f:0:1'        => true,    'a::f:0:1'        => true,    'a::0:1'        => true,    'a::1'            => true,    'a::'            => true,    '::0:1:a:b:c:d:e:f'    => false,    '::0:a:b:c:d:e:f'    => false,    '::a:b:c:d:e:f'        => true,    '::b:c:d:e:f'        => true,    '::c:d:e:f'        => true,    '::e:f'        => true,    '::e:f'            => true,    '::f'            => true,    '0:1:a:b:c:d:e:f::'    => false,    '0:a:b:c:d:e:f::'    => false,    'a:b:c:d:e:f::'        => true,    'b:c:d:e:f::'        => true,    'c:d:e:f::'        => true,    'd:e:f::'        => true,    'e:f::'            => true,    'f::'            => true,    'a:b:::e:f'        => false,    '::a:'            => false,    '::a::'            => false,    ':a::b'            => false,    'a::b:'            => false,    '::a:b::c'        => false,    'abcde::f'        => false,    '10.0.0.1'        => false,    ':10.0.0.1'        => false,    '0:0:0:255.255.255.255'    => false,    '1fff::a88:85a3::172.31.128.1' => false,    'a:b:c:d:e:f:0::1'    => false,    'a:b:c:d:e:f:0::'    => false,    'a:b:c:d:e:f::0'    => true,    'a:b:c:d:e:f::'        => true,    'total gibberish'    => false);

    ValidateIP.zip

  3. Do you really need the voltage level? Or do you only need a indicator for the how much % of the battery level remains. If the latter you can just use the "GetSystemPowerStatus" function, it also returns the % level of the battery.

    If not you can use PowerReadACValue; msdn.microsoft.com/en-us/library/windows/desktop/aa372734(v=VS.85).aspx

    or PowerReadDCValue; msdn.microsoft.com/en-us/library/windows/desktop/aa372737(v=VS.85).aspx

    for all power management functions you can look here: msdn.microsoft.com/en-us/library/windows/desktop/aa373163(v=VS.85).aspx

  4. VI Name:

    CRC32

    Total VIs:

    3

    Description:

    I was suprised LabVIEW didn't had the CRC32. So I made it, http://en.wikipedia.org/wiki/Cyclic_redundancy_check, http://www.ietf.org/rfc/rfc1952.txt. It can take a array of U32, one element of U32 or a string. When needed I can create more CRC checks, CRC8, CRC16, etc... but CRC32 is the most used one I readed.

    Note:

    -

    Blockdiagram:

    gallery_17774_56_22701.png

    What are you thoughts on this VI?

    • Would you like to see such a function in OpenG?
    • Can you optimize the code?
    • In which package should it be included?
    • Should it be rejected?

    crc32.vi

    crc32 (Element).vi

    crc32 (String).vi

  5. VI Name:

    SliceString

    Total VIs:

    2

    Description:

    The slice string should in my opinion by revised. Currently it is not doing as the name implies it thus. Because it only fetches the subset of a string, which can already be done by the "string subset" function in LabVIEW, the only thing it really does is calculating the length. Because one gives 2 indices, i:j, then length is j-i.

    My two VI's are different. They accept a array of indices and then slice them on those places and index the results in a array of strings. Further the other VI accepts a numeric input and then slices the string after each repetition. The end VI should be polymorfic. (The slice string by reptition is in fact the same as the StringToChar function.

    Note:

    -

    Blockdiagram:

    Slice string by indices

    gallery_17774_56_21691.png

    Slice string by repitition

    gallery_17774_56_6448.png

    What are you thoughts on this VI?


    • Would you like to see such a function in OpenG?

    • Can you optimize the code?

    • In which package should it be included?

    • Should it be rejected?

    ps. the snippts are in 2011, the VI's in 2009

    SliceStringByIndices.vi

    SliceStringByRepetition.vi

  6. VI Name:

    Numeric to binary string and binary string to numeric

    Total VIs:

    2

    Description:

    Conversion of numeric to binary string, and binary string back to numeric

    Note:

    Could be a good wrapper in my opinion.

    Blockdiagram:

    Binary string to numeric:

    gallery_17774_56_133.png

    Numeric to binary string (from: https://decibel.ni.com/content/docs/DOC-5782)

    gallery_17774_56_4269.png

    What are you thoughts on this VI?

    • Would you like to see such a function in OpenG?
    • Can you optimize the code?
    • In which package should it be included?
    • Should it be rejected?

    • Like 1
  7. VI Name:

    Hamming Weight and Hamming Distance

    Total VIs:

    2

    Description:

    One VI calculates the hamming weight, the other the hamming distance,

    Note:

    -

    Blockdiagram:

    Hamming weight (two versions, one with parallel loop, other without, didn't tested which one was faster)

    gallery_17774_56_20603.png

    Hamming distance:

    gallery_17774_56_23692.png

    What are you thoughts on this VI?
    • Would you like to see such a function in OpenG?
    • Can you optimize the code?
    • In which package should it be included?
    • Should it be rejected?

  8. For this particulary example I disagree with you. Comment is good, but all the comments in this particular example are in my opinion not needed since the code is very straight forward.

    When coding in C I wouldn't either comment code like "lenVariable = strlen(strVariable) // get the length of the string"

    In my opinion only parts of code which are not that straightforward, certain parts of a algorithm, should be documented. When all the parts of the algorithm are straightforward, as in this case, the only thing that needs to be documented is what the algorithm exactly does, which is already done in this case.

    Of course one could discuss about what the exact definition is of straightforward.

    • Like 1
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.