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, October 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: Develop a background process that feeds data to a foreground loop but with the requirement that the background cannot stall the foreground.

Last issue’s winner: Andy Reding of G.W. Lisk won the ASCII encoding code challenge. This is Andy’s second win. Any one up to the challenge of going head-to-head with a good LV programmer?

Suppose you are collecting multiple channels of data from a DAQ devices at 1000 S/s and you also want to merge into this data stream some measurements from a serial device or some other slower device.

The VI you submit should run have the following specifications:

  • Runs under LV 8.0 or later.
  • Uses Runs under Windows XP.
  • Uses a simulated 6221 E-series created in MAX.
  • Uses a simulated device of you own design that produces 1 DBL number per second using software timing.
  • The fast acquisition acquires 10 channels at 1 kS/s from the simulated 6221. This sample rate is per channel so the aggregate rate is 10 kS/s.
  • The longest delay allowable for retrieving data from the simulated 6221 is 100 ms.
  • The slow acquisition acquires from the simulated slow device (at the specified 1 sample per second). This simulated device must output a value different than the previous value, so each update can be detected in the output data stream.
  • The VI that simulates the slow device must execute in a duration between 500 ms and 1000 ms.
  • Merges the fast and slow data into a single data stream by duplicating the previous slow sample as many times as there are elements acquired from the fast device every iteration of acquisition from the fast device. For example, if the fast channel has a backlog of 12 samples since the last read (120 total samples, 12 points from each of the 10 channels), then the last slow value should be duplicated 12 times and appended to the sampled data to make what appears to be the 11th channel.
  • Save the blocks of the 11 channels to disk in a binary file.
  • Collect data until the Stop button is pressed.

To compare entries, the data stream will be analyzed to find the sample number when the update of the slow data appears within the 11 channel merged data stream.

The winner will be the VI that meets the requirements above and has the smallest jitter in the update of the slow data in the 11 channel merged data stream.

Each submission should also include a file reader VI that will read the 11 channels into a 2D array.

All submitted code will be compiled into LabVIEW 8.5 and run on the same computer with 1GB RAM and a simulated 6221 created in the same MAX version (4.3). Submissions must be received by the 1 December 2008. Award will be made by 15 December 2008.