Conversion of elapsed time in Momentum PLC

P

Thread Starter

psajal

I use instructions TIME_TO_WORD or TIME_AS_WORD to convert elapsed time to WORD format. Both instructions convert elapsed time into 2 WORDS, the high and less significant words. Preset time is 10000 ms and converted result is in range between 10 to 200 ms. We record a result of every single execution. I noticed that sometimes the converted result is negative, but only in the less significant word. The most significant word is always zero. Quite often the negative value of conversion ends with 6 such as -26, -46, -76, etc. Any idea what is the significance of the negative value? By the way, I have reviewed the Schneider support site already to avail.

Thanks,

Peter
 
If you are getting a double word (two words) and are looking at just the lower word as a signed integer, then any number larger than 32767 will appear to be a negative number. Try looking at the number as hexadecimal and this may make more sense.
 
Top