Configure a windows-event task in the controller, Controller – Rockwell Automation 1789-L10_L30_L60 SoftLogix 5800 System User Manual User Manual

Page 151

Advertising
background image

Rockwell Automation Publication 1789-UM002J-EN-P - December 2012

151

Program Windows Events to Monitor and Change Controller Execution

Chapter 8

_tprintf(_T("Mode change occured: "));
fflush(stdout);
break;
}

// A mode change occured. Now we have to check to determine the new controller mode.
// This is done by performing a WaitForMultipleObjects on the mode event handles.
// These events are manual reset events that are controlled by the SoftLogix
// controller.
// Only one of these events can be set at any given time.
// Log a message to the screen indicating the new controller mode, and then go back
// to waiting for the mode change event above.
status = WaitForMultipleObjects(numevents, EventArray, FALSE, INFINITE);
switch (status)
{
case WAIT_OBJECT_0:

_tprintf(_T("now in program mode\n"));

fflush(stdout);

break;

case WAIT_OBJECT_0+1:

_tprintf(_T("now in run mode\n"));

fflush(stdout);

break;

case WAIT_OBJECT_0+2:

_tprintf(_T("now in test mode\n"));

fflush(stdout);

break;

case WAIT_OBJECT_0+3:

_tprintf(_T("now in fault mode\n"));

fflush(stdout);

break;

}
}
return 0;
}

Configure Windows Events to
Launch Tasks within the
SoftLogix Controller

Windows event tasks are functionality associated with Microsoft’s
Windows 2000 and Windows XP operating systems. Applications outside of
RSLogix 5000 software (Visual Basic, RSView, Custom C applications, external
routines, and so forth) can cause a task within the SoftLogix5800 controller
to execute.

Configure a Windows-event Task in the Controller

In the SoftLogix project, we will create a task and configure the trigger as a
Windows event on the controller. Follow these steps.

1. Launch RSLogix 5000 software.
2. Open the controller1 project we created previously.
3. In the Controller Organizer, right-click Tasks folder and choose

New Task.

Advertising