Page 1 of 1

Thread Executions

Posted: Thu Feb 10, 2022 8:05 pm
by PBandJacob
Hello!
Is there a C program equivalent of the script command CheckThread<N>?
Is the size of the .out file proportional to the number of threads a program will occupy? If I have a 150 KB .out file, will it occupy three user threads and have a timing of 360us (90 us for Thread 0, 90 us for Thread 1, 90 us for Thread 2, and 90 us for Thread 3) or will it act as if it only occupies 1 thread and have an execution timing of 180 us? (90 us for Thread 0, 90 us for Thread 1)?

Re: Thread Executions

Posted: Thu Feb 10, 2022 10:24 pm
by TomKerekes
Hi,
Is there a C program equivalent of the script command CheckThread<N>?
The ThreadActive variable has bits 0-7 for which Threads are active. 1=Active 0=Inactive.

Code: Select all

extern volatile int ThreadActive;  // one bit for each thread    
Is the size of the .out file proportional to the number of threads a program will occupy?
No. Compile in KMotion.exe and it will report the size.
If I have a 150 KB .out file, will it occupy three user threads and have a timing of 360us (90 us for Thread 0, 90 us for Thread 1, 90 us for Thread 2, and 90 us for Thread 3) or will it act as if it only occupies 1 thread and have an execution timing of 180 us? (90 us for Thread 0, 90 us for Thread 1)?
If a Thread's memory overflows into another Thread's memory it is still 1 Thread and in that case would still be 90us for Thread 0 and 90us for Thread 1.

HTH