![Cincinnati Sub-Zero EZT-570S Reference Manual Download Page 39](http://html.mh-extra.com/html/cincinnati-sub-zero/ezt-570s/ezt-570s_reference-manual_2607293039.webp)
EZT-570S User Communication Reference Manual
39
2.5.1
Progran Download Algorithm
An example download procedure as well as the timer procedure is provided below in VB format.
These are sample procedures and CSZ does not take responsibility for end user actions. The user
must pay close attention regarding ranges and user interaction during program download.
Private Sub downloadProfile()
'This sub will initiate the profile download and start the timer for profile download. Timer should be set at 1 second intervals
'to make sure timeout from EZT controller does not occur.
'------------------------------------------------------------------------------------------------------------------------------------------------------------------
'Variables used in procedure. User can select static, form, global variables or class type based on preference.
G_vary(x,x) is array for each EZT in system. First element is EZT number, second element is EZT register. EZT register
are a total of 180 registers per EZT.
f_curProfileName is form var that holds currently loaded profile.
f_profRegsToWrite is form var that holds the current profile array point being written when timer ticks are active.
f_writeNum is form var that holds the current segment being written when timer ticks are active.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
'User error checking for sub should go here
'Check to see if profile is running before downloading profile (see EZT register list for profile status register)
'if EZT is offline mode or downloading a profile do not start profile download from PC and alert user
If G_vAry(f_EztNum, 180) = 1 Then
MsgBox "Local EZT-570S is in the offline mode or running/downloading a profile!" & vbCrLf & _
"Writes from the PC can not be initiated at this time.", _
vbInformation
Exit Sub
End If
'Before download, make sure to save the profile name to disk as well as to array registers within profile list.
'EZT manual outlines profile register list. Profile name is 5 registers (10 chars total) and must be converted from
'text to integer values (2 chars per register)
If f_curProfileName = "" Then
MsgBoxOver "You must load or save a Profile before download to processor!", vbInformation, "Download Profile", Me.hWnd
Exit Sub
End If
'following should disable graphic user interface for profile download while profile is being downloaded. User dependent code but
'user should not press download button again during download of profile from PC to EZT controller.
f_profRegsToWrite = 0
'set var to zero each time profile download is initiated.
f_writeNum = 0
'set var to zero each time profile download is initiated.
f_regAdd = 201
'registers for profile data start at register 200 in HMI. Modbus master dependent based on zero based addressing.
End Sub