Dynomotion

Group: DynoMotion Message: 14969 From: cnc_machines Date: 8/28/2017
Subject: Load on Startup
Well.. Starting to see why Tom recommends against flashing the INIT program into the KFlop. We now have 20 machines that have various programs flashed in and I am unsure of what version is where.

I am thinking to correct this we could flash a simple program that would activate a user button on startup. My only issue is, when we power up, the KFlop boots much faster than the PC. I am trying to think of a way to make a while loop that waits for active communication to KMotionCNC before it breaks the loop. 

Something like this:

main()
{
while(!Communication with KMotionCNC) // Is there a way to do this??
// Run Initiate Program
DoPCInt(PC_COMM_USER_BUTTON,0);
DoPCInt(PC_COMM_RESTART);

}

The user button would be pointing to the latest and greatest INIT program. Does this sound reasonable?

Thanks,

Scott
Group: DynoMotion Message: 14970 From: Tom Kerekes Date: 8/28/2017
Subject: Re: Load on Startup

Hi Scott,

There is a configurable Program Startup Action in KMotionCNC if that is what you are after.  See:

http://dynomotion.com/Help/KMotionCNC/ToolSetupScreenM3.htm#G_Code_Actions_-_M3_-_M9

Otherwise there is a counter (StatusRequestCounter) that increments every time a PC Application such as KMotionCNC requests status from KFLOP (~10 times/sec).  This can be used to determine if an App is actively communicating with KFLOP.  Note this will also happen when KMotion.exe is running.  Normally it is used to detect when KMotionCNC stops communicating (PC crashes, USB unplugged, etc.  to disable things).  See the attached WatchdogStatusRequests.c example.

Regards

TK




On 8/28/2017 8:30 AM, cnc_machines@... [DynoMotion] wrote:
 

Well.. Starting to see why Tom recommends against flashing the INIT program into the KFlop. We now have 20 machines that have various programs flashed in and I am unsure of what version is where.


I am thinking to correct this we could flash a simple program that would activate a user button on startup. My only issue is, when we power up, the KFlop boots much faster than the PC. I am trying to think of a way to make a while loop that waits for active communication to KMotionCNC before it breaks the loop. 

Something like this:

main()
{
while(!Communication with KMotionCNC) // Is there a way to do this??
// Run Initiate Program
DoPCInt(PC_COMM_USER_BUTTON,0);
DoPCInt(PC_COMM_RESTART);

}

The user button would be pointing to the latest and greatest INIT program. Does this sound reasonable?

Thanks,

Scott

  @@attachment@@
Group: DynoMotion Message: 14971 From: Federico Javier de la Cruz Riz Date: 8/28/2017
Subject: Re: Load on Startup [1 Attachment]
Can't you just init the board with a false logical status(into a var). After the PC load, the user should press a button called "standby" that modifies the variable in kflop, in order to enable the main program (almost sure is an endless loop).
Similar thing happen in some industrial controls (ie. fanuc), after everything is loaded, you must press a "standby" button to enable the machine. In some machines if you do not press this button, only power drives and control are powered, but you cannot move a single axis.


El 28 ago. 2017 2:38 PM, "Tom Kerekes tk@... [DynoMotion]" <DynoMotion@yahoogroups.com> escribió:
 
[Attachment(s) from Tom Kerekes included below]

Hi Scott,

There is a configurable Program Startup Action in KMotionCNC if that is what you are after.  See:

http://dynomotion.com/Help/ KMotionCNC/ToolSetupScreenM3. htm#G_Code_Actions_-_M3_-_M9

Otherwise there is a counter (StatusRequestCounter) that increments every time a PC Application such as KMotionCNC requests status from KFLOP (~10 times/sec).  This can be used to determine if an App is actively communicating with KFLOP.  Note this will also happen when KMotion.exe is running.  Normally it is used to detect when KMotionCNC stops communicating (PC crashes, USB unplugged, etc.  to disable things).  See the attached WatchdogStatusRequests.c example.

Regards

TK




On 8/28/2017 8:30 AM, cnc_machines@... [DynoMotion] wrote:
 

Well.. Starting to see why Tom recommends against flashing the INIT program into the KFlop. We now have 20 machines that have various programs flashed in and I am unsure of what version is where.


I am thinking to correct this we could flash a simple program that would activate a user button on startup. My only issue is, when we power up, the KFlop boots much faster than the PC. I am trying to think of a way to make a while loop that waits for active communication to KMotionCNC before it breaks the loop. 

Something like this:

main()
{
while(!Communication with KMotionCNC) // Is there a way to do this??
// Run Initiate Program
DoPCInt(PC_COMM_USER_BUTTON,0) ;
DoPCInt(PC_COMM_RESTART);

}

The user button would be pointing to the latest and greatest INIT program. Does this sound reasonable?

Thanks,

Scott

Group: DynoMotion Message: 14972 From: cnc_machines Date: 8/28/2017
Subject: Re: Load on Startup
Thanks Tom! Exactly what I needed.