i4 Automation Ltd V G23 Rev: 12/04

Size: px
Start display at page:

Download "i4 Automation Ltd V G23 Rev: 12/04"

Transcription

1 Software Manual Function Blocks V G23 Rev: 12/04

2 No part of this document may be used for any purpose other than for the purposes specifically indicated herein nor may it be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying and/or recording, for any purpose without written permission from Unitronics. The information appearing in this document is for general purposes only. Unitronics makes no warranty of any kind with regard to the information appearing in this document, including, but not limited to, implied warranties of merchantability and/or fitness for a particular use or purpose. Unitronics assumes no responsibility for the results, direct and/or indirect, of any misuse of the information appearing in this document nor for any use of the Unitronics products referred to herein in any manner deviating from the recommendations made in this document. Unitronics assumes no responsibility for the use of any parts, components, or other ancillary appliances including circuitry other than as recommended hereunder or other than that embodied in the Unitronics product. Unitronics retains all rights to its proprietary assets including, but not limited to its software products which are copyrighted and shall remain the property of Unitronics. Copyright protection claimed includes all Forms and matters of copyrightable materials and information legally allowed including but not limited to material generated from the software programs which are displayed on the screen of the Unitronics products such as styles, templates, icons, screen displays, looks, etc. Duplication and/or any unauthorized use thereof are strictly prohibited without prior written permission from Unitronics. All brand or product names are used for identification purpose only and may be trademarks or registered trademarks of their respective holders. Unitronics reserves the right to revise this publication from time to time and to amend its contents and related hardware and software at any time. Technical updates (if any) may be included in subsequent editions (if any).

3 VisiLogic Function Blocks Table Of Contents FBs Library...6 PID + Autotune FB...8 FB Operations...8 PID Autotune...8 PID Configuration...9 PID Function Parameters...10 Run Auto-Tune...11 Auto-tune Parameters...12 Run PID...12 Pause Integral & Derivative Calculation...12 Read Control Components...13 Error Integral...13 General Background:How PID Works...14 About PID and Process Control...14 Inside the PID Function...15 PID Status Messages...17 PID Tips...18 Background: the Proportional Band and PV...18 PID Analog Input Tips...19 PID via Digital Output (Contactor, Solenoid Valve, SSR)...20 Manual Loop Tuning...21 Remote PLC DataCom...22 Using Remote PLC DataCom...22 Master Program...23 Slave Program...23 FB Operations...24 PLC DataCom: Configuration...24 Master Configuration...24 Read Write Limitations...24 Slave Configuration...26 Master Data Request...26 Update...27 DataCom Data Synchronization...27 PLC DataCom Status Messages...27 Trends...28

4 FBs Library FB FB Operations...28 How Trends Works...28 Trends QuickStart...29 Linearizing Values...30 Refreshing the LCD screen...30 Configuration...31 Configuration Parameters...31 Trend Fill & Draw Loop: Track a Single Value...33 Loop Init...33 Loop: Fill...33 Draw Operations...34 Advanced-Trends: Style...35 Configuration Parameters...36 Advanced-Trend Draw Graph...37 Draw Trend Parameters...39 Draw Axis...40 FB Operations...40 Configuration...40 Draw...43 Clear...43 Loadcell...45 FB Operations...45 Loadcell Hardware Configuration...46 Configuring a Loadcell...46 Loadcell: Configuration...47 Scan...49 Calibration...49 Calibrating Points...49 Calibrate Point FB...51 Save Calibration...51 Tare & Zero...51 Tare & Zero...52 Setup...53 Motion Band...53 Filter and Rounding...54 Auto Zero Tracking...55 Loadcell Operands & Status Messages...56 Loadcell Hardware Status Messages (Hardware Configuration)...57 Advanced Loadcell Functions...58 Advanced-Calibration...58 Setpoint...60 Change Representation Mode...62 Reset Net Min/Max Values...64 Change Excitation Mode...64 Input Range...64 GPRS FB...66 Using GPRS...67 FB Operations

5 VisiLogic FB Library GPRS Configuration...68 GPRS Register to Network...69 GPRS Run...70 Start Call...70 End Call...70 Unregister from Network...71 Check Signal Quality...71 GPRS Operands & Status Messages...71 SMS Messaging FB...74 Using SMS Messaging...74 FB Operations...74 How to Configure, Receive, and Send Messages...74 SMS: Configuration...77 Creating SMS Messages & Variables...77 Message Properties...79 Phone Book...80 SMS: Scan...81 SMS: Send...83 SMS Variables...85 SMS: Check GSM Signal Quality...87 Sending SMS messages from a GSM cell phone...87 Writing SMS messages in your cell phone...87 Sending the message to the PLC...88 Checking that the PLC has received the SMS message...88 SMS Operands...89 SMS System Operands...91 MODBUS...92 Using MODBUS: Unitronics' PLCs, Master - Slave...92 Using MODBUS: Accessing PLC data via SCADA/OPC server...93 FB Operations...94 MODBUS: Configuration...95 MODBUS: ScanEX and Scan...96 Read Coils (1)...97 Read Inputs (2)...99 Read Holding Registers (3) Read Float Registers (3) Read Input Registers (4) Read Float Registers (4) Force Coil (5) Preset Holding Register (6) Loopback Test (8) Force Coils (15) Preset Holding Registers (16) Preset Float Registers (16) Read/Write from Data Tables Read from Data Table Write to Data Table Read/Write Mixed Data via MODBUS

6 FBs Library FB Read Write Limitations Send / Receive Buffers Configuring a MODBUS slave device Slave Addressing Slave Address Tables MODBUS via GSM or Standard Modem MODBUS Status Operands MODBUS IP Using MODBUS FB Operations MODBUS: Configuration Vision Slaves MODBUS: ScanEX and Scan Read Coils (1) Read Inputs (2) Read Holding Registers (3) Read Float Registers (3) Read Input Registers (4) Read Float Registers (4) Force Coil (5) Preset Holding Register (6) Loopback Test (8) Force Coils (15) Preset Holding Registers (16) Preset Float Registers (16) Read/Write Mixed Data via MODBUS Read Write Limitations Send / Receive Buffers Read/Write from Data Tables Read from Data Table Write to Data Table Configuring a MODBUS slave device Slave Addressing Slave Address Tables MODBUS Status Operands Communication Protocol FB Protocol Ladder Requirements Protocol: Configuration Protocol: Scan Protocol Messages Protocol: Send Protocol Messages Protocol: Copy Buffer Contents Protocol: Reset Buffer Variables Variable Types: Send Variable Types: Scan Checksum Configuration

7 VisiLogic FB Library Protocol Status Operands and Messages Examples Basic Example How does the Protocol FB communicate data between Vision controllers and other devices? Advanced Example: Mitsubishi Frequency Converter Protocol message structure MB as PWM Filter FB How Filter works FB Operations Filter: Configuration Filter: Calculate Events FB: Registering MB status change Event Operations Events: Scan Next Event Previous Event Clear Current Clear All Events: Count Events: Loopback Track Events BAS (Building Automation Systems) FB BAS Operations Configuration Configuration Parameters Open Session Scan Read, Write Inputs: Digital or Analog I/Os Digital I/Os Analog I/Os

8 FBs Library FB FBs Library Unitronics offers an FB library for advanced functions, such as SMS messaging and MODBUS communications. FBs that are currently installed in VisiLogic are listed under the FB's menu. Note You must use a condition (RLO) to activate any FB that requires Configuration in your application, such as MODBUS or SMS. To install an updated FB library, select Update from the Web from the FBs menu or Help menu, then follow the on-screen instructions. Note that at the end of the download, you must close and then restart VisiLogic. The new FBs will appear on the FBs menu. Note To enable Live Update, you can select to use a proxy server in Project Properties. Use Function Block Information, located on the View menu, to check: Which FBs are installed in your library. Which FB versions are installed, which versions are used in the open project, and to manage FB versions. FB memory usage. 6

9 VisiLogic FB Library FB Library Versions Used 7

10 PID + Autotune FB PID + Autotune FB The PID FB enables you to use system feedback to continuously control a dynamic process. The purpose of PID control is to keep a process running as close as possible to a desired Set Point. VisiLogic' PID FB includes autotune. In order to ensure proper PID function, you should use Autotune. During the Autotune process, the PID function collects certain essential data. Unitronics' proprietary PID algorithm uses this data to run smooth, accurate PID. FB Operations PID Configuration Run Auto Tune Run PID Pause Integral & Derivative Calculation Error Integral Read Control Components PID Autotune Auto-tuning loops enables the system to set the parameters for PID. The picture below shows the elements of a basic PID application with Auto-tune. 8

11 VisiLogic FB Library After Auto-tune runs, the P, I, and D values are automatically written to the Configuration parameters and the Auto-tune vector is also filled with the Auto-tune parameters. Note Note that, once you have run Auto-tune, you can back up the P, I, and D values, the sample time (ST), and the 32 MI-long Auto-tune vector into a Data Table. You can then transfer these values to another Vision controlling an identical system, in order to run PID without tuning the loop. PID Configuration To place a PID Configuration: 1. Select PID Configuration from the FBs menu, then place the function in the net; the PID parameter box opens. 2. The Select Operand and Address box opens; prompting you to link operands to the PID parameters. Note To enable PID, values must be provided for: Set Point Input Range:PV Low Limit & PV High Limit Output Range:CV Low Limit & CV High Limit These values are used to Auto-tune the loop. After Auto-tune runs, the P, I, D and Sample Time values are automatically written to the Configuration parameters. 9

12 PID + Autotune FB PID Function Parameters Parameters: Inputs Type Function SP: Set Point MI SP is the target value for the process. In a heating system, this is the temperature value set for the system. Note that the Set Point and Process value must be given in the same type of units (degrees Celsius, bars, meters per second, etc.) PV: Process Value MI PV is the feedback from the process. PV is output from the process and input to the PID function. In a heating system, the temperature measured by a temperature sensor provides the PV. Kp: Proportional Band MI Use this parameter to define the proportional band, in units of 0.1%. The proportional band is a percentage of the total Process Value (PV). It is a range defined around the Set Point. When the PV is within this range, the PID function is active. Ti: Integral Time MI Use this parameter to define the integral time, in units of 1 second. Integral action responds to the rate of change in the controller s CV output relative to the change in Error. The integral time you set is the amount of time, as calculated by the controller, required to bring the process to Set Point. Td: Derivative Time MI Use this parameter to define the derivative time, in units of 1 second. Derivative action responds to the rate and direction of change in the Error. This means that a fast change in error causes a strong response from the controller. The derivative action anticipates the PV s value in relation to the Set Point and adjusts the CV accordingly, thus shortening the PID function s response time. ST: Sample Time MI Use this parameter to define the intervals between PID function updates, in units of 10mSecs. Action: 0: Heat, 1: Cool MB Select Off to activate Reverse Action (control type = heating), ON to activate Direct Action (control type = cooling ). Input Range: Process Value Low limit MI Use this parameter to define the lower limit for the Process Value. Input Range: Process Value High limit MI Use this parameter to define the upper limit for the Process Value. Output Range: Control Value Low limit MI Use this parameter to define the lower limit for the Control Value. Output Range: Control Value High limit MI Use this parameter to define the upper limit for the Control Value. Parameters: Outputs Type Function CV: Control Value 10 MI CV is the output from the PID function. CV is output from the PID function and input to the process. Note that this output signal may be an analog or time-proportional variable value.

13 VisiLogic FB Library Status Messages Initialized to 0 when Configuration is activated. MI Value Message >=0 FB status OK < 0-1 Proportion band zero. -2 Input range is invalid (PV input). -3 Output range is invalid (CV output). -4 Integral has reached maximum of 100,000. PID will not allow the Integral value to increase any further. -5 Error in Auto Tune vector addresses, ex., the vector exceeds the final address in the MI data type. -6 Set Point less then Input low range or Set Point more then Input high range. -7 to-10 Auto tune error. -11 Noise is more then 5% of Input Range. Auto-tune parameters MI The start of a 32 MI-long Auto-tune vector that contains the Auto-tuned parameters. Note Note that, once you have run Auto-tune, you can back up the P, I, and D values, the sample time (ST), and the 32 MI-long Auto-tune vector into a Data Table. You can then transfer these values to another Vision controlling an identical system, in order to run PID without tuning the loop. Run Auto-Tune The Run Auto-tune operation uses the Configuration's parameters: Set Point Input Range:PV Low Limit & PV High Limit Output Range:CV Low Limit & CV High Limit These values are used to Auto-tune the loop. After Auto-tune is run, the Auto-tune MB turns ON, and all of the Auto-tune parameters are written into the Autotune Parameter MI vector that is defined in the PID Configuration. Note Note that, once you have run Auto-tune, you can back up the P, I, and D values, the sample time (ST), and the 32 MI-long Auto-tune vector into a Data Table. You can then transfer these values to another Vision controlling an identical system, in order to run PID without tuning the loop. 11

14 PID + Autotune FB Auto-tune Parameters Parameters: Inputs Type Function Stage # The number of Stages aids the system to determine accurate Auto-tune parameters. The Default is 3. The higher the number of stages, the longer the Auto-tune time, however choosing a lower Stage may result in less accurate Auto-tune parameters. Auto-tune Done MB After Auto-tune is run, the Auto-tune MB turns ON, and all of the Auto-tune parameters are written into the Auto-tune Parameter MI vector that is defined in the PID Configuration. Run PID In order to run a PID loop, the Run operation must be included in the application following the PID Configuration. In order to Auto-tune the loop, the PID Run must be suspended. Pause Integral & Derivative Calculation If conditions require, you can suspend this value and prevent it from changing. This may prove useful, for example, in a temperature application, when an opened oven door can cause a temporary temperature drop. 12

15 VisiLogic FB Library Read Control Components This function enables you to scale down very large PID control values to smaller, more logical values. The current functions factors the PID control values by a value in an MI, then stores the values in the output MIs. Parameters Type Function Resolution Factor # This is the value used to factor the PID control values. Control Value: Proportional Output MI Stores the factored Proportional Output. Control Value: Integral Output MI Stores the factored Integral Output. Control Value: Derivative Output MI Stores the factored Derivative Output. Error Integral You can read and write to the Integral Value. Read Error Integral Use this operation to store the current error in the linked ML. Force Error Integral Use this to initialize or change the error value while the application is running. 13

16 PID + Autotune FB General Background:How PID Works The PID function uses system feedback to continuously control a dynamic process. The purpose of PID control is to keep a process running as close as possible to a desired Set Point. About PID and Process Control A common type of control is On-Off control. Many heating systems work on this principle. The heater is off when the temperature is above the Set Point, and turns on when the temperature is below the Set Point. The lag in the system response time causes the temperature to overshoot and oscillate around the Set Point. PID control enables you to minimize overshoot and damp the resulting oscillations. 14 PID enables your controller to automatically regulate your process by: 1. Taking the output signal from the process, called the Process Variable (PV), 2. Comparing this output value with the process Set Point. The difference between the output Process Variable and the Set Point is called the Error signal. 3. Using the Error signal to regulate the controller output signal, called the Control Variable (CV), to keep the process running at the Set Point. Note that this output signal may be an analog or time-proportional variable value. In the figure below, a system is regulated according to temperature.

17 VisiLogic FB Library Inside the PID Function The PID function is based on 3 actions, Proportional, Integral, and Derivative. The PID output is the combined output of all 3 actions. All of the PID functions are activated by changes in the process Error, the difference between the Process Value and the process Set Point value (E = SP PV). Proportional Band The proportional band is a range defined around the Set Point. It is expressed as a percentage of the total Process Value (PV). When the PV is within this range, the PID function is active. Note range. The proportional band may exceed 100%. In this case, PID control is applied over the entire system Proportional Action Proportional action begins after the PV enters the proportional band; at this point, the Error is 100%. The action outputs a value that is in direct linear proportion to the size of the Error value. A broad proportional band causes a more gradual initial response from the controller. Typically, Set Point overshoot is low; but when the system stabilizes, oscillations around the Set Point tend to be greater. 15

18 PID + Autotune FB A narrow band causes a rapid response that typically overshoots the Set Point by a greater margin. However, the system does tend to stabilize closer to the set point. Note that a proportional band set at 0.0% actually forces the controller into On-Off mode. The drawback of proportional control is that it can cause the system to stabilize below set point. This occurs because when the system is at set point, Error is zero and the control value output is therefore pegged at zero as well. The majority of systems require continuous power to run at set point. This is achieved by integrating integral and derivative control into the system. Direct and Reverse Action Direct action causes the output to change in the same direction as the change in Error, meaning that a positive change in Error causes a positive change in the proportional band s output. Reverse action creates an inverse change in the output, meaning that a positive change in Error causes a negative change in output. Integral Action Integral action responds to the rate of change in the controller s CV output relative to the change in Error. The integral time you set is the amount of time, as calculated by the controller, required to bring the process to Set Point. Note that if you set a short integral time, the function will respond very quickly and may overshoot the Set Point. Setting a larger integral time value will cause a slower response. Integral time is sometimes called Reset. The controller s CV output may reach and remain at 100%, a condition called saturation. This may occur, for example, if the process is unable to reach Set Point. This causes the Error signal to remain stuck in either the positive or negative range. In this situation, the integral action will grow larger and larger as the Error accumulates over time. This is called integral "wind up", which can cause the controller to overshoot the set point by a wide margin. This situation can be prevented by setting an MB to clear the accumulated Integral error when saturation is occurs. 16

19 VisiLogic FB Library Derivative Action Derivative action responds to the rate and direction of change in the Error. This means that a fast change in error causes a strong response from the controller. The derivative action anticipates the PV s value in relation to the Set Point and adjusts the controller s CV output accordingly, thus shortening the PID function s response time. PID Status Messages PID error indications are given in the Status Messages MI in the PID configuration. Status Messages Initialized to 0 when Configuration is activated. MI Value Message 0 FB status OK 1, 2, 3 Auto-tune in progress 4 PID running 5, 6 Setpoint change in progress 7 Integral-wind up 8 integral-wind down 12, 13 AT parameter mismatch Note that this means that PID will run without Auto-tune. The user may either rewrite the PID values to the 32-MI long Auto-tune vector, or may re-run Auto-tune -1 Proportion band zero. -2 Input range is invalid (PV input). -3 Output range is invalid (CV output). 17

20 PID + Autotune FB -4 Integral Overflow has reached maximum of 100,000. PID will not allow the Integral value to increase any further. -5 Error in 32-MI long Auto Tune vector addresses, ex., the vector exceeds the final address in the MI data type. -6 Set Point less then Input low range or Set Point more then Input high range. -7 to-10 Auto tune error, failed to calculate PID parameters -11 Noise is more then 5% of Input Range. PID Tips Background: the Proportional Band and PV The proportional band is a range defined around the Set Point. It is expressed as a percentage of the total Process Value (PV). When the PV is within this range, the PID function is active. Note The proportional band may exceed 100%. In this case, PID control is applied over the entire system range. The PV and Setpoint must be the same unit type. You can set PV limits by assigning Power up values as shown below. 18

21 VisiLogic FB Library Note A broad proportional band increases the stability of the system, but also increases fluctuations during the stable phase. A proportional band that is too narrow will cause the system to react as though to ON-OFF control, and greatly overshoot and undershoot the setpoint. You can increase the proportional band or the integral time to decrease overshooting and stabilize the system. PID Analog Input Tips PID Range Settings: PV Low and PV High limits. If your PID PV is based on an analog input using current or voltage, you can use the analog range units to set the PV low and PV high limits. If this is done, you must also 'normalize' the setpoint to this range. In general, it is recommended that you linearize the ranges to Engineering Units (EU). In this case use the analog reading ranges for X1 and X2, and use engineering units for Y1 and Y2. Input resolution Reading Range 10 bit, (0 to 10V, 0-20mA) units 10 bit (4-20mA) 205 to bit (0 to 10V, 0-20mA) bit (-20mA) bit (0 to 10V, 0-20mA) unit 14 bit (4-20mA ) Note If you are using a PT100 or Thermocouple input, the values do not have to be linearized. This is because the input value is already in degrees Celsius or Fahrenheit ( 0.1 resolution) according to the Hardware Configuration. Example: If the MI that is linked to a temperature input, set to Celsius, contains the value 385, the temperature reading is 38.5 C. 19

22 PID + Autotune FB Example: Temperature, Thermocouple type 'J' Example: Linearizing to bars (pressure EU) Assume that you are using a 14-bit input, 4-20mA with a pressure transducer with a range of 0-10 bars. Set Linearization parameters as shown below. 20 Although you can set the PV limits to the input range, this may not produce accurate results. Example 1: Assume that the 14-bit pressure transducer mentioned above is in a system with range limits of 0-5 bars. If you set the PV Low to 0 and the PV high to 1000 (10.00 bars), this is the range that will be used by the PID function. PID will work properly. However, you can achieve better PID control by setting the PV Low to 0 and the PV High to 600 ( 6 bars). Since the error is a function of the PID working band, Example 2 will run with approximately 40% greater accuracy than Example 1. Example 2: Thermocouple type 'J' has as range of -200 to 760 C. Assume that this is the input for a PID system with an ambient temperature that can reach a low of 10 C to a maximum setpoint of 250 C. If you set the PV Low to 0 and the PV High to 300 C, PID control will function with approximately 3 times greater accuracy than if you set the PV range to cover the entire -200 to 760 input range. PID via Digital Output (Contactor, Solenoid Valve, SSR) You can use the PWM (Pulse Width Modulation) FB to control a PID system. PWM FB enables you to control the ratio between the ON and OFF status of a selected MB (Duty Cycle) within the defined cycle time, which is given as ticks of 2.5 milliseconds. The ratio is given as an ON pulse percentage on the range of (0-100%). In order to control PID with the PWM FB, you must set the PID CV range to ( %). Since the PWM cycle time is set in ticks of 2.5 ms, e.g. 1 s = 400. If the output is a relay/contactor/solenoid valve, the recommended cycle time range is between 2000 and (5 to 30 sec). Example: As the PWM output MB pulses ON and OFF, the pulse ON time is proportional to the CV. If the cycle time is = 4000 (10 sec), and the CV is 100 (10.0%), the output bit will be ON for 1 second and OFF for 9 seconds, thereby supplying 10% of the energy to the system.

23 VisiLogic FB Library If the switch is an SSR, the recommended cycle time range is between 200 and 1000 (0.5 to 2.5 sec). Transistor outputs are preferable. If you use an SSR, you can use a Unitronics PLC that supports a high-speed output. In Hardware Configuration, set the Frequency (F=1/CT) parameter's Power-up Value to 5 to 10Hz ( which is s cycle time). Link the PWM Duty Cycle MI to the CV. Note that in order to activate the output pulses, you must SET the RUN MB linked to the HSO in Hardware Configuration. Manual Loop Tuning In certain cases, you may already have the PID values required by you application. However, you should still perform Autotune in order to ensure proper PID function. This is because during the Autotune process, the PID function collects certain essential data. Unitronics' proprietary PID algorithm uses this data to run smooth, accurate PID. 21

24 Remote PLC DataCom FB Remote PLC DataCom If your controller comprises an Ethernet card, you can use Remote PLC DataCom commands to communicate mixed data messages, containing both register and bit values, to remote Unitronics PLCs over TCP/IP. Any controller in the network may function as either master or slave via the controller's Ethernet port. Remote PLC DataCom runs over UDP. TCP is not supported. Specific information on implementing Ethernet is provided in the topic Using Ethernet. Using Remote PLC DataCom Before using a Remote PLC DataCom operation in your application, you must: Assign IP addresses to both master and slave PLCs. This is done by placing TCP/IP Card Init FBs in the ladder application of both master and slave. Determine which socket will be used for PLC DataCom. - Socket 0: This socket is set to UDP Unicast by default. If you select Socket 0, you must set it to support UDP Multicast by turning SB 159 OFF. - Sockets 1-3: These are set to TCP by default. In order to use these sockets, use a TCP/IP Socket Init function to switch the socket to UDP mode. If you set Sockets 1-3 to UDP, they will be in Multicast mode. Include at least 1 Remote PLC DataCom Configuration FB in the ladder application of both master and slave. The condition that activates the Configuration must turn ON for a single program scan (positive transition recommended). However, the Remote PLC DataCom configuration must be scanned during every program cycle--after the Configuration is activated. One way to ensure this is by placing the configuration in the first subroutine of the main module. Enable data transfer by including an Update FB in the ladder application of both master and slave. You can also include a DataCom Data Synchronization function in your master's ladder application. This causes the Write messages to be sent before the Read messages. The programs below show how to implement PLC DataCom via Socket 0. 22

25 VisiLogic FB Library Master Program Slave Program 23

26 Remote PLC DataCom FB FB Operations Remote PLC DataCom Operations are located on the FBs menu. Configuration DataCom Data Synchronization Update Master Data Request PLC DataCom: Configuration A PLC DataCom Configuration FB must be included in both master and slave Ladder applications as shown below. PLC DataCom Operations are located on the FBs menu. Master Configuration The Master Configuration enables you to send data requests to Slave PLCs. To display the Master parameters, select Master under Master/Slave. Each Configuration can contain both Read and Write Mix Requests. Each request may be for a different data type. Your data request must include : Master and Slave operand addresses Length of vector Direction: Read or Write After you add a request, the OK button is disabled. Click the Compile button to see current buffer status; if the buffer contains less than the maximum number of bytes, the OK is enabled. Read Write Limitations Only the following data types may be used in Read/Write requests: MI, ML, DW, MB, I and O. Registers: may only be read/written to the same data type. Booleans: Inputs cannot be written to. Booleans, Read Write Registers, Read Write I MB, O MI MI O MB, O ML ML MB MB, O DW DW 24

27 VisiLogic FB Library Parameter Type Function Configuration parameters Delay Program Scan MI This is the amount of time a Master PLC will halt the program scan in order to wait for an answer from a Slave. Time out units are defined in 1 msecs; the maximum is 100 msec. Actual Time of Delay MI This is the amount of time the Master PLC actually waited for a Slave response. Status MI Status Messages are listed on page 27. TCP/IP Socket In order to support Remote PLC DataCom, the socket you use must be set to UDP, Multicast mode. By default, Socket 0 is set to UDP, Unicast. To enable PLC DataCom, reset SB 159 to change Socket 0 to Multicast. Remote IP MI The IP address of the remote Slave unit. Note The IP vector is 4 MIs long. The low byte of each MI provides the number for an octet within the IP address. If, for example, the IP address is linked to MI 0, and the low bytes of MI 0 to MI 3 contain the values 192, 198, 192, 45, the IP address will be

28 Remote PLC DataCom FB Remote Port MI The access port of the remote Slave unit. Master Data Requests Click in a field to select the: -Start of the master's data vector -Start of the slave's data vector -Vector length - Direction, Read from Slave or Write to Slave Memory usage The function uses two buffers, Send and Receive. Each buffer can contain a maximum of 500 bytes. Clicking Compile updates the Buffer Usage report. If the Request fits in the buffer, the OK button is enabled. Slave Configuration The Slave Configuration enables the Slave PLC to receive data requests. Parameter Type Function Configuration parameters Delay Program Scan MI This is the amount of time a Slave PLC will halt the program scan in order to wait for a Master message. Time out units are defined in 1 msecs; the maximum is 10 msec. Actual Time of Delay MI This is the amount of time the Slave PLC actually waited for a Master message. Status MI Status Messages are listed on page 27. Master Data Request Activate a Master Data Request to send all data messages in the Master Configuration. 26

29 VisiLogic FB Library Update Update enables a PLC to receive Remote PLC DataCom messages. Update must be included in Slave ladder applications to enable a Slave to receive messages, and must be included in the Master ladder application to enable the Master to receive responses from slave PLCs. Update should be placed on the left-hand ladder rail in the Main routine. DataCom Data Synchronization This function causes the Write data messages to be sent before the Read data messages. PLC DataCom Status Messages The value in the Configuration's Status MI indicates the following: 0 - No Error 1 - Master: waiting for message (The Configuration parameter Delay Program Scan time has not been exceeded) Errors: 3 - The number of Read requests or the number of Write requests is greater than The Master message length or the Slave message length exceeds the legal limit of 500 bytes. 5 - No Ethernet card can be found. 6 - The Ethernet card is not set to UDP. 7 - The Wait Time has been exceeded (Wait time > 100 in the Master or Wait time > 10 in Slave). 8 - Master has not received message (The Configuration parameter Delay Program Scan time has been exceeded). 9 - PLC or network error The remote Slave IP does not exist. 11 -Checksum Error in the message received by the Master. 27

30 Trends FB Trends Trends Ladder functions enable you to display a vector of dynamically changing values on the Vision screen in response to application conditions. The values input to Trends may come from: Registers Data Tables. To provide background axes for Trends, you can either use the HMI utility Draw Static Axis, or the advanced Draw Axis functions. Trends operations are located on the FBs toolbar. FB Operations Configuration Trend Fill & Draw Loop: Track a Single Value Advanced-Draw Advanced Trends: Style How Trends Works In order to draw a real-time graph on the LCD, your Ladder application must include a Trends Configuration and one of the Trends Draw operations. The Trends Configuration parameters define: The location and length of the Trends vector, which is the vector of values that the application uses to draw the Trends graph. The size of the Drawing Area The graph's location on the screen. The Draw operations actually draw the values on the LCD: Fill & Draw Loop: Track a Single Value automatically tracks a single, dynamic value such as a temperature value. The advanced operation Trend Draw Graph enables you to draw an array of values within the vector, by setting the array length and the offset from the start of the vector. By default, the graph is drawn as a 1-pixel high single line of connected points. Trends Style enables you to control the default appearance of the graph line (point height and width in pixels, and connecting line type). 28

31 VisiLogic FB Library Trends QuickStart The figures below show all of the basic elements required to track a single "Temperature" value. Each second, a single value is stored in the Trends vector. When the application draws the Trends graph on the LCD, each point in the graph line represents a single value in the vector. 29

32 Trends FB Linearizing Values Linearizing Data Table values ensures that the Trends graph will fit into the drawing area. To do this, read each value from a Data Table, linearize and then store it in the MI that provides the value for the Fill Loop function. If, for example, within the Data Table, the 'temperature' value range is , set the 'x' parameters in the Linearization function from If, within the Trend Configuration, the area height is set to 200, set the 'y' parameters range from Refreshing the LCD screen At certain times, for example when a new display is entered, or during Information Mode, the graph is erased. The net shown below ensures that the graph is always refreshed. Note that SB 26, Exiting OS Draw Mode, turns ON for 1 cycle after OS draw. OS Draw Mode means that the controller's Operating System takes control of the LCD screen: During Info Mode When a Display is entered When the Virtual Keypad (touch-screen models) is displayed. 30

33 VisiLogic FB Library Configuration Use the Trends Configuration to set the parameters the controller uses to draw the Trends graph on the LCD. You must link each Trends operation to a Configuration. Set the Data Source to define the Trends vector, the vector that contains the values to be drawn in the Trends graph. This vector can be from within the PLC operands, or from values in the PLC's Data Tables. Note The Configuration must be scanned during each PLC program cycle (even if the activating condition is OFF). It should therefore be placed in the main routine and activated once, at power-up (SB2). The net containing the Configuration must not be jumped via label. Configuration Parameters Parameter Type Function X Start Position Y Start Position MI,ML, DW, or Constant MI,ML, DW, or Constant Sets the x and y origins (starting point) of the Trends graph, in pixels. The origins must be within the actual dimensions of the screen. Drawing Area: Width Drawing Area:Height MI,ML, DW, or Constant MI,ML, DW, or Constant Determines the width and length, in pixels, of the area in which the graph is drawn. The Draw Area must fit into the actual dimensions of the screen. Status MI The value of the linked MI indicates messages as follows: 31

34 Trends FB Value Message 1 PLC currently in drawing mod (ex. Information mode); Trend graph cannot be drawn. 2 Function in Progress bit is ON; Trend graph cannot be drawn. 3 X & Y origins are not within the area of the Vision screen; Trend graph cannot be drawn. 4 Drawing area height exceeds the area of the Vision screen; Trend graph cannot be drawn.. 5 Point Height is not within range, 1-10; Trend graph cannot be drawn. 6 The parameter Refresh: Number of Points per Scan is not within range, 1-16; Trend graph cannot be drawn. 7 FB version outdated, run Update from the Web 8 The linked Data Source Type is not legal (operand or Data Table); Trend graph cannot be drawn. 9 The linked Data type is not legal (byte, integer, long); Trend graph cannot be drawn 10 Trend: Number of Values in Vector (Trends Configuration); Trend graph cannot be drawn 11 Draw: Number of Values (Trends Draw)is zero; Trend graph cannot be drawn. 12 The Trend: Number of Values in Vector (Trends Configuration)is less than the Draw: Number of Values (Trends Draw) or The Data Offset (Draw) is out of the range set by Trend: Number of Values in Vector (Trends Configuration)and Draw: Number of Values (Trends Draw) Trend graph cannot be drawn 13 The Trends Configuration is not active. To avoid this, place the Configurations on the right-hand Ladder rail in the main routine 14 Coordinates are outside of the screen dimensions. 15 Loop Fill/Draw is active, but the Loop has not been initialized with Loop Init. 16 The space between points is bigger than the Trend Width 17 "Fill & Draw loop -Init" and "Advanced - Draw Graph"are both included in the application (illegal) 32

35 VisiLogic FB Library Draw in Progress MB Note Drawing may take a number of scans Draw Trend Turns ON, When Draw is activated, and remains ON when Draw operation is drawing. Turns OFF when the operation finishes drawing Do not use the state of 'Function in Progress' together with the Fill & Draw operation. Trend Fill & Draw Loop: Track a Single Value Trend Fill & Draw Loop operations enable you to create a Trends graph that tracks a single, dynamic value such as a temperature value. Loop: Draw and Fill automatically adapt the number of values on-screen to the Drawing Area, which is set in the linked Configuration. When the operation reaches the last operand in the Trends vector, they return to the beginning. Loop: Draw and Fill operations manage their own pointers. Note Do not use the state of the Configuration's 'Function in Progress' MB together with the Fill & Draw operation. Since the Fill and Draw operation automatizes the pointer action with the vector, Loop Init When you activate this operation, it initializes the Loop: Fill & Draw pointers, causing it to return to the first operand in the Trends vector. Loop: Fill This operation has a single parameter: Fill Value. The Fill register is linked to the value that the function stores in the Trends Vector. The first time Loop: Fill is called, the operation stores the value in the Fill register into the first operand in the Trends vector. Each time this operation is activated after this, the value in the Insert Value operand is stored into the next consecutive operand. The value is then represented as a point in the Trends Loop graph. When the last value has been stored, Loop: Fill returns to the beginning and stores the value into the first operand. This process continues until Loop: Init is called. 33

36 Trends FB Draw Operations Draw operations actually draw each value in the Trend Vector on the Vision Display screen. Each value is represented as a point on the screen. By default, each value is represented by a single pixel. You can change the appearance of the points by using the Trends Style operation. When the last value in the Trend Vector has been drawn, Draw operations return to the first value and begin again. This process continues until Loop: Init is called. Loop: Draw This operation represents the values in the Trends Vector in sequence. The first time Loop: Draw is called, the operation draws the first value in the Trends Vector as the first point on the graph. Each time this operation is activated after this, it draws the next consecutive value in the vector. When the last value has been drawn, Loop: Draw returns to the first value and begins again. This process continues until Loop: Init is called. Loop: Draw has no parameters. Draw: Show History Like Loop: Draw, this operation represents the values in the Trends vector. Show History enables you to move backwards in the Trend vector, starting from the newest point drawn on screen, and display a section of previously-shown values. The value of the input parameter, History Offset, determines which section of the vector is shown on-screen. 34

37 VisiLogic FB Library When you look at the figure below, assume that the first time the arrow is pressed, the value 800 is the newest value displayed on-screen. Note Note that if the History Offset MI = 0, Show History displays the Trend Vector values in sequence exactly like Loop: Draw. Once you have moved backwards in the Trend Vector by decrementing the History Offset, you can move forward in the vector by incrementing the value. Advanced-Trends: Style This operation enables you to set the appearance of the Trends graph. The figure below shows what parts of the Trends graph are affected by the different parameters. 35

38 Trends FB Configuration Parameters Parameter Type Function Point width MI, ML, DW, or Constant Sets the width, in pixels, of each individual point. Range of Values: 1-10 pixels. Default: 1. Point Height MI, ML, DW, or Constant Sets the height, in pixels, of each individual point. Range of Values: 1-10 pixels. Default: 1. Space between points MI, ML, DW, or Constant Sets the space between points; this is limited by the size of the Drawing Area and Vision screen dimensions. Default: 0. Space style MI, ML, DW, or Constant Use this parameter to connect the points in the graph. Default: 0. Value Style 0 No line 1 Simple line 2 Zig-Zag (hyphenated line) 3 Steps 4 Bar Graph style Refresh: Number of Points per scan MI, ML, DW, or Constant Sets the number of points that are refreshed on-screen during each program scan. Range of Values: 1-16 points. Default:8 36

39 VisiLogic FB Library Advanced-Trend Draw Graph Trend Draw Graph enables you to focus on a certain part of the Trends vector. The Draw operation defines: How many values will be represented from within the Trends vector. The offset of those values from the start of the Trends vector. Each value in the Trends vector is represented by a single point on the graph. Use the Draw: Number of Values parameter to determine how many values, within that vector, will be represented at each program scan. Each time the Trend Draw is activated, all of the points in Number of Values are refreshed, according to the Data Offset. Parameter Type Function Data Offset MI, ML, DW, or Constant Sets the offset number, from the beginning of the vector, of values to be read. Draw: Number of Values MI, ML, DW, or Constant The number of values to be represented at each program scan. Note All points must be able to fit on the screen. If, for example, in Trends Configuration, the point width is set at 1 pixel and the space between points is set to 0, and Trends Draw is set to represent 200 values, the resulting graph line will be two hundred pixels long on the LCD screen. In order to display all 200 values, the Drawing Area Width must therefore be set to a minimum of 200 pixels Clear Trend Before Refresh MB When this MB is ON: at each scan, before the trend graph is drawn, the function clears any pixels that are occupying the locations of new points in the Trends graph. The location of the Trends graph is in accordance with the parameters in the Trend Configuration. The Trends Configuration below sets a Trends Vector of 1000 MIs. 37

40 Trends FB The following Draw Graph operation will draw 200 values on the screen; which 200 values are drawn depends on the value in the parameter Data Offset in Trend Vector. 38

41 VisiLogic FB Library Draw Trend Parameters Parameter Type Function Data Offset MI,ML, DW, or Constant Sets the offset number, from the beginning of the vector, of values to be read. Draw: Number of Values MI,ML, DW, or Constant The number of values to be represented at each program scan. Note All points must be able to fit on the screen. If, for example, in Trends Configuration, the point width is set at 1 pixel and the space between points is set to 0, and Trends Draw is set to represent 200 values, the resulting graph line will be two hundred pixels long on the LCD screen. In order to display all 200 values, the Drawing Area Width must therefore be set to a minimum of 200 pixels Clear Trend Before Refresh MB When this MB is ON: at each scan, before the trend graph is drawn, the function clears any pixels that are occupying the locations of new points in the Trends graph. 39

42 Draw Axis FB Draw Axis Use this function to place x and y axes, including ticks, on the Vision screen in response to Ladder conditions. The axes may be used to provide a background for bar graphs, or in conjunction with the Trends function block. Draw Axis operations are located on the FBs toolbar. FB Operations Configuration Draw Clear Configuration The Draw Axis Configuration sets the parameters the controller uses to draw the axis on the LCD. Each Draw Axis operation is linked to a Configuration. 40

43 VisiLogic FB Library Parameter Type Function Axis Type Constant This sets the axis direction. Select between: X axis (horizontal). Y axis (vertical). X Start Position MI,ML, DW, or Constant x-origin of the axis, in pixels. Y Start Position MI,ML, DW, or Constant y-origin of the axis, in pixels. Axis Length MI,ML, DW, or Constant Length of the axis, in pixels. Space Between Ticks MI,ML, DW, or Constant Distance between ticks, in pixels. Height Of Ticks MI,ML, DW, or Constant Height of ticks, in pixels. Axis Thickness MI,ML, DW, or Constant Thickness of the main axis line, in pixels. Tick Thickness MI,ML, DW, or Constant Thickness of ticks, in pixels. Status MI If the axis or ticks are not drawn when the Draw operation is called, check the value of the Status MI. The first 4 (LSB) bits of the MI act as a bitmap to indicate the messages listed below. Bit Message 0 PLC in Info Mode, Axis cannot be drawn 41

44 Draw Axis FB 1 PLC in Info Mode, Axis cannot be cleared (erased). 2 The main axis line cannot be drawn because: - the length of the line exceeds the screen's dimensions. - the coordinates of the line are not within the screen. - both of the above. 3 The ticks cannot be drawn because: - the length of the ticks exceeds the screen's dimensions. - the ticks are not within the screen. Each axis, whether x or y, that is drawn on screen requires a separate Draw Axis Configuration. In addition, note that in order to obtain an axis with different tick heights, you must superimpose one axis on top of another. The example below shows a horizontal axis that is composed of 2 separate Draw Axis Configurations. Note that the parameters supplying coordinates are identical; the tick height and spacing are different. 42

45 VisiLogic FB Library Draw To display the axis on screen: 1. Place a Draw operation in the Ladder application. 2. Link it to the desired Configuration. When Draw is activated, generally by a positive transitional contact, the axis will appear on screen. If the axis does not appear, check the Status MI in the Draw Axis Configuration. The axis remains on screen until it is cleared by a Clear operation. Clear To clear the axis from the screen: 1. Place a Clear operation in the Ladder application. 2. Link it to the desired Configuration. When Clear is activated, generally by a positive transitional contact, the axis disappears from the screen. Note The Draw Axis Clear clears the last axis drawn. This means that if the application: 1. Draws an axis, 2. Redraws the same axis, but after changing the Configuration's parameters, changing the location/appearance of the axis, 3. Runs Clear Draw Axis The result is that only the axis drawn in Step 2 will be cleared. 43

46 Draw Axis FB This means that you must run Clear Draw Axis before redrawing an axis. 44

47 VisiLogic FB Library Loadcell Loadcell FBs, located on the FB menu, enable you to include an I/O module that is connected to a loadcell or strain-gauge in your control application. Unitronics I/O expansion loadcell modules are intelligent I/O modules that are capable of receiving analog values directly from loadcells. IO-LC1 offers 1 Loadcell input; IO-LC3 module offers 3 Loadcell inputs. Each IO-LCx module is capable of providing excitation for up to 12 loadcells. The Loadcell FBs enable you to calibrate the loadcell. You can also tare and zero the loadcell, compensate for deadload and scale movement, and set the input range. Once you connect the loadcell and calibrate at least 2 points, you can begin to run a loadcell application. The loadcell input can be read in 6 different ways: Gross weight Net weight Net Min. Weight Net Max. Weight Scaled to uv/v Raw Value Most applications will require only the Gross or Net weight. Raw Value and uv/v readings may be useful for troubleshooting purposes. FB Operations Configuration Scan Calibration Setup Tare & Zero Advanced Note Both negative and positive (signed and unsigned) values can be processed by the I/O-LCx and the support software, enabling a range of applications. This feature is not supported by the V series. 45

48 Loadcell FB Loadcell Hardware Configuration The IO-LCx Hardware Configuration enables you to configure a loadcell, plus the digital input and digital outputs located on the module. These digital I/Os enable you to implement setpoints that are processed within the I/O module, independently of the controller and its program scan, enabling a fast response to process events. Configuring a Loadcell The number of Loadcell tabs in the Hardware Configuration window depends upon the loadcell module. Parameter Type Function In use Select 'In Use' to enable the loadcell for the application. Note A loadcell marked 'in use' can be suspended according to application conditions via the Advanced Calibration function Enable/Disable loadcell. This may be done to shorten the application's calibration time. Resolution ML, MI Selecting High enables you to link the input value to an ML, Normal to an MI. LC Input Value(s) MI, ML When the application runs, these registers contain the weight value input to the controller from the I/O LCx. When you select two values, you link the first value to a single register. The second value is automatically linked to the next register. The default representation mode for the first register is Net Weight, and Gross Weight for the second register. Excitation AC is the default, recommended Excitation method. You may select the DC option if your application requires. Hardware Status Messages MI Provides a bitmap showing the status of the module. 46

49 VisiLogic FB Library Loadcell: Configuration All Loadcell operations run through a Loadcell Configuration placed in the control program. Each Configuration is linked to a specific Loadcell input on the I/O expansion module. Loadcell Configuration is generally a Power-up task. The Loadcell Configuration FB is located on the FB's>Loadcell menu. Parameter Type Function I/O Module DIN Location Links the Configuration with the correct I/O expansion module according to its DIN rail location in Hardware Configuration. On this DIN rail, the I/O LC3 is module # 2 Note If the module is not located in the entered location, the LC Command Status Messages MI will display 6, Communication Error (I/O module does not exist) Loadcell Input Number Here, Loadcell 2 is being shown as marked 'In Use'. Note If the selected Loadcell is not marked 'In Use', the LC Command Status Messages MI will display 11, Illegal parameter LC Command Status Messages MI Is reset to 0 when a command is activated. Updated at the end of all operations using the Loadcell Configuration. Indicates error status for all loadcell operations processed by the Configuration Current value always shows the most recent error status. Value Message 0 Function in Progress 47

50 Loadcell FB 1 Command carried out successfully 2 I/O Expansion Command Buffer is full, please retry. Can be avoided by using SB 91, I/O Expansion Module--Command Buffer Full, as a condition 3 The I/O expansion module linked to the configuration is busy 5 Timeout Exceeded 6 Communication Error (I/O module does not exist) 11 Illegal parameter 13 Power supply not connected 16 Scale is currently in motion (is only relevant if In-Motion function is applied) 17 Signal is out of range (this value occurs when the Out of Range bit is ON) 18 Illegal weight (Occurs during calibration, if the raw value of weight being calibrated is too close to the raw value of an already calibrated weight; minimum distance is 256 or 100 Hex) 19 Command not supported in uv/v mode 20 Not calibrated (This value appears when less than 2 points have been calibrated) 21 EEPROM Protection Error (Indicates when too many Save Calibration FBs are run too frequently. Check the activating conditions for the Save Calibration FB, and whether your application contains loops) LC Success Bit MB Use this to monitor the status of a command Turns ON when: Configuration is first activated. Command is successfully processed. Command Status Messages MI is 1. Turns OFF when: Command Status Messages MI is 0. Function in Progress MB is ON, indicating that a command is being processed. Command error occurs Function in Progress MB This bit is ON when the module is processing a command. Use this as a condition bit for Loadcell operations to avoid conflicts. Turns ON when: Command is being processed. Command Status Messages MI is 0. Turns OFF when: Configuration is first activated. Command Status Messages MI is 1. 48

51 VisiLogic FB Library Command Issued LC Success Bit Function in Progress Success Error 0 0 >1 LC Command Status Messages Scan A Scan FB must be included for every Loadcell Configuration in a Loadcell application. When an application contains more than 1 Loadcell Configuration in the Ladder, the Scan FB displays the Select Name drop-down list, enabling you to link the desired Configuration. The Scan FB is located on the FB>Loadcell menu. Note The Scan FB must be on the left-hand ladder rail. Calibration Calibration parameters include calibrated points, input range settings, tare and zero values. These may be burned to the module's EEPROM using the Save Calibration FB. Before you can begin to implement a Loadcell application, you must calibrate at least two points, although up to 12 points may be calibrated; all other calibration parameters are optional. However, note that if the application requires you to set Input Range/Gain, you must make these settings before you calibrate points. Setting the Input Range/Gain after calibrating points invalidates these points. Calibrating Points A Calibration Point matches a Raw Value with a Weight value. These points are used to linearize the input value. To calibrate points, connect the controller to the loadcell via the I/O-LCx. Initial calibration is generally performed with known weights as shown in the following figure. After calibration has been performed, advanced calibration enables points to be added or edited via the ladder without weight being physically placed on the loadcell. 49

52 Loadcell FB Notes If the application requires you to set Input Range/Gain, you must make these settings before you calibrate points. Setting the Input Range/Gain after calibrating points invalidates the calibrated points. Zero does not have to be calibrated. Points do not have to be calibrated in any particular order. All calibrated points must be separated by a raw value minimum of 256 (100 Hex). Calibration is an immediate operation; motion is not checked before the operation is carried out. Calibration should be performed with greater accuracy than is required by the application. For example, in an application that requires 100g accuracy, calibrate in units of 10g, then round off the represented value by 10. The highest Calibrated Point weight value should % of the scale capacity. Calibration cannot be performed if the selected representation mode is uv/v. During calibration, increase filter depth by: - Increasing Settling Time. - Disabling other Loadcells. 50

53 VisiLogic FB Library Calibrate Point FB The Calibrate Point FB is located on the FB's>Loadcell>Calibration menu. Parameter Type Function Point Number Constant, MI A Calibration Point matches a weight value with a raw value. The raw value is acquired as an input from the loadcell when the application is run. Calibrate to Weight MI, ML This provides the weight value that is matched to the raw value Save Calibration When you save the calibration, calibrated points, tare, zero, and input range are burned into the module's EEPROM memory. This protects the calibration in the event of a power outage, reset, or power-up. To preserve any changes made to calibrated points, input range settings, tare and zero values, use Save Calibration any time these parameters are edited. Tare & Zero Applying Tare and Zero accomplish the same aim: to start a weighing session with a value of zero. The Tare value may include, for example, the container of the material to be weighed. 51 If the scale does not read 0 when empty, use Zero to compensate. When Tare is applied, it is reflected in the net weight. When Zero is applied, only the gross weight will be zero at the beginning of a weighing session.

54 Loadcell FB Tare & Zero Acquire Tare/Zero FB: value read from Loadcell Acquire Tare and Acquire Zero are both located on the FB's>Loadcell>Tare & Zero menu. Acquire Tare: In this method, the tare value is acquired from the scale. The objects comprising the tare, such as a pallet or materials container, are placed on the scale, and Acquire Tare is activated. Acquire Zero: The scale must be empty to acquire Zero. Acquire Zero is not related to the Auto-Zero Tracking function, which enables the module to compensate for the accumulation of undesired material on the scale in the course of operations. Note Loadcell Name determines from which loadcell the tare/zero will be acquired. After the tare has been acquired, the tare value will be applied to that loadcell. Use the Save Calibration FB to save Tare and Zero values to the module's EEPROM memory. Tare and Zero cannot be acquired when running uv/v mode. If the Motion Band FB is activated, the tare value cannot be acquired until the scale is stable. Although only the FBs relating to tare are pictured in the following figures, the figure apply to both Tare and Zero FBs. Advanced Tare& Zero Functions These FBs are both located on the FB's>Loadcell> Advanced> Tare & Zero menu. Edit Tare/Zero: value via operand or constant Parameter Type Function Tare/Zero Value MI, ML, or Constant Edit Tare/Zero enables the tare value to be acquired from a register or constant value within the controller. You can also use Edit Tare/Zero to change a loadcell's existing tare/zero value. 52

55 VisiLogic FB Library Read Tare/Zero: reading the current Tare or Zero Value Parameter Type Function Read Tare/Zero MI, ML Reads the current tare or zero value applied to the linked loadcell input into the linked register. Setup Setup FBs provide additional parameters that you may require for your application. Setup FBs include Motion Band, Filter & Rounding, and Auto-Zero, and are located on the FB's>Loadcell>Setup menu. Note The Setup FBs need to be activated only once, at power-up. They are not saved to EEPROM. Motion Band When the weight on the scale changes, the scale needs time to stabilize. The Motion band determines the amount of weight change the module uses to decide if the scale is in motion. Bit 0, of the MI that is linked to LC Hardware Status Messages in Hardware Configuration, is the In-motion indicator. Bit 0 is ON when the scale is in motion, and OFF when the scale is steady. As the module reads the signals from the loadcell(s) it calculates the weight value. If a weight change falls within the Motion Band, Bit 0 turns OFF. In the figure below, the in-motion indicator (Bit 0) turns ON when the weight change is below 100 grams, or more than 500 grams. When the weight change falls within the band (100 to 500), Bit 0 turns OFF. Notes The FB must be activated in order to apply the Motion Band. The In-motion indication is OFF when: 53

56 Loadcell FB - at Power-up - or The scale is not calibrated. In order for the In-Motion indication to function properly, the filter Active Band must be equal or higher than the In-Motion Tolerance. Refer to the Filter and Rounding function for description and power-up defaults. If the Motion Band is active, the tare/zero values cannot be acquired when the scale is in motion. Parameter Type Function LC Motion Band MI, ML, or Constant Provides a value for the weight band. A weight change that falls outside this band turns the Inmotion bit ON. When the weight change is inside the band, the bit turns OFF. Filter and Rounding The Filter & Rounding parameters change the default filter parameters and value rounding. Rounding further smooths the loadcell reading. Parameter Type Function Rounding MI or Constant The number used to round the output values. 0 - Round by 1(Power-up default) 1 - Round by Round by Round by Round by Round by Round by 100 Note Value rounding will not take effect in uv/v and Raw value representation modes. Settling Time MI,or Constant The time, in units of 10msec, that the filter requires to settle to the final reading. Notes The default settling time is 1 second, the minimum time 1 is 12.5 milliseconds, and the maximum is 24 seconds. A value of zero disables the filter. Settling time rises with the number of active loadcells. 54

57 VisiLogic FB Library The minimum settling times are: ms for one active loadcell ms for two active loadcells. - 1,012.5ms for three active loadcells. Using a settling time of zero sets the settling time to its minimum value without returning an error. Active Band MI, ML, or Constant The band of weight changes in which the filter is active. The filter is turned off by weight changes that exceed the active band. This allows a rapid response to large weight changes. When the weight changes become smaller than the active band, the filter turns on. An active band of zero forces the filter to be always active. Notes If the Motion Band is on, the filter's Active Band must be equal or higher than the Motion Band. Auto Zero Tracking When activated, Auto-Zero Tracking zeros the gross weight according to the conditions you set, enabling the module to automatically compensate for small variations at the zero point, such as those caused by a buildup of litter on the scale platform, or by temperature fluctuations near the scale. Before Auto-zero Tracking can zero the scale: The Motion Band FB must be included in the application. The Motion Band must be active. The In-Motion bit, Bit 0 of the MI linked to LC Hardware Status Messages in Hardware Configuration, must already have turned OFF, indicating that the scale is steady. Once these conditions have been met, Auto-zero zeros the gross weight. Notes Once Auto-Zero tracking is activated, it stays active until the function is suspended by the application. Auto zero tracking will not function in uv/v representation mode. Parameter Type Function LC Time: Scale Stable, 10 ms units MI, ML or Constant The time in which, in units of 10 msec, the scale must be stable in order to trigger Auto-Zero Tracking. Notes Initializing this parameter to 0 will turn off Auto Zero Tracking and clear the accumulated offset. Power-up default: 0 (auto zero tracking is off). To clear the auto zero tracking offset, initialize this parameter to 0, and then enter a new time value. LC Tracking band, Weight from last MI, ML or This determines the maximum distance from the point of the last zero (auto or manual) in which auto-zero tracking is activated [weight units]. 55

58 Loadcell FB Auto-0 Constant LC Tracking Range, Weight from Calib. 0 MI, ML or Constant This determines the maximum weight from the point of the last calibrated zero in which auto-zero is activated. Loadcell Operands & Status Messages Loadcell: Configuration FB All Loadcell operations run through a Loadcell configuration placed in the control program. Each Configuration is linked to a specific Loadcell input on the I/O expansion module. Command Status Messages Initialized to 0 when Loadcell Configuration is activated. MI Is reset to 0 when a command is activated. Updated at the end of all operations using the Loadcell Configuration. Indicates error status for all loadcell operations processed by the Configuration Current value always shows the most recent error status. Value Message 0 Function in Progress 1 Command carried out successfully 2 I/O Expansion Command Buffer is full, please retry. Can be avoided by using SB 91, I/O Expansion Module--Command Buffer Full, as a condition 3 The I/O expansion module linked to the configuration is busy 5 Timeout Exceeded 6 Communication Error (I/O module does not exist) 11 Illegal parameter 13 Power supply not connected 16 Scale is currently in motion (is only relevant if In-Motion function is applied) 17 Signal is out of range (this value occurs when the Out of Range bit is ON) 18 Illegal weight (Occurs during calibration, if the raw value of weight being calibrated is too close to the raw value of an already calibrated weight; minimum distance is 256 or 100 Hex) 19 Command not supported in uv/v mode 56

59 VisiLogic FB Library 20 Not calibrated (This value appears when less than 2 points have been calibrated) 21 EEPROM Protection Error (Indicates when too many Save Calibration FBs are run too frequently. Check the activating conditions for the Save Calibration FB, and whether your application contains loops) LC Success Bit MB Turns ON when: Configuration is first activated. Command is successfully processed. Command Status Messages MI is 1. Turns OFF when: Command Status Messages MI is 0. Function in Progress MB is ON, indicating that a command is being processed. Function in Progress MB Turns ON when: Command is being processed. Command Status Messages MI is 0. Turns OFF when: Configuration is first activated. Command Status Messages MI is 1. Loadcell Hardware Status Messages (Hardware Configuration) The MI linked to the parameter LC Hardware Status Messages in Hardware Configuration provides a bitmap for the following messages. Bit# Description Turns ON when: Turns OFF when: 0 Scale motion Only relevant if Motion Band FB is included in application and activated Scale is in motion At Power-up When Scale is steady 1 Input Value Range Linked to I/O module's Out of Range LED indicator Input value is out of range Possible causes: 1 or more signal wires are disconnected A/D input voltage is out of range 2 Input Value Validity Input Value is invalid Possible causes: Channel is temporarily disabled, via the Disable all other Loadcells FB Bit is ON at Power-up until the first input value is received from the loadcell Input value is in range Input Value is valid 3 Loadcell Calibration Status When less than 2 points are calibrated At least 2 points are calibrated 4 Input Power Supply Status Linked to I/O module's Out of Range LED No Power Power Supply OK indicators When the input power is not supplied, the indicators blinks rapidly Note Bits 6 & 7 are linked to Outputs 0 & 1, located on the I/O module. Bit 6 is related to Output 0, Bit 7 to Output 1. Bits 6 & 7 can be used to monitor the setpoint output's status from within the Ladder application. The I/O module itself controls the setpoint function of the outputs. The module turns the outputs ON and OFF when the current loadcell input value reaches setpoint. Since the function is based in the firmware of the expansion module, when the output's status changes as a result of reaching/departing from setpoint, the status change is not registered by the Ladder application. Examples 57

60 Loadcell FB When setpoint output 1 is assigned to load cell channel 0, Bit 7 of load cell 0 status will indicate the state of output 1. When setpoint output 0 is assigned to load cell channel 2, Bit 6 of load cell 2 status will indicate the state of output 0. 6 Setpoint Status, Output 0 Output 0 is ON Output 0 is OFF 7 Setpoint Status, Output 1 Output 1 is ON Output 1 OFF SB91 I/O Exp. Module--Command buffer is full ON when commands cannot be sent to the I/O module. OFF when commands can be sent to the I/O module.. Advanced Loadcell Functions Advanced-Calibration These FBs are all located on the FB's>Loadcell> Advanced> Calibration menu. Note The Edit and Read Calibration Point functions contain parameters which accept the raw and weight values from existing Calibration Points. These parameters must be linked to the same type of registers, MI or ML, used to calibrate the original Calibration Point. Edit Calibration Point: value via operand or constant A Calibration Point matches a raw value to a weight value. You can use Edit Calibration Point to change these values. Notes The loadcell will stop functioning if deleting a point causes the number of Calibration Points to be less than 2. To prevent your changes from being lost at power-up, reset, or in the event of power outage, use the Save Calibration FB to burn the changes to the module's EEPROM.. Parameter Type Function LC Calibration Point Number MI or Constant The number of the Calibration Point that you wish to edit. LC Raw Value MI, or ML This register contains the new raw value for the Calibration Point. LC Calibrate to Weight MI, or ML This register contains the new weight value for the Calibration Point. Read Calibration Point Use this function to read the current raw and weight values of a Calibration Point. 58

61 VisiLogic FB Library Note If the point being read is not in use, both returned values will be (0x8000) for integer and (0x800000) for long. Parameter Type Function LC Calibration Point Number MI or Constant The number of the Calibration Point that you wish to read. LC Raw Value MI, or ML This register contains the current raw value of the Calibration Pointt. LC Calibrate to Weight MI, or ML This register contains the current weight value of the Calibration Point. Delete Calibration Point This deletes a Calibration Point. Notes The loadcell will stop functioning if a deleted point causes the number of Calibration Points to be less than 2. To prevent your changes from being lost at power-up, reset, or in the event of power outage, use the Save Calibration FB to burn the changes to the module's EEPROM. Parameter Type Function LC Calibration Point Number MI or Constant The number of the calibrated point that you wish to delete. Clear Calibration This deletes all calibrated points, tare, zero, and input ranges from the module's memory. However, Clear Calibration does not erase the values from the EEPROM. They may be retrieved from the EEPROM by resetting the controller. To delete all values from the EEPROM, run Clear Calibration followed by Save Calibration. 59

62 Loadcell FB Enable/Disable all other load cells Disable All Other Loadcells disables all loadcells in the expansion module except for the loadcell selected in the FB. During Calibration, the Disable All Other Loadcells FB can be used to increase filter depth for a specified settling time by eliminating the delay caused by channel change (approx. 300ms) and thus ensuring faster and more accurate calibration. To prevent channel changing from wasting settling time, use this function to disable all other loadcells except for the one you are currently calibrating. Enable All Other Loadcells re-enables all loadcells in the expansion module. Notes After this FB is run, and the Command Status Messages MI linked to the selected Loadcell Configuration indicates 1, updated values for all of the enabled channels are already available at their linked operands. This indication can be used to trigger a process, such as calibration. Disabled Loadcells: the Hardware Status Messages MI linked to the selected Loadcell Configuration The status bit "Value not valid" will rise in the disabled load cells' status word. Setpoint Each digital output located on the I/O module is associated with a setpoint. The I/O module itself controls the setpoint function of the outputs. The module turns the outputs ON and OFF when the current loadcell input value reaches setpoint. Setpoint activity is therefore not linked to the program scan. Each output may be assigned a setpoint. Since the function is based in the firmware of the expansion module, when the output's status changes as a result of reaching/departing from setpoint, the status change is not registered by the Ladder application. To monitor the outputs' status, this MI provides a bitmap indicating status messages; Bit 6 is related to Output 0, Bit 7 to Output 1. Therefore, use Bits 6 & 7 of the LC Hardware Status Messages MI to monitor the outputs' status, from within the Ladder application. 60 Note Once the Setpoint is activated, it cannot be changed by setting the output via the Ladder application. The setpoint remains OFF, regardless of its N.O./N.C.setting, when the loadcell input value is: - invalid (i.e., powered off, LC disabled, out of range, loadcell not calibrated. - In uv/v mode.

63 VisiLogic FB Library Examples When setpoint output 1 is assigned to load cell channel 0, Bit 7 of load cell 0 status will indicate the state of output 1. When setpoint output 0 is assigned to load cell channel 2, Bit 6 of load cell 2 status will indicate the state of output 0. Bit Description Turns ON when: Turns OFF when: 6 Setpoint Status, Output 0 Output 0 is ON Output 0 is OFF 7 Setpoint Status, Output 1 Output 1 is ON Output 1 OFF Set and Activate Setpoint Use this FB to implement a desired setpoint. Parameter Type Function LC Value Mode Constant Set the input value mode for the setpoint: 0 - Net 1 - Gross 2 - Net Min 3 - Net Max LC Output Number Constant Select output: Output - 0 Output - 1 LC Setpoint Type MI, ML, or Constant Select setpoint type: 0 - Normal state: Open Activation: Low 1 - Normal state: Open Activation: High 2 - Normal state: Closed Activation: Low 61

64 Loadcell FB 3 - Normal state: Closed Activation: High LC Setpoint Value MI, ML, or Constant The actual value assigned to the setpoint. LC Setpoint Hysteresis MI, ML, or Constant Sets a band in which the output will not chatter due to overshoot or vibrations. Deactivate Setpoint Use this to suspend the activity of a particular setpoint. Change Representation Mode During hardware configuration, under Number of values, you select whether to use one or two values. When you select a register for the Address: Value(s) parameter, selecting two values means that the register immediately following the register you select is used for the second value. The default representation mode for the first register is Net Weight, and Gross Weight for the second register. Via Change Representation mode, you can 'read' the value as: 62

65 VisiLogic FB Library Gross weight Net weight Net Min. Weight Net Max. Weight Scaled to mv Raw Value Parameter Type Function LC Value to Represent Constant Select the value for which you want to change the representation mode. LC Representation Mode MI or Constant Select the desired representation mode. 0 - Net (Gross if no Tare) (Power-up default for 1st value) 1 - Gross (Power-up default for 2nd value) 2 - Net Min 3 - Net Max 6 - uv/v 7 - Raw value Note When, after Change Representation Mode runs, the LC Command Status Messages MI returns '1', the requested value is already in its linked operand. This means that you can use the '1' status to trigger a process which relies on this specific representation value. The mv/v representation mode uses the default calibration. Therefore: The mv/v rep. mode indicates the actual applied differential input voltage in micro-volts per every volt of the excitation, regardless of the user-selected input range and DAC (offset) compensation. Setting one of the values representation modes to mv/v will force both values to be represented in mv/v (the rep. mode of the other value will not be overwritten). It takes approximately 330msec to change between mv/v and other different representation modes. The A/D raw value is affected by the user-selected input range (gain and DAC (offset) compensation). To cancel this effect, use the Clear Calibration command to set default calibration. To return to the last saved calibration, reset the controller (no need to re-power-up neither the unit nor the controller). 63

66 Loadcell FB Reset Net Min/Max Values Resets the Net Minimum value to positive full-scale, and the Net Maximum value to negative full-scale. As soon as the scale becomes stable, meaning that the In-motion bit is OFF, the Net Min and Max values will be set to the net value. A Net Min and Max reset occurs also at power-up. Change Excitation Mode Use this FB to temporarily change the excitation supplied to the loadcell. This method is intended to use only for diagnostic purposes,such as when using a DC milli-voltmeter. Note Changing the excitation mode may add an offset to the A/D measurements. Therefore, the system should be calibrated using the same excitation mode the loadcell will work with. In general, the working excitation mode should be set via Hardware Configuration. The Change Excitation command overrides the hardware configuration excitation setting until the next system reset / power-up. Changing excitation mode may cause a momentary conversions-break (about 300msec) due to filter reset. Parameter Type Function LC Excitation mode MI or Constant 0=DC 1=AC Input Range The Input Gain parameter sets the amplification range for the input signal. The Offset parameter is generally used to compensate for the deadload; particularly in cases where the combined weight of deadload and payload exceed the A to D converter input range. Input Range and Offset are considered part of the loadcell's calibration. To burn these values into the module's EEPROM memory and protect them in the event of a power outage, use the Save Calibration FB. Notes Changing Gain or Offset requires you to recalibrate and save all calibrated points. If the application requires you to set Input Range/Gain, you must make these settings before you calibrate points. Setting the Input Range/Gain after calibrating points invalidates the calibrated points. Offset values out of the ±31 range will be truncated and no error will be returned. The uv/v rep. mode uses its own input range settings and therefore is not affected by the command. 64

67 VisiLogic FB Library Set Gain FB This FB limits the input range. The gain is applied to the signal after offset compensation. Setting the Set Gain MB to 0 limits the input range to ±20mV (Default setting), setting it to 1 (or any other value) limits the input range to ±80mV. Set Offset This FB sets the offset compensation, which is applied to the input signal before the gain. By default, the offset is set to 0mV (no offset). Possible values are in the range of ±31, where: 1LSB 0.5mV/V (= 2.5mV at exactly 5V excitation). Hence, the maximum offset compensation is ±15.5mV/V (= ±77.5mV at exactly 5V excitation). To calculate the offset value, measure the differential voltage at the input, between the -SG and +SG terminals, and then calculate the offset value according to 1LSB 0.5mV/V. If, for example, the differential voltage at the input is 10mV, use -4 as the offset value. Read Gain Reads the input range Gain. Read Offset Reads the input range Offset. 65

68 GPRS FB GPRS FB GPRS is a wireless data transmission service offered by some cellular providers. When a Unitronics' PLC is connected to a GPRS modem, the PLC can establish a data connection with a remote PC connected to the Internet and transmit IP packets of data over the GPRS cellular network. You can then use your PC to access the PLC via VisiLogic, Remote Access or other communication.dll, as well as log PLC data via the DataXport utility. The figure below shows GPRS communication elements. Notes The PLC must be connected to a GPRS modem. GPRS service must be supplied by the user's cellular service provider. To enable any GPRS operations to run, the PLC application must include GPRS Configuration and GPRS Run FBs. Unitronics has tested the following GPRS modems with Unitronic's PLCs: Wavecom Fastrack WM15467 (GPRS+TCP/IP 900/1800 MHz), Firmware version: 640b09gg.Q2406B , TCP/IP stack: edsoft-w302_v You can use Hyperterminal to: Check the modem's firmware version, via command AT+CGMR. Check the TCP/IP Stack, via command AT#VVersion. Sony Ericsson GT47 Firmware version: R5B003 prgcxcc

69 VisiLogic FB Library You can use Hyperterminal to: Check the modem's firmware version, via command AT+GMR. The PLC must initiate the GPRS data link by calling the PC. A sample application showing how to establish PC-PLC communications is available for both Sony Ericsson and Wavecom modems. This application is intended to be used as a template, for you to simply copy and adapt to your own requirements. Sample applications are located under Help>Examples. Wavecom modems do not support the End Call function. In order to end a call, use the Unregister from Network function, and then re-register if required. The Sony Ericsson GT47 GPRS modem must be used in conjunction with an appropriate cable and 5 pin connector. Using GPRS The PLC's Ladder application must contain the conditions and elements shown below. 67

70 GPRS FB FB Name COM Port Init FB GPRS Configuration GPRS Connect to Network GPRS Run Purpose Configure this FB to initialize the PLC COM Port connected to the GPRS-modem. Within the COM Init FB, select the GSM modem type, and then the actual GPRS modem type, such as the Sony Ericsson GT47. COM Port Init is usually a Power-up task. Note To learn how to prepare the modem for PLC use, check the topic PLC-side Modems. The Configuration is linked to the serial port initialized via the COM Port Init FB. Note The activating conditions should include the appropriate Modem Initialized SB for the COM Port. Connect must follow the GPRS Configuration. Connect provides the parameters that enable the PLC to connect to the Internet via the cellular network. This element enables data communications via GPRS. Note The activating conditions should include the appropriate Modem Initialized SB for the COM Port. Note This feature is not supported by the V series. FB Operations GPRS Operations are located on the FBs menu. GPRS Configuration GPRS Register to Network GPRS Run Start Call End Call Unregister (Disconnect) from Network Check Signal Quality GPRS Operands & Status Messages GPRS Configuration The GPRS Configuration must be included in all GPRS Ladder applications. The Configuration is linked to the serial port connected to the GPRS modem and initialized via the COM Port Init FB. Note The activating conditions should include the appropriate Modem Initialized SB for the COM Port. 68

71 VisiLogic FB Library Parameter Type Function Name The name of the Configuration. Port Number Constant Click the drop-down arrows to view available ports; click the port you want to use. Status Messages MI The value of the linked MI indicates GPRS status messages. Call Status MB This bit turns ON when the remote device has been accessed and the GPRS connection is established. GPRS Register to Network This FB provides the parameters that enable the PLC to connect to the Internet via the GPRS cellular network. Parameter Type Function Name Select the name of the GPRS Configuration that Connect will use to connect to the GPRS network. Registered by Network MB Turns ON when the PLC is assigned an IP address and registered by the GPRS network. IP Address MI When the PLC registers on the GPRS network, it is assigned a dynamic IP address. This is the start of a vector that contains the IP address that is assigned to the modem when the modem registers with the GPRS network. The vector is 4 MIs long. The low byte of each MI provides the number for an octet within the IP address. If, for example, the IP address is linked to MI 0, and the low bytes of MI 0 to MI 3 contain the values 192, 198, 192, 45, the IP address will be APN Server Constant or MI The name of the APN (Access Point Name) Server given by your GPRS service provider. Dial Number (optional) Constant or MI This parameter is required by some GPRS service providers and GPRS modem manufacturers. 69

72 GPRS FB User Name (optional) Constant or MI This parameter is required by some GPRS service providers and GPRS modem manufacturers. Password (optional) Constant or MI This parameter is required by some GPRS service providers and GPRS modem manufacturers. GPRS Run This FB must be included in all GPRS applications. Start Call This FB provides the Port and IP address of the remote device, enabling the PLC to call the remote device and establish a data communications link. Parameter Type Function Name Select the name of the GPRS Configuration that Connect will use to connect to the GPRS network. Remote TCP/IP Port Constant or MI The access port of the remote device. IP Address Constant or MI The address of the remote device. End Call This FB ends the current data communications sessions with a remote device, but does not terminate the connection to the GPRS network. Notes Wavecom modems do not support the End Call function. In order to end a call, use the Unregister from Network FB, and then re-register to the network if required. 70

73 VisiLogic FB Library Unregister from Network Use this to disconnect the PLC from the GPRS network. Check Signal Quality The signal quality value is placed in SI 185 GSM Signal Quality. A value of -1(FFFF)signifies a modem error. This may be due to a weak signal; try repositioning the antenna. If this has no effect, check the modem. GPRS Operands & Status Messages Operands linked to GPRS FBs should be assigned Power-up Values; bits should be reset, and registers initialized to 0. GPRS: Configuration FB Call Status GPRS MB Turns ON when: Call successfully made Turns OFF when Call is terminated Status Messages Initialized to 0 when GPRS: Configuration is activated. MI Value Message 0 No message 1 GPRS network registration is in progress 2 Registration Complete: the modem successfully registered with and received an IP address from the GPRS network 10 Start Call: Begins 11 Start Call: Complete 15 End call: Begins 16 End call: Complete 20 Unregistration Begins (Not during Call) 71

74 GPRS FB 21 Unregistration Begins (During Call) 22 Unregistration Complete: the modem has successfully disconnected from the GPRS network 40 Command not supported (When End Call is activated in an application using a Wavecom modem) 50 Modem reply error 51 Modem Timeout GPRS: Register to Network Registration Status MB Turns ON when: The modem successfully registers with and received an IP address from the GPRS network Turns OFF when The modem disconnects from the network IP Address MI This is the start of a vector that contains the IP address that is assigned to the modem when the modem registers with the GPRS network. The vector is 4 MIs long. The low byte of each MI provides the number for an octet within the IP address. GPRS System Operands If, for example, the IP address is linked to MI 0, and the low bytes of MI 0 to MI 3 contain the values 192, 198, 192, 45, the IP address will be SI Description Value 185 GSM Signal Quality The value is written during COM Init of the GSM modem. The value is updated whenever the user uses the GSM Signal Quality FB. A value of -1(FFFF) signifies a modem error. This may be due to a weak signal; try repositioning the antenna. If this has no effect, check the modem. SBs register the signals that each port receives from the DTR and DSR pins of a serial communication cable. The DTR SBs 120, 122, and 124 are also used by the OS to control the DTR signal during RS485 serial communications, and during GPRS communications using the Sony Ericsson GPRS modem. SB# Description Turns ON when: Turns OFF when: Reset by: SB100 GPRS modem connected Call Remote device begins GPRS incoming call is answered End Session succeeds Disconnect from Network succeeds OS SB 120 DTR COM Port 1 (signal output from PLC) DTR signal present DTR signal absent OS, may also be reset by user 72

75 VisiLogic FB Library SB 121 DSR COM Port 1 (signal input to PLC) SB 122 DTR COM Port 2 (signal output from PLC) SB 123 DSR COM Port 2 (signal input to PLC) SB 124 DTR COM Port 3 (signal output from PLC) SB 125 DSR COM Port 3 (signal input to PLC) DSR signal present DSR signal absent OS DTR signal present DTR signal absent OS, may also be reset by user DSR signal present DSR signal absent OS DTR signal present DTR signal absent OS, may also be reset by user DSR signal present DSR signal absent OS 73

76 SMS Messaging FB SMS Messaging FB Using SMS Messaging To enable a controller to use SMS messaging, use a modem that supports connection to a cellular network. SMS messaging operations are located on the FBs menu. To send or receive SMS messages: 1. Initialize one of the controller's communications ports using a COM Init FB. Note Communications cannot flow through the port during initialization. To avoid conflicts in your program, use the Modem Initialization Status SBs. Before using a modem, prepare it as described in the help topic PLC-side Modems. 2. Place an SMS Configuration FB into your application. Link it to the port initialized via the COM Init FB. The SMS Configuration will use this port to receive and send messages. 3. The SMS Configuration contains a list of SMS messages and phone numbers. Note COM Init and SMS Configuration must appear in the application and be activated before any SMS operations are activated. If this is not done, the application will not work. To enable the controller to receive messages, place an SMS Scan FB in your application and link it to a Configuration. When activated, this causes the controller to scan the GSM modem's SIM card for incoming SMS messages To enable the controller to send SMS messages, place an SMS Send FB in your application and link it to a Configuration. You can then either send one of the messages in that Configuration or create one for that specific Send FB. In either case, the port defined in the Configuration will be used to send the message. FB Operations SMS: Configuration SMS: Scan SMS: Send SMS: Check GSM Signal Quality How to Configure, Receive, and Send Messages 1. Initialize a COM Port. The initialization status of each port is indicated in Modem Initialization Status SBs. These SBs can be used to activate an SMS configuration. 2. Select SMS Configuration from the FBs menu and place the function in your application. 74

77 VisiLogic FB Library Note The condition that activates the SMS Configuration must turn ON for a single program scan (positive transition recommended). Once an SMS Configuration is activated, it can process SMS messages. However, messages are sent or received only when the MB linked to Modem Busy (GSM) is OFF. This MB turns ON when the modem is processing a message, or is communicating data to another application such as VisiLogic. The appropriate Modem: Initialized SBs [80 (COM 1), SB 82 (COM 2), SB 84 (COM 3)] must turn ON before activating an SMS Configuration using that COM port; the SBs should be used as an activating condition. The SMS configuration must be scanned during every program cycle--after the Configuration is activated. One way to ensure this is by placing the configuration in the first subroutine of the main module. 3. To receive messages, place a Scan FB in your application. Note An SMS Scan generally uses a direct contact as an activating condition. This enables the configuration to continually 'listen' for incoming messages. When the controller registers that a Scan has been activated, the MB linked to Modem Busy (GSM) turns ON, turning OFF only after the Scan is complete. 4. To send messages, place a Send FB in your application. 75

78 SMS Messaging FB Note When the positive transition contact used to activate the Send FB rises, the MB linked to Modem Busy (GSM) turns ON. The rest of the logic in the net is processed whether or not the Send operation is completed. Operands linked to SMS FBs, such as Modem Busy (GSM), should be assigned Power-up Values; bits should be reset, and registers initialized to 0. When an SMS message is sent, the Modem Busy (GSM) MB remains ON until the message has cleared the SIM card. Be careful when using positive transition contacts to activate a Send operation. When a Send operation is in progress, the modem is busy. If another Send operation is activated while the modem is busy, the second Send operation will not be activated and the message will not be sent--even after the modem is no longer busy. 76

79 VisiLogic FB Library SMS: Configuration An SMS Configuration contains a list of SMS messages with attached variables and a phone book that is unique to that configuration. SMS Configuration is also where you define Message Properties. Note The appropriate Modem: Initialized SBs[80 (COM 1),SB 82 (COM 2), SB 84 (COM 3)] must turn ON before activating an SMS Config FB using that COM port; ideally the SBs should be used as an activating condition. Creating SMS Messages & Variables A single SMS message can contain both fixed text and up to 10 variables. A message containing only English characters may contain up to 160 characters. A message containing non-english characters may contain up to 70 characters. Note When you create messages in a Configuration, VisiLogic does not allow you to begin a message with a fixed text character that is not a numeral (0-9) or a number sign (#). These limitations do not apply to messages that you compose in an SMS Send FB, or to Indirect Messages. These may begin with variables or with any alphanumeric character. Although the PLC can send Binary Text, Numeric, and List of Texts variables, it can only receive Numeric variables. 77

80 SMS Messaging FB Binary Variable This type of variable displays different text in the SMS variable field according to the status of a bit operand. Number Variable A Number Variable enables you to: Show any numeric value within a message. Control the format in which that value is shown, including the placement of a decimal point and leading zeros. Use Linearization to show a converted value, such as an analog temperature converted to degrees Celsius. 78

81 VisiLogic FB Library List of Texts: by Pointer This type of variable contains numbered lines of text. You link the Variable to an operand. The value within that operand 'points' to the number of a line within the list. When the operand value is equal to a particular line number, the text of that line is shown in the Display. Message Properties This defines how the PLC deals with a specific SMS message that is received by the system. Note that a SMS Scan FB must be placed in the Ladder to enable the PLC to check a specific SMS Configuration for received messages. 79

82 SMS Messaging FB Phone Book Click on a line to either: Directly enter a phone number in the phone book, or Use a vector of registers to indirectly dial a number. HMI Keypad Entry Variables can then be linked to this vector, enabling a user to dial a number from the controller keypad via HMI Entry Variables. Indirect Vector Each register byte contains 1 character. Note that the byte actually contains the ASCII value of the desired numeral. For example, the ASCII value of 1 is 049. International Cell Phone Number Format To work with international phone numbers, use the full GSM format, including the '+' in front of the country code. 80

83 VisiLogic FB Library SMS: Scan To enable the controller to receive messages, place an SMS Scan FB in your application and link it to a Configuration. When activated, this causes the controller to scan the GSM modem's SIM card for incoming SMS messages. Before you can receive an SMS, you must initialize a COM port to use a GSM modem, create an SMS Configuration, and set conditions as explained in Using SMS Messaging. Note Communications cannot flow through the port during initialization. To avoid conflicts in your program, use the Modem Initialization Status SBs. Although the PLC can send Binary Text, Numeric, and List of Texts variables, it can only receive Numeric variables. Use an MB activated by the SMS Configuration FB to activate the Scan, as shown in Using SMS Messaging When the PLC receives a message, the Message Properties defined in the SMS configuration for that message define how it will be processed. 81

84 SMS Messaging FB 82

85 VisiLogic FB Library SMS: Send To send an SMS, place an SMS Send operation in your Ladder application. Before you can send an SMS, you must initialize a COM port to use a GSM modem, create an SMS Configuration, and set conditions as explained in Using SMS Messaging. Note Communications cannot flow through the port during initialization. To avoid conflicts in your program, use the Modem Initialization Status SBs. Before using a modem, prepare it as described in the help topic PLC-side Modems. If the SMS Configuration is busy, messages cannot be received. Avoid conflicts by using a negative contact, linked to the Configuration's FB in Progress MB, as an activating condition for SMS: Send. Note You can send only one SMS message at a time, but you may send it to multiple phone numbers. The Send Status MB turns on if there are more than one Send operations, and the PLC has not finished processing the first Send before the second Send is activated. In this case, Modem Busy MB of the SMS: Configuration bit will be ON, causing the Send Fail Bitmap to contain a value of

86 SMS Messaging FB Compose Message Opens a blank message field. Create a message by typing characters and attaching variables. Select from Configuration Opens the list of messages contained in the linked Configuration. To select a message to send, click it; the message will be highlighted. Indirect Message Enables a vector of register values to be sent as ASCII characters. Note Each register byte contains one character. Note When you create messages in a Configuration, VisiLogic does not allow you to begin a message with a fixed text character that is not a numeral (0-9) or a number sign (#). These limitations do not apply to messages that you compose in an SMS Send FB, or to Indirect Messages. These may begin with variables or with any alphanumeric character. A message containing only English characters may contain up to 160 characters. A message containing non-english characters may contain up to 70 characters. 84

87 VisiLogic FB Library Phone Indexes is based on the Phone Book in the linked SMS configuration. Index numbers are 0 to 8, note that 0 is the index of the last number called. SB 184 SMS: Transmission Succeeded and 185 SMS: Transmission Failed are both reset when any message is sent to any phone number. After the message has been processed, the Relevant SB will turn ON. SMS Variables Variables can be included in Configuration or Send FB messages. A single SMS message can contain both fixed text and up to 10 variables. Note that SMS variables are not related to HMI variables. Although the PLC can send Binary Text, Numeric, and List of Texts variables, it can only receive Numeric variables. Binary Variable This type of variable displays different text in the SMS variable field according to the status of a bit operand. The value currently visible is the last value sent. Numeric Variable A Number Variable enables you to: 85

88 SMS Messaging FB Show any numeric value within a message. Control the format in which that value is shown, including the placement of a decimal point and leading zeros. Use Linearization to show a converted value, such as an analog temperature converted to degrees Celsius. List of Texts: by Pointer This type of variable contains numbered lines of text. You link the Variable to an operand. The value within that operand 'points' to the number of a line within the list. When the operand value is equal to a particular line number, the text of that line is shown in the Display. 86

89 VisiLogic FB Library SMS: Check GSM Signal Quality The signal quality may be checked at any point after SMS Configuration. The signal quality value is placed in SI 185 GSM Signal Quality. A value of -1(FFFF) signifies a modem error. This may be due to a weak signal; try repositioning the antenna. If this has no effect, check the modem. Sending SMS messages from a GSM cell phone To send SMS messages from your cell phone to your PLC, you must: Create and download a project to your PLC that includes an SMS Configuration, set Message Properties, and define conditions as described in the topic Using SMS Messaging. Write an SMS message in your cell phone. Send the message to the PLC's GSM modem Note You can only send messages that are already part of an SMS Configuration in the PLC. If the Limit to Authorized Phone Numbers option is selected in the SMS configuration, the cell phone number must be in the list. Writing SMS messages in your cell phone You write an SMS message using your cell phone keypad. Make sure that: The fixed text in your cell phone is identical to the message in the PLC's SMS Configuration in every detail: spaces, characters--and note that characters are case-sensitive. You bracket variable values with number signs (#) as shown below. These signs '#' do not count as spaces. The variable field in the SMS message is big enough to hold the value. The figure below shows the same SMS message: as it appears on a cell phone display, and as it appears in the PLC's SMS Configuration. 87

90 SMS Messaging FB When you send this message from your cell phone, the value 110 will be written into the variable in the PLC. Sending the message to the PLC 1. Enter the number of the PLC's GSM modem exactly as you would enter any GSM cell phone number, then send the message. Checking that the PLC has received the SMS message You can check if the PLC received your message by using the Acknowledge feature: 1. Select 'Acknowledge' in Message Properties, the ACK box is checked as shown below. 2. Use your cell phone to send the message "Holding Temperature:#110#" to the PLC. 3. The PLC receives this SMS message; AutoAcknowledge causes the PLC to immediately return the message to your cell phone, together with the current variable value. 4. You can now view this SMS message on your cell phone display, together with changes in the variable value. Note that although the PLC can send SMS messages that include Numeric, Binary, and List variables, the PLC can only receive Numeric variables. 88

91 VisiLogic FB Library SMS Operands Operands linked to SMS FBs should be assigned Power-up Values; bits should be reset, and registers initialized to 0. SMS: Configuration FB Modem Busy (GSM) MB Turns ON when: Turns OFF when Reset when SMS: Configuration is activated. SMS: Send FB is activated. Check GSM signal FB is active A Scan FB is processing incoming messages. An SMS is being Auto-acknowledged. The PLC is communicating data with another application, such as VisiLogic. Send process is complete. When messages received from a Scan FB have been processed. Status Messages Initialized to 0 when SMS: Configuration is activated. MI Updated at the end of all operations using the SMS: Configuration; Send, Scan, and Check GSM Signal FBs. Indicates error status for Send, Scan, and Check GSM Signal FBs. Current value always shows the most recent error status. Value Message 0 No error 1 Message received from a phone number that is not in the phone book, or the number is not in the correct format 2 (Send only) Non-existent SMS message index number 3 SMS received from unauthorized phone number 4 (Scan only)the SMS message received does not exist in the SMS configuration 5 Modem TimeOut time exceeded: no reply 6 (Scan only) Received Variable Mismatch. Variable: Does not exist in the SMS configuration, or Is not in the correct format, or Exceeds the range set for the variable 7 Modem Reply Error 8 Unknown Modem Reply 9 (Send only)either the phone number or the SMS message is in the incorrect format and may not be transmitted 89

92 SMS Messaging FB SMS Scan FB Scan Status Initialized to 0 the first time the SMS Scan is called MB Turns ON when: Turns OFF when An error occurs during the current Scan. The Error message is indicated in the Status Messages MI of the SMS: Configuration. A Scan operation is successfully completed. SMS: Send FB Send Status MB Turns ON when: The Send operation has been completed, and one or more of the SMS messages has not been successfully sent. This MB turns on if there are more than one Send operations, and the PLC has not finished processing the first Send before the second Send is activated. In this case, Modem Busy (GSM) MB of the SMS: Configuration will be ON, causing the Send Fail Bitmap will contain a value of -1. -The Error message is indicated in the Error Status MI of the SMS: Configuration linked to the Scan FB -The Send: Fail Bitmap indicates which phone numbers have not received the SMS. Turns OFF when All messages in the SMS: Send have been sent to all of the phone numbers. Send: Fail Bitmap MI Provides a bitmap that indicates the index number of a phone number that cannot be reached. If, for example, bit #3 in the register is not 0, the 3rd number in the phone book could not be reached. The bits are initialized to 0 when the Send FB is activated. As calls are made, each failure causes the relevant bit to turn ON. Note that: - Phone Indexes is based on the Phone Book in the linked SMS configuration. Index numbers are 0 to 8, note that 0 is the index of the last number called. - a value of -1 indicates that the Modem Busy MB of the SMS: Configuration was ON when the Send attempt was made. 90

93 VisiLogic FB Library SMS System Operands The status of these SBs changes to reflect the status of each SMS message sent by the system, including when messages are auto-acknowledged. When the Send process begins, for each and every message, both SB 184 and 185 are OFF. After the message is sent, the relevant bit turns ON, indicating the success or failure of that message. SB Description Turns ON when: Turns OFF when: 184 SMS: Transmission Succeeded Transmission succeeds Transmission begins 185 SMS: Transmission Failed Transmission fails Transmission begins SI Description Value 185 GSM Signal Quality The value is written during COM Init of the GSM modem. The value is updated whenever the user uses the GSM Signal Quality FB. A value of -1(FFFF) signifies a modem error. This may be due to a weak signal; try repositioning the antenna. If this has no effect, check the modem. SDW Description 13 Phone number of last received SMS (last 9 digits) 91

94 MODBUS FB MODBUS MODBUS enables you to establish master-slave communications with any connected device that supports the MODBUS protocol. Any controller in the network may function as either master or slave using any of the controller's existing COM Ports. Within a MODBUS network, you can use standard MODBUS commands to read and write bit and register data; you can also read and write data to Vision controller Data Tables. Unitronics currently supports RTU (binary) transmission mode. Using MODBUS: Unitronics' PLCs, Master - Slave Before using a MODBUS operation in your application, you must: Synchronize the communication port settings of master and slave devices. This is done by placing COM Port Init FBs, set with identical parameters, in the ladder application of both master and slave. Include at least 1 MODBUS Configuration FB in the ladder application of both master and slave. The port you select must be the same port selected in the COM Port Init FB. The condition that activates the Configuration must turn ON for a single program scan (positive transition recommended).however, the MODBUS configuration must be scanned during every program cycle--after the Configuration is activated. One way to ensure this is by placing the configuration in the first subroutine of the main module. Enable slave devices to be accessed by placing a Scan_EX FB in the slave's Ladder application. The figure below shows the elements required to carry out a Read Coils Operation. Note that the operand addresses in slave PLCs are indirect addresses (pointers). 92

95 VisiLogic FB Library Using MODBUS: Accessing PLC data via SCADA/OPC server The PC master can access data within the PLC via the addresses given in the Slave Addresses Table. The PLC slave's Ladder application must include the following: 93

96 MODBUS FB A COM Port Init FB. A MODBUS Configuration FB. Within the Configuration, the port you select must be the same port selected in the COM Port Init FB. Note The condition that activates the Configuration must turn ON for a single program scan (positive transition recommended).however, the MODBUS configuration must be scanned during every program cycle--after the Configuration is activated. One way to ensure this is by placing the configuration in the first subroutine of the main module. A Scan_EX FB. Note The operand addresses in slave PLCs are indirect addresses (pointers). FB Operations Operations are grouped under MODBUS on the FB's menu. MODBUS: Configuration MODBUS: Scan MODBUS: Read Coils (1) MODBUS: Read Inputs (2) Read Holding Registers (3) Read Float Registers (3) Read Input Registers (4) Read Float Input Registers (4) Force Coil (5) Preset Holding Register (6) Loopback Test (8) 94

97 VisiLogic FB Library Force Coils (15) Preset Holding Registers (16) Preset Float Registers (16) Read/Write Mixed Data Read/Write to Data Tables MODBUS: Configuration A MODBUS Configuration FB must be included in both master and slave Ladder applications as shown below. Parameter Type Function Port Number Constant Click the drop-down arrows to view available ports; click the port you want to use. Network ID Constant This number identifies the device on the network. You can either assign an ID via an MI, or directly via a constant number. The unit ID range is from Do not assign the same ID number to more than one device. Time out Constant or MI This is the amount of time a master device will wait for an answer from a slave. Time out units are 10 msecs; a Time out value of 100 is equal to 1 second. Retries Constant or MI This is the number of times a device will try to send a message. Function in Progress MB This bit is ON when MODBUS is active. Use this as a condition bit for MODBUS operations to avoid communication conflicts. Note Indirectly addressed parameters in a MODBUS Configuration FB are only read when the Configuration is called. Since a Configuration is generally called as a power-up task, if, for example Retries has been indirectly addressed, and the linked MI is updated, the new value will not be read into the Configuration. The value will only be updated until the Configuration is called. While a master attempts to send a command, the Function In Progress bit is ON. The 95

98 MODBUS FB number of attempts that the master will make is the number in Retries +1, where '1' is the initial access attempt. When a master attempts to access a slave device, and the slave does not answer, the Function In Progress bit will turn ON. This bit will remain on according to the following: (the number of retries + 1) x (Time Out), where '1' is the initial access attempt. Note that the Time Out parameter is in units of 10 msec. The Ladder application below enables the controller act as a MODBUS master and read coils in a slave PLC. The Scan_EX operation in the final net enables the controller to also act as a slave. MODBUS: ScanEX and Scan Scan_EX enables a master device to access a slave PLC. 96

99 VisiLogic FB Library Note Scan_Ex is recommended for new applications. About Scan and Scan_EX MODBUS Versions previous to V2.01 offered only the Scan FB. Scan is still supported for older, working applications. When MODBUS operations accessed double registers (5100 addresses and higher), using odd addresses, such as 5101, there were incompatibility issues. When ScanEX receives an input parameter in the 32-bit range (for example, 5100{ML}), it automatically takes double-register values. If, for example, ScanEX receives a Read Register (6) request for 5100, it returns the values in 5100 and If, however, ScanEX receives Read Register (6) request for 5101, it returns Status Message #2-- since 5101 provides the 'high' bytes of the 32-bit register, it is not a legal address. Read Coils (1) Use this command to read the status of a selected group of coils and write them into a vector. The coil's status is written into a vector of MBs in the master PLC. Parameter Type Function Slave ID Constant or MI The ID of the slave device containing the coils to be read (data source). Slave: Start of Vector Constant, MI, ML, or DW The start of the vector of coils to be read (data source). Note Check topic Slave Address Tables Read: Vector Length Constant or MI The vector length. Note A MODBUS command cannot read/write more than 1900 bit operands at one time. In addition, 0 is not a legal length. 97

100 MODBUS FB Master: Start of Vector MB This is the start of a vector of MBs that will contain the coils' status in the master (data destination). Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Messages. Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. 98

101 VisiLogic FB Library Read Inputs (2) Use this command to read the status of a selected group of inputs in a slave device and write them into a vector. The inputs' status is written into a vector of MBs in the master PLC. Parameter Type Function Slave ID Constant or MI The ID of the slave device containing the inputs to be read (data source). Slave: Start of Vector Constant, MI, ML, or DW The start of the vector of inputs to be read (data source). Note Check topic Slave Address Tables Read: Vector Length Constant or MI The vector length. Note A MODBUS command cannot read/write more than 1900 bit operands at one time. In addition, 0 is not a legal length. Master: Start of Vector MB This is the start of a vector of MBs that will contain the inputs' status in the master (data destination). Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Messages. Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. 99

102 MODBUS FB Read Holding Registers (3) Use this command to read the values of a selected group of registers in a slave PLC and write them into a defined vector of registers in the master. Parameter Type Function Slave ID Constant or MI The ID of the device containing the registers to be read (data source). Slave: Start of Vector Constant, MI, ML, or DW The start of the vector of registers to be read (data source). Note Check topic Slave Address Tables Read: Vector Length Constant, MI, ML, or DW The vector length Note A MODBUS command cannot read more than bit integers, 62 double registers, or 64 float registers at one time. In addition, 0 is not a legal length. If, within the Slave: Start of Vector parameter, the selected register type is a 32-bit double register (slave addresses 5100 and greater) the preset vector length must be doubled as well. If, for example: - Slave: Start of Vector parameter is set to 6300, and - You wish to preset 4 registers, for a total of 16 bytes - You must set the Preset Vector length to 8. Note that this means that, in these cases, the Preset: Vector Length parameter will always be an even number. Master: Start of Vector MI This is the start of a vector of MIs that will contain the registers' values in the master (data destination). Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Messages. Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. 100

103 VisiLogic FB Library Read Float Registers (3) Use this command to read the values of a selected group of floating point registers in a slave device and write them into a defined vector of registers in the master. Values after the decimal point are rounded to the nearest whole value. Parameter Type Function Slave ID Constant or MI The ID of the device containing the registers to be read (data source). Slave: Start of Vector Constant, MI, ML, or DW The start of the vector of registers to be read (data source). Note Check topic Slave Address Tables Read: Vector Length Constant, MI, ML, or DW The vector length Note You can transpose 16 bits of a 32-bit double register value by turning SB 102 MODBUS Read Long ON in your program. SB 102 is OFF by default, and must be reset by the user program. Master: Start of Vector MI This is the start of a vector of MIs that will contain the registers' values in the master (data destination). Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Messages. Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. Use this command to read the values of a selected group of floating point registers in a slave device and write them into a defined vector of registers in the master. Values after the decimal point are rounded to the nearest whole value. 101

104 MODBUS FB Parameter Type Function Slave ID Constant or MI The ID of the device containing the registers to be read (data source). Slave: Start of Vector Constant, MI, ML, or DW The start of the vector of registers to be read (data source). Note Check topic Slave Address Tables Read: Vector Length Constant, MI, ML, or DW The vector length. Master: Start of Vector MI This is the start of a vector of MIs that will contain the registers' values in the master (data destination). Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Messages. Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. Read Input Registers (4) Use this command to read the values of a selected group of registers in a slave PLC and write them into a defined vector of registers in the master. 102

105 VisiLogic FB Library Parameter Type Function Slave ID Constant or MI The ID of the device containing the registers to be read (data source). Slave: Start of Vector Constant, MI, ML, or DW The start of the vector of registers to be read (data source). Note Check topic Slave Address Tables Read: Vector Length Constant, MI, ML, or DW The vector length Note A MODBUS command cannot read more than bit integers, 62 double registers, or 64 float registers at one time. In addition, 0 is not a legal length. If, within the Slave: Start of Vector parameter, the selected register type is a 32-bit double register (slave addresses 5100 and greater) the preset vector length must be doubled as well. If, for example: - Slave: Start of Vector parameter is set to 6300, and - You wish to preset 4 registers, for a total of 16 bytes - You must set the Preset Vector length to 8. Note that this means that, in these cases, the Preset: Vector Length parameter will always be an even number. Master: Start of Vector MI This is the start of a vector of MIs that will contain the registers' values in the master (data destination). Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Messages. Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. Read Float Registers (4) Use this command to read the values of a selected group of floating point registers in a slave device and write them into a defined vector of registers in the master. Values after the decimal point are rounded to the nearest whole value. 103

106 MODBUS FB Parameter Type Function Slave ID Constant or MI The ID of the device containing the registers to be read (data source). Slave: Start of Vector Constant, MI, ML, or DW The start of the vector of registers to be read (data source). Note Check topic Slave Address Tables Read: Vector Length Constant, MI, ML, or DW The vector length. Master: Start of Vector MI This is the start of a vector of MIs that will contain the registers' values in the master (data destination). Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Messages. Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. Force Coil (5) Use this command to force the status of a selected coil in a slave PLC. The coil's status is forced according to the status of a selected MB in the master PLC. Parameter Type Function Slave ID Constant or MI The ID of the device containing the coil to be forced (data source). Slave Address Constant, MI, ML, or DW The address of the coil to be forced (data target). Note Check topic Slave Address Tables Value to Force M, SB, I, O,T This MB is located in the master PLC; this MB contains the status to be forced ( data source). If, for example, the status of this MB is OFF, the status of the coil in the slave will be forced to OFF. Note A MODBUS command cannot read/write more than 1900 bit 104

107 VisiLogic FB Library operands at one time. In addition, 0 is not a legal length. Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Messages. Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. Preset Holding Register (6) Use this command to preset the value of a single register in a slave PLC. The value is set in a register contained in the master PLC. Parameter Type Function Slave ID Constant or MI The ID of the device containing the register to be preset (target). Slave: Operand Address Constant, MI, ML, or DW The address of the register to be preset (target). Note Check topic Slave Address Tables Value to Preset Constant, MI, SI, ML, SL, DW, SDW or T This is the address of the register containing the value in the master PLC (source). This value will be written into the slave's register, the register that is to be preset. Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Messages. Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. 105

108 MODBUS FB Loopback Test (8) Use this command to send a test message to a slave device and receive Acknowledgements when communications are functioning properly. Parameter Type Function Slave ID Constant or MI The ID of the device to be checked. Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Messages. Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. Force Coils (15) Use this command to force the status of a selected group of coils in a slave PLC. The coils' status is forced according to the status of a group of MBs in the master PLC. 106

109 VisiLogic FB Library Parameter Type Function Slave ID Constant or MI The ID of the slave device containing the coils to be forced (target). Slave:Start of Vector Constant, MI, ML, or DW The start of the vector of coils to be forced (data target). Note Check topic Slave Address Tables Master: Start of Vector MI, SB, I, O,T This is the start of a vector of MBs that will contain the coils' status in the master (data source). Force: Vector Length Constant or MI The vector length. Note A MODBUS command cannot read/write more than 1900 bit operands at one time. In addition, 0 is not a legal length. Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Messages. Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. Preset Holding Registers (16) Use this command to preset the value of a group of registers in a slave PLC. The values are set in a vector of registers contained in the master PLC. Parameter Type Function Slave ID Constant or MI The ID of the device containing the registers to be preset (target). Slave: Start of Vector Constant, MI, ML, or DW The start of the vector of registers to be preset (target). Note Check topic Slave Address Tables Master: Start of Vector Constant, MI, SI, ML, SL, DW, This is the start of a vector of MIs that will contain the registers' values in the master (data source). 107

110 MODBUS FB SDW or T Preset: Vector Length Constant, MI, ML, or DW The length of the vector of registers in both master and slave. Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Messages. Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. Preset Float Registers (16) Use this command to preset the value of a group of floating point registers in a slave PLC. The values are set in a vector of registers contained in the master PLC. Values after the decimal point are rounded to the nearest whole value. Parameter Type Function Slave ID Constant or MI The ID of the device containing the register to be preset (target). Slave: Start of Vector Constant, MI, ML, or DW The address of the register to be preset (target). Note Check topic Slave Address Tables Master: Start of Vector MI, SI, ML, SL, DW, SDW or T This is the address of the register containing the value in the master PLC (source). This value will be written into the slave's register, the register that is to be preset. Preset: Vector Length Constant, MI, ML, or DW The length of the vector of registers in both master and slave. Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Messages. 108

111 VisiLogic FB Library Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. Read/Write from Data Tables Use these commands to access the bytes in Vision data tables without reference to table structure. Please note that this is not a standard MODBUS function. Read/Write from Data Tables is compatible with Unitronics' Vision PLC data tables only. To determine the byte number of a data table cell, hold the cursor over the data table cell. A Tooltip opens, displaying the byte number. Note A MODBUS command cannot read/write more than 242 DT bytes at one time. In addition, 0 is not a legal length. Read from Data Table Below, a MODBUS master reads data tables in Slave ID 1. Bytes are read from Slave 1 into bytes in the master's data tables. 109

112 MODBUS FB Parameter Type Function Slave ID Constant or MI The ID of the slave device containing the coils to be read (data source). Slave: DT Start of Vector Constant, MI, ML, or DW The start of the vector of bytes to be read (data source). Slave: DT Offset in Vector Constant, MI, ML, or DW Offset from the Slave: DT Start of Vector Master: DT Start of Vector Constant, MI, ML, or DW This is the start of a vector of bytes that will contain the data read from the slave. Master: DT Offset in Vector Constant, MI, ML, or DW Offset from the Master: DT Start of Vector Read: DT Vector Length Constant or MI The vector length. Note A MODBUS command cannot read/write more than 242 DT bytes at one time. In addition, 0 is not a legal length. Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Messages. Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. 110

113 VisiLogic FB Library Write to Data Table Below, a MODBUS master writes to data tables in Slave ID 1. Bytes are written from the master into bytes in the slave's data tables. Parameter Type Function Slave ID Constant or MI The ID of the slave device to which the data will be written (data target). Slave: DT Start of Vector Constant, MI, ML, or DW The start of the vector of bytes to be written into (data target). Slave: DT Offset in Vector Constant, MI, ML, or DW Offset from the Slave: DT Start of Vector Master: DT Start of Vector Constant, MI, ML, or DW This is the start of a vector of bytes, in the master, that will contain the data to be written to the slave (data source) Master: DT Offset in Vector Constant, MI, ML, or DW Offset from the Master: DT Start of Vector Read: DT Vector Length Constant or MI The vector length. Note A MODBUS command cannot read/write more than 242 DT bytes at one time. In addition, 0 is not a legal length. Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Messages. 111

114 MODBUS FB Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. Read/Write Mixed Data via MODBUS The Read/Write Mixed Data function enables you to combine Read & Write operations in a single MODBUS command, transferring data between master and slave controllers, without using standard MODBUS commands and addressing conventions. Please note that this is not a standard MODBUS function. Read/Write Mixed Data is compatible with Unitronics' Vision controllers only. Note that this function is compatible with O/S 401 and higher. Each function can contain both Read and Write Mix Requests. Each request may be for a different data type. Your data request must include: Master and Slave operand addresses Length of vector Direction: Read or Write After you add a request, the OK button is disabled. Click the Compile button to see current buffer status; if the buffer contains less than the maximum number of bytes, the OK is enabled. 112

115 VisiLogic FB Library Read Write Limitations Only the following data types may be used in Mixed Data requests: MI, ML, DW, MB, I and O. Registers: may only be read/written to the same data type. Booleans: Inputs cannot be written to. Booleans, Read Write Registers, Read Write I MB, O MI MI O MB, O ML ML MB MB, O DW DW Send / Receive Buffers The function uses two buffers, Send and Receive. Each buffer can contain a maximum of 500 bytes. Configuring a MODBUS slave device The Ladder section below shows what elements are necessary to enable a master device to read from a slave. Note that the MODBUS Scan_EX operation should not be performed during the initial program scan. Note that you must use a condition (RLO) to activate the MODBUS Configuration and SCAN _EX. 113

116 MODBUS FB Slave Addressing Slave Address Tables Coils MODBUS Command Number Pointer Value From: Operand type Read Write 0000 MB #01 Read Coils #15 Force Coils 3000 SB #15 Force Coils 4000 I (read-only) Read-only 5000 O #15 Force Coils 6000 T(read-only) Read-only 7000 C(read-only) Read-only 8000 MB Note Note that in order to access MBs , you address as follows: to access MB 3012, request slave address Registers MODBUS Command Number Pointer Value From: Operand type Register size Read Write 0000 MI 16 bit 4000 SI 16 bit # 03 Read Holding Registers # 16 Preset Holding Registers 5100 ML 32 bit 6100 SL 32 bit 6300 MDW 32 bit 6700 SDW 32 bit 6900 Timer preset 32 bit 7300 Timer current 32 bit 7700 MF 32 bit 7800 Counter Preset 16 bit 7900 Counter Current 16 bit 114

117 VisiLogic FB Library Examples The examples below show that: MODBUS addressing systems start at 1. Vision addressing start at 0. Bit Operands Read a 10-bit vector of inputs in a slave Vision controller, starting at Input 20, via Read Coils ( MODBUS COMMAND #1) Vision PLC as the MODBUS master In VisiLogic's Read Coils FB, set the Slave: Start of Vector parameter to 4020, and the Read: Vector Length parameter to 10. Within the slave Vision controller, VisiLogic will read I 20 - I 29. SCADA as the MODBUS master In the SCADA application, set the Slave: Start of Vector parameter to 34021( ), and the Read: Vector Length to 10, enabling the Master device to read I 20 - I 29 within the slave Vision controller. Write a 3-bit vector of outputs in a slave Vision controller, starting at Output 8, via Force Coils (MODBUS COMMAND #15) Vision PLC as the MODBUS master In VisiLogic's Force Coils FB, set the Slave: Start of Vector parameter to 5008, and the Read: Vector Length parameter to 3. Within the slave Vision controller, VisiLogic will write to O 8 - O 10. SCADA as the MODBUS master In the SCADA application, set the Slave: Start of Vector parameter to ( ) and the Read: Vector Length parameter to 3, enabling the Master device to write to O 8 - O 10 within the slave Vision controller. Registers Read a 9-register long vector of 16-bit integers in a slave Vision controller, starting at MI 32, via Read Holding Registers (MODBUS COMMAND #03) Vision PLC as the MODBUS master In VisiLogic's Read Holding Registers FB, set the Slave: Start of Vector parameter to 32, and the Read: Vector Length parameter to 9. Within the slave Vision controller, VisiLogic will read MI 32 - MI 41. SCADA as the MODBUS master In the SCADA application, set the Slave: Start of Vector parameter to ( ), and the Read: Vector Length parameter to 9, enabling the Master device to read MI 32 - MI 41 within the slave Vision controller. Note If, within the Slave: Start of Vector parameter, the selected register type is a 32-bit double register (slave addresses 5100 and greater)the preset vector length must be doubled as well. If, for example in the VisiLogic Preset Holding Registers FB: Slave: Start of Vector parameter is set to 6300, and You wish to preset 4 registers, for a total of 16 bytes You must set the Preset Vector length to 8. Note that this means that, in these cases, the Preset: Vector Length parameter will always be an even number. Read a 9-register long vector of 32 -bit integers in a slave Vision controller, starting at SL 32, via Preset Holding Registers (MODBUS COMMAND #16) 115

118 MODBUS FB Vision PLC as the MODBUS master In VisiLogic's Preset Holding Registers FB, set the Slave: Preset Vector parameter to 6132, and the Read: Vector Length parameter to 18 ( 2x9, in order to fit the 32-bit SL registers ). Within the slave Vision controller, VisiLogic will read SL 32 - SL 41. SCADA as the MODBUS master In the SCADA application, set the Slave: Start of Vector parameter to , and the Read: Vector Length parameter to 18, enabling the Master device to read SL 32 - SL 41 within the slave Vision controller. Write a 6-register long vector of 16-bit integers in a slave Vision controller, starting at MI 32, via Preset Holding Registers (MODBUS COMMAND #16) Vision PLC as the MODBUS master In VisiLogic's Preset Holding Registers FB, set the Slave: Start of Vector parameter to 32, and the Preset: Vector Length parameter to 6. Within the slave Vision controller, VisiLogic will write to MI 32 - MI 37. SCADA as the MODBUS master In the SCADA application, set the Slave: Start of Vector parameter to 40033, and the Read: Vector Length parameter to 6, enabling the Master device to write to MI 32 - MI 37 within the slave Vision controller. MODBUS via GSM or Standard Modem 116 Note When MODBUS (Serial) is configured to a port linked to a modem, the MODBUS function checks SI 100 Maximum Time Delay between characters (units 2.5ms) MODBUS + Modem. If SI 100 = 1, a time interval of up to 2.5 msecs is permitted between characters, if SI 100 contains 2, the permitted interval is 5 msecs ( n x 2.5 = interval. Note that the application must update SI 100 before the MODBUS configuration is activated.

119 VisiLogic FB Library MODBUS Status Operands All of the Status operands linked to MODBUS FBs should be assigned Power-up Values; bits should be reset, and registers initialized to 0. MODBUS: Configuration FB Status Operand All MODBUS operations run through a MODBUS configuration placed in the master device's program. Function in Progress Shows status of master's MODBUS Configuration MB Turns ON when: A master Vision initiates MODBUS communication. Remains ON during the MODBUS session. Turns OFF when The MODBUS: Configuration is activated. An answer is received from a slave. The TimeOut defined in the Configuration is exceeded. Certain Status Messages are given MODBUS Operation Status Operands When you place MODBUS operations in your application (Force, Read, Preset, and Loopback commands), you link the operands below. These show the status of MODBUS sessions. Status Messages Shows status of master's data requests and the replies the master receives from the slaves MI Automatically initialized to 0 when MODBUS operation is activated. Updated at the end of each attempt to communicate via MODBUS. Indicates status of MODBUS communications, according to the table below. Note that the current value always shows the most recent status. # Status Message 0 Status OK 1 Unknown Command Number This is received from the slave device. 2 Illegal Data Address Master: an invalid address is found by the master before a data request is sent to a slave. This may result, for example, when an MI is used to provide vector length. Slave: The slave notifies the master that the data request command includes invalid addresses. Slave--ScanEX: When ScanEX receives an input parameter in the 32-bit range (for example, 5100{ML}), it automatically takes double-register values. If, for example, ScanEX receives a Read Register(6) request for 5100, it returns the values in 5100 and If, however, ScanEX receives Read Register(6) request for 5101, it returns Error #2-- since 5101 provides the 'high' bytes of the 32-bit register, it is not a legal address. 3 Slave to Master: Illegal Data Type Quantity Number of operands requested by user exceeds the maximum Note A MODBUS command cannot read more than bit integers, 62 double registers, 62 float registers, or 1900 bit operands at one time. In addition, 0 is not a legal vector length. 4 Master--Time Out 117

120 MODBUS FB 5 No Communication The MODBUS session cannot be established. Note Messages 4 & 5. TimeOut and Number of Retries are defined in the Configuration. A Retry is an attempt to establish a MODBUS session. If, for example, TimeOut is defined as 2 seconds, and number of Retries as 3: - the controller will try to establish the session once, and will continue to try for 2 seconds. - If the first attempt fails, the Status Message value will be 4, Master TimeOut. -The controller will try twice more, for a total of 3 retries over 6 seconds. - If all attempts fail, the Status Message value will be 5. -If any attempt succeeds, the Status Message will be 0. * 6 Master-slave data incorrectly synchronized * 7 Master-slave data incorrectly synchronized 8 Master to application: Illegal Data Type Quantity Number of operands requested by user exceeds the maximum permitted for that FB operation in the master. Note A MODBUS command cannot read more than bit integers, 62 double registers, 62 float registers, or 1900 bit operands at one time. In addition, 0 is not a legal vector length. 9 Slave ID =0 An attempt does to communicate with Slave ID 0. * 11 Master-slave data incorrectly synchronized * Messages 6, 7, and 11mean that the master has found incompatible elements in the data sent between master and slave. Total Sessions DW Acknowledgements DW SI Description Value 100 Maximum Time Delay between characters (units 2.5ms) MODBUS + Modem When MODBUS (Serial) is configured to a port linked to a modem, the MODBUS function checks SI 100. If SI 100 = 1, a time interval of up to 2.5 msecs is permitted between characters, if SI 100 contains 2, the permitted interval is 5 msecs ( n x 2.5 =interval. Note that: - The power-up value is 1, - the application must update SI 100 before the MODBUS configuration is activated. 118

121 VisiLogic FB Library MODBUS IP If your controller comprises an Ethernet card, you can use MODBUS IP commands with any connected device that supports the MODBUS protocol. Within a MODBUS network, you can use standard MODBUS commands to read and write bit and register data; you can also read and write data to Vision controller Data Tables. Any controller in the network may function as either master or slave via the controller's Ethernet port. Ethernet uses star topology. V2xx Vision OPLCs can be installed with an Ethernet port. The Ethernet port enables you to implement communications via TCP/IP, such as MODBUS over TCP. Unitronics currently supports both TCP and UDP, as explained in the topic About Ethernet. This topic also contains general information about Ethernet, IP addressing, sockets, and ports. Specific information on implementing Ethernet is provided in the Help topic Using Ethernet. Using MODBUS Before using a MODBUS IP operation in your application, you must: Assign IP addresses to both master and slave devices. This is done by placing Ethernet Card Init FBs in the ladder application of both master and slave. Include at least 1 MODBUS Configuration FB in the ladder application of both master and slave. The condition that activates the Configuration must turn ON for a single program scan (positive transition recommended) However, the MODBUS configuration must be scanned during every program cycle--after the Configuration is activated. One way to ensure this is by placing the configuration in the first subroutine of the main module. Enable slave devices to be accessed by placing a Scan FB in the slave's Ladder application. The figure below shows the elements required to carry out a Read Coils Operation. 119

122 MODBUS IP FB Note that the operand addresses in slave PLCs are indirect addresses (pointers). 120

123 VisiLogic FB Library FB Operations MODBUS IP Operations are located on the FBs menu. MODBUS: Configuration MODBUS: Scan MODBUS: Read Coils (1) MODBUS: Read Inputs (2) Read Holding Registers (3) Read Float Registers (3) Read Input Registers (4) Read Float Input Registers (4) Force Coil (5) Preset Holding Register (6) Force Coils (15) Preset Holding Registers (16) Preset Float Registers (16) Read/Write Mixed Data (non-standard MODBUS command) Read/Write to Data Tables MODBUS Status Operands MODBUS: Configuration A MODBUS Configuration FB must be included in both master and slave Ladder applications as shown below. MODBUS IP Operations are located on the FBs menu. 121

124 MODBUS IP FB Parameter Type Function Port Number Constant Click the drop-down arrows to view available ports; click the port you want to use. Network ID Constant This number identifies the device on the network. You can either assign an ID via an MI, or directly via a constant number. The unit ID range is from Do not assign the same ID number to more than one device. Time out Constant or MI This is the amount of time a master device will wait for an answer from a slave. Time out units are defined in 10 msecs; a Time out value of 100 is equal to 1 second. Retries Constant or MI This is the number of times a device will try to send a message. Function in Progress MB This bit is ON when MODBUS is active. Use this as a condition bit for MODBUS operations to avoid communication conflicts. Note Indirectly addressed parameters in a MODBUS Configuration FB are only read when the Configuration is called. Since a Configuration is generally called as a power-up task, if, for example Retries has been indirectly addressed, and the linked MI is updated, the new value will not be read into the Configuration. The value will only be updated until the Configuration is called. While a master attempts to send a command, the Function In Progress bit is ON. The number of attempts that the master will make is the number in Retries +1, where '1' is the initial access attempt. When a master attempts to access a slave device, and the slave does not answer,- the Function In Progress bit will turn ON. This bit will remain on according to the following: (the number of retries + 1) x (Time Out), where '1' is the initial access attempt. Note that the Time Out parameter is in units of 10 msec. Vision Slaves In order to access Vision Controllers as slave devices and implement MODBUS commands, you must enter the IP addresses of the slave devices in the MODBUS IP configuration. This means that you must first assign IP addresses to each slave. This is done via the Ethernet Card Init FB, which must be configured as described in the topic Using Ethernet. 122

125 VisiLogic FB Library Note Slave IP addresses can also be linked to an MI vector, note that the vector is 4 MIs long. The low byte of each MI provides the number for an octet within the IP address. If, for example, the IP address is linked to MI 0, and the low bytes of MI 0 to MI 3 contain the values 192, 198, 192, 45, the IP address will be The Ladder application below enables the controller act as a MODBUS master and read coils in a slave PLC. The same PLC can also act as a slave, if a Scan_EX operation is included in the application. 123

126 MODBUS IP FB MODBUS: ScanEX and Scan Scan_EX enables a master device to access a slave PLC. MODBUS IP Operations are located on the FBs menu. Note Scan_Ex is recommended for new applications. About Scan and Scan_EX MODBUS Versions previous to V2.01 offered only the Scan FB. Scan is still supported for older, working applications. When MODBUS operations accessed double registers (5100 addresses and higher), using odd addresses, such as 5101, there were incompatibility issues. Scan_EX is recommended for new applications. When ScanEX receives an input parameter in the 32-bit range (for example, 5100{ML}), it automatically takes double-register values. If, for example, ScanEX receives a Read Register(6) request for 5100, it returns the values in 5100 and If, 124

127 VisiLogic FB Library however, ScanEX receives Read Register(6) request for 5101, it returns Status Message #2-- since 5101 provides the 'high' bytes of the 32-bit register, it is not a legal address. Read Coils (1) Use this command to read the status of a selected group of coils and write them into a vector. The coil's status is written into a vector of MBs in the master PLC. MODBUS IP Operations are located on the FBs menu. Parameter Type Function Slave ID Constant or MI The IP address of the slave device containing the coils to be read (data source). Slave: Start of Vector Constant, MI, ML, or DW The start of the vector of coils to be read (data source). Note Check topic Slave Address Tables. Read: Vector Length Constant or MI The vector length. Note A MODBUS command cannot read/write more than 1900 bit operands at one time. In addition, 0 is not a legal length. Master: Start of Vector MB Shows a message number. To check status and diagnose errors, check the MODBUS Status Operands. Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Operands. Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. 125

128 MODBUS IP FB Read Inputs (2) Use this command to read the status of a selected group of inputs in a slave device and write them into a vector. The inputs's status is written into a vector of MBs in the master PLC. MODBUS IP Operations are located on the FBs menu. Parameter Type Function Slave ID Constant or MI The IP address of the slave device containing the inputs to be read (data source). Slave: Start of Vector Constant, MI, ML, or DW The start of the vector of inputs to be read (data source). Note Check topic Slave Address Tables. Read: Vector Length Constant or MI The vector length. Note A MODBUS command cannot read/write more than 1900 bit operands at one time. In addition, 0 is not a legal length. Master: Start of Vector MB This is the start of a vector of MBs that will contain the inputs' status in the master (data destination). Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Operands. Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. 126

129 VisiLogic FB Library Read Holding Registers (3) Use this command to read the values of a selected group of registers in a slave PLC and write them into a defined vector of registers in the master. MODBUS IP Operations are located on the FBs menu. Parameter Type Function Slave ID Constant or MI The IP address of the device containing the registers to be read (data source). Slave: Start of Vector Constant, MI, ML, or DW The start of the vector of registers to be read (data source). Note Check topic Slave Address Tables. Read: Vector Length Constant, MI, ML, or DW The vector length Note A MODBUS command cannot read more than bit integers, 62 double registers, or 64 float registers at one time. In addition, 0 is not a legal length. If, within the Slave: Start of Vector parameter, the selected register type is a 32- bit double register (slave addresses 5100 and greater)the preset vector length must be doubled as well. If, for example: - Slave: Start of Vector parameter is set to 6300, and - You wish to preset 4 registers, for a total of 16 bytes - You must set the Preset Vector length to 8. Note that this means that, in these cases, the Preset: Vector Length parameter will always be an even number. Master: Start of Vector MI This is the start of a vector of MIs that will contain the registers' values in the master (data destination). Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Operands. Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. 127

130 MODBUS IP FB Read Float Registers (3) Use this command to read the values of a selected group of floating point registers in a slave device and write them into a defined vector of registers in the master. Values after the decimal point are rounded to the nearest whole value. MODBUS IP Operations are located on the FBs menu. Parameter Type Function Slave ID Constant or MI The IP address of the device containing the registers to be read (data source). Slave: Start of Vector Constant, MI, ML, or DW The start of the vector of registers to be read (data source). Note Check topic Slave Address Tables. Read: Vector Length Constant, MI, ML, or DW The vector length Note You can transpose 16 bits of a 32-bit double register value by turning SB 102 MODBUS Read Long ON in your program. SB 102 is OFF by default, and must be reset by the user program. Master: Start of Vector MI This is the start of a vector of MIs that will contain the registers' values in the master (data destination). Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Operands. Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. 128

131 VisiLogic FB Library Read Input Registers (4) Use this command to read the values of a selected group of registers in a slave PLC and write them into a defined vector of registers in the master. MODBUS IP Operations are located on the FBs menu. Parameter Type Function Slave ID Constant or MI The IP address of the device containing the registers to be read (data source). Slave: Start of Vector Constant, MI, ML, or DW The start of the vector of registers to be read (data source). Note Check topic Slave Address Tables. Read: Vector Length Constant, MI, ML, or DW The vector length. Master: Start of Vector MI This is the start of a vector of MIs that will contain the registers' values in the master (data destination). Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Operands. Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. 129

132 MODBUS IP FB Read Float Registers (4) Use this command to read the values of a selected group of floating point registers in a slave device and write them into a defined vector of registers in the master. Values after the decimal point are rounded to the nearest whole value. MODBUS IP Operations are located on the FBs menu. Parameter Type Function Slave ID Constant or MI The IP address of the device containing the registers to be read (data source). Slave: Start of Vector Constant, MI, ML, or DW The start of the vector of registers to be read (data source). Note Check topic Slave Address Tables. Read: Vector Length Constant, MI, ML, or DW The vector length. Master: Start of Vector MI This is the start of a vector of MIs that will contain the registers' values in the master (data destination). Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Operands. Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. 130

133 VisiLogic FB Library Force Coil (5) Use this command to force the status of a selected coil in a slave PLC. The coil's status is forced according to the status of a selected MB in the master PLC. MODBUS IP Operations are located on the FBs menu. Parameter Type Function Slave ID Constant or MI The IP address of the device containing the coil to be forced (data source). Slave Address Constant, MI, ML, or DW The address of the coil to be forced (data target). Note Check topic Slave Address Tables. Value to Force M, SB, I, O,T This MB is located in the master PLC; this MB contains the status to be forced (data source). If, for example, the status of this MB is OFF, the status of the coil in the slave will be forced to OFF. Note A MODBUS command cannot read/write more than 1900 bit operands at one time. In addition, 0 is not a legal length. Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Operands Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. 131

134 MODBUS IP FB Preset Holding Register (6) Use this command to preset the value of a single register in a slave PLC. The value is set in a register contained in the master PLC. MODBUS IP Operations are located on the FBs menu. Parameter Type Function Slave ID Constant or MI The IP address of the device containing the register to be preset (target). Slave: Operand Address Constant, MI, ML, or DW The address of the register to be preset (target). Note Check topic Slave Address Tables Value to Preset Constant, MI, SI, ML, SL, DW, SDW or T This is the address of the register containing the value in the master PLC (source). This value will be written into the slave's register, the register that is to be preset. Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Operands Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. 132

135 VisiLogic FB Library Loopback Test (8) Use this command to send a test message to a slave device and receive Acknowledgements when communications are functioning properly. MODBUS IP Operations are located on the FBs menu. Parameter Type Function Slave ID Constant or MI The IP address of the device to be checked. Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Operands. Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. Force Coils (15) Use this command to force the status of a selected group of coils in a slave PLC. The coils' status is forced according to the status of a group of MBs in the master PLC. MODBUS IP Operations are located on the FBs menu. Parameter Type Function Slave ID Constant or MI The IP address of the slave device containing the coils to be forced (target). 133

136 MODBUS IP FB Slave:Start of Vector Constant, MI, ML, or DW The start of the vector of coils to be forced (data target). Note Check topic Slave Address Tables. Master: Start of Vector MI, SB, I, O,T This is the start of a vector of MBs that will contain the coils' status in the master (data source). Force: Vector Length Constant or MI The vector length. Note A MODBUS command cannot read/write more than 1900 bit operands at one time. In addition, 0 is not a legal length. Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Operands Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. Preset Holding Registers (16) Use this command to preset the value of a group of registers in a slave PLC. The values are set in a vector of registers contained in the master PLC. MODBUS IP Operations are located on the FBs menu. Parameter Type Function Slave ID Constant or MI The IP address of the device containing the registers to be preset (target). Slave: Start of Vector Constant, MI, ML, or DW The start of the vector of registers to be preset (target). Note Check topic Slave Address Tables. Master: Start of Vector Constant, MI, SI, ML, SL, DW, SDW or T This is the start of a vector of MIs that will contain the registers' values in the master (data source). Preset: Vector Length Constant, MI, ML, or DW The length of the vector of registers in both master and slave. 134

137 VisiLogic FB Library Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Operands. Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. Preset Float Registers (16) Use this command to preset the value of a group of floating point registers in a slave PLC. The values are set in a vector of registers contained in the master PLC. Values after the decimal point are rounded to the nearest whole value. MODBUS IP Operations are located on the FBs menu. Parameter Type Function Slave ID Constant or MI The IP address of the device containing the register to be preset (target). Slave: Start of Vector Constant, MI, ML, or DW The address of the register to be preset (target). Note Check topic Slave Address Tables. Master: Start of Vector MI, SI, ML, SL, DW, SDW or T This is the address of the register containing the value in the master PLC (source). This value will be written into the slave's register, the register that is to be preset. Preset: Vector Length Constant, MI, ML, or DW The length of the vector of registers in both master and slave. Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Operands. Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. 135

138 MODBUS IP FB Read/Write Mixed Data via MODBUS The Read/Write Mixed Data function enables you to combine Read & Write operations in a single MODBUS command, transferring data between master and slave controllers, without using standard MODBUS commands and addressing conventions.. Please note that this is not a standard MODBUS function. Read/Write Mixed Data is compatible with Unitronics' Vision controllers only. Each function can contain both Read and Write Mix Requests. Each request may be for a different data type. Your data request must include: Master and Slave operand addresses Length of vector Direction: Read or Write After you add a request, the OK button is disabled. Click the Compile button to see current buffer status; if the buffer contains less than the maximum number of bytes, the OK is enabled. Read Write Limitations Only the following data types may be used in Mixed Data requests: MI, ML, DW, MB, I and O. Registers: may only be read/written to the same data type. Booleans: Inputs cannot be written to. Booleans, Read Write Registers, Read Write I MB, O MI MI O MB, O ML ML MB MB, O DW DW 136

139 VisiLogic FB Library Send / Receive Buffers The function uses two buffers, Send and Receive. Each buffer can contain a maximum of 500 bytes. Read/Write from Data Tables Use these commands to access the bytes in Vision data tables without reference to table structure. Please note that this is not a standard MODBUS function. Read/Write from Data Tables is compatible with Unitronics' Vision PLC data tables only. To determine the byte number of a data table cell, hold the cursor over the data table cell. A Tooltip opens, displaying the byte number. Note A MODBUS command cannot read/write more than 242 DT bytes at one time. In addition, 0 is not a legal length. Read from Data Table Below, a MODBUS master reads data tables in Slave ID 1. Bytes are read from Slave 1 into bytes in the master's data tables. 137

140 MODBUS IP FB Parameter Type Function Slave ID Constant or MI The ID of the slave device containing the coils to be read (data source). Slave: DT Start of Vector Constant, MI, ML, or DW The start of the vector of bytes to be read (data source). Slave: DT Offset in Vector Constant, MI, ML, or DW Offset from the Slave: DT Start of Vector Master: DT Start of Vector Constant, MI, ML, or DW This is the start of a vector of bytes that will contain the data read from the slave. Master: DT Offset in Vector Constant, MI, ML, or DW Offset from the Master: DT Start of Vector Read: DT Vector Length Constant or MI The vector length. Note A MODBUS command cannot read/write more than 242 DT bytes at one time. In addition, 0 is not a legal length. Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Messages. Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. 138

141 VisiLogic FB Library Write to Data Table Below, a MODBUS master writes to data tables in Slave ID 1. Bytes are written from the master into bytes in the slave's data tables. Parameter Type Function Slave ID Constant or MI The ID of the slave device to which the data will be written (data target). Slave: DT Start of Vector Constant, MI, ML, or DW The start of the vector of bytes to be written into (data target). Slave: DT Offset in Vector Constant, MI, ML, or DW Offset from the Slave: DT Start of Vector Master: DT Start of Vector Constant, MI, ML, or DW This is the start of a vector of bytes, in the master, that will contain the data to be written to the slave (data source) Master: DT Offset in Vector Constant, MI, ML, or DW Offset from the Master: DT Start of Vector Read: DT Vector Length Constant or MI The vector length. Note A MODBUS command cannot read/write more than 242 DT bytes at one time. In addition, 0 is not a legal length. Status Messages MI Shows a message number. To check status and diagnose errors, check the MODBUS Status Messages. 139

142 MODBUS IP FB Total Sessions DW This is the number of times the master PLC will attempt to access the slave device. Note that this is a simple incremental counter. Initialize it by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. Configuring a MODBUS slave device The Ladder section below shows what elements are necessary to enable a master device to read from a slave. Note that the MODBUS Scan operation should not be performed during the initial program scan. Note that you must use a condition (RLO) to activate the MODBUS Configuration. The slave PLC Ladder application must include the elements shown below. Step 1: Initializing the Ethernet card and configuring MODBUS Note that all slave devices must be assigned ID number 255. Step 2: Scan To enable the master PLC to access the slave, include a MODBUS Scan FB in the slave's application. 140

143 VisiLogic FB Library Slave Addressing Slave Address Tables Coils MODBUS Command Number Pointer Value From: Operand type Read Write 0000 MB #01 Read Coils #15 Force Coils 3000 SB #15 Force Coils 4000 I (read-only) Read-only 5000 O #15 Force Coils 6000 T(read-only) Read-only 7000 C(read-only) Read-only 8000 MB Note Note that in order to access MBs , you address as follows: to access MB 3012, request slave address Registers MODBUS Command Number Pointer Value From: Operand type Register size Read Write 0000 MI 16 bit 4000 SI 16 bit # 03 Read Holding Registers # 16 Preset Holding Registers 5100 ML 32 bit 6100 SL 32 bit 6300 MDW 32 bit 6700 SDW 32 bit 6900 Timer preset 32 bit 7300 Timer current 32 bit 7700 MF 32 bit 7800 Counter Preset 16 bit 7900 Counter Current 16 bit 141

144 MODBUS IP FB Examples The examples below show that: MODBUS addressing systems start at 1. Vision addressing start at 0. Bit Operands Read a 10-bit vector of inputs in a slave Vision controller, starting at Input 20, via Read Coils ( MODBUS COMMAND #1) Vision PLC as the MODBUS master In VisiLogic's Read Coils FB, set the Slave: Start of Vector parameter to 4020, and the Read: Vector Length parameter to 10. Within the slave Vision controller, VisiLogic will read I 20 - I 29. SCADA as the MODBUS master In the SCADA application, set the Slave: Start of Vector parameter to 34021( ), and the Read: Vector Length to 10, enabling the Master device to read I 20 - I 29 within the slave Vision controller. Write a 3-bit vector of outputs in a slave Vision controller, starting at Output 8, via Force Coils (MODBUS COMMAND #15) Vision PLC as the MODBUS master In VisiLogic's Force Coils FB, set the Slave: Start of Vector parameter to 5008, and the Read: Vector Length parameter to 3. Within the slave Vision controller, VisiLogic will write to O 8 - O 10. SCADA as the MODBUS master In the SCADA application, set the Slave: Start of Vector parameter to ( ) and the Read: Vector Length parameter to 3, enabling the Master device to write to O 8 - O 10 within the slave Vision controller. Registers Read a 9-register long vector of 16-bit integers in a slave Vision controller, starting at MI 32, via Read Holding Registers (MODBUS COMMAND #03) Vision PLC as the MODBUS master In VisiLogic's Read Holding Registers FB, set the Slave: Start of Vector parameter to 32, and the Read: Vector Length parameter to 9. Within the slave Vision controller, VisiLogic will read MI 32 - MI 41. SCADA as the MODBUS master In the SCADA application, set the Slave: Start of Vector parameter to ( ), and the Read: Vector Length parameter to 9, enabling the Master device to read MI 32 - MI 41 within the slave Vision controller. Note If, within the Slave: Start of Vector parameter, the selected register type is a 32-bit double register (slave addresses 5100 and greater)the preset vector length must be doubled as well. If, for example in the VisiLogic Preset Holding Registers FB: Slave: Start of Vector parameter is set to 6300, and You wish to preset 4 registers, for a total of 16 bytes You must set the Preset Vector length to 8. Note that this means that, in these cases, the Preset: Vector Length parameter will always be an even number. Read a 9-register long vector of 32 -bit integers in a slave Vision controller, starting at SL 32, via Preset Holding Registers (MODBUS COMMAND #16) 142

145 VisiLogic FB Library Vision PLC as the MODBUS master In VisiLogic's Preset Holding Registers FB, set the Slave: Preset Vector parameter to 6132, and the Read: Vector Length parameter to 18 ( 2x9, in order to fit the 32-bit SL registers ). Within the slave Vision controller, VisiLogic will read SL 32 - SL 41. SCADA as the MODBUS master In the SCADA application, set the Slave: Start of Vector parameter to , and the Read: Vector Length parameter to 18, enabling the Master device to read SL 32 - SL 41 within the slave Vision controller. Write a 6-register long vector of 16-bit integers in a slave Vision controller, starting at MI 32, via Preset Holding Registers (MODBUS COMMAND #16) Vision PLC as the MODBUS master In VisiLogic's Preset Holding Registers FB, set the Slave: Start of Vector parameter to 32, and the Preset: Vector Length parameter to 6. Within the slave Vision controller, VisiLogic will write to MI 32 - MI 37. SCADA as the MODBUS master In the SCADA application, set the Slave: Start of Vector parameter to 40033, and the Read: Vector Length parameter to 6,enabling the Master device to write to MI 32 - MI 37 within the slave Vision controller. MODBUS Status Operands All of the Status operands linked to MODBUS FBs should be assigned Power-up Values; bits should be reset, and registers initialized to 0. MODBUS: Configuration FB Status Operand All MODBUS operations run through a MODBUS configuration placed in the master device's program. Function in Progress Shows status of master's MODBUS Configuration MB Turns ON when: A master Vision initiates MODBUS communication. Remains ON during the MODBUS session. Turns OFF when The MODBUS: Configuration is activated. An answer is received from a slave. The TimeOut defined in the Configuration is exceeded. Certain Status Messages are given MODBUS Operation Status Operands When you place MODBUS operations in your application (Force, Read, Preset, and Loopback commands), you link the operands below. These show the status of MODBUS sessions. Status Shows status of master's data requests and the replies the master receives from the slaves MI Automatically initialized to 0 when MODBUS operation is activated. Updated at the end of each attempt to communicate via MODBUS. Indicates status of MODBUS communications, according to the table below. Note that the current value always shows the most recent status. # Status Message 0 Status OK 1 Unknown Command Number 143

146 MODBUS IP FB This is received from the slave device. 2 Illegal Data Address Master: an invalid address is found by the master before a data request is sent to a slave. This may result, for example, when an MI is used to provide vector length. Slave: The slave notifies the master that the data request command includes invalid addresses. Slave--ScanEX: When ScanEX receives an input parameter in the 32-bit range (for example, 5100{ML}), it automatically takes double-register values. If, for example, ScanEX receives a Read Register(6) request for 5100, it returns the values in 5100 and If, however, ScanEX receives Read Register(6) request for 5101, it returns Error #2-- since 5101 provides the 'high' bytes of the 32-bit register, it is not a legal address. 3 Slave to Master: Illegal Data Type Quantity Number of operands requested by user exceeds the maximum Note A MODBUS command cannot read more than bit integers, 62 double registers, 62 float registers, or 1900 bit operands at one time. In addition, 0 is not a legal vector length. 4 Master--Time Out The amount of time the master will attempt to establish a MODBUS session 5 No Communication The MODBUS session cannot be established. Note Messages 4 & 5. TimeOut and Number of Retries are defined in the Configuration. A Retry is an attempt to establish a MODBUS session. If, for example, TimeOut is defined as 2 seconds, and number of Retries as 3: - the controller will try to establish the session once, and will continue to try for 2 seconds. - If the first attempt fails, the Status Message value will be 4, Master TimeOut. -The controller will try twice more, for a total of 3 retries over 6 seconds. - If all attempts fail, the Status Message value will be 5. -If any attempt succeeds, the Status Message will be 0. * 6 Master-slave data incorrectly synchronized * 7 Master-slave data incorrectly synchronized 8 Master to application: Illegal Data Type Quantity Number of operands requested by user exceeds the maximum permitted for that FB operation in the master. Note A MODBUS command cannot read more than bit integers, 62 double registers, 62 float registers, or 1900 bit operands at one time. In addition, 0 is not a legal vector length. 9 Slave ID Mismatch The Slave ID master sends a command to a slave unit whose IP, as defined in the Configuration, does not match the slaves' index number. * 11 Master-slave data incorrectly synchronized * Messages 6, 7, and 11mean that the master has found incompatible elements in the data sent between master and slave. 144

147 VisiLogic FB Library Total Sessions DW This is the total number of times the master PLC attempts to access the slave device, whether the attempt is successful or not, including Retries. Note that this is a simple incremental counter. This must be initialized by the user, by storing 0 into the selected DW. Acknowledgements DW This is the number of times the slave device answers. This must be initialized by the user, by storing 0 into the selected DW. 145

148 Communication Protocol FB Communication Protocol FB Via the Communication Protocol operations located on the FBs menu, you can enable your controller to exchange data with external devices, such as frequency converters, bar-code readers, and printers via a Vision COM port. Protocol operations are located on the FBs menu. How the Protocol FB communicates data between Vision controllers and other devices A device, such as a magnetic card reader, may use its own proprietary protocol. If you know the protocol's structure, you can use the Protocol FB to structure messages accordingly. This enables a Vision controller to exchange data with the device using the device's own protocol. Note that before you can use Protocol operations, you must configure the COM port to be connected to the external device in accordance with the device's requirements. This is done by placing a COM Port Init FB in your Ladder application. Basic Example The example below shows how a Vision controller can, via COM port 2, read Register 25 within a device that has the ID number of 01. The device uses the simple protocol shown below. Device Protocol Parameter name Length (bytes) Value Comments STX 1 STX 02(hex) All messages must begin with the STX character Unit ID 2 ID# range = 0-99 All messages must contain the ID number of the device that the controller is communicating with Command 2 03=Read Register 04=Read Bit 05=Write Register Commands are embedded in Data Request messages Data (Request) 4 Vision to Device Data (Response) 8 Device to Vision Reserved 2 2 Null characters=00,00 These characters must be included in all messages Checksum 2 Sum 8 ETX 1 / backslash) 2F(hex) All messages must end with the '/'character Message Structure: Data Request (Vision to device) The device can only receive request messages that are structured as shown below. 146

149 VisiLogic FB Library Checksum Message Structure: Data Response (device to Vision) The device sends data in messages that are structured as shown below. Protocol Ladder Requirements In order to enable a Vision controller to request and receive data from a device, the controller's Ladder application must contain: A COM Init FB to initialize the serial port that will be linked to the device. A Protocol Configuration FB set to use the serial port. A Protocol Send FB, which enables the controller to send data request messages to the device. A Protocol Scan FB, which enables the controller to receive data response messages from the device. Note that in order to receive new messages, you must clear the communication buffer after each message by using the Reset Buffer FB. COM Init and Configuration Since COM Port 2 is connected to the device, the application initializes and configures COM 2 at Power-up. Send: Data Request The application requests data via the Protocol Send FB. The Send FB enables you to structure messages that conform to any protocol's requirements. Below, the Vision sends a data request to Unit 01. The request is Command 03, Read Register, and the register is Register

150 Communication Protocol FB Scan: Receiving Messages A Protocol Scan FB contains messages. Activating the Scan causes the Vision to check if it has received any of the messages contained within the Scan FB. Note that the controller can only receive messages that are defined in the Scan FB. Note In order to receive new messages, you must clear the communication buffer by using the Reset Buffer operation. You can save the contents of the buffer at any time by using the Copy Buffer operation. Maximum message length is 500 characters; a message may include up to 50 variables. Note that with in the body of a message, no section--whether text or variable--may exceed 255 characters. Below, the application enables the Vision to receive a response to Command 03. Note that Buffer reset follows the Scan. 148

151 VisiLogic FB Library Note that the Scan message contains a Data Response field that is long enough to contain the contents of a register. For more information regarding Protocol operations, refer to the topics below. FB Operations Configuration Scan Send Copy Buffer Contents Reset Buffer Note Reset Buffer must be used in the Ladder application to enable new messages to be received. 149

152 Communication Protocol FB Protocol: Configuration You create messages and attach variable data in Protocol Send and Scan operations. Each operation is linked to a Protocol Configuration. When a Send operation is called in your program, the Configuration determines which COM port is used for outgoing messages; when a Scan operation is activated, the PLC monitors that COM port for incoming messages. Note The Configuration should be placed in the Main Routine, before any other FB operations. If the configuration is not active, Protocol operations will not be processed. Before you place this FB in your Ladder, you must use a COM Port INIT FB to configure a COM port. Parameter Function Name Identifies the configuration. You use the name to link Protocol Send and Scan operations to a configuration. COM Port Determines which port is used for communicating the configured protocol. Function in Progress MB Link an MB; this MB will be ON when the Configuration is processing Scan or Send operations. Status MI If errors occur when the Configuration is used for a Send or Scan operation, the value of the linked MI indicates which error has occurred. Protocol: Scan A Protocol Scan operation contains messages. Activating the Scan causes the PLC to check if it has received any of the messages contained within the Scan. The PLC can only receive messages that are contained in a Scan FB. Each Protocol Scan operation is linked to a particular Protocol Configuration. The Scan only registers messages that are received via the COM port defined in that Configuration. Scan is located under FBs>Protocol. Note In order to receive new messages, you must clear the communication buffer by using the Reset Buffer operation. You can save the contents of the buffer at any time by using the Copy Buffer operation. Maximum message length is 500 characters; a message may include up to 50 variables. Note that with in the body of a message, no section--whether text or variable--may exceed 255 characters. 150

153 VisiLogic FB Library 151

154 Communication Protocol FB Message index Identifies the incoming message. Scan Length This enables you to define the length of each incoming message, via the drop-down box that follows Message index #. Scan Length causes the Scan FB to use the length of a message--including header and terminator--to define whether an incoming message is legal. The length of an incoming message cannot be less than the length specified in the Scan operation. Note This parameter overrides Start Of Text and Terminator settings. If you use Scan Length, arrange the messages in ascending order, for example, message #0 may contain 3 bytes, #1 may contain 4 bytes, #2 may contain 6 bytes, etc. Start of Text (STX) Check Start Of Text to use an STX parameter to indicate the beginning of a message. Length: Enter the number of bytes required by the external device's protocol to mark STX. STX Character: Click a 'byte' box and select an ASCII character. Terminators Select one of the terminator parameters to indicate where the message ends. Parameter Function Session Complete MB Turns ON when: Turns ON when the PLC receives the message's STX and terminator, after the Linked Configuration's Function in Progress MB turns OFF. Turns OFF when Turns OFF whenever the Protocol Scan operation is called by the program. Turns OFF when a Reset Buffer operation runs. In your program, link the Session Complete bit to a positive transition contact, then use this condition to activate a Copy Buffer FB, as well as number of Bytes Received and Number of Received Message. Number of Bytes Received MI This holds the number of bytes currently in the buffer. It is initialized by the system when a different message is received. Index of Received Message MI This holds the index number of the received message. It changes when another message enters the system. The value in the linked MI is valid only when the Session Complete bit in ON. During this time, the linked MI contains the index number of the last valid incoming message. Once a valid message has been received, the first incoming character of any message causes -1 to be written in the linked MI. 152

155 VisiLogic FB Library Protocol Messages Messages can include: Fixed Text This text does not change. Variables These variables may be received by the PLC: Numeric, Stream, and Checksum. Control Characters These can be added according to protocol requirements. Example Note that Buffer reset follows the Scan. Note that the Scan message contains a Data Response field that is long enough to contain the contents of a register. 153

156 Communication Protocol FB Scan operations containing more than one message Note that if a Scan operation contains more than one message with identical variables that use the same format, the PLC will overwrite the variable values as they are received. To enable the PLC to differentiate between the messages and their attached variables, include fixed text and/or control characters within the message. 154

157 VisiLogic FB Library Protocol: Send Each Protocol Send operation is linked to a particular Configuration; outgoing messages are sent via the COM port selected in that Configuration. Send is located on the FBs menu. Start of Text (STX) Check Start Of Text to use an STX parameter to indicate the beginning of a message. Length: Enter the number of bytes required by the external device's protocol to mark STX. STX Character: Click a 'byte' box and select an ASCII character. End of Text (ETX) The ETX parameter indicates where the message ends. Length: Enter the number of bytes required by the external device's protocol to mark ETX. ETX: Click a 'byte' box and select an ASCII character. 155

158 Communication Protocol FB End of Message format: - Note that the protocol may require that a checksum be either part of the message body or part of the End Of Message - If your protocol requires a checksum as part of the End of Message, click the End of Message button to define checksum placement and format. - Use the options to configure the checksum according to the requirements of your particular protocol. Send Message Number Determines which message in the FB will be sent. In the program, store a message index numbers in the linked register. When the FB is called, message whose index number currently in the linked MI will be sent. 156

159 VisiLogic FB Library Advanced Button Protocol Messages Messages can include: Fixed Text Fixed text must be included if there is more than one message in a Scan. This enables the PLC to identify the message. Control Characters These can be added according to protocol requirements. Variables These variables may be sent by the PLC: Binary, Numeric, Stream, List of Texts, Checksum, Date, and Time. Example Below, the Vision sends a data request to Unit 01. The request is Command 03, Read Register, and the register is Register

160 Communication Protocol FB Protocol: Copy Buffer Contents You can copy the current contents of the buffer which receives incoming messages at any point in your application by including the Copy to Buffer operation, which is located on the FBs menu. This operation copies whatever information is in the buffer at the time the operation is called. Note Note that copying the buffer contents is optional. Maximum message length is 500 characters; a message may include up to 50 variables. Note that with in the body of a message, no section--whether text or variable--may exceed 255 characters. 158

161 VisiLogic FB Library Copy Format The format determines how the received bytes are copied. 1->1 Select this to copy the low byte (first 8 bits) of each received register value currently in the buffer to a vector defined in the PLC. 2->1 Select this to copy both low and high bytes of each received register value currently in the buffer to a vector defined in the PLC. Note that this is an entire 16-bit register, and the first 2 bytes of a 32-bit register. 159

162 Communication Protocol FB 4->1 Select this to copy all 4 bytes of each 32-bit register currently in the buffer into a defined vector. Protocol: Reset Buffer In order to receive new messages, you must clear the communication buffer by using the Reset Buffer operation, which is located on the FBs menu. Note Note that the Session Complete bit turns OFF automatically when the Reset Buffer operation runs. Maximum message length is 500 characters; a message may include up to 50 variables. Note that with in the body of a message, no section--whether text or variable--may exceed 255 characters. 160

163 VisiLogic FB Library Variables Variables enable you to send and receive a variety of dynamic data from your process. Variable Types: Send The PLC sends messages via the Configuration linked to the Send operation. These are the types of variables that can be attached to an outgoing message. Binary text Use this type of variable to send text based on the status of a linked bit. Numeric Use a Numeric variable to send a vector of registers. You can send register values as Binary, Hex as ASCII, or Decimal ASCII. The variable field automatically adjusts to fit the size of the data to be sent. Note Sending Hex as ASCII: the PLC transfers the value to ASCII, and sends it byte by byte, beginning from the most significant value. Thus, the value 8F03BCA1 sent "Hex as ASCII" will be converted to Hex and sent as follows: 38, 46, 30, 33, 42, 43, 41,

164 Communication Protocol FB Stream Use Stream to send a vector of registers to a target device. Note Values are sent in binary format, beginning from the LSB. Thus, the value 8F03BCA1 is sent as follows: A1, BC, 3, 8F. In order to send floating values, select MF and the Convert 4 bytes into 1 linked element option. Note that the PLC uses the big-endian system; meaning that the most significant value in the sequence is stored at the lowest (first) storage address). Stream Variable Format The format determines which bytes are sent from within a register. 162

165 VisiLogic FB Library 1->1 Select this to send the low byte (first 8 bits) of each register in the vector. 2->1 Select this to send both low and high bytes from each register in the vector. Note that this is an entire 16-bit register, and the first 2 bytes of a 32-bit register. 163

166 Communication Protocol FB 4->1 Select this to send all 4 bytes of each 32-bit register in a vector. List of texts This type of variable contains a list of numbered lines of text. The value within the linked operand 'points' to the number of a line within the list. When the operand value is equal to a particular line number, the text of that line is included in the variable. Selecting the Define Length option enables you to make all of the text lines a uniform length, regardless of the number of characters a specific line may have. If a text line is shorter than the defined length, empty spaces will be added; if the text line is longer than the defined length, excess characters will be cut off. Checksum Via this variable, you can calculate a checksum and attach it to a message. Use the options to configure the checksum according to the requirements of your particular protocol. Date Use this variable to send the current date according to a selected format. 164

167 VisiLogic FB Library Time Use this variable to send the current time according to a selected format. Variable Types: Scan The PLC scans for messages that enter the system via the Configuration linked to the Scan operation. These are the types of variables that can be attached to an incoming message. To correctly identify incoming variables, use either Scan Length, or include fixed text. Notes Scan Length can be defined for each message via the drop-down box that follows Message index #. Scan length causes the Scan FB to use the length of a message to define whether an incoming message is legal. This parameter overrides Start Of Text and Terminator settings. If you use Scan Length, arrange the messages in ascending order, for example, message #0 may contain 3 bytes, #1 may contain 4 bytes, #2 may contain 6 bytes, etc. If a Scan operation contains more than one message with identical variables that use the same format, the PLC will overwrite the variable values as they are received. To enable the PLC to differentiate between the messages and their attached variables, include fixed text and/or control characters within the message. 165

168 Communication Protocol FB Numeric Receive Use a Numeric variable to receive a vector of registers. You can receive register values as Binary, Hex as ASCII, or Decimal ASCII. 166

169 VisiLogic FB Library Receive Stream Use Stream to receive a vector of register values from an external device and copy them into a defined vector of registers within the PLC. Note A vector is read either until the end of the defined vector length, or until a null character is encountered. By adding a null character to the end of the stream, you can mark the end of a data string. This can prevent other data, that might be present in a vector, from being added to the data string when the vector is read. In order to send floating values, select MF and the Convert 4 bytes into 1 linked element option. Note that the PLC uses the big-endian system; meaning that the most significant value in the sequence is stored at the lowest (first) storage address). Checksum Via this variable, you can process the checksum of an incoming message. Use the options to configure the checksum according to the requirements of your particular protocol. Click to view an ASCII Table Checksum Configuration Use the options to configure the checksum according to the requirements of your particular protocol. Format Select the data representation method: Decimal ASCII, Hex as ASCII, or Binary. Calculate Offset The two Offset parameters determine the delimiters of the data to be calculated for checksum. Calculation Type This is the type of calculation that will be performed on the data defined above. SUM 167

170 Communication Protocol FB Adds all of the data bytes in the selected cells into one sum. XOR Calculate checksum using exclusive-or operation. 168

171 VisiLogic FB Library CRC-16 Calculates checksum according to CRC-16. 2's complement This is calculated as follows: Checksum = 0 For Stardoms to Endorses do Checksum = Checksum + Netherworlds End For Checksum = (Checksum XOR 0xFFFFFFFF) + 1 Modulus method 256 (100H): 8 bits Select to store the first 8 bits (low data byte) of the result into the checksum field (10000H): 16 bits Select to store the entire result into the checksum field. 169

172 Communication Protocol FB Checksum Length This determines the length of the field which will hold the calculated checksum result. Example If the result is 7563 and the 16-bit modulus method is selected, the results stored in checksum fields of different lengths as follows: Length: 1 Length: 2 Length: 3 Binary , 63 Decimal 33 36, 33 35, 36, 33 Hex as ASCII 42 38, 42 44, 38, 42 (7563 =1D8B) Advanced: Set Limits From Value and To Value determine a range for the checksum result ;if the final value falls within these limits, the function can automatically add a set value to the calculated checksum. Protocol Status Operands and Messages The Status Operands show the state of Protocol communications. All of the Status operands linked to Protocol FBs should be assigned Power-up Values; bits should be reset, and registers initialized to 0. Protocol Operation Status Operands When you place a Protocol Configuration your application, the linked operands indicate the status of Protocol operations. Function in Progress Shows status of Protocol Configuration MB Turns ON when: Configuration begins When Send or Scan begins Note Messages cannot be sent while this MB is ON. Use an indirect contact for this MB as an activating condition for Send operations. Turns OFF when The Protocol: Configuration is finished. When Scan is complete, when the PLC receives the message's STX and terminator. The Status Message indication changes Status MI Automatically initialized to 0 when a Protocol operation is activated. 170

173 VisiLogic FB Library Messages Updated at the end of each attempt to communicate via the Protocol Configuration. Indicates status of Protocol communications, according to the table below. Note that the current value always shows the most recent status. Value Error Message Indication 0 No Error Operations successful 1 Send: General Error Indicates an unknown system error. 2 Send: COM Port busy The COM port that is selected in the active Protocol Configuration cannot currently be accessed. 3 Send: Invalid Message Index The message that is referenced in the Send operation does not exist. 4 Send: Invalid Operand Type The message references an operand type that does not exist in the system. 5 Send: Invalid Operand Address The message references an operand address that does not exist in the system. 6 Send: Data Overflow The message data exceeds 512 bytes. 7 Send: Format Error The message contains variable fields that are not long enough for the attached variable data. 257 Receive: General Error Indicates an unknown system error. 258 Receive: Invalid message The received message does not exist in the system. 259 Receive: Checksum Error The message may have been corrupted during transmission. Examples Basic Example How does the Protocol FB communicate data between Vision controllers and other devices? A device, such as a magnetic card reader, may use its own, proprietary protocol. If you know the protocol's structure, you can use the Protocol FB to structure messages accordingly. This enables a Vision controller to exchange data with the device using the device's own protocol. The example below shows how a Vision controller can, via COM port 2, read Register 25 within a device that has the ID number of 01. The device uses the simple protocol shown below. 171

174 Communication Protocol FB Device Protocol Parameter name Length (bytes) Value Comments STX 1 STX 02(hex) All messages must begin with the STX character Unit ID 2 ID# range= 0-99 All messages must contain the ID number of the device that the controller is communicating with Command 2 03=Read Register 04=Read Bit 05=Write Register Commands are embedded in Data Request messages. Data (Request) 4 Vision to Device Data (Response 8 Device to Vision Reserved 2 2 Null characters=00,00 These characters must be included in all messages. Checksum 2 Sum 8 ETX 1 / backslash) 2F(hex) All messages must end with the '/'character Message Structure: Data Request (Vision to device) The device can only receive request messages that are structured as shown below. Checksum 172

175 VisiLogic FB Library Message Structure: Data Response (device to Vision) The device sends data in messages that are structured as shown below. Protocol Ladder Requirements In order to enable a Vision controller to request and receive data from a device, the controller's Ladder application must contain: A COM Init FB to initialize the serial port that will be linked to the device. A Protocol Configuration FB set to use the serial port. A Protocol Send FB, which enables the controller to send data request messages to the device. A Protocol Scan FB, which enables the controller to receive data response messages from the device. Note that in order to receive new messages, you mustclear the communication buffer after each message by using the Reset Buffer FB. COM Init and Configuration Since COM Port 2 is connected to the device, the application initializes and configures COM 2 at Power-up. Send: Data Request The application requests data via the Protocol Send FB. The Send FB enables you to structure messages that conform to any protocol's requirements. Below, the Vision sends a data request to Unit 01. The request is Command 03, Read Register, and the register is Register

176 Communication Protocol FB Scan: Receiving Messages A Protocol Scan FB contains messages. Activating the Scan causes the Vision to check if it has received any of the messages contained within the Scan FB. Note that the controller can only receive messages that are defined in the Scan FB. Note In order to receive new messages, you must clear the communication buffer by using the Reset Buffer operation. You can save the contents of the buffer at ay time by using the Copy Buffer operation. Below, the application enables the Vision to receive a response to Command 03. Note that Buffer reset follows the Scan. Note that the Scan message contains a Data Response field that is long enough to contain the contents of a register. 174

177 VisiLogic FB Library Advanced Example: Mitsubishi Frequency Converter The information below is intended to accompany the sample application Mitsubishi.vlp. This application shows how to exchange data between networked Mitsubishi frequency converters and a Vision controller. Data exchange is performed using the Mitsubishi communication protocol, via VisiLogic's communication Protocol FB. By modifying the FB's parameters, you can exchange data between Vision controllers and external devices using many different protocols. About the Mitsubishi Protocol The Mitsubishi manual for the converter used in the example may be found by accessing the Mitsubishi site at: entering SH(NA)3197-B under Title, and then pressing Search. Note that this manual is in.pdf format and requires you to have Adobe's Acrobat Reader installed on your system. The manual includes complete protocol requirements. The elements used in the sample application to implement the Mitsubishi protocol are presented below. 175

178 Communication Protocol FB Read Commands Write Station ID # Each converter is assigned a station number. Station numbers are transmitted in hexadecimal. Protocol message structure Send The FB shown below is located in Net 8 within subroutine: Send command to Mitsubishi. Note how the messages in the Protocol Send FB are configured to conform to the Mitsubishi message structure. 176

179 VisiLogic FB Library Scan The FB shown below is located in Net 3 within subroutine: Check answer after sending. Note how the messages in the Protocol Send FB are created to conform to the Mitsubishi message structure. Error codes The Mitsubishi protocol uses an error code to determine if data is transmitted correctly. When a converter receives a message, it replies by sending a message to the controller, according to the table below. 177

180 MB as PWM FB MB as PWM The PWM FB enables you to control the change in the status of a selected MB, causing it to function like a PWM (Pulse Width Modulation) output at a resolution of 2.5 milliseconds (in relation to the total scan time). You can place the PWM FB directly on the left Ladder rail to cause it to run continuously. PWM is located on the FBs menu. Parameter Cycle Time Function The total cycle time. One unit of cycle time is equal to 2.5 msec. Duty Cycle The ratio of the "on" period of a cycle to the total cycle period, expressed as a tenth of a percent of the total Cycle Time. Output The MB you select will function as the PWM output. It will be turned ON and OFF according to the input parameters. Example Cycle Time = 800 Duty Cycle = 255 If the Cycle Time parameter is 800; the total PWM cycle time will be 2000mSec (800 x 2.5 = 2000mSec). If the Duty Cycle parameter is 255; the selected MB will be ON for 25.5% of the total Cycle Time (25.5% of 2000 = 510mSec), and OFF for 74.5% of the total Cycle Time (74.5 of 2000= 1490mSec) 178

181 VisiLogic FB Library Filter FB Filter, located on the FB menu, enables you to take from 4 to 16 values and calculate an average. You can influence the average by configuring the function to: Discard a user-defined number of maximum & minimum input values Weight the average according to the order of the input values (FIFO). Note The values are not allocated memory, but are stored and calculated independently within the function block. Certain analog inputs can also be filtered via Hardware Configuration settings. How Filter works The Filter Configuration holds the parameters that determine how the input values are averaged. The input value is taken from the linked Filter Calculate function. In the figure below, Filter Calculate is linked to the configuration Filter_1. In this configuration, Parameter 1: Filter type is Dynamic Average; Parameter 2: Number of Values is 8; and Parameter 3: Discard Values is 2. ML 0 provides the input values. Each time Filter: Calculate is activated, the value in ML 0 is copied to the vector of the linked Filter Configuration,. In this example, 8 values are collected. As each new value is input, the oldest value is shifted out. Since Discard Values is 2, the 2 lowest and 2 highest values are discarded. The remaining values are summed, and then averaged ( =180/4). The result is 45, which is output to ML

182 Filter FB FB Operations Filter: Configuration Filter: Calculate Filter: Configuration The Filter Configuration holds the parameters that determine how the input values are averaged, therefore it must be activated before the Filter: Calculate function is called. Parameters Type Function Filter Type: Calculates the average of all the current input values Dynamic Average Order-weighted Average Each input value is given equal weight. More weight is given to the newer input values. (FIFO) Number of Values 4-16 Defines the values in the vector as well as the divisor for calculating the average. Discard Values 0-4 Removes the minimum and maximum input values according to the selection. For example, selecting the number '3' cause the 3 lowest and 3 highest values to be discarded before the average is calculated. Filter: Calculate Each time the Calculate function's activating condition is turned ON, the function's Input parameter is copied to the vector of the linked Filter Configuration, the average is calculated, and the result is placed in the linked output operand. Note The output value is overwritten each time the function is activated. The vector is not allocated PLC memory. The values are stored in the function 180

183 VisiLogic FB Library 181

184 Events FB Events FB: Registering MB status change An Event is the change in status of an MB from OFF (0) to ON (1). Events can be used, for example, to monitor the status of an array of alarm bits. The Events FBs are located on the FB's menu. The Event: Scan enables you to: Define a vector of MBs. Locate the first MB that is ON (active) within that vector Record the MB's location. Other Event operations enable you to: Move between the active MBs within that vector Change MB status from ON to OFF. Event Operations Event: Scan Next Event Previous Event Clear Current Clear All Events: Count Events: Loopback Track Events Events: Scan Use the Events: Scan to define a vector of MBs and locate the first positive bit within that vector. Once you have defined a vector of MBs using the Events Scan FB, you can perform other actions within that vector using Event operations. Note Place the Scan FB directly on the left-hand Ladder rail; this ensures that all of the Events functions will run continuously. 182

185 VisiLogic FB Library Operand Type Function MB Vector: Start MB The first MB of the vector to be scanned. MB Vector: End MB The last MB of the vector to be scanned. Active MB MB Turns ON when an active bit is located. Note Once the Active MB has been turned ON, it remains ON until it is reset by the program. Active MB Location: Offset in Vector MI, ML,DW Contains the location of the Active MB, relative to the beginning of the defined vector. Note If no MB is active, the value in the linked register will be -1. Next Event Once a vector of MBs has been defined using the Event Scan FB, the Scan finds the first active MB in the vector. Use the Next Event operation to move to the next active MB in the vector, in the direction of the Most Significant Bit. 183

186 Events FB Previous Event Once a vector of MBs has been defined using the Event Scan FB, the Scan finds the first active MB in the vector. Use the Previous Event operation to move to the previously active MB in the vector, in the direction of the Least Significant Bit. 184

187 VisiLogic FB Library Clear Current Use the Clear Current operation to reset a currently active MB. 185

188 Events FB Clear All This operation causes all of the active MBs in an Event vector to be reset. Events: Count This shows the number of MBs currently ON within the vector defined by the Events Scan. 186

189 VisiLogic FB Library Events: Loopback When Loopback is activated by power flow, the focus of the Events moves to the beginning of the vector. Track Events This FB enables you to keep track of Rise and Fall events as they happen. Rise Events: Each time an MB rises in the Events vector, the Rise Event MB in Track Events turns ON for a single cycle, and the Rise Location MI contains the location of the active MB, relative to the beginning of the Events vector. If two MBs rise during a single cycle, the Rise Event Location MI will show the events in two consecutive cycles. Fall Events: Each time an MB falls in the Events vector, the Fall Event MB in Track Events turns ON for a single cycle, and the Fall Location MI contains the location of the active MB, relative to the beginning of the Events vector. If two MBs fall during a single cycle, the Rise Event Location MI will show the events in two consecutive cycles. Note that Track events can only monitor an vector that, as defined in the Events Configuration, does not exceed 255 MBs in length. 187

190 Events FB BAS (Building Automation Systems) FB The BAS operations enable Vision controllers to exchange data with CSI building environment cards. BAS operations are located on the FBs toolbar. To use BAS, you must initialize the PLC COM port to 9600, 8n1. BAS Operations Configuration Scan Open Session Read, Write Inputs: Digital or Analog I/Os Configuration The BAS Configuration must be included in the application. In addition, Scan is required in order to enable the PLC application to receive BAS messages; the Open Session operation must also be included in the application. Configuration Parameters Parameter Type Function Port # Constant Enter the number of the PLC serial port that connects the PLC to the BAS network. Router ID Constant If the BAS card is accessed via a router, select the ID number. Time Out MI or Constant Amount of time the PLC will wait for a reply, units of 10 ms. Retries MI or Constant Number of times the PLC will attempt to send a message. Function in Progress MB Turns ON when the PLC sends a BAS data request, remains ON either until the Time Out is exceeded or until a message is received in answer to the data request. Use this MB as a condition to send a message. Retries Made MI or Constant Number of times the PLC has attempted to send a message. Status MI The value of the linked MI indicates messages as follows: 188

191 VisiLogic FB Library Value Message 1 Operation completed successfully 2 (Transmit) Illegal card ID ( ) 3 (Transmit) Illegal point value 4 (Transmit) Illegal bit offset 5 (Transmit)-Serial port busy 6 (Receive) Illegal length The actual length of the message does not match the length given in the first message byte 7 (Receive) Illegal card ID The ID received does not match the ID in the data request message 8 (Receive) Illegal Router The message was received from a router that is not the router named in the data request message 9 Illegal Command The command received does not match the command in the data request message 10 (Receive) Illegal point value The point received does not match the point in the data request message 11 (Receive) TimeOut An answer was not received before the timeout set in the BAS Configuration. 12 (Receive) Checksum error 13 (Receive) Illegal offset for IO type 189

192 Events FB Open Session In order to run BAS operations, you must include Open Session in the application; it may be activated as a power-up task. Scan To enable the controller to receive messages, place an BAS Scan FB in your application and link it to a Configuration. When activated, this causes the controller to scan the Com port for incoming BAS messages. Before you can receive a BAS message, you must initialize a COM port. Read, Write Inputs: Digital or Analog I/Os You can read from and write to digital or analog I/Os Digital I/Os 190

193 VisiLogic FB Library Parameter Type Function Card ID MI or Constant Enter the ID number of the card to be read from/written to. Point Value MI or Constant Card Point to be read from/written to. Bit offset MI or Constant Enter the bit offset value. Result MB Read: Writes the current status of the I/O to the selected MB. Write: Writes the current status of the MB to the selected I/O. Analog I/Os Parameter Type Function Card ID MI or Constant Enter the ID number of the card to be read from/written to. Point Value MI or Constant Card Point to be read from/written to. Bit offset MI or Constant Enter the bit offset value. Result MF Read: Writes the current value of the I/O to the selected MF. Write: Writes the current value of the MF to the selected I/O. 191

V G23 Rev: 12/04

V G23 Rev: 12/04 Software Manual HMI V230-21-G23 Rev: 12/04 No part of this document may be used for any purpose other than for the purposes specifically indicated herein nor may it be reproduced or transmitted in any

More information

No part of this document may be used for any purpose other than for the purposes specifically indicated herein nor may it be reproduced or

No part of this document may be used for any purpose other than for the purposes specifically indicated herein nor may it be reproduced or UniDDE Server No part of this document may be used for any purpose other than for the purposes specifically indicated herein nor may it be reproduced or transmitted in any form or by any means, electronic

More information

No part of this document may be used for any purpose other than for the purposes specifically indicated herein nor may it be reproduced or

No part of this document may be used for any purpose other than for the purposes specifically indicated herein nor may it be reproduced or No part of this document may be used for any purpose other than for the purposes specifically indicated herein nor may it be reproduced or transmitted in any form or by any means, electronic or mechanical,

More information

U90 Ladder Software Manual. Version 3.50, 6/03

U90 Ladder Software Manual. Version 3.50, 6/03 U90 Ladder Software Manual Version 3.50, 6/03 Table Of Contents Welcome to U90 Ladder... 1 Program Editors... 1 Project Navigation Tree...1 Browse Sequences...1 Printing Documentation...2 Interface Language...

More information

U90 Ladder Software Manual

U90 Ladder Software Manual U90 Ladder Software Manual 3/06 No part of this document may be used for any purpose other than for the purposes specifically indicated herein nor may it be reproduced or transmitted in any form or by

More information

Loadcell. Table Of Contents. Loadcell Help Rev: 17/06/04

Loadcell. Table Of Contents. Loadcell Help Rev: 17/06/04 Loadcell Help Rev: 17/06/04 Table Of Contents Loadcell... 1 Loadcell Quickstart... 1 FB Operations... 1 Loadcell Help Rev: 17/06/04... 2 Loadcell Quickstart... 2 FB Operations... 2 Loadcell Hardware Configuration...

More information

Distributors News. December, 2004 Unitronics has announced a major market release. The release includes:

Distributors News. December, 2004 Unitronics has announced a major market release. The release includes: MAJOR RELEASE VISILOGIC 4.00, VISION 290, REMOTE ACCESS 4.00 & DATAXPORT 2.00 Unitronics has announced a major market release. The release includes: PID: includes internal Auto-tune Trends: Real-Time HMI

More information

IO-AO6X I/O Expansion Module 6 Isolated Analog Outputs

IO-AO6X I/O Expansion Module 6 Isolated Analog Outputs IO-AO6X I/O Expansion Module 6 Isolated Analog Outputs The IO-AO6X is an I/O Expansion Module that can be used in conjunction with specific Unitronics OPLC controllers. The module offers 6 12-bit isolated

More information

No part of this document may be used for any purpose other than for the purposes specifically indicated herein nor may it be reproduced or

No part of this document may be used for any purpose other than for the purposes specifically indicated herein nor may it be reproduced or UniOPC 3/07 No part of this document may be used for any purpose other than for the purposes specifically indicated herein nor may it be reproduced or transmitted in any form or by any means, electronic

More information

1 General Information

1 General Information 2013 PLC 1 General Information Controller configuration: main block Visio V230-13-B20 standard version addit. module Snap-in I/0 V200-18-E1B or V200-18-E2B Program uses operands with fixed addresses: I

More information

If a project set to Samba includes a Socket Init function set to protocol HTTP, a compilation error now results. (Samba does not support web server)

If a project set to Samba includes a Socket Init function set to protocol HTTP, a compilation error now results. (Samba does not support web server) VisiLogic V9.8.65 Bugs Fixed SAMBA The RS485 for COM2 is now visible in COM INIT. Data Table grid scroll bar width is now standard. Trend - Title of operand window to matching to variable field. (Trend

More information

V E2B Snap-in I/O Module

V E2B Snap-in I/O Module i4 Automation Ltd - 01480 395256 V200-18-E2B Snap-in I/O Module The V200-18-E2B plugs directly into the back of compatible Unitronics OPLCs, creating a selfcontained PLC unit with a local I/O configuration.

More information

V E1B Snap-in I/O Module

V E1B Snap-in I/O Module V200-18-E1B Snap-in I/O Module The V200-18-E1B plugs directly into the back of compatible Unitronics OPLCs, creating a selfcontained PLC unit with a local I/O configuration. Features 16 isolated digital

More information

This document is for information purposes only and is subject to change without notice.

This document is for information purposes only and is subject to change without notice. Notice WALCHEM, Iwaki America Inc. (hereinafter Walchem ) Boynton Road, Holliston, MA USA () - All Rights Reserved Printed in USA Proprietary Material The information and descriptions contained herein

More information

Wide Ladder Nets Ladder nets are now wide, and reach completely across your PC screen - no empty areas. This gives you twice the editing space

Wide Ladder Nets Ladder nets are now wide, and reach completely across your PC screen - no empty areas. This gives you twice the editing space U90 Ladder 6.6.36 Features Document version: 17/9/17 model JZ20-UN20 Digital Inputs including one HSC, 2 Analog/Digital Inputs, 1 Analog Input, 1 PT100/TC, 5 Relay Outputs, and 2 Transistor Outputs. Wide

More information

1210 TM /1040 TM. Features: V1210 Flat Panel. V1040 Classic Panel HMI PLC. Communication

1210 TM /1040 TM. Features: V1210 Flat Panel. V1040 Classic Panel HMI PLC. Communication Features: HMI Up to 1024 user-designed screens 500 images per application HMI graphs - color-code Trends Built-in alarm screens Text String Library - easy localization Memory and communication monitoring

More information

Packaging User Guide for Temperature Control M221 Project Template

Packaging User Guide for Temperature Control M221 Project Template Packaging EIO0000001762 04/2014 Packaging User Guide for Temperature Control M221 Project Template 04/2014 EIO0000001762.00 www.schneider-electric.com The information provided in this documentation contains

More information

Vision570 TM /560 TM. Color OPLC TM. Color Vision570 TM /560 TM Series Featuring:

Vision570 TM /560 TM. Color OPLC TM. Color Vision570 TM /560 TM Series Featuring: Vision570 TM /560 TM Color OPLC TM Color Vision570 TM /560 TM Series Featuring: HMI Up to 1024 user-designed screens 500 images per application HMI graphs color-code Trends Built-in alarm screens Text

More information

IO-LC1, IO-LC3 I/O Expansion Modules 1-3 Loadcell Inputs, 1 Digital In, 2 Out

IO-LC1, IO-LC3 I/O Expansion Modules 1-3 Loadcell Inputs, 1 Digital In, 2 Out IO-LC1, IO-LC3 I/O Expansion Modules 1-3 Loadcell Inputs, 1 Digital In, 2 Out The IO-LC1 and IO-LC3 are I/O Expansion Modules that can be used in conjunction with specific Unitronics OPLC controllers.

More information

This document is for information purposes only and is subject to change without notice.

This document is for information purposes only and is subject to change without notice. Notice 7 WALCHEM, Iwaki America Inc. (hereinafter Walchem ) Boynton Road, Holliston, MA 76 USA () - All Rights Reserved Printed in USA Proprietary Material The information and descriptions contained herein

More information

350 TM. Features: V350-J Flat Panel. V350 Classic Panel HMI PLC. Communication

350 TM. Features: V350-J Flat Panel. V350 Classic Panel HMI PLC. Communication 350 TM Advanced PLC integrated with a 3.5" color touchscreen. Includes an onboard I/O configuration; expand up to 5 I/Os Features: HMI 1024 user-designed screens 250 images per application HMI graphs -

More information

20.4VDC to 28.8VDC with less than 10% ripple Max. current consumption See Note 1 npn inputs

20.4VDC to 28.8VDC with less than 10% ripple Max. current consumption See Note 1 npn inputs Vision OPLC V130-33-T38 Technical Specifications The Unitronics V130-33-T38 offers the following onboard I/Os: 22 Digital Inputs, configurable via wiring to include 2 Analog and 2 HSC/Shaft-encoder Inputs

More information

All Analog Outputs, voltage/current 20mA 35mA 5mA 48mA/30mA* *If the analog outputs are not configured, then subtract the higher value.

All Analog Outputs, voltage/current 20mA 35mA 5mA 48mA/30mA* *If the analog outputs are not configured, then subtract the higher value. Vision OPLC V350-35-TA24/V350-J-TA24 Technical Specifications The Unitronics V350-35-TA24/V350-J-TA24 offers the following onboard I/Os: 12 Digital Inputs, configurable via wiring to include 2 Analog,

More information

Power Supply Input voltage 20.4VDC to 28.8VDC with less than 10% ripple Max. current consumption See Note 1

Power Supply Input voltage 20.4VDC to 28.8VDC with less than 10% ripple Max. current consumption See Note 1 Vision OPLC V130-33-TR6/V130-J-TR6 Technical Specifications The Unitronics V130-33-TR6/V130-J-TR6 offers the following onboard I/Os: 8 Digital Inputs, configurable via wiring to include 2 Analog (current/voltage)

More information

Power Supply Input voltage 20.4VDC to 28.8VDC with less than 10% ripple Max. current consumption See Note 1

Power Supply Input voltage 20.4VDC to 28.8VDC with less than 10% ripple Max. current consumption See Note 1 Vision OPLC V130-33-TR20/V130-J-TR20 Technical Specifications The Unitronics V130-33-TR20/V130-J-TR20 offers the following onboard I/Os: 12 Digital Inputs, configurable via wiring to include 2 Analog (current/voltage)

More information

Power Supply Input voltage 20.4VDC to 28.8VDC with less than 10% ripple Max. current consumption See Note 1

Power Supply Input voltage 20.4VDC to 28.8VDC with less than 10% ripple Max. current consumption See Note 1 Vision OPLC V130-33-TR34 Technical Specifications The Unitronics V130-33-TR34 offers the following onboard I/Os: 22 Digital Inputs, configurable via wiring to include 2 Analog and 3 HSC/Shaft-encoder Inputs

More information

BMS Steam Station Solutions

BMS Steam Station Solutions BMS Steam Station Solutions rtk@circor.com www.circorenergy.com Compact Programmable Controller Touch Screen Operator Panel MP-02 CPU Modem / Router Remote management using a SMARTphone Remote management

More information

Item SM35-J-TA22 SM43-J-TA22 SM70-J-TA22

Item SM35-J-TA22 SM43-J-TA22 SM70-J-TA22 Samba PLC+HMI SM35-J-TA22 SM43-J-TA22 SM70-J-TA22 Technical Specifications Ordering Information Item SM35-J- TA22 PLC with Flat panel, Color touch display 3.5 SM43-J- TA22 PLC with Flat panel, Color touch

More information

SOFTWARE MANUAL VISILOGIC - GETTING STARTED. V G23 Rev: 3:00

SOFTWARE MANUAL VISILOGIC - GETTING STARTED.   V G23 Rev: 3:00 SOFTWARE MANUAL VISILOGIC - GETTING STARTED V230-21-G23 Rev: 3:00 www.klinkmann.com The information in this document reflects products at the date of printing. Unitronics reserves the right, subject to

More information

350 TM. Features: V350-J Flat Panel. V350 Classic Panel HMI PLC. Communication

350 TM. Features: V350-J Flat Panel. V350 Classic Panel HMI PLC. Communication 350 TM Advanced PLC integrated with a 3.5" color touchscreen. Includes an onboard I/O configuration; expand up to 5 I/Os Features: HMI 1024 user-designed screens 250 images per application HMI graphs -

More information

20.4VDC to 28.8VDC with less than 10% ripple. Input impedance 10mSec typical, when used as normal digital inputs

20.4VDC to 28.8VDC with less than 10% ripple. Input impedance 10mSec typical, when used as normal digital inputs Vision OPLC V130-33-RA22 Technical Specifications This guide provides specifications for Unitronics model V130-33-RA22. General features include: 12 pnp/npn Digital, including 2 Analog, 2 PT100/TC, 1 HSC/Shaft-encoder

More information

20.4VDC to 28.8VDC with less than 10% ripple Max. current consumption See Note 1

20.4VDC to 28.8VDC with less than 10% ripple Max. current consumption See Note 1 Vision OPLC V130-33-R34 /V130-J-R34 Technical Specifications The Unitronics V130-33-R34 /V130-J-R34 offers the following onboard I/Os: 22 Digital Inputs, configurable via wiring to include 2 Analog and

More information

V350-T38 V350J-T38.

V350-T38 V350J-T38. Vision OPLC V130/ V350/ Technical Specifications Order Information V130-33-T38 PLC with Classic panel, Monochrome display 2.4" V130-J-T38 PLC with Flat panel, Monochrome display 2.4" V350-35-T38 PLC with

More information

DaqPRO Solution. User Guide INNOVATIVE MONITORING SOLUTIONS ALL IN ONE SOLUTION FOR DATA LOGGING AND ANALYSIS.

DaqPRO Solution. User Guide INNOVATIVE MONITORING SOLUTIONS ALL IN ONE SOLUTION FOR DATA LOGGING AND ANALYSIS. INNOVATIVE MONITORING SOLUTIONS www.fourtec.com User Guide including DaqLab FACTORIES Monitoring product quality throughout the entire manufacturing cycle TESTING STANDARDS Ensuring quality control and

More information

Power Supply Input voltage 20.4VDC to 28.8VDC with less than 10% ripple Max. current consumption See Note 1

Power Supply Input voltage 20.4VDC to 28.8VDC with less than 10% ripple Max. current consumption See Note 1 Vision OPLC V350-35-TRA22 Technical Specifications The Unitronics V350-35-TRA22 offers the following onboard I/Os: 12 Digital Inputs, configurable via wiring to include 2 Analog, 2 PT100/TC and 1 HSC/Shaftencoder

More information

W600/W900 Modbus. Instruction Manual

W600/W900 Modbus. Instruction Manual W6/W Modbus Instruction Manual WALCHEM, Iwaki America Inc. Five Boynton Road Hopping Brook Park Holliston, MA 76 USA : TEL: -- WEB: www.walchem.com Notice 7 WALCHEM, Iwaki America Inc. (hereinafter Walchem

More information

Control D. Controller Module for Proportional Valve Control. Installation Manual

Control D. Controller Module for Proportional Valve Control. Installation Manual Control D Controller Module Table of Contents Control D 1 1.1 1.2 1.3 1.3.1 1.3.2 1.4 2 3 4 5 5.1 5.2 5.3 6 7 8 Description 3 How To Order 3 Operating Elements 3 Adjustment 4 Operation 4 Auto-adapt 4 Operating

More information

Omni. User Manual. Economic Self-Tune PID Temperature Controller. Omni 96. Omni 72 72X72. Omni ~ 265 V AC SUPPLY

Omni. User Manual. Economic Self-Tune PID Temperature Controller. Omni 96. Omni 72 72X72. Omni ~ 265 V AC SUPPLY Omni Economic Self-Tune PID Temperature Controller Omni 7 Omni 4 6 5 4 3 1 7X7 7 1 11 5 ~ 65 V AC SUPPLY Omni 6 CONTENTS 1. PANEL MOUNTING & ELECTRICAL CONNECTIONS 1. FRONT PANEL : LAYOUT AND OPERATION

More information

From lab to production, providing a window into the process. Dynisco's ATC990 and UPR900 Applications and Setup

From lab to production, providing a window into the process. Dynisco's ATC990 and UPR900 Applications and Setup From lab to production, providing a window into the process Dynisco's ATC990 and UPR900 Applications and Setup Introduction UPR900 Indicator Is ¼ Din (96x96mm) size, 117mm depth behind the panel. It has

More information

PID Server. Table Of Contents 6/6/04

PID Server. Table Of Contents 6/6/04 PID Server 6/6/04 Table Of Contents PID Server... 1 How Auto-tune works... 1 Vision Auto-tune... 3 Auto-tuning with PID Server (Vision)... 3 Controlling the Physical Output... 5 M90/91 Auto-tune... 7 Auto-tuning

More information

Jazz-J. Jazz. Features:

Jazz-J. Jazz. Features: An All-in-One that is as affordable as a "smart relay" - full-function PLC combined with a textual HMI and keyboard, with up to 40 onboard I/Os Meet the New Jazz 2 series Advantages: Faster performance

More information

BLH. DXp-40 Interface Manual Allen-Bradley Remote I/O WEIGH SYSTEM TECHNOLOGY. TM014 Rev D 6/1/11 Doc 35105

BLH. DXp-40 Interface Manual Allen-Bradley Remote I/O WEIGH SYSTEM TECHNOLOGY. TM014 Rev D 6/1/11 Doc 35105 WEIGH SYSTEM TECHNOLOGY BLH DXp-40 Interface Manual Allen-Bradley Remote I/O TM014 Rev D 6/1/11 Doc 35105 NOTICE BLH makes no representation or warranties of any kind whatsoever with respect to the contents

More information

All Analog Outputs, voltage/current 10mA 35mA 5mA 48mA/30mA* *If the analog outputs are not configured, then subtract the higher value.

All Analog Outputs, voltage/current 10mA 35mA 5mA 48mA/30mA* *If the analog outputs are not configured, then subtract the higher value. Vision OPLC V350-35-TRA22/V350-J-TRA22 Technical Specifications The Unitronics V350-35-TRA22/V350-J-TRA22 offers the following onboard I/Os: 12 Digital Inputs, configurable via wiring to include 2 Analog,

More information

PID Control Application Guide

PID Control Application Guide 2104301-001 rev. AB PID Control Application Guide TABLE OF CONTENTS 1.0 INTRODUCTION... 3 1.1 Overview...3 1.2 PID Control Example...3 2.0 TOTALFLOW S IMPLEMENTATION OF THE PID CONTROL... 4 2.1 Overview...4

More information

Samba PLC+HMI SM35-J-RA22

Samba PLC+HMI SM35-J-RA22 Samba PLC+HMI SM35-J-RA22 SM43-J-RA22 Technical Specifications Ordering Information Item SM35-J-RA22 PLC with Flat panel, Color touch display 3.5 SM43-J-RA22 PLC with Flat panel, Color touch display 4.3

More information

Yokogawa YS100 Driver PTC Inc. All Rights Reserved.

Yokogawa YS100 Driver PTC Inc. All Rights Reserved. 2016 PTC Inc. All Rights Reserved. 2 Table of Contents 1 Table of Contents 2 3 Overview 3 Device Setup 4 Modem Setup 4 Data Types Description 6 Address Descriptions 7 YS150 Addressing 7 YS170 Addressing

More information

Jazz-J. Jazz. Features:

Jazz-J. Jazz. Features: An All-in-One that is as affordable as a "smart relay" - full-function PLC combined with a textual HMI and keyboard, with up to 40 onboard I/Os Meet the New Jazz 2 series Advantages: Faster performance

More information

Item SM35-J-T20 SM43-J-T20 SM70-J-T20

Item SM35-J-T20 SM43-J-T20 SM70-J-T20 Samba OPLC SM35-J-T20 SM43-J-T20 SM70-J-T20 Technical Specifications Ordering Information Item SM35-J-T20 PLC with Flat panel, Color touch display 3.5 SM43-J-T20 PLC with Flat panel, Color touch display

More information

Yokogawa YS100 Serial Driver Help Kepware Technologies

Yokogawa YS100 Serial Driver Help Kepware Technologies Yokogawa YS100 Serial Driver Help 2012 Kepware Technologies 2 Table of Contents Table of Contents 2 3 Overview 3 Device Setup 4 Modem Setup 5 Data Types Description 7 Address Descriptions 8 YS150 Addressing

More information

Vision OPLC. Distributed by: M.A. Selmon Company, Inc 4 Oxford Rd. Milford, CT V R34/V350-J-R34 Technical Specifications

Vision OPLC. Distributed by: M.A. Selmon Company, Inc 4 Oxford Rd. Milford, CT V R34/V350-J-R34 Technical Specifications Vision OPLC V350-35-R34/V350-J-R34 Technical Specifications The Unitronics V350-35-R34/V350-J-R34 offers the following onboard I/Os: 22 Digital Inputs, configurable via wiring to include 2 Analog and 3

More information

Optidrive Applications Support Library

Optidrive Applications Support Library Optidrive Applications Support Library Application Note Title AN-ODV-3-038 Related Products Optidrive Eco Overview Level 3 Modbus RTU Control and Register Mapping 1 Fundamental - No previous experience

More information

PRODUCT FAMILY: SOLO Controllers Number: AN-LC-009

PRODUCT FAMILY: SOLO Controllers Number: AN-LC-009 THIS INFORMATION PROVIDED BY AUTOMATIONDIRECT.COM TECHNICAL SUPPORT IS SUPPLIED "AS IS", WITHOUT ANY GUARANTEE OF ANY KIND. These documents are provided by our technical support department to assist others.

More information

PLC AUTOMATION SYSTEM LABORATORY. Manual

PLC AUTOMATION SYSTEM LABORATORY. Manual MRS AVN COLLEGE POLYTECHNIC VISAKHAPATNAM DEPARTMENT OF ELECTRICAL ELECTRONICS ENGINEERING PLC AUTOMATION SYSTEM LABORATORY Manual PLC Automation System Laboratory Lab 1 : Getting familiar with Step 7-

More information

Introduction of Configure Software for 3.5'' Touch Panel

Introduction of Configure Software for 3.5'' Touch Panel Introduction of Configure Software for 3.5'' Touch Panel 1. Brief Introduction This Configure Software is used with the 3.5'' Touch Panel. After setting group address of different devices in ETS users

More information

V350-RA22 V350J-RA22.

V350-RA22 V350J-RA22. Vision PLC+HMI V130/ V350/ Technical Specifications Order Information V130-33-RA22 PLC with Classic panel, Monochrome display 2.4" V130-J-RA22 PLC with Flat panel, Monochrome display 2.4" V350-35-RA22

More information

Object 18 - PID. PID Summary

Object 18 - PID. PID Summary Object 18 - PID PID Summary Overview: The PID (Proportional-Integral-Derivative) object typically takes a measured variable such as static pressure or temperature as its control input and uses this value

More information

20.4VDC to 28.8VDC with less than 10% ripple Max. current consumption See Note 1 npn inputs

20.4VDC to 28.8VDC with less than 10% ripple Max. current consumption See Note 1 npn inputs Vision OPLC V350-35-T38 Technical Specifications The Unitronics V350-35-T38 offers the following onboard I/Os: 22 Digital Inputs, configurable via wiring to include 2 Analog and 2 HSC/Shaft-encoder Inputs

More information

V430J-TR34 V350-TR34 V350J-TR34. pnp inputs

V430J-TR34 V350-TR34 V350J-TR34. pnp inputs Vision PLC+HMI Order Information V130-33-TR34/V130-J-TR34 V350-35-TR34/V350-J-TR34 V430-J-TR34 Technical Specifications V130-33-TR34 PLC with Classic panel, Monochrome display 2.4" V130-J-TR34 PLC with

More information

TRAINING GUIDE LEVEL 3 MODBUS WRITE IMPORT COMMAND

TRAINING GUIDE LEVEL 3 MODBUS WRITE IMPORT COMMAND OleumTechTM TRAINING GUIDE LEVEL 3 MODBUS WRITE IMPORT COMMAND MUST BE FAMILIAR WITH LEVEL 1 TRAINING MATERIALS BEFORE MOVING FORWARD Doc ID# 80-6010-001b TABLE OF CONTENTS 1. WHAT IS NEW WRITE IMPORT

More information

Vision PLC+HMI V130/V130J-TA24 V350/V350J-TA24 V350S/V350JS-TA24 Technical Specifications Order Information V130-33-TA24 PLC with Classic panel, Monochrome display 2.4" V130-J-TA24 PLC with Flat panel,

More information

Using the MODBUS Protocol with Athena Series C (1ZC, 16C, 18C, and 25C) Controllers

Using the MODBUS Protocol with Athena Series C (1ZC, 16C, 18C, and 25C) Controllers Using the MODBUS Protocol with Athena Series C (1ZC, 16C, 18C, and 25C) Controllers Athena and Multi-Comm are trademarks of Athena Controls, Inc. MODBUS is a trademark of AEG Schneider Automation, Inc.

More information

PLC PL User Manual

PLC PL User Manual PLC PL - 300 User Manual Contents list 1. Data acquisition module PL300... 3 1.1 Introduction... 3 1.2 Frontal panel... 5 1.3 Size and installation... 6 1.4 Electrical wirings... 7 1.4.1 Examples of sensors

More information

ThermoPad Reference Manual

ThermoPad Reference Manual ThermoPad Reference Manual Revision 0.6 www.coolautomation.com 2/18/2015 2 Table of Contents 1 Revision History 3 2 Specification 4 3 Thermopad Models 5 4 Terminals 6 5 MODBUS Map 7 6 Special Features

More information

Samba OPLC SM35-J-T20

Samba OPLC SM35-J-T20 Samba OPLC SM35-J-T20 Technical Specifications The Unitronics SM35-J-T20 offers the following onboard I/Os: 12 Digital Inputs, configurable via wiring to include: 3 HSC/Shaft-encoder Input, 2 Analog inputs

More information

Topic: The DPID/DPIDE function of AH500 Series PLCs (Examples of temperature control)

Topic: The DPID/DPIDE function of AH500 Series PLCs (Examples of temperature control) Topic: The DPID/DPIDE function of AH500 Series PLCs (Examples of temperature control) Applicable model Keyword AH500 series DPID function, DPIDE function Page 1/34 Table of Contents 1. Preface and Purpose...

More information

SERIES C 1ZC 16C 18C 19C 25C

SERIES C 1ZC 16C 18C 19C 25C SERIES C 1ZC 16C 18C 19C 25C TEMPERATURE / PROCESS CONTROLLER Controller Operator Manual Athena is a registered trademark and Multi-Comm is a trademark of Athena Controls, Inc. Platinel is a trademark

More information

User Guide Supplement Modbus TM Serial Data Communications Option IM/C100 MOD_6. /8 DIN Process Indicators and Controllers C100, C150, C160 and V100

User Guide Supplement Modbus TM Serial Data Communications Option IM/C100 MOD_6. /8 DIN Process Indicators and Controllers C100, C150, C160 and V100 User Guide Supplement Modbus TM Serial Data Communications Option IM/C100 MOD_6 1 /8 DIN Process Indicators and Controllers C100, C150, C160 and V100 Electrical Safety This equipment complies with the

More information

PM290 POWERMETER. Communication Protocols ASCII & Modbus Reference Guide

PM290 POWERMETER. Communication Protocols ASCII & Modbus Reference Guide PM290 POWERMETER Communication Protocols ASCII & Modbus Reference Guide PM290 Communication Protocols Communication protocol is a method of transferring information between different devices (i.e., the

More information

VersaMax Micro and Nano Technical Product Presentation

VersaMax Micro and Nano Technical Product Presentation VersaMax Nano VersaMax Micro VersaMax Micro and Nano Technical Product Presentation Outline Introduction VersaMax Micro and Nano Product Strategy Future Products Product Description VersaMax Nano VersaMax

More information

1500ct Pump Controller

1500ct Pump Controller Quality Control & Integration, Inc. Control, Instrumentation, Telemetry, SCADA, and Automation Systems 1500ct Pump Controller Dynamic Solutions for greater control and true dynamic I/O, color, touch screen

More information

1500ct Pump Controller

1500ct Pump Controller Quality Control & Integration, Inc. Control, Instrumentation, Telemetry, SCADA, and Automation Systems 1500ct Pump Controller Dynamic Solutions for greater control and true dynamic I/O, color, touch screen

More information

Modbus TCP/IP Option Instruction Manual

Modbus TCP/IP Option Instruction Manual W A L C H E M An Iwaki America Company WebMaster Modbus TCP/IP Option Modbus TCP/IP Option Instruction Manual s800v005, s801v004 and higher Five Boynton Road Hopping Brook Park Holliston, MA 01746 USA

More information

User Guide IM/C250 MOD_3. Modbus (RTU) Communications Option C250 and V250

User Guide IM/C250 MOD_3. Modbus (RTU) Communications Option C250 and V250 User Guide IM/C250 MOD_3 Modbus (RTU) Communications Option C250 and V250 Electrical Safety This instrument complies with the requirements of CEI/IEC 61010-1:2001-2 "Safety requirements for electrical

More information

Automationdirect.com. D i r e c t L o g i c M a g n e t i c P u l s e I n p u t C o p r o c e s s o r F 4-8 M P I

Automationdirect.com. D i r e c t L o g i c M a g n e t i c P u l s e I n p u t C o p r o c e s s o r F 4-8 M P I Automationdirect.com D i r e c t L o g i c 0 5 M a g n e t i c P u l s e I n p u t C o p r o c e s s o r F - 8 M P I Manual Order Number: F-8MPI-M TRADEMARKS AutomationDirect.com is a Trademark of Automationdirect.com

More information

13-1. This chapter explains how to use different objects.

13-1. This chapter explains how to use different objects. 13-1 13.Objects This chapter explains how to use different objects. 13.1. Bit Lamp... 13-3 13.2. Word Lamp... 13-5 13.3. Set Bit... 13-10 13.4. Set Word... 13-13 13.5. Function Key... 13-21 13.6. Toggle

More information

PF2100 MODBUS LOGGER CARD SYSTEM SPECIFICATION. v1.0 DRAFT Revised Dec 4, 2014 Last Revised by Alex Messner

PF2100 MODBUS LOGGER CARD SYSTEM SPECIFICATION. v1.0 DRAFT Revised Dec 4, 2014 Last Revised by Alex Messner PF2100 MODBUS LOGGER CARD SYSTEM SPECIFICATION Revised Last Revised by Alex Messner This page was intentionally left blank. Table of Contents 1 Overview... 2 2 User Interface... 3 2.1 LEDs... 3 2.2 Buttons...

More information

Vision OPLC. Technical Specifications. V T34 Technical Specifications

Vision OPLC. Technical Specifications. V T34 Technical Specifications Vision OPLC V570-57-T34 Technical Specifications The Unitronics V570-57-T34 offers the following onboard I/Os via HE-10 connectors: 16 isolated Digital Inputs, configurable via wiring to include2 HSC/Shaft-encoder

More information

Temperature, Process &

Temperature, Process & Temperature, Process & 150 For Temp. Units 1/32 DIN meter 195 with 2 control outputs User Friendly, Simple to Configure High Quality i/32 i/16 i/8 Extended 5-Year Warranty Powerful Features Free Software,

More information

111 Highland Drive Putnam, CT USA PHONE (860) FAX (860) SM32Pro SDK

111 Highland Drive Putnam, CT USA PHONE (860) FAX (860) SM32Pro SDK SM32Pro SDK Spectrometer Operating Software USER MANUAL SM301/SM301EX Table Of Contents Warranty And Liability...3 Quick Start Installation Guide...4 System Requirements...5 Getting Started...6 Using the

More information

Omni + User Manual. Dual Setpoint Temperature Controller with Programmable Input & TIMER. Omni 96+ Omni 72+ Omni 48+ TMR TMR TMR

Omni + User Manual. Dual Setpoint Temperature Controller with Programmable Input & TIMER. Omni 96+ Omni 72+ Omni 48+ TMR TMR TMR Omni + Dual Setpoint Temperature Controller with Programmable Input & TIMER Omni 72+ Omni 48+ TMR TMR Omni 96+ TMR CONTENTS 1. PANEL MOUNTING & ELECTRICAL CONNECTIONS 1 2. FRONT PANEL : LAYOUT AND OPERATION

More information

HD32MTLogger Software Manual for the instrument HD32MT.1 Introduction

HD32MTLogger Software Manual for the instrument HD32MT.1 Introduction HD32MTLogger Software Manual for the instrument HD32MT.1 Introduction WARNING: The software must always be run as administrator! The HD32MTLogger program allows management of the HD32MT.1 datalogger from

More information

PROGRAMMING MANUAL IM262R00. AQUAVAR Intelligent Pump Controller START-UP GENIE PROGRAMMING MANUAL

PROGRAMMING MANUAL IM262R00. AQUAVAR Intelligent Pump Controller START-UP GENIE PROGRAMMING MANUAL PROGRAMMING MANUAL IM262R00 AQUAVAR Intelligent Pump Controller START-UP GENIE PROGRAMMING MANUAL TABLE OF CONTENTS Introduction 3 Chapter 1: Motor 4 Chapter 2: Application 5 2.1. Single Pump 5 2.2. Constant

More information

Vision OPLC. V TR6 Technical Specifications. Technical Specifications.

Vision OPLC. V TR6 Technical Specifications. Technical Specifications. V350-35-TR6 Technical Specifications The Unitronics V350-35-TR6 offers the following onboard I/Os: 8 Digital Inputs, configurable via wiring to include 2 Analog (current/voltage) and 1 HSC/Shaft-encoder

More information

V E4XB Snap-in I/O Module

V E4XB Snap-in I/O Module Cara Bereck Levy V200-18-E4XB Snap-in I/O Module The V200-18-E4XB plugs directly into the back of compatible Unitronics OPLCs, creating a selfcontained PLC unit with a local I/O configuration. Features

More information

V350-RA22 V350J-RA22.

V350-RA22 V350J-RA22. Vision OPLC V130/ V350/ Technical Specifications Order Information V130-33-RA22 PLC with Classic panel, Monochrome display 2.4" V130-J-RA22 PLC with Flat panel, Monochrome display 2.4" V350-35-RA22 PLC

More information

F4T Touch Screen Controller Cascade Control Addendum

F4T Touch Screen Controller Cascade Control Addendum F4T Touch Screen Controller Cascade Control Addendum Revision 3.06 and higher Firmware TestEquity LLC 6100 Condor Drive Moorpark, CA 93021 Support: 877-512-3457 Toll Free 805-480-0638 Corporate: 800-732-3457

More information

MODBUS EXPANSION CARD

MODBUS EXPANSION CARD 2100 MODBUS EXPANSION CARD MAP v2.1 FOR HARDWARE v2.0 ONLY FOR FIRMWARE v2.0, v4.0, v4.1, v4.3 PF2100 MODBUS EXPANSION CARD MAP v2.1 PROFIRE ENERGY INC. FIRMWARE VERSION HISTORY FIRMWARE VERSION HISTORY

More information

RTU500 series. RTU500 series Remote Terminal Unit Function Description Release 12 Part 5: SCADA functions

RTU500 series. RTU500 series Remote Terminal Unit Function Description Release 12 Part 5: SCADA functions RTU500 series RTU500 series Remote Terminal Unit Function Description Release 12 Part 5: SCADA functions RTU500 series Remote Terminal Unit Revision Revision Document identity: 1KGT 150 944 V002 1 Revision:

More information

ROWTEST TDR200 ROTOR REFLECTOMETER TDRPLOT SOFTWARE

ROWTEST TDR200 ROTOR REFLECTOMETER TDRPLOT SOFTWARE ROWTEST TDR200 ROTOR REFLECTOMETER TDRPLOT SOFTWARE USER GUIDE Issue 2 October 2014 ROWTest Ltd., 64, Courthill House,Water Lane, Wilmslow, Cheshire. SK9 5AJ. UK Phone/Fax +44 - (0) - 1625-418722 Email:

More information

OVEN INDUSTRIES, INC.

OVEN INDUSTRIES, INC. OVEN INDUSTRIES, INC. OPERATING MANUAL MODEL 5C7-195 THERMOELECTRIC MODULE TEMPERATURE CONTROLLER TABLE OF CONTENTS Page Features...1 Description...2 Block Diagram...2 Mechanical Package Drawing...3 RS232

More information

Chapter 21 General purpose PID control

Chapter 21 General purpose PID control Chapter 21 General purpose control 21.1 Introduction of control As the general application of process control, the open loop methodology may be good enough for most situations, because the key control

More information

Accord Builder. User Guide

Accord Builder. User Guide User Guide Document: V 3.6 User Guide R01 V3.6 User Guide R01 Page 1 of 110 Table of Contents 1 Introduction... 7 2 General Summary and Definitions... 8 2.1 Accord Platform and Plant... 8 2.2 PLC Control

More information

Retentive On-Delay (TONR)

Retentive On-Delay (TONR) A small sample of the flexibility of PLCs is shown in the following program logic. By reprogramming the T37 contact as a normally closed contact, the function of the circuit is changed to cause the indicator

More information

Operating guide. OPC server for ECL Comfort 310. Table of Contents

Operating guide. OPC server for ECL Comfort 310. Table of Contents Operating guide OPC server for ECL Comfort 310 Table of Contents 1. Introduction to Danfoss ECL OPC Server... 2 2. Configuring databases... 6 3. Exporting configuration data... 7 4. Importing data from

More information

Proportional/Integral/Derivative (PID) Loop Instruction

Proportional/Integral/Derivative (PID) Loop Instruction S7-200 Instruction Set Chapter 6 Proportional/Integral/Derivative (PID) Loop Instruction The PID Loop instruction (PID) executes a PID loop calculation on the referenced LOOP based on the input and configuration

More information

TABLE OF FIGURES... II A - DISCUSSION...1 B MAIN CONFIGURATION...4

TABLE OF FIGURES... II A - DISCUSSION...1 B MAIN CONFIGURATION...4 Radiant Technologies, Inc. 2835D Pan American Freeway NE Albuquerque, NM 87107 Tel: 505-842-8007 Fax: 505-842-0366 e-mail: radiant@ferrodevices.com Table of Contents TABLE OF FIGURES... II A - DISCUSSION...1

More information

Hybrid AC Driver [GCNC-1110]

Hybrid AC Driver [GCNC-1110] Page 1 Installation Manual and Datasheet Page 2 Key Features Smooth and quiet operation at all speeds and extremely low motor heating Industrial grade performance for an alternating current servo motor

More information

PF MODBUS REGISTER MAP. v1.4 Revised Nov 29, 2016

PF MODBUS REGISTER MAP. v1.4 Revised Nov 29, 2016 PF3107-00 MODBUS REGISTER MAP v1.4 Revised TRADEMARKS AND COPYRIGHT All content is subject to copyright and may not be reproduced in any form without the express written consent of the author. 2016 Profire

More information

Appendix C: HVAC PRO Modules

Appendix C: HVAC PRO Modules FANs 637.5, 1637.5 Appendix Section Issue Date 0400 APPLICATION NOTE Appendix C: HVAC PRO Modules HVAC PRO Modules...3 Introduction...*3 Key Concepts...*4 ABS VALUE... 6 ADD... 6 ANALOG OUTPUT... 6 AND...

More information

RMCWin. WalkThrough. This document is intended for walking through RMCWin with customers over the telephone/internet.

RMCWin. WalkThrough. This document is intended for walking through RMCWin with customers over the telephone/internet. RMCWin WalkThrough This document is intended for walking through RMCWin with customers over the telephone/internet. Figure 1. Typical RMC100 and RMCWin installation. PC running RMCWin Setup and Diagnostics

More information