Rockwell Automation Publication 1789-UM002K-EN-P - January 2015
159
Program Windows Events to Monitor and Change Controller Execution
Chapter 8
swprintf(eventname, sa_savedone_event_fmt, slot);
h_saveDoneEvent = CreateEvent (&sa, TRUE, FALSE, eventname);
printf("h_saveDoneEvent = %d
swprintf(eventname, sa_savelock_event_fmt, slot);
h_saveLockEvent = CreateEvent (&sa, TRUE, FALSE, eventname);
printf("h_saveLockEvent = %d
// Yield remainder of timeslice to make it less likely that a
// context switch will occur between the wait for lock event and
// corresponding SetEvent().
// If saves not permitted (download in progress) OR
// a save is in progress
// Explain
// Else
// Set lock event
// Kick save event
// Endif
// Wait for save started (if desired)
// Wait for save done (if desired)
SwitchToThread();
if ((WaitForSingleObject(h_savePermittedEvent, 0) != WAIT_OBJECT_0) ||
WaitForSingleObject(h_saveLockEvent, 0) == WAIT_OBJECT_0)
{
printf("Save not permitted or save already running
return 1;
}
else
{
SetEvent(h_saveLockEvent); // Save in progress
printf("Kicking save
SetEvent(h_kicksaveEvent);
}
WaitForSingleObject(h_saveStartEvent, INFINITE);
printf("Save started
WaitForSingleObject(h_saveDoneEvent, INFINITE);
printf("Save complete
return 0;
}
Содержание SoftLogix 5800
Страница 1: ...SoftLogix 5800 System Catalog Numbers 1789 L10 1789 L30 1789 L60 User Manual...
Страница 4: ...4 Rockwell Automation Publication 1789 UM002K EN P January 2015 Summary of Changes Notes...
Страница 104: ...104 Rockwell Automation Publication 1789 UM002K EN P January 2015 Chapter 5 Configure and Use Simulated I O Notes...
Страница 110: ...110 Rockwell Automation Publication 1789 UM002K EN P January 2015 Chapter 6 Execute External Routines 9 Click OK...
Страница 148: ...148 Rockwell Automation Publication 1789 UM002K EN P January 2015 Chapter 7 Develop External Routines Notes...
Страница 256: ...256 Rockwell Automation Publication 1789 UM002K EN P January 2015 Appendix E System Performance Tuning Guidelines Notes...
Страница 262: ...262 Rockwell Automation Publication 1789 UM002K EN P January 2015 Appendix G SoftLogix 5800 Revision History Notes...
Страница 270: ...270 Rockwell Automation Publication 1789 UM002K EN P January 2015 Index...
Страница 271: ......