beautypg.com

Rockwell Automation ControlFLASH Firmware Upgrade Kit User Manual User Manual

Page 47

background image

Rockwell Automation Publication 1756-UM105E-EN-E - October 2012

47

Create a Custom Interface to Process Firmware Downloads Appendix B

After registering the two messages, an application must override the form's
WndProc method to actually listen for these messages

For more information, see MSDN:

http://msdn.microsoft.com/en-us/library/

system.windows.forms.form.wndproc(VS.71).aspx

Example:

Protected Overrides Sub WndProc(ByRef recWinMessage As
Windows.Forms.Message)

In WndProc, you first need to determine if the message received is one of the two
registered ones. This is done by checking (in this example):

recWinMessage.Msg = WM_CF_PROGRESS (as defined in the above example)
or recWinMessage.Msg = WM_CF_COMPLETE

Assuming the message is one of the two, the details of what the message means are
as follows:

· If the message is WM_CFPROGRESS:

recWinMessage.WParam.ToInt32

is the number of the device

currently being flashed. These numbers should correspond to the numbers
listed in the script file

recWinMessage.LParam.ToInt32

is the actual progress of the

current device (as a percentage).

Because of the way the system is designed, if recWinMessage.LParam.ToInt32 is
100, that does not mean the flashing of that device is complete. Flashing is only
complete when the WM_CFCOMPLETE message is sent.

· If the message is WM_CFCOMPLETE:

recWinMessage.WParam.ToInt32

is still the number of the

device

recWinMessage.LParam.ToInt32

indicates success or failure.

If the value is 1, the flash succeeded; if 0, it failed.

For more information, see MSDN

http://msdn.microsoft.com/en-us/library/

system.windows.forms.message_members(VS.71).aspx