Set different programs to different threads
Moderators: TomKerekes, dynomotion
-
- Posts: 8
- Joined: Sun Mar 30, 2025 12:41 pm
Set different programs to different threads
Can not see a way to tell which function or program is saved on thread n, I have seen commands to check if thread is running,stop it,etc but not able to guess how I setup the code on any thread.
I have a c function to config the channels and another to read data in a loop, works ok are just simple examples but when I reboot the board configuration is lost.
Thanks
I have a c function to config the channels and another to read data in a loop, works ok are just simple examples but when I reboot the board configuration is lost.
Thanks
- TomKerekes
- Posts: 2791
- Joined: Mon Dec 04, 2017 1:49 am
Re: Set different programs to different threads
We don't have a way to upload the binary code from a Thread's memory and re-create the C Code that created it. Its up to you to keep track of what was placed into a Thread last.
Normally a PC is in the system and it is used to Compile/Download/Execute any program when you want to run it. That way nothing needs to be saved in KFLOP/Kogna or remembered.
To remove anything Flashed into KFLOP/Kogna and return it to a virgin state re-Flash New Version.
HTH
Normally a PC is in the system and it is used to Compile/Download/Execute any program when you want to run it. That way nothing needs to be saved in KFLOP/Kogna or remembered.
To remove anything Flashed into KFLOP/Kogna and return it to a virgin state re-Flash New Version.
HTH
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
-
- Posts: 8
- Joined: Sun Mar 30, 2025 12:41 pm
Re: Set different programs to different threads
I think I didn´t explained properly.
Say I have two functions in C (f1 and f2) , and want f1 to run on thread 1 and f2 to run on thread 2,
How can be done?
If you can run programs on different threads must be a way to assing the code to run on each thread in some way.
Say I have two functions in C (f1 and f2) , and want f1 to run on thread 1 and f2 to run on thread 2,
How can be done?
If you can run programs on different threads must be a way to assing the code to run on each thread in some way.
- TomKerekes
- Posts: 2791
- Joined: Mon Dec 04, 2017 1:49 am
Re: Set different programs to different threads
KFLOP/Kogna uses a simple method of one Program per Thread. You cannot run functions as threads.
You might read this.
You might read this.
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
-
- Posts: 8
- Joined: Sun Mar 30, 2025 12:41 pm
Re: Set different programs to different threads
Tom,
I was writing a very long answer with the same question as didn´t see the way, and suddently I saw the Thread options on the C program dialog, below on the left....
It was invisible for me until now....
Now is clear, let me try it.
Thanks
I was writing a very long answer with the same question as didn´t see the way, and suddently I saw the Thread options on the C program dialog, below on the left....
It was invisible for me until now....
Now is clear, let me try it.
Thanks
-
- Posts: 8
- Joined: Sun Mar 30, 2025 12:41 pm
Re: Set different programs to different threads
I hope this is the last question for a while...
Now I load the config on thread1 as stated, but on Axis never get the axis enabled (in KMotionCNC is the same) , rest of config seems ok, if I press Enable on the Axis dialog works Ok, but as ssoon as I press reboot or switch off - on Kflop the axis gets deisabled again.
I use this:
EnableAxisDest(4,0);
EnableAxisDest(5,0);
EnableAxisDest(6,0);
EnableAxisDest(7,0);
And probably is working as the position counters are reset, but never enable the axis.
Is this the default behaviour?
How can I change the status to enabled from a program?
Now I load the config on thread1 as stated, but on Axis never get the axis enabled (in KMotionCNC is the same) , rest of config seems ok, if I press Enable on the Axis dialog works Ok, but as ssoon as I press reboot or switch off - on Kflop the axis gets deisabled again.
I use this:
EnableAxisDest(4,0);
EnableAxisDest(5,0);
EnableAxisDest(6,0);
EnableAxisDest(7,0);
And probably is working as the position counters are reset, but never enable the axis.
Is this the default behaviour?
How can I change the status to enabled from a program?
- TomKerekes
- Posts: 2791
- Joined: Mon Dec 04, 2017 1:49 am
Re: Set different programs to different threads
It not clear what you are doing. Its not clear what you mean by "load the config on thread1".
The C Program needs to be Compiled/Downloaded/Executed for a C Program to do anything such as Enable an Axis.
After a Power Loss or reboot the C Program will need to be Compiled/Downloaded/Executed again.
Not sure why you are using Axes 4-7 rather than 0-3. You can, but it is just not logical.
You might read Initialization C Program.
Also Setting Parameters.
please Post your entire initialization C Program.
The C Program needs to be Compiled/Downloaded/Executed for a C Program to do anything such as Enable an Axis.
After a Power Loss or reboot the C Program will need to be Compiled/Downloaded/Executed again.
Not sure why you are using Axes 4-7 rather than 0-3. You can, but it is just not logical.
You might read Initialization C Program.
Also Setting Parameters.
please Post your entire initialization C Program.
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
-
- Posts: 8
- Joined: Sun Mar 30, 2025 12:41 pm
Re: Set different programs to different threads
Hi Tom,
we use the channel 4-7 because we need to use the JP5.
There was a piece that didn't fit, after finding the ini.c settings in Kmotioncnc, everything fits and now is clear for me.
Thanks!!
we use the channel 4-7 because we need to use the JP5.
There was a piece that didn't fit, after finding the ini.c settings in Kmotioncnc, everything fits and now is clear for me.
Thanks!!
- TomKerekes
- Posts: 2791
- Joined: Mon Dec 04, 2017 1:49 am
Re: Set different programs to different threads
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.