12-13-2013 12:04 AM
test_man ha scritto:
In LabVIEW you are running both blocks simulteneously. (Delay and Digital pulse)
In CVI you are running sequencially.
With the code I posted timer and digital output start at the same moment.
12-13-2013 12:10 AM
PKIM ha scritto:
I just test it with CmtScheduleThreadPoolFunction to spawn many threads to paralellize the code but it doesn't for short sleep. It will only work if sleep is so long. I think it is due to if you just want to sleep for few milliseconds, the time to create the threads, set/get policy and runing a pooling loop will be much longer than few milliseconds.
I didn't explain myself well. My intention was to change your entire sequence in the way I posted, not to have a simple step executed in its own thread; this way SetSleepPolicy is called only once before the sequence executes, Also, I wanted you to try the entire code without multithreading, just to check the behaviour of the system in plain and simple conditions. If this is satisfactory, next you can try moving it to a separate thread and optimize it as needed.