Related Content

Contact Information

Viewpoint Systems, Inc.
800 West Metro Park
Rochester, NY 14623
Phone: 585.475.9555
Fax: 585.475.9645

Viewpoint Data Management, LLC.
800 West Metro Park
Rochester, NY 14623
Phone: 585.475.9555
Fax: 585.475.9645

round top

bulletViewpoint News, Spring 2008


Code Challenge

Want to highlight your skills to your peers and win a $50 gift while doing it? Take the Viewpoint Code Challenge.

This issue’s challenge: Converting a byte array into an ASCII encoded string.

Last issue’s winner: Jimmy Zhang at Lockheed Martin in Syracuse, NY. Jimmy’s solution was as fast as Andy Reding’s (who won the previous Code Challenge), but Jimmy reused memory by overwriting his initial array, and this efficiency feature broke the tie.

Similar to MIME and the now “ancient” uuencode standard, we want to take a sequence of byte values and convert it to its ASCII equivalent in hex values. For example, the string “ASCII” has a ASCII byte array equivalent of [ 0x41, 0x53, 0x43, 0x49, 0x49 ] (shown using hex values). The ASCII encoded output string of the routine in this Code Challenge should return the string “4153434949”.

The input to the encoding VI will be the byte array and the output will be the ASCII encoded hex-based string.

One use of this would be to store a flattened string to a text file or an XML file.

To compare entries, each VI will be run with a specific byte array which can be found by downloading the VI (Code Challenge Data - LV71.vi) which has the test case input byte array saved as default.

In previous challenges, the winner was ranked only on execution speed. In this Code Challenge, VI memory usage is also important. Now the rank is based on the shortest vector length of [Execution Time, (VI Memory Usage)/100000], with the memory usage as reported in the VI Properties after the VI has been executed once. Execution time is in milliseconds, memory is in bytes. (Note, the vector length of [a,b] is sqrt(a^2+b^2).)

All submitted code will be compiled into LabVIEW 8.5 and run on the same computer with 1GB RAM. Submissions must be received by the end of July 2008.

Please submit your solution (via email) as a ZIP file (with no password, please).