I have a PCIe-6351 multifunction board on my computer.
And I want to realize exact 1ms timed loop control for my device including read analog and digital data, and write pwm signal.
Could any one tell me whether it is possible and if it is, how to realize it.
(as far as I know, only NI devices like CompactRIO or myRIO can realize such 1ms exact timed loop, is it true?)
Anything running on Windows will fail you as far as timing. At 1ms, you could likely accomplish your timing requirement on a Real Time system. There are PXI controllers that use an RT OS. So you could use one of those.
Personally, I would use an R series FPGA board and put any time critical controls in the FPGA. Can't get any more deterministic than hardware.
FYI, the cRIO and myRIO are based on an RT controller and a FPGA that controls the IO.
As far as I know, Ubuntu is not a Real Time OS. So you will have similar issues with timing as Windows.
Hard to answer without knowing what you actually want to do.
If you want to have software, running on a PC run in deterministic time, no you can't do that because PCs don't do that.
If you want to concurrently read a signal and generate an output a precise point in time, that is very easy using triggering.
A lot depends on what kind of calculations need to be done and what precisely do you mean by "exact 1ms".
You can even convert a PC into a RT machine, but I wouldn't count on a very precise 1kHz loop rate (again, I don't have enough information to give a more concrete answer).
If you consider changing hardware, you might also look into R series devices, that have a FPGA chip onboard. This way you are able to program the control loop directly on the card, although you need the FPGA Module for that.