EasyManuals Logo

Allen-Bradley SoftLogix 5800 User Manual

Allen-Bradley SoftLogix 5800
272 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #159 background imageLoading...
Page #159 background image
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;
}

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Allen-Bradley SoftLogix 5800 and is the answer not in the manual?

Allen-Bradley SoftLogix 5800 Specifications

General IconGeneral
BrandAllen-Bradley
ModelSoftLogix 5800
CategoryController
LanguageEnglish

Related product manuals