Robert,
It seems that you are right and my code was actually not working correctly, even though I thought it was. When I set the 'DAQmx read.vi' function for the analog inputs to 'continious samples' with 500 samples to read, and a 1Hz loop speed, based on my testing it appeared that the sample speed was not actually 500 Hz. Instead it seem to take 500 samples very quickly (faster than 500Hz) and then wait and then sample again, and so on.
I have implemented your suggestion and changed everything to software timing. All four tasks in MAX have been set to '1 sample (on demand)' and all four 'DAQmx read.vi' functions have been set to sample at 'multiple channels, single sample' with the producer loop set to 500 Hz (2ms wait). Unformately at the moment the loop only appears to be cycling at 1Hz and I cannot understand why. I have disabled absolutely everything (the whole consumer loop, the que, and all other functions in the producer loop) other than the acquisition functions and the producer loop still only increments at 1Hz. I can see from task manager that the CPU usage is only around 10% and the Labview only uses 150MB of memory so I cannot understand what is limiting the producer loop speed. Could it be that the NI hardware is not capable? I am acquiring 31 analog channels and 4 digital cahnnels. Though I have had 31 analog channels being acquired with hardware timing at 500Hz with no problem previously.
My hardware is an NI-cDAQ-9178 chassis with an NI-9213 and NI-9207 for the analg inputs and an NI-9375 for the digital inputs.
EDIT: just noticed that the sample speed of the NI-9213 cards are max 75Hz, so I would still expect the producer loop to be able to run at 50Hz at least, and not 1Hz.