Hi StevenK,
Have you tried reading the voltage from test panels in Measurement and Automation Explorer (MAX). This can be found at Start » All Programs » National Instruments » Measurement and Automation. Find your device under devices and interfaces and right-click and select test panels. By running the test in test panels, we can verify that the device is able to read the proper voltage and eliminate any possible errors with the LabVIEW code. If you are still reading voltages that are incorrect, what type of break-out box are you using to make connections to your PCI-6229? What is the voltage range you are trying to read and how far off is the reading?
If you're able to get the test panels to show the correct voltage, I would suggest moving towards our example programs to verify that the device is working in LabVIEW. One example can be found in the following: (Help » Find Examples » Hardware Input and Output » DAQmx » Analog Measurements » Voltage » Acq&Graph Voltage-Int Clk.vi). From the code that you posted, it looks like your trying to take in digital values and then you wait 500ms before you do your analog input. I also wanted to warn you that when running two concurrent loops with global variables you may need to watch out for race conditions. A good article on this can be found
here. Take a look at the Producer/Consumer tutorial in the related links.
I hope this helps,
Paul C.