Robert,
Thanks for your suggestion. For simplicity I have changed all the data acquisition to be software timed, as per your example. However I am having some issues. If I set the 'DAQmx read.vi' functions to sample a single sample at a time and the 'wait(ms).vi' to 2, the loop seems to increment at 10Hz exactly for some reason, and not at 500 Hz. If I change the 'DAQmx read.vi' function to acquire multiple samples at a time (so that the samples get put into a buffer) I get this error:
Error -200284 occurred at control_v2_ML_simple.vi
Possible reason(s):
Some or all of the samples requested have not yet been acquired.
To wait for the samples to become available use a longer read timeout or read later in your program. To make the samples available sooner, increase the sample rate. If your task uses a start trigger, make sure that your start trigger is configured correctly. It is also possible that you configured the task for external timing, and no clock was supplied. If this is the case, supply an external clock.
Property: RelativeTo Corresponding Value: Current Read Position Property: Offset Corresponding Value: 0
Task Name: Heater testing lab analog inputs
I don't understand why this is happening considering considering when I was using hardware timing, I was still able to acquire 500 samples per second in the producer loop with no issues.