Hi Jani,
You said
"
..., but why elapsed time is giving different time than "numeric"-time ?"
The code demonstrates the answer you posted, ie how to measure the elapsed time. The code that executes between the first millisecond timer call and the next has indeterminism due to FP object reads and the nature of the "wait until next millisecond" calls.
You went on to say,
"
I'm doing this program for injection moulding machine, and I'm measuring different things like:
Pressure, movement of linear sensor, temperature etc.
I also measure times like: Injection time, postpressure time, dosage time, cooling time.
"
I could encourage you to take a look at some of the examples that can be found under
Help >>> Find Examples >>> Browse >>> Hardware Input and Output >>> DAQmx >>> Analog measurements >>> Position
or some of the other examples in that area for something that will get you started.
If you just want to measure the period of time a logic signal is asserted, look under the digital examples.
I said "I could" because of three reasons.
1) Before this injection molding game is over someone always asks for the area under the curve.
2) I think I heard you say you wanted monitor more than one process.
3) I guess you will want to know the repeatability of a process.
I will also go on to guess that we can not say the that the indiviual processes are syncronized with each other.
If this is the case we should start by talking about the architecture of this application.
If NOT then take a look at the examples in the area I cited above.
Still trying to help,
Ben