ICS Regent ® PD-6048 MODBUS Master Package for WINTERPRET MODBUS Master Function Block (T3837) Issue 1, August, 96 The MODBUS Master package for WINTERPRET is an add-in software package which allows the user to MODBUS Master function blocks for Regent application programs. When installed on the PC, the package is seamlessly integrated with the base WINTERPRET software.
MODBUS Master Package for W INTERPRET (T3837) 4. Type a:\setup.exe in the text box. (if you inserted the WINTERPRET base package disk in drive B: type b:\setup.exe.) Choose OK or press ENTER. 5. In the WINTERPRET Setup dialog box enter the name of the directory in which you have installed the WINTERPRET base package (This assumes that you have already installed WINTERPRET). Choose Continue. 6. In the WINTERPRET Installation dialog box check the MODBUS Master package box. 7.
MODBUS Master Package for W INTERPRET (T3837) time it is called, the MODBUS Master function block code splits up the tasks so that it can be done a little at a time. This allows the Regent system to remain responsive, as well as eliminating the potential loss of time while waiting for MODBUS responses. For an overview about Regent application programs and function blocks and how to create them using WINTERPRET, refer to Section 5, Working with Programs and Function Blocks, in the Regent User’s Guide.
MODBUS Master Package for W INTERPRET (T3837) Operation The MODBUS function block uses control signals to report information and accept runtime control directives. The signals are user defined, and may be used like normal Regent variables. Table 1 identifies these control signals. Table 1 - Control Signals Name Size Type Description ENABLE Coil Input Enables execution of the function block. Energize to execute the function block.
MODBUS Master Package for W INTERPRET (T3837) Tables define the work that the MODBUS function block performs. The primary table used is the ‘Read Command’ (RC) table. Each entry in the RC table is eight bytes wide, with the first six bytes corresponding exactly to the same fields in a MODBUS command. Each entry (starting with the first) in the RC table sends a MODBUS command. When the response is received, the Count field is used to decode the received data.
MODBUS Master Package for W INTERPRET (T3837) The ‘Write Command’ (WC) table is also used by the MODBUS master function block code. In many ways, the WC table is similar to the RC table. However, the WC table does not utilize a corresponding Write Variable table because each “Write” only references a single variable. Table 4 defines the Write Command Table. Table 4 - Write Command Table Field Size Description Node Byte The MODBUS node to notify when the value changes.
MODBUS Master Package for W INTERPRET (T3837) · · · · · · A check is made to see if this is the start of a MODBUS scan. If so, the ‘MODBUS Scan Time’ timer is reset. Each “Write” variable is check to see if it has changed state (or value), and those that have are added to the WRITEQ. Outgoing packets are sent. While !FULL(SENDQ) If !EMPTY(WRITWQ) ENQ(SENDQ, DEQ(WRITWQ)) Else If !EMPTY(READQ) ENQ(SENDQ, DEQ(READQ)) End If End While Incoming responses are received, and the appropriate actions are taken.
MODBUS Master Package for W INTERPRET (T3837) Table 5 - MODBUS Node Table Field Size Description Node Byte A MODBUS slave node Reserved Byte Reserved for internal use. If a non-MODBUS error is reported for any MODBUS slave on the current primary port, the ports are swapped and the secondary port is used as the primary port for the next MODBUS scan. If no errors are reported, the Primary port is used for the next MODBUS scan.
MODBUS Master Package for W INTERPRET (T3837) Field Type Description ENABLE Tag If specified, must be the name of a valid bit variable. If not specified, the MODBUS function block is assumed to always be enabled. RESET Tag If specified, must be the name of a valid bit variable. If not specified, the ERROR output can only be cleared by stopping, and then restarting the MODBUS function block. ERROR Tag If specified, must be the name of a valid bit variable.
MODBUS Master Package for W INTERPRET (T3837) A rule violation results in an error message, but the validation procedure continues until all variables have been checked. The special condition where there are no variables defined also generates an error message. The compiler proceeds only after all parameters and variables have been validated and no errors have occurred. The special condition where there are no variables defined also generates an error message.
MODBUS Master Package for W INTERPRET (T3837) Using the MODBUS Master Function Block Editor MODBUS Master function blocks are created using Add Function Block or Insert Function Block from the Program Editor. After you have created a new function block, the MODBUS Master Function Block Editor window is opened as shown in Figure 1. Figure 1. The MODBUS Master Function Block Editor Window The primary user interface for the MODBUS Master function block will be the MODBUS Master function block window.
MODBUS Master Package for W INTERPRET (T3837) Edit Menu The Edit menu (see Figure 2) allows you to select Add Variable, Edit Variable, Insert Variable, Delete Variable, Add Multiple, and Edit Parameters commands. Figure 2. The Edit Menu Add Variable/Edit Variable/Insert Variable The Add Variable command allows you to add a variable to the end of the function block variable list. The Edit Variable command allows you to edit a selected variable. The Insert Variable command allow to enter a new variable.
MODBUS Master Package for W INTERPRET (T3837) The variable parameters are as follows: Name The variable to be associated with the specified MODBUS address. This is a required field and must be a valid Winterpret tag name. Node The MODBUS node to be associated with the specified MODBUS variable. This is a required field and must contain a valid node number in the range of 1 - 247. Address The MODBUS address to be associated with the specified MODBUS variable.
MODBUS Master Package for W INTERPRET (T3837) Figure 4. The Add Multiple MODBUS Variables Dialog Box The variable parameters are as follows: Name (Starting) The name of the initial variable to be added. This is a required field and must contain a valid WINTERPRET tag name picture. Node The MODBUS node to be associated with each MODBUS variable. This required field must contain a valid MODBUS node number in the range of 1 - 247. Address (Starting) The starting MODBUS address to be used.
MODBUS Master Package for W INTERPRET (T3837) Usage: Read/Write The MODBUS function usage: to send data or receive data from a MODBUS slave. This is a required field and must follow the MODBUS variable type as implied by the MODBUS address. Count The number of MODBUS variables to be added. This required field must contain a valid count in the range of 1 - 999. Edit Parameters This command allows you to specify or change the compile-time configuration options for the MODBUS Master function block.
MODBUS Master Package for W INTERPRET (T3837) number in the range of 2 - 6, and must not be the same as the Secondary Port field. Secondary Port The compile time parameter which selects the Regent serial port to be used as the secondary MODBUS port. If not left blank, this field must be a valid port number in the range of 2 - 6, and must not be the same as the Primary Port field. Enable The variable to be used as the ENABLE control relay.
MODBUS Master Package for W INTERPRET (T3837) Figure 6. The Search Menu Go To Variable The Go To Variable command allows you to quickly move to different entries in the MODBUS variables list and the MODBUS parameters. After choosing this command, the dialog box shown in Figure 7 opens. Figure 7. The Go To Variable Dialog Box Find The Find command allows you to locate different entries in the MODBUS variables list and the MODBUS parameters.
MODBUS Master Package for W INTERPRET (T3837) Figure 8. The Find Dialog Box Find Next The Find command searches for the next occurrence of whatever was previously searched for using the Find command.
MODBUS Master Package for W INTERPRET (T3837) Using the MODBUS Master Function Block Monitor The MODBUS Master function block monitor displays the parameters, variables, addresses, and values of a MODBUS Master function block executing in a Regent. When you have selected a MODBUS Master function block in the Program Monitor window and have chosen the Monitor command from the Control Menu, the MODBUS Master Function Block Monitor Window is opened, as shown in Figure 9. Figure 9.
MODBUS Master Package for W INTERPRET (T3837) Control Menu The Control menu provides access to several commands common to all function block monitors, including Run, Stop, and Scan. For descriptions of these commands, refer to Commands Common to All Function Block Monitors in Section 7 of the Regent Ò + Plus User’s Guide. The Control Menu command specific to the MODBUS Master Function Block Monitor is the Take Monitor Offline command.
MODBUS Master Package for W INTERPRET (T3837) Configuring a MODBUS Master Function Block Serial Port Definition The MODBUS function block requires you to define a Regent serial port to use as the primary and/or secondary MODBUS Master port. To allow the user to reserve a port for this use, and so that the port definition can be check at runtime a new type of serial port, called MOD MASTER, is used.
MODBUS Master Package for W INTERPRET (T3837) A MOD MASTER type port has the following restrictions: · · 8 data bits 2 stop bits and no parity bit, or 1 stop bit and 1 parity bit. In addition, the Node field is not valid in this context, and is set to zero (0). Figure 12. Serial Port Settings Dialog Box Refer to Section 4 of the Regent Ò + Plus User’s Guide for more information on working with serial ports.
MODBUS Master Package for W INTERPRET (T3837) Safety Considerations The MODBUS Master function block is TÜV certified for Risk Class 5 as non-interfering. These function blocks may only be used in safety critical applications if they do not perform any control actions that affect the value of Risk Class 5 safety critical variables. Availability The MODBUS Master function block is available as an add on package to Winterpret/TRIOS versions 3.40 and later.