Home

USER MANUAL - Divelbiss Corporation

image

Contents

1. Figure 5 4 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 50 Chapter 5 Creating Ladder Diagram Projects Placing a Linked Variable To place a variable that is linked to a function block from the tool bar select the Insert Variables button Inst Vars In the ladder diagram workspace click in an open area and the Variables window will open This window contains tabs at the top for all variable types supported When inserting a variable next to a function block input only the variable types supported by the function block will be displayed as tabs in the Variables window Select the appropriate type for the variable you are needing to insert and click the app button The Add Vari able dialog box will open automatically Enter a variable name in the Name field See Figure 5 4 For now click ok to create the variable We will cover the details of variable attributes later in this chapter You have now placed a linkable variable If the variable you need to insert already exists select it from the list and click ox to insert it Variables names must always begin with a letter and cannot contain spaces Trying to begin variables with numbers or using spaces will result in a error message being displayed Variables may be created at any time without inserting or placing them in the ladder diagram Q workspace To create a variable without placing it from the tool bar select the Edit Variables button Edit
2. ccccccccceeeeceeceseeeeceeeeeceesensenseneeeseaeeeesensenenness 193 Counter Timer Capture INpUtS xc ecicccssiccce ccs cscs ieecce tec czvecereccsctceeecceccveeesseerstceccngececsessenedscsecedeeu sucesentecsxsseaekt 194 Installing Counter Capture NAPUCS sii scsiciuccdxiacicientsutatictegenccteiicadncnvcsanunuccieuanedueirevantauddeeveedselanveanducesienmdontes 194 Quadrature Counter Inputs sisspsicncciccscussaitnseseustastavansanasstansvateondaveacanstionseansneabudaasnecesncinenssbincnousunsiaassreunwees 197 Installing Quadrature Counter Inputs ccccseceseeeseeeeeeeeeseeneeseeneeseeeeesseeeeeenenenseeneeseaaeesenneesennaessonnees 197 Using the Quadrature Counter INDUtS iivisicisisscnendceenaienciudenstniwnmceyancstnanentineiabenpsitestnncdsideneneevndsninabiameeceuasye 199 Chapter 19 Ethernet a reicecceesrcccsreacirn ccs cece nce nnieree nce ancensecteneedespecavsnestaestieaessecaieeins 201 EES OVGT VIG eiai E E E enone indeterminate 202 installing Ethernet SUD DOM eege 202 Ethernet as the Programming Port ccceeeeseeseeeeeeeeeneeeeneeeeeseseeneeeeneseeseeeeneeeeneeseneesenessenaeennaenenenenaes 205 Eth rnet Modbus Port sasapan E AEA A Ana AE E A AEE 206 Chapter 20 SD Card Suppolt eee cceccecseeceeeeneeeeceneceeseneeeesenscnesensonssenesneseneaes 207 SEENEN 208 Installing SD Card SUP Le TEE 208 using TING SD CAN ME 209 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 4 Table of Cont
3. cccccsceceesseeeeeeeeeseeeeeeeseeeseeneeeeeseeseasseseasneseeenessenesees 67 Downloading Ladder Diagram Projects to Targets cccscssesseeeeeeseeseeeeseneeeeeeeseeeeeeeneseeneneneeneenensaaes 68 Ge Time Eege EE 68 Chapter 7 Retentive Variables ccccccceccsecseeeeeeeeeeeceeeeeeeneeeseneeeseneeeesenseneoness 71 What IS R t ntive Variable gc caecersce ste c ce we stserctmc cis a nner me EA E Ea ERE 72 How to Make a Variable Retentive cccccsceceeeeeeeseeeeeeeeeneeeeeeeeeeneeeeseseeneeeeneeseneeeenessoneseasasensnenenenenaes 72 Retentive Variable Memory Limitations cccccsceecesseeeeeeeeseeeeeseeeseeeeesneeeeeneeseaneeeeaeeesenenesseanessonnees 73 Configuring Retentive Memory in the Project SettingS cccccsssseesseseeeeeseeeseeeesseeeeesesneeseeneeseeneenes 73 EEPROM MEMOry Eeer 74 Installing EEPROM Fuctionality iicievtaianetsecnecinedennneannneieena vue sssieduuiensesensinidaivnndinedaudswubabiewindined nntudanietaviens 75 Using EEPROM MEMOTY E 76 RPS OOS e D 77 Chapter 8 Pulse Width Modulation c ccscceeeceeceeceeceeeeesnsneeneenseeesensnseness 78 Kkbat is Fulee VogtlcMlogdulattott seessuggete ege AER 79 PYM CCG Du 79 Configuring PWM in Project Settings cccccssseeesseeeeeeeeeeeseeeeeeneeeeeneeeeesseseaeseseeesesenaseseeasneseeenesseanenses 80 Controlling PWM in the Ladder Diagram Proje ct cccccsssecssseeeeseeeeeeeeeeeeeseeeseeneesnensesean
4. Click ok to accept the DHCP settings and close the window Click RESTART TARGET to exit the Bootloader and force the software kernel to restart accepting the changes The Ethernet port is now configured to operate as the hardware target s programming port with the network s DHCP The MAC field is factory set and should not be changed Static IP Configuration To configure for a static IP mode de select the DHCP Enabled and IP v4 Auto Config check boxes Addi tional configuration items are required See Figure 19 4 When using the static IP mode a Host Name is recommended to identify the hardware target on the Ethernet network ad Target Options Ethemet Options USB Options SD Card Options Ethemet Enabled E DHCP Enabled Host Name E IP v4 Auto Config Static IP Options IP Addr Subnet Gateway Figure 19 4 The IP Address IP Addr Subnet Subnet and Gateway Gateway information must be entered into the ap propriate boxes Enter the information l Generally the Subnet mask is 255 255 255 0 however this setting as with the IP Address and Gateway is network specific This information may be obtained from you network administrator Click ok to accept the static IP settings and close the window Click RESTART TARGET to exit the Bootloader and force the software kernel to restart accepting the changes The Ethernet port is now configured to operate as the hardware target s programming port with a stat
5. 8 Retentive This check box is used to identify retentive variables variables that will store their current value on power loss and reload it automatically when power is restored This feature must be supported on the hardware target a Add Timer NO oh Ga N CO Milliseconds 0 25ms OK Figure 5 6 Keeping Variable Values on Power Loss In the event of a power loss to the target EZ LADDER Toolkit is designed to allow ladder diagram variables to be stored and then be reloaded when power is restored This is called the Retentive feature and variables must be configured as retentive as well as the hardware target must support this feature See Chapter 7 Retentive Variables for more details on the retentive feature Placing Objects and Drawing Links To place an object in an EZ LADDER Toolkit project select the object or function block from the tool bar or select the object or function block from the tool bar drop down menu Position the pointer in the ladder dia gram workspace where the object is to be inserted and left click This places the object at that point As you add objects variables may need created See earlier in this chapter for how to create variables Figure 5 7 illustrates the placement of a Direct Contact and Direct Coil Please refer to Chapter 24 Func tion Reference Q The last placed object stays selected until a different object or button in the tool bar is chosen This featur
6. Retentive This check box is used to identify retentive variables variables that will store their current value on power loss and reload it automatically when power is restored This feature must be supported on the hardware target This is where the physical address of real world I O points is entered This field is only used if the Variable Type is either Input or Output This is where default variable values are set An internal variable will be equal to this value unless it has been altered by the ladder diagram This is used to preset values in the ladder diagram for comparisons as well as other uses This field is optional When the ladder diagram project is configured to use register based communications such as Modbus or OptiCAN the register assignment for the variable is configured in this field If left blank there is no assigned register This field only appears if a feature that will use a register is installed or supported on the hardware target and Projects Settings This field is optional Clicking the Epit button opens an additional dialog box with all the available networks and makes assigning registers easier EZ LADDER Toolkit User Manual 53 Chapter 5 Creating Ladder Diagram Projects al Add Variable 1 Description 3 3 2 Variable Type er Var VO Number 4 ef Default Valu 5 Te Internal A AddressiRegister P 6 Figure 5 5 Timer Variable Attributes When adding new timer varia
7. x C Aatve True SS es SS o Output Sa Example Circuit Related Functions ACOS ASIN ATAN SIN TAN Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 260 Chapter 24 Function Reference CTD CTD Description LU Q The CTD function is a programmable software down counter A true on CD will cause the counter to decrement by one Once the counter CV equals zero the Q output will be true A true on LD will cause the counter to load the PV as the current CV count and reset the Q output The down counter triggers on a false to true transition on the CD input LD Input Output Connections The CTD function block placement requires connections of three input pins CD LD PV and two output pins Q CV DN CY C WoPin Des Integer Real Boolean Timer ActiveState OtherDetalls CD Input A Rising Edge o mw LL LA IL f RisngEagse PO DD ow EX Cw me a a a o om e o O e ev owe x S Example Circuit Timing Diagram Related Functions CTU CTUD Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 261 Chapter 24 Function Reference CTU CTU Description The CTU function is a programmable software up counter A true on CU will cause the coun ter to increment by one Once the counter CV equals the preset value PV the Q output will be true A true on reset R will cause the counter reset to zero and reset the Q output The down coun
8. Chapter Contents Password Protection OVervieW cccccecseceeeeeeeeeeeeeeeeeseeneeeeseaeeeeeeeeeneeeses 353 Configuring Password Protection ccccecceeeeeeeeeeeeeeeeeeeseeeneeeseeeeeeeeeeaes 353 Master Ee EE 354 Creating Lower Level PaSSWOMGS cccceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeseeneees 354 Editing Lower Level PasswordsS cccceeeseceeeeeeeeeeeeeeeeneeseeneeseeeeessoes 355 Removing Lower Level PaSSWOMUS cc sceceeseeeeeneneeeeeeeeeneeeeseeeeseees 356 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 352 Chapter 25 Password Protection Password Protection Overview Password protection may be used on all P Series PLC on a Chip targets There may be multiple pass words for a ladder diagram project When using Password protection the Master password is the only pre named password Other lower level passwords and descriptions may be created as needed to provide maximum versatility in allow certain individuals to certain ladder diagram project features If password protection is enabled in a ladder diagram project a password will be required prior to the project opening and being viewed in the EZ LADDER Toolkit Workspace Configuring Password Protection By default no passwords are set for a new ladder diagram project dld If password protection is desired the protection must be configured using the Project Settings Menu Select the target PLCHIP PXX and click th
9. Divelbiss Corporation P Series EZ LADDER Toolkit User Manual Timer Counter TimerCounter Pulse Timer TP Uart Set Property UART_SET PROPERTY Unlatching Coil UNLATCH Bitwise XOR XOR EEPROM Storage 4000 bytes Modbus TCP over Ethernet OptiCAN Networking J1939 NMEA 2000 Networking Standard LCD Display Port Keypad Port EXP1 EXP2Plug in Expansion Ports Expandable UC Accepts ICM PUI 01 Expander Get Time GETTIME Hysteresis HYSTER Convert to Integer INTEGER J1939 Receive PGN J1939_RX_PGN J1939 Transmit PGN J1939_ TX_PGN Jump JMP Keypad Keypad2 Label Latching Coil LATCH LCD Display LCD Clear Limit LIMIT Natural Logarithm LN Base 10 Logarithm LOG Modbus Master MODBUS_MASTER Moving Average MAVG Maximum MAX Minimum MIN Modulo MOD Multiplication MULT Multiplexer MUX Bitwise NOT NOT Optican Node Status OPTICAN NODESTATUS Optican Transmit Message OPTICAN_TXNETMSG Bitwise OR OR PID PID Rising Edge Detect R_TRIG Random RANDOM Convert to Real REAL 233 Chapter 23 Hardware Targets Rotate Left ROL Rotate Right ROR Reset Set Reset Dominant RS Seed Random SEED Select SEL Set Date SETDATE Set Time SETTIME Shift Left SHL Shift Right SHR Sine SIN Square Root SQRT Set Reset Set Dominant SR Structured Text Function ST_FUNC Structured Text Function Block ST_FUNC_BLKk Subtraction SUB
10. Example Circuit z Timing Diagram mmm mmm mm oo ooo ET PT ET e eS SSS 0 Elapsed Time GC ee e EE E E de ee ee True On U LC Rm Im mm mm mm mm False Off Ce eee eS SS True On IN be ee eee False Off Related Functions TON TOF Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 348 Chapter 24 Function Reference UART_SET_ PROPERTY UART_SET_PROPERTY Description EN o The UART_SET PROPERTY function block allows for adjustment of certain UART parameters from inside the ladder program The enable EN must be true for the UART SET PROPERTY function to be enabled The Q output is true when the UART_ SET PROPERTY function is enabled The ER output provides an error code should an error occur The P is the input parameter to adjust A dialog box will automatically open when placing the UART SET PROPERTY func tion block This dialog allows the selection of the UART and Property to adjust Q The Baud Rate is the only adjustable parameter as of this release version of EZ LADDER Toolkit Input Output Connections The UART_SET PROPERTY function block placement requires connections of two input pins EN P and two output pins Q ER R Be Be RE BE Error Out Code 0 No Eror ae ee SC SS ef tat Sep SS ef eu Example Circuit CRI _SET_PROP Dialog Box ad UartSetPropertyForm Name UART_SET_PROPERTY Description Divelbis
11. Greater Than Equal To gt Absolute Value ABS Arc Cosine ACOS Addition ADD Arc Sine ASIN Arc Tangent ATAN Bitwise AND AND Average AVG Bit Pack BIT_PACK Bit Unpack BIT _UNPACKk Convert to Boolean BOOLEAN Compare CMP Cosine COS Count Down CTD Count Up CTU Count Up Down CTUD Division DIV Drum Sequencer DRUM_SEQ EEprom Read EEPROM_READ EEprom Write EEPROM_ Write Exponential EXP Time Delay Off TOF Time Delay On TON Timer Counter TimerCounter Pulse Timer TP Uart Set Property UART_ SET PROPERTY Unlatching Coil UNLATCH Bitwise XOR XOR Ethernet Port EEPROM Storage 4000 bytes Modbus Master Slave Modbus TCP over Ethernet OptiCAN Networking J1939 NMEA 2000 Networking VBDSP X Display Port Keypad Port Din Rail Mount EXP Plug in Expansion Port Power Function EXPT Falling Edge Detect E TRIG Floor FLOOR Get Date GETDATE Get Time GETTIME Hysteresis HYSTER Convert to Integer INTEGER J1939 Receive PGN J1939_ Has DON J1939 Transmit PGN J1939_ TX_PGN Jump JMP Keypad Keypad2 Label Latching Coil LATCH LCD Display LCD Clear Limit LIMIT Natural Logarithm LN Base 10 Logarithm LOG Modbus Master MODBUS_MASTER Moving Average MAVG Maximum MAX Minimum MIN Modulo MOD Multiplication MULT Multiplexer MUX Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 229 Chapter 23 H
12. Monitor Monitor Modify Variable Values Download LD Program Enter Bootloader Editing Lower Level Passwords Enter a description for the password s function Enter the password When checked if this password is used the user will be able to edit the ladder diagram project ladder diagram When checked if this password is used the user will be able to monitor the program in EZ LADDER Toolkit Run mode and see the program operate in real time When checked if this password is used the user will be able to monitor the program in EZ LADDER Toolkit see the program operate in real time and be able to modify variable values When checked if this password is used the user will be able to download the ladder diagram program to the hardware target replacing the current program installed on the hardware target When checked if this password is used the user will be able to enter the Bootloader on the hardware target and will allow the user to make any changes normally allowed in the bootloader including updating the kernel To edit lower level passwords the Master Password is required When prompted for a password enter the Master Password The Password Setup window will be used Refer to Figure 25 3 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 355 Chapter 25 Password Protection Removing Lower Level Passwords To remove lower level passwords the Master Password is required When promp
13. Output value DINT_TO_INT Tel END VAR d m DINT_TO_DWORD b Q Fnable ww Tang Varia User Output Pane Coli Coli Figure 26 18 Function List Pane The function list pane lists the functions and function blocks by type Four tabs are located at the bottom of the pane The first tab is for Standard functions such as ASIN and LIMIT The second tab is for Target Spe cific functions as previously listed Only the target specific functions listed in this tab are availabe to your selected hardware target The third tab list the variables The variables listed are the variable file descriptors for accessing specific target hardware and ladder diagram variables from structured text The fourth tab is for User Declarations functions This tab will hold any functions or function blocks that you have created Selecting the tab changes the contents for the pane Figure 26 19 is a sample of each tab contents a FD Type Declarations Cp UART Global Variables 7 Function 4 FunctionBlock DoubleN FunctionBlackl Function Block EZ ModbusMaster_UartEnablels EZ SpiWriteData EY UartEnablelsr Er UartGetBytesToRead EY Uartls TxFinished TE ee I BYTE_TO_DINT BYTE_TO_DWORD L Le P Figure 26 19 When creating and editing User Defined functions placing the cursor at a location in the function pane and then double clicking a Standa
14. Tangent TAN Convert to Timer TIMER Time Delay Off TOF Time Delay On TON Timer Counter TimerCounter Pulse Timer TP Uart Set Property UART SET PROPERTY Unlatching Coil UNLATCH Bitwise XOR XOR Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 234 CHAPTER 24 Function Reference This chapter provides detailed information for each function block and object found in the EZ LADDER Toolkit for P Series Targets For each function block and object the follow ing is provided type inputs outputs and other special instructions needed to use them Chapter Contents Object and Function Block Basics ccccseceeseseeeeeeseeeseeeenseeneeseeneeseees 238 Eeer 239 AGOS E 240 ADD BE 241 AND ME 242 ASIN E 243 ATA ME 244 NS EE 245 BI PACI E 246 SIS E e 247 BOOLEAN eae eee ee ee eee eee cee ere 248 eege 249 Ee 250 CNTR e 251 CNIR PXA e E 254 EIS PXX QBI CMP eege 256 CNTR PXA QE WI 258 ee 260 CTO DEE 261 EU HE 262 CTOD DE 263 DIRECT Gl Ie ese ener eee E ee eee E eee ee eee 265 DIRECT C2 ut Os W 266 EI eege EE 267 DRUM SE eens eee eee S E eee eee 268 Geif ane AE E 270 EEPROM RE E 271 EEPROM WRI aerate eas ascertain cet ewan erences 272 bere 274 BP rere se sows elastase tse smc ees etcetera eves ene eedereeceeees 275 5 AO EE 276 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 239 Chapter 24 Function Reference Be RS AAE EENAA ANEA cette tesco
15. 12C0 12C 0 LC 12C 1 12C2 DC 2 KEYPAD Keypad LCD LCD Display Low Voltage Sense Low Voltage Sense Active Low LS7366R 32 Bit Quadrature Counter SP MCP3204 Microchip 4 Channel 12Bit A D Converter SPI Modbus Master Modbus Master Modbus Slave Modbus Slave Variable Names Name ETHER_CRS ETHER_MDC ETHER_MDIO ETHER_REFCLK ETHER_RXDO Figure 19 7 Select Ethernet and click ox The Target Properties Properites window Ethernet should now be listed in the Devices pane under Internal Click ox to close the Target Properties window Click ox to close the Project Settings window Be sure to save the ladder diagram project The Ethernet port now installed and ready to be used for Modbus communication Refer to Chapter 13 Modbus Networking for details on Modbus communication and Modbus function blocks Divelbiss Corporation EZ LADDER Toolkit User Manual 206 CHAPTER 20 SD Card Support This chapter provides basic information to understand install and use SD Card features Chapter Contents SD Card SUPHO EE 208 Installing SD Card Support ccc cccseccseeecseeeeeeeeeeeeeeseeeeeeseeseneesaeeesaneesens 208 Using UE SY Cai eoe n EE EAEE E EER 209 Updating the Kernel and Ladder Diagram ccsssseeesseeeeeenseeenees 210 Divelbiss Corporation EZ LADDER Toolkit User Manual 207 Chapter 20 EZ LADDER Toolkit Reports SD Card Support EZ LADDER Toolkit provides features f
16. Broadcast Interval mz Figure 14 15 The CONFIGURE REGISTERS button is used to configure each register of the device including it s trigger and value CONFIGURE REGISTERS Du Configure Registers Number Mame Digital Inputs Digital Outputs Output Error Status Output Mode Pbi Frequency A PDAM Frequency B Pbi Polarity Pew O Duty Cycle Piki 1 Quty Cycle PDAhM 2 Duty Cycle PDAM 2 Duty Cycle A OD OD AJ OO P om AC Display tton to open the Configure Registers dialog box See Figure 14 16 Trigger On Change of State None On Change of State Nore hh OH CO OO OH None one None one None Nore MATTAN SI U U U U U Hone Decimal Hexadecimal Figure 14 16 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 141 Chapter 14 CAN Networking To change the Trigger for any register select the register and click the down arrow in the trigger column for that register This will open a small list of trigger options Each register maintains its own individual trigger setting See Figure 14 17 Configure Registers Mumber Name Trigger Digital Inputs On Change of State Digital Outputs None Output Error Status Morne On Change of State Output Mode AL Specified Interval PYM Frequency A At Interval and Change of State Puy hd Frequency B Puy hd Polarity Puy hd O Duty Cycle Puy hd 1 Duty Cycle Puy hd 2 Duty Cycle Puy hd 3 Duby Cycle ow Oo HO OI P GI bh Esc oO 4
17. Destination Address Receive only addressed to this device E Receive addressed to any device Specify Dest Address to Receive E Cancel e 286 Chapter 24 Function Reference 1 CAN Port Select 2 PGN Pane 3 SPN Pane 4 Map Variable Button 5 PGN Settings 6 SPN Field Settings 7 Source Address Area 8 Destination Address Area 9 Mapped Variables Area Example Circuit Drop down box to select the CAN port network to be used for this J1939 receive function block Select the PGN to receive with this receive function block Only one PGN per function block is allowed Select the SPN s to receive and store in variables of the selected PGN Clicking this button opens the map variable dialog to map the selected SPN data to variables The data variable is required but the status variable is optional Double c licking the SPN in the SPN pane will also open the map variable dialog The PGN settings will update as different PGNs are selected These values are based on the PGN settings in the J1939 database The SPN settings will update as different SPNs are selected These values are based on the SPN settings in the J1939 database The Gain and Offset may be overridden by entering new values Values changed will only affect this function block not the J1939 database The Request Type may be configured to NOT_REQUEST which is standard or J1939_ REQUEST to request a PGN SPN on J1939 or NMEA REQUEST to
18. E Listen Only V Enable Address Claim Interfaces Name Figure 14 20 Listen Only checkbox When this box is checked J1939 is configured to receive J1939 The controller with this EZ LADDER program will receive data but cannot transmit on the J1939 bus Enable Address Claim checkbox When this box is checked J1939 is configured to receive and transmit J1939 broadcast data The controller with this EZ LADDER program will attempt to claim an address on the J1939 bus With the address claimed it not only receives data but can transmit on the J1939 bus You should select between Listen Only mode and Enable Address Claim mode No check boxes are re quired to receive J1939 but per the J1939 specification to transmit the unit must claim an address on the network If you are only needing to receive J1939 broadcast data no transmit it is recommended you select Listen Only The ADVANCED button accesses advanced configuration features such as receive and transmit buffer sizes PGN and BAM connections Changing these parameters would be required if larger numbers of simultane ous PGNs or lager buffers were required This information will be discussed in detail later Once the Universal Setting Listen Only or Enable Address Claim has been configured click the app button The J1939 Properties dialog will open Refer to Figure 14 21 Using the provided CAN Port drop down box select the CAN port to use for the J1939 communication
19. Integer Real Boolean Timer Active Sate omor Dorais Ten not fT Xtreme e ot fx fx __ _Narberofinputsisanamie _ 2 owt ee ee CH owej ee Example Circuit Related Functions ADD SUB DIV Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 311 Chapter 24 Function Reference MUX MUX Description EN Q The MUX function multiplexes the INx inputs into one output O The number of inputs is specified when the object is placed The output O provides the value of the selected input The value on input K starts at zero for IN1 determines the number of the input that will be present on the output The enable EN must be true for the MUX function to be K 0 enabled Input Output Connections The MUX function block placement requires connections of at least four input pins EN K ms IN1 IN2 and two output pints Q O IN2 Torin type integer Real Boolean Timer Active State Other Deis a RRE Example Circuit Related Functions SEL Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 312 Chapter 24 Function Reference NOT NOT Description Se The NOT function provides a one s complement bit to bit negation of the P input The output O provides the one s complement The enable EN must be true for the NOT function to be enabled P 0 Input Output Connections The NOT function block placement requires connections of
20. O ege Type Integer Real Boolean Timer Active State Other Dorais ren not TT x Cate E met x e e e S S S gt y Y a owe E xx E Example Circuit Related Functions INTEGER REAL BOOLEAN Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 344 Chapter 24 Function Reference TIMERCOUNTER TIMERCOUNTER Description EN Q The TIMERCOUNTER function block is used to read counter or timer values of the real world inputs connected to the Timer Counter Capture inputs pins The enable EN must be true for the TIMERCOUNTER function to be enabled The Q output is true when the TIMERCOUNTER function is enabled The CV output is the actual count or time R CY value based on how the input is configured The reset R input is used to reset the counter or timer Counter Timer Capture inputs may be configured as Timers Free Running Timers or Counters Q The capture input s must be configured in the EZ LADDER Toolkits Target Settings prior to placing in the ladder diagram Input Output Connections The TIMER function block placement requires connections of two input pins EN R and two output pins Q CV L mmes le C reme Resets CounterTimer tea count Timer venue A A ees Real T T ino idx cxf S if SC ef uu Example Circuit CRI imerCounter Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 345 Chapter 24 Function Reference T
21. P Series EZ LADDER Toolkit User Manual 64 Chapter 6 Downloading amp Running Projects The following descriptions are for buttons found on the Monitor Mode Tool Bar Edit Edit Mode Switches EZ LADDER Toolkit to the Edit Mode Connect Connects EZ LADDER Toolkit to the hardware target s Programming Port Disconnect Disconnects EZ LADDER Toolkit from the hardware target Download Transfers the compiled ladder diagram project to the hardware target and saves the program in memory and starts executing the program The program will remain until over written by a new downloaded program Stop Stops execution of the ladder diagram project on the hardware target Go Starts execution of the ladder diagram project on the hardware target Ta rg Target Information Opens the a target information dialog that identifies the actual target Into version connected to EZ LADDER Toolkit and the current Target s Name or Model Number a ee EEPROM Erase This erases the EEPROM on the hardware target The target must support EEPROM storage for this feature to function There is no UNDO when erasing the EEPROM Once the EEPROM has been O erased all contents are lost Take care in erasing the EEPROM as to not lose valuable data Connecting to a Target To download a ladder diagram project to a hardware target it must first be connected to in the Monitor Mode To successfully connect to a target the Serial Port Settings in the Pro
22. P Series EZ LADDER Toolkit User Manual 121 Chapter 13 Modbus Networking All the available devices and features for the target are shown in the Devices section Scroll down and find the Modbus Slave or Modbus Master depending upon your exact needs Figure 13 17 shows the Target s Devices window al PLCHIP PXX Devices Co Devices Name Description LS7366R 32 Bit Quadrature Counter SPI MCP3204 Microchip 4 Channel 12Bit A D Converter SPI Modbus Master Modbus Master PLCHIP_Pxx_eeprom Intemal PLCHIP PXX 4K EEProm PLCHIP Po oei Intemal Quadrature Encoder Interface PLCHIP Po gc Intemal PLCHIP PXX Real Time Clock PWM Pulse Width Modulator SD_CARD SD Card Serial Print Serial Print SPIO SPIO SPI1 SPI 1 TimerCounter Hardware Timer Counter UART2 UART2 Variable Names Figure 13 17 For this example select the Modbus Slave and click ox The Modbus Slave Properties dialog will open This dialog is used to specify which hardware interface will be used for this Modbus Network Click the app button The Add Interface dialog will open Using the drop down Interfade menu select the actual hardware inter face Ethernet The Ethernet must already be installed prior to this step Enter the Number of TCP Sockets based on your needs See Figure 13 18 For details on installing Ethernet see Chapter 19 Ethernet Q If Modbus Master was selected the Number of TCP Sockets is not available b
23. 1 Not Seen 2 Data Error 3 Not Supported 4 Data Reserved Transmitting Data with J1939 With the J1939 network configured in the Project Settings of EZ LADDER Toolkit data may be transmitted using the ladder diagram To transmit data using J1939 NMEA 2000 the J1939_ TX _PGN Function block is used This function block is automatically added to the functions drop down list when J1939 NMEA 2000 is installed in the project settings To transmit data use the Functions drop down box on the toolbar and select J1939_TX_PGN Click the INSERT FUNCTION button and then click in the ladder diagram workspace where you want to insert the J1939 _ TX_PGN function block The J1939 TX Properties dialog box will open This box is used to configure this specific instance of the J1939 TX _PGN function used in the program Refer to Figure 14 28 The J1939 RX Properties must be configured for each insert of a J1939 RX_PGN function block as each insert is a unique instance of the function block EZ J1939 Tx Properties Can Port Block Name J1939_TX_PGN1 PGN Description DEES Priority Broadcast Rate NMEA2000 PGN Access Priority Access B Cast Rate Access F SPN Description SPN Field Settings Gain Offset Destination Address Map Variable Figure 14 28 Using the drop down menu select the CAN port for the J1939 NMEA 2000 network Along the left side of the dialog belo
24. I q Contacts Functions Variables CR2 DIV CR3 i Labels Bit3 VarOut Blue Indicates 5 No Power Flow 6 4 mm j Ready Figure 6 7 Scan Time Scan time is calculated in real time updated and displayed in the Scan Time Field The scan time is always represented in milliseconds The scan time resolution is target specific For more information on scan time please see Chapter 3 Ladder Diagram Basics Starting and Stopping Program Execution The program on the target can be stopped and started again using the EZ LADDER Toolkit when in Monitor Mode and connected to the target V V To Stop a program from executing on the target on the tool bar click the Stop button This can be useful when troubleshooting and diagnosing ladder diagrams that do not operate as expected To Start a program executing on the target on the tool bar click the Go button This can be useful when troubleshooting and diagnosing ladder diagrams that do not operate as expected Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 69 Chapter 6 Downloading amp Running Projects Hover Boxes Another useful feature that can be utilized in real time monitoring is the use of hover boxes When the mouse pointer is hovered over an object a hover box will appear that provides additional information in re gards to the function or object including its name and current status Figure 6 8 shows a typical hover box
25. P Series EZ LADDER Toolkit User Manual 224 Chapter 23 Hardware Targets HEC P5xxx Series Each HEC P5xxx model supports different features and function blocks based differences in the internal hardware When any HEC P5xxx model is selected in the Project Settings some supported functions are automtically installed while others must be manually installed HEC P5000 Features On Board Real Time Clock Retentive Memory FRAM 480 bytes 16 Digital Inputs Sink Source DC 12 PWM On Off Digital Outputs DC 4 On Off Digital Outputs DC Quadrature Input 3 High Speed Counter Timer Inputs NPN PNP SD Card Support 2 Analog Inputs Range Type Field Adjustable Supported Function Blocks Less Than lt Less Than Equal To lt Not Equal To lt gt Equal To Greater Than gt Greater Than Equal To gt Absolute Value ABS Arc Cosine ACOS Addition ADD Arc Sine ASIN Arc Tangent ATAN Bitwise AND AND Average AVG Bit Pack BIT_PACK Bit Unpack BIT_UNPACKk Convert to Boolean BOOLEAN Compare CMP Cosine COS Count Down CTD Count Up CTU Count Up Down CTUD Division DIV Drum Sequencer DRUM_SEQ EEprom Read EEPROM_READ EEprom Write EEPROM_ Write Exponential EXP Power Function EXPT Falling Edge Detect rt TRIG Floor FLOOR Get Date GETDATE Get Time GETTIME Hysteresis HYSTER Convert to Integer INTEGER J1939 Receive PGN J1939_RX_P
26. PROJECT MENU The PROJECT Menu is used to view and configure Project target settings including hardware target selec tions and installing and configuring optional target features Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 18 Chapter 2 Navigating EZ LADDER Toolkit Settings The Settings menu item opens the Project Settings Dialog This dialog is used to configure the actual hardware target controller and its features The target is selected from the available list Depending upon the target selected additional configuration settings may be required and additional features can be configured from this menu Refer to Chapter 4 Configuring Targets for detailed information regarding target configurations Bootloader The Bootloader menu item will open the Bootloader dialog window This window is used to install or update hardware target kernels and to configure some features such as the SD Card Ethernet and USB The Bootloader menu item is only available in the Run Mode OptiCAN The OptiCAN menu item will open the OptiCAN Configuration Tool This tool is used to configure the OptiCAN network The OptiCAN menu item is only available in the Run Mode and when OptiCAN is enabled and supported REPORTS MENU The REPORTS Menu is used to generate view and print reports that may be helpful when developing a lad der diagram project Variable Definitions The Variables Definitions report generates a list of all varia
27. Q O Di en Type integer Real Boolean Timer Active Sate Other Dorais ren mot fT XT tree CS RSC ERR ECCE C OO Eemere o owe x S o owm x _ Resuttof exponentiation Example Circuit EXPT EN 0 BaseNumf PI O j NumOut Exp Fe P2 Related Functions EXP LN SQRT LOG Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 2195 Chapter 24 Function Reference FLOOR FLOOR Description The FLOOR function provides a rouned down output of P1 input The output O is the is the EN Q rounded down number The enable EN must be true for the FLOOR function to be en abled Input Output Connections PI o The FLOOR function block placement requires connections of two input pins EN P1 and two output pins Q O en Type integer Real Boolean Timer Active State Other Dorais Cen mot fT REECH a ERR ECCE o ow EE EE of ow ff x __ Reanded Down P7 Base Number Example Circuit Related Functions CEIL Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 2 6 Chapter 24 Function Reference F_TRIG F_TRIG Description CLK o The F_TRIG is a function that may be used to trigger another function on the falling edge of a transition When the CLK detects a true to false transition the output Q is energized for one scan of the program only Input Output Connections The F_TRIG function block placement requires connections of o
28. Read Holding Registers will support from 0 to 65535 registers however these two groups of registers are unique and independent from each other Typically the following register types are supported Coils Discrete Inputs Inputs and Holding Registers Using these groups of registers a master can read and write as needed for communication Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 117 Chapter 13 Modbus Networking sl PLCHIP PXX Target Properties BCPN PLCHIP P13 5122 r Figure 13 14 Coil Registers Coils registers are registers that are written to by the Master Using these registers the master can directly control coils located in the ladder diagram project internal only Discrete Input Registers Discrete Input registers are registers that are read directly by the Master Using these registers the master can directly monitor the status of contacts located in the ladder diagram project inter nal or real world Input Registers Input registers are registers that may be read by the Master but can only be written to by the slave itself Using these registers the slave can set data that the master can view but not modify Holding Registers Holding registers are registers that may be read and modified by both the Master and Slave These are the most commonly used registers to pass data between the master and slave Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 118 Chapter 13 M
29. The mouse pointer is located over the contact CR2 Notice the hover box is now shown and identifies the contact by name type and it s current state or value Le EZ EZ Ladder Standard AnotherProgram did EZ File Edit View Project Reports Window Help a x tD gA T BEE O Ee Status Running Program Name AnotherProgram Program Version 0 0 0 0 Build Number 5 Scan Time ms lt 0 10 CRI CHA EN E 3 Coils 1 Ir Contacts Functions Variables CR2 DI CR3 Labels NORM_OPEN_CONTACT INTERNAL Value 0 Bit3 YarOut RBit3 Figure 6 8 Changing Variable Values EZ LADDER Toolkit provides an option for changing the value of a variable while the ladder project is ex ecuting Double click on the object and an dialog box appears with the current state or variable value This box is changeable and the value may be changed Change the value as needed and click ox The changes take place immediately The change does not affect the actual ladder diagram in the Edit mode only the executing program This is helpful for adjusting timer and counter values in real time during debugging Changing a contact variable boolean does not always have the desired effect For example Ifthe l value of an internal coil that is connected to a real world input is changed using the dialog box the actual value will change only until the next scan and then will revert t
30. This chapter provides detailed information on understanding the origin of ladder diagrams as they relate to original relay logic basic ladder diagram symbols power rails links types of circuit connections and ladder diagram functionality Chapter Contents Relay Logic vs Ladder Diagram ccsccccssseeseeeeceeeeeeseeeeeeeeeseseeseeeeeeenens 26 Basic Ladder Diagram SyMbols ccccssecsseeeeeseeneeeseeeeeeeeeeesseneeseeneenes 27 COI eege 27 e 27 Power Rails e D E lo 28 Eed EE 28 Bil 28 STEEN FY CS resin ae E TT 29 Understanding Ladder Diagram Functionality cccccsseesseeeeeeeeeees 30 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual Chapter 3 Ladder Diagram Basics Relay Logic vs Ladder Diagram Prior to the invention of the Programmable Logic Controller PLC control panels consisted of large num bers of relays motor starters and other devices wired to create the required functionality Today with the use of PLCs the same functionality is achieved by drawing the circuit functionality in software similar to the original relay logic panel wiring diagrams were drawn Ladder Diagram is a graphical representation of boolean equations using contacts inputs and coils out puts The ladder diagram language allows these features to be viewed in a graphical form by placing graph ic symbols into the program workspace similar to a Relay Logic electrical diagram Both ladder diagram and
31. development Device Defined registers for I O and other devices have preset definitions of register use and cannot be changed Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 132 Chapter 14 CAN Networking Common Configuration Command Register Assignments These registers are pre assigned and cannot be altered These register s contents may only be modified by a controller and can only change the I O setting Register Number Name 1 Desertpton 1 _Read Write Node ID The node s ID Number Read Write Common Broadcast Register Assignments These registers are pre assigned and cannot be altered Register Number Nom Desertpten _ Read Write 250 249 248 247 246 245 244 243 242 241 Node Status This Node s Status Read 190 CAN Transmit Errors CAN Transmit Error Counter Read 189 CAN Receive Errors CAN Receive Error Counter Read a The Node Status register 191 is represented by a 32 bit number The lower 16 bits represents the current status code while the upper 16 bits represents the error code There are three status codes supported on the OptiCAN network The status codes are 1 Reset 2 Active and 4 Error If the error code returned is O then typically the network was not started Error codes are divided into two groups Device specific errors are numbered 0 32767 while common error codes are numbered 32768 65535 Common Error Codes are as follows 65535 C
32. listed in the Devices pane under the Devices section Click the app pevice button The Targets Devices window will open All the available devices and features for the target are shown in the Devices section Scroll down and find Keypad Figure 10 1 shows the Targets Devices window Le al PLCHIP PXX Devices o Ramtron FM24XXX FRAM LC CH 12C 0 12C1 12C 1 12C2 I2C 2 LCD LCD Display Low Voltage Sense Low Voltage Sense Active Low LS7366R 32 Bit Quadrature Counter SPI MCP3204 Microchip 4 Channel 12Bit A D Converter SPI Modbus Master Modbus Master Modbus Slave Modbus Slave Variable Names Name COL1 COL2 COL3 Figure 10 1 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 90 Chapter 10 Keypad Support Click Keypad and click ox The Devices window will close and return to the Target Properties window The Device section will now list the Keypad as an installed device Refer to Figure 10 2 No additional configuration is required to begin using the Keypad Click ox close the Target Properties win dow and click ok again to close the Project Settings window Use the File Menu and Save the ladder dia gram project The keypad matrix can now be utilized from the ladder diagram project r ail PLCHIP PXX Target Properties oje DCPN PLCHIP P13 5122X g Devices Device B Intemal i PWM Figure 10 2 Getting Data from the K
33. while function blocks typically require you to insert any needed variables and link them without being prompted to do so We will identify how to create and assign variables using two methods although variable creation is basi cally the same for all methods Placing Contacts and Coil Type Objects To place a contact from the tool bar select the Direct Contact and locate a point in the workspace to place the item Clicking that location will place the object When placing certain objects coils and contacts a Contact Properties dialog box will appear You can choose a variable that already exists from the drop down list or type in a new name For this example we will type in a new name and click ox If you had selected a name that already exists the object placement would be completed Since we have chosen a new variable the dialog in Figure 5 3 will appear EZ LADDER end a Variable doesn t exist Figure 5 3 Click yes to create the new variable The Add Variable dialog box will open automatically with the variable name you entered already in the Name field See Figure 5 4 For now click ox to create the variable We will cover the details of variable attributes later in this chapter You have now successfully created a con tact with a new variable Repeat the same as needed for new contacts or coils aO Add Variable Name Description m Vanable Type Input Var VO Number C Output Default Value Ce Internal
34. 12 shows the Target s Devices window aO PLCHIP PXX Devices Name Description Low Voltage Sense Low Voltage Sense Active Low LS7366R 32 Bit Quadrature Counter SPI MCP3204 Microchip 4 Channel 128i A D Converter SPI Modbus Master Modbus Master Modbus Slave Modbus Slave Optic AN Divelbiss OptiCAN PLCHIP_Paoe_eeprom Intemal PLCHIP PXX AR EEProm PLCHID Px oei Intemal Quadrature Encoder Interface PLCHIP_ De gc Intemal PLCHIP PXX Real Time Clock PWM Pulse Width Modulator SD_CARD SD Card Serial Print Serial Print SPIO SPI 0 SPI1 SPI 1 TimerCounter Hardware Timer Counter Figure 13 12 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 116 Chapter 13 Modbus Networking Select the Modbus Slave and click ox The Modbus Slave Properties dialog will open This dialog is used to specify which hardware interface will be used for this Modbus Network UARTx Ethernet Click the app but ton The Add Interface dialog will open Using the drop down Interfade menu select the actual hardware in terface to use UART or Ethernet must already be installed prior to this step Enter the Slave ID of this unit 1 255 select the Uart Properties as RTU or ASCII based on your needs See Figure 13 13 The packet Transmit Delay defaults to 3 5 and typically it does not need to be adjusted aO Add Interface eben Uart Properties Slave ID 5 RTU ASCII Packet Transmit Delay 35 Character Times Figure 13 13 E
35. 15 3 If using structured text when all the chip selects have been reserved click ox The Target s Devices window will close and the previous target properties window will now list the SPI port as an installed device Click ox to close the Target Properties window and click ox to close the Project Settings window Be sure to save the ladder diagram project The SPI port is now installed and ready to be used and additional SPI devices may be installed and used in the ladder diagram Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 161 Chapter 15 SPI Devices and Support Installing Supported SPI Bus Devices The following SPI devices are supported by EZ LADDER Toolkit LS7366R 32 Bit Quadrature Counter The LS7366R is a 32 bit Quadrature Counter integrated circuit with an SPI interface EZ LADDER Toolkit has built in software support for using this device on an SPI port The LS7366R is a hardware device and requires additional circuitry and knowledge to interface it an EZ LADDER supported target This chapter discusses the basics of using the LS7366R in the ladder diagram and minor references to hardware when needed LS7366R SPI support is based on actual hardware targets Refer to the targets User Manual or Chapter 23 Hardware Targets to determine if SPI devices are supported Installing the LS7366R in the Ladder Diagram Project To be able to use the LS7366R in an EZ LADDER Toolkit ladder diagram project the L
36. 277 GETDATE 0 cescessessccecsessesessessesssessecessesuesusarsasstsatsssesaesussesaessstsatsesseeaseaee 278 pt TE 279 GREATER THAN Tel 280 GREATER THAN OR EQUAL TO fe 281 HSTER EE 282 INTEGER nonssaansonennsosenneosennenennsonenrennnnrensanrennnntennnntenanntonanntnnanneonannennanrennans 283 INVERTED COU 284 INVERTED CONTACT nsnnsosannsonannnoeennnoeennnoennnnnennnnnnnnennnennnnnnnnnnnennnnrrnnane 285 J1939_RX_PGN ooecccccsecceccessececsessesecsessesuesessesassesassessesuesessesaesessesassesateaeees 286 J1939_TX_PGN oueeccccecsececcessececsessesessessesuesessesssesacsessessesessesaesessesassteaeeseees 288 IMP oon ccsescccesseseccecsesesessesacsessessecussesuesessesaesussesuescsesassessesaesnsstsaesnsansaesesseeas 290 AAN 291 KEYPADD2 c ccssessecsssesececsessesessessesessessecssesuesessesaesessessesnssesssusateesesseeaeeess 292 EE EE 294 LATCH COIL c ccssessecessecesecsessesessesaesssesaesecsesuesessesassessesatsrateaesesseeaeeess 295 LOD CLEAR EE 296 LCD PRINT oossssaannsonannsosanneosennsonenrennnrensnnrensnnrennrennnnneonnnntnnnnennnnnennanrennans 297 LESS THAN S ecccsssssecessecececsessesecsesacsussessesecsesaesessesatsussesaesiratsatsessteaeeess 299 LESS THAN OR EQUAL TO feel 300 LIMIT escesseceecesseseccessesucccsesucsssesessesaesssessesueeesaesessesatsessessesnssesassesatenesnsaees 301 EE 302 Kole 303 N 304 AT EE 305 MIN 306 del ME 307 MODBUS_ MASTER on naannnonannnonenenoeennnosennensnnnnnnnnnnnnnennnnenen
37. Bit Length Gain Offset and Data Type For NMEA 2000 the SPN is the Field Use the save and saveas buttons to set the filename of the user J1939 database and save update as new PGNs are added The crose button is used to close the editor Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 149 Chapter 14 CAN Networking and addtional not in the database you will need to add ALL the PGNs that you require to the User l Since the J1939 database cannot be edited if you require PGNs from the Standard J1939 database J1939 database Refer to Figure 14 21 To select your User J1939 database uncheck the Use Standard J1939 Database and click the BRowsE button Browse to the location your J1939 database is located and click open The location of your User J1939 database should now be locate in the box Ensure all the J1939 settings are correct and click ok with the User J1939 Database selected to close the CAN port Properties window Exit out of all the remaining project settings windows Be sure to save your ladder diagram project Advanced J1939 Configuration EZ LADDER Toolkit provides advanced configuration options for J1939 These configuration items may be adjusted if the default configuration is not sufficient for the application With the J1939 Properties window open See Figure 14 20 click the ADvANcED button The J1939 Advanced Properties window will open The currently shown settings are the default transmit and receiv
38. Broadcast Rate for th PGN are stored in the database but may be overridden for this instance of the J1939 TX _PGN function block The SPN Settings are based on the settings from the J1939 User database These values may be adjusted for this instance of the function block The adjustable values include the Gain and Offset The Gain and Offset for the SPN are stored in the database but may be overridden for this instance of the J1939_ TX _PGN function block The next step is to identify where the SPN data that will be broadcast will be gathered from All J1939 broad cast data must be mapped from variables To set the variable s used click the MAP VARIABLE button The Map Variable dialog will open Using the Browse buttons select the variable to gather the transmit data from Tx Data For NMEA 2000 Commanded Data select the variable for the Rx Command NMEA2kK Click ok when the variables have been set Refer to Figure 14 29 Refer to the NMEA 2000 specification regarding Commanded Data Q Double clicking the SPN will open the Map Variable dialog EZ Map Variable Tx Data Browse Rx Command NMEA2K R o a Figure 14 29 Repeat these steps for any SPN of the selected PGN you want to transmit data as in this instance of the J1939 TX _PGN function block Figure 14 30 shows one SPN selected and mapped to variables for PGN 61442 Q Multiple SPNs may be mapped to a variables in one J1939_TX_PGN function block instance provid
39. Chapter 23 Hardware Targets OptiCAN Networking availability is based on actual hardware targets Refer to the target s User Manual or Chapter 23 Hardware Targets to determine if OptiCAN is supported Using the Project Menu choose Settings The Project Settings window will open as previously covered in Chapter 4 Configuring Targets Select the target and click the properties button The Target Properties window will open From the drop down menu DCPN select the model part number of the target If OptiCAN were installed it would be listed in the Devices pane under the Device section Click the app Device button The Target s Devices win dow will open A CAN port must be installed prior to installing OptiCAN See Installing CAN Network Ports earlier in this chapter All the available devices and features for the target are shown in the Devices section Scroll down and find the OptiCAN Figure 14 3 shows the Targe s Devices window oJ PLCHIP PXX Devices Name Low Voltage Sense Modbus Master Modbus Slave PLCHIP_Paoe_eeprom PLCHIP_Paoe_gei PLCHIP De gc PWM SD_CARD Serial Print SPIO SPI1 TimerCounter Variable Names Name Figure 14 3 Description Low Voltage Sense Active Low 32 Bit Quadrature Counter SPI Microchip 4 Channel 12Bit A D Converter SPI Modbus Master Modbus Slave Divelbiss OC AN Intemal PLCHIP PXX 4K EEProm Intemal Quadrature Encoder Interface Intemal PLCHIP PXX R
40. Connections When the EN ENABLE is true the function block is active and will transmit J1939 NMEA 2000 data as con figured based on broadcast rates The transmitted data is read from the mapped variables The Q Output is true when the EN is true H Can Port CANO Block Name J1939_TX_PGN1 PGN Description PGN Settings Tx Only Mapped Variables D 61442 Electronic Transmission Cont Priority 3 61443 Electronic Engine Controller Broadcast Rate 50 61444 Electronic Engine Controller NMEA2000 61445 Electronic Transmission Cont PGN Access 65217 High Resolution Vehicle Dist ger Ate B Cast Rate Access Boa Sow Mhdd Da Se ae ID a ST GE L Description SPN Field Settings EZ 29 Accelerator Pedal Position 2 Gain Offset 91 Accelerator Pedal Position 1 i 92 Engine Percent Load At Curr 358 Accelerator Pedal 1 Low Idle 559 Accelerator Pedal Kickdown R ATA Le BEE E WEE EE O v E ES Fi H 1 CAN Port Select Drop down box to select the CAN port network to be used for this J1939 transmit function block 2 PGN Pane Select the PGN to transmit with this receive function block Only one PGN per function block is allowed Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 288 Chapter 24 Function Reference 3 SPN Pane 4 Map Variable Button 5 PGN Settings 6 SPN Field Settings 7 Destination Address Area 8 Mapped Variables Area Example Circu
41. Declarations tab to view the user defined items Single Click to highlight the FunctionBlock or Function heading in the User Declarations tab Right click and select the ADD from the menu te Ze Je A new function block will be created and opened in the Function Pane This function block will have all minimal requirements including the function block beginning and ending code required This function block can be edited and added to as required To quickly add a standard function Target specific function or variable to the function function block place the cursor as the desired insertion point in the function function block click the appropriate tab and double click the desired function to add The item is added into the location selected in the user defined function function block The next step with your code added is to verify the user defined function function block In the ST Editor window click the Verify item from the menu In the Output Pane either an error message will be seen or the Verify Passed will be seen If an error message is shown the error must be corrected before proceeding If the Verify Passed is shown it is time to save the function function block An unverified function or function block may be saved without verification but it will not be usable until it is verified and will not show in drop down menu to call the function or function block from the ladder diagram To save the user defined function or fun
42. ER ERROR output stores the current status of the data received from the PGN The SA is the Source Address output It must be connected to an integer variable This variable will store the Source Address of the last receive which address this PGN was received from The DA is the Destination Address output It must be connected to an integer variable This variable will store the Destination Address of the last receive if the PGN had a specific destination in the broadcast packet If the broadcast was a global broadcast then the DA does not apply 2 ne he J1939 Rx Properties Description Electronic Transmission Con Electronic Engine Controller Electronic Engine Controller EZ E Electronic Transmission Cont mites Resolution Vehicle Dist Descriptio Transmission Input Shaft Sab Transmission Output Shaft 5 Percent Clutch Slip Transmission Driveline Engat Transmission Torque Conver CTA ss CLE Te M 4 a as Source Address Map Variable Source Address to Recenve From 0 RSC Divelbiss Corporation P Series EZ LADDER Toolkit User Manual Can Port ee g E Receive from all addresses Block Name J1939_R4_PGN1 PON Settings Tx Only Mapped Variables Priority 3 Broadcast Rate 100 NMEA2000 PGN Access Priority Access B Cast Rate Access SR SPN Field Settings Gain 0 125 Offset Request Type 0 A Request message will be transmitted every Isec if Request Type is choosen
43. Kernel and EZ LADDER Toolkit and Licensee wishes to secure certain rights to use such software and Divelbiss is prepared to license such rights subject to the terms and conditions of this Agreement therefore in consideration of the mutual covenants contained herein and intending to be legally bound hereby Divelbiss and Licensee agree as follows 1 Licensed Software The PLC ON A CHIP Kernel and EZ LADDER Toolkit software whether in source code or object code format and all related docu mentation and revisions updates and modifications thereto collectively Licensed Software is licensed by Divelbiss to Licensee strictly subject to the terms of this Agreement 2 License Grant Divelbiss hereby grants to Licensee a non exclusive non transferable license to use the Licensed Software as follows a Except as otherwise provided herein one 1 user may install and use on one 1 desktop personal computer and on one 1 portable personal computer the EZ LADDER Toolkit i to develop test install configure and distribute certain applications on certain hardware devices such as programmable logic controllers each a Resulting Product and ii to configure the PLC ON A CHIP Kernel on designated processors which shall constitute Resulting Products b Licensee may copy the EZ LADDER Toolkit only for backup purposes c Licensee may not amend modify decompile reverse engineer copy except as expressly authorize
44. LADDER Toolkit The standard EZ LADDER Toolkit license agreement allows the EZ LADDER Toolkit to be installed on up to two computers usually a PC and a laptop To install on a second computer install the EZ LADDER Toolkit and Activate it as was done on the original computer If you attempt to activate a serial more than two time unless you have purchased a site license O the activation will fail as the serial number has been activated the maximum number of allowed times If you are re installing due to a hardware failure or moving computers Contact Divelbiss Customer Support to allow additional activations Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 13 CHAPTER 2 Navigating EZ LADDER Toolkit This chapter provides detailed information on the basics of navigating and using the EZ LADDER Toolkit s workspace menus tool bars and windows Chapter Contents EZ LADDER Toolkit Overview siviiccusisiiiseiscinsimmnsearnsiedsemeancriaradceawinnnerewens 15 EZ LADDER Toolkit MenuS eguungteeg geegent due ege 16 RILE ME NU eege 16 RIIT BE 17 17 VEW MENU D 18 PROJECT MENU WE 18 REPORTS MENU E 19 WINDOW MENU EE 19 HELP E 20 EZ LADDER Toolkit Tool Bars and Tool Bar Buttons sceeee 20 Ladder Diagram WorkSpace ccccscecesseeeeeseeseeeeseeeeeseseseeeeeeesseeeseneenees 22 Cross Reference Window Pane ccssssecssseeseeseeeeeeeeeeenenenseneeseaeeesenes 23 Output Window TE 24 O
45. Name SERIAL_PRINT1 Description Text PSl d Figure 11 9 When a SERIAL_PRINT function is used to transmit variables a new variable input is added to the function block automatically for each variable that will be transmitted The SERIAL_PRINT function block is rising edge sensitive Therefore it will only transmit one time Gi as the ENable input goes high If data is required to be transmitted repeatedly it must be programmed into the ladder diagram project as part of the ENable control on the SERIAL_PRINT function block Every placement of a SERIAL_PRINT function block will use available RAM For most ladder diagram projects there is an more than enough RAM however ladder diagram projects with heavy memory usage functions could run short on RAM Q For more detail on all EZ LADDER Toolkit Function Blocks and objects refer to Chapter 24 Function Reference Additional Serial communications is available using Modbus and Structured Text For Modbus Master Slave see Chapter 13 Modbus Networking For Structured Text see Chapter 26 Structured Text Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 102 CHAPTER 12 Real Time Clock This chapter provides basic information to understand how to install configure and use the Real Time Clock in the EZ LADDER Toolkit Chapter Contents Installing the Real Time CIOCK cccccessseceeeseeeceeeeeeeeneeseaseeseaseessnenenses 104 Using the R
46. OTR register and then the OTR registers is output at the function blocks count CT output DTR is used to set the count value and may be used as a comparison see LFLAG DFLAG The first step is to configure the LS7366R While targets may differ slightly this configu ration is found by clicking the Menu then Project Settings Look for a button LS7366R Properties Clicking this button will open the LS7366R Device Properties Window In this window configure the LS7366R for the type of application type of counting along with op tional settings LS7366R Device Properties Window a LS7366R Device Properties SPI Port SPI CS Output GPO17 Quadrature Mode Count mode Index Mode Non quadrature A CLK B DIR Freetunning Disable index Asynchronous Index CH NI Single cycle Load CNTR Synchronous Index E X2 5 Rangeimit 5 Reset CNTR SA 5 Modulo n Load OTR LFLAG DEL AG Fag on IDX E Fag on CMP E Fag on BW E Aag on CY Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 251 Chapter 24 Function Reference Quadrature Mode Non quadrature Counter input B sets the direction of counting increase or decrease and a pulse on input A causes the counter to count by 1 X1 quadrature Counter operates in X1 quadrature mode X2 quadrature Counter operates in X2 quadrature mode X4 quadrature Counter operates in X4 quadrature mode Count Mode Free Running Free running m
47. OptiCAN registers based on the network condition These conditions may be monitored using function blocks One node on the OptiCAN network MUST broadcast the heartbeat message for the network to function properly Although it is possible to have multiple controllers on one network sending heartbeats it is recommended only one controller broadcast a heartbeat per network In the event the heartbeat is lost then the local ladder diagram project should ignore data from the network as the loss of heartbeat signifies that communication with part or all of the network has been lost How a controller responds to a network loss is entirely dependent on the ladder diagram project Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 129 Chapter 14 CAN Networking Installing a Controller on the OptiCAN Network Before a controller may communicate on the OptiCAN network it must be installed in the EZ LADDER Tool kit Once the OptiCAN settings are configured they are stored in the actual ladder diagram project Please see the following steps required to install and configure the OptiCAN network feature on a controller Actual menus steps to reach the OptiCAN configuration may vary based on the actual controller used but the con figuration itself is always the same Divelbiss standard controllers based on PLC on a Chip Enhanced Baby Bear PCS XXX etc are configured based on the part number For details on specific targets please see
48. Other Details EN Px awene oO fC S a SSES SE SE E SE Example Circuit Related Functions ADD MULT DIV ABS ON _ 2 a Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 342 Chapter 24 Function Reference TAN TAN Description EN QO The TAN function provides the Tangent O from the input value P1 The enable EN must be true for the TAN function to be enabled The Q output is true when the TAN function is enabled Input Output Connections PI 0 The TAN function block placement requires connections of two input pins EN P1 and two output pins Q O x ameme OSS SS SS SE Rm SCH out Example Circuit TAN EN Q Daschumta PI O jm NumOut_ Related Functions ASIN ATAN COS SIN ACOS Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 343 Chapter 24 Function Reference TIMER TIMER Description EN Q The TIMER function converts the input P into an Timer output O The enable EN must be true for the TIMER function to be enabled The Q output is true when the TIMER function is enabled The O output is a representation of the P input value in milliseconds 5 5ms 1000 1 Second P 0 In addition to converting an Integer or Real to a Timer the Timer function block can be used to copy one timer to another Input Output Connections The TIMER function block placement requires connections of two input pins EN P and two output pins Q
49. P Series EZ LADDER Toolkit User Manual 268 Chapter 24 Function Reference Example Circuit JRUM_ GEO UM SEO UM SEO Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 269 Chapter 24 Function Reference EQUAL TO EQUAL TO Description EN Q The EQUAL TO function provides an equal to comparison for the Px inputs The number of inputs is specified when the object is placed The Q output is true if all the Px inputs are equal The Enable must be true for the EQUAL TO function to be enabled Input Output Connections Pl The EQUAL TO function block placement requires connections of at least three input pins EN P1 P2 and one output pin Q The EN is always considered an input in the total number of inputs therefore always add one to the number of Px inputs that need to be used RP eps type Integer Real Boolean Timer Active State Other Detais e f me x Actes Pf m x x _ _ _Namberofinputsis dynamo o om eS Example Circuit Related Functions lt gt lt gt lt gt Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 2 0 Chapter 24 Function Reference EEPROM READ EEPROM_READ Description EN Q The EEPROM_ READ recalls variables stored in non volatile memory EEPROM The function is enabled when a false to true is seen on EN AD provides the actual address to read from and V is the actual value that is read from the EEPROM
50. SPI clock else uses high SPI Clock 16 20000 to capture data on first clock transition CPHA 0 else CPHA gets set to 1 Low 8 bits are data fram size 4 16 Typical size is 8 bits clkrate clock rate in Khz maximum 10 Mhz UDINT GPIO GPIO number for chip select of SPI device UDINT txbuff Array for data transmit USINT rxbuff Array for data receive USINT len Number of frame transfer sized based on data fram size UDINT of bytes transferred or negative value if error occurs On P Series targets minimum clock rate is 2KHz Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 371 Chapter 26 Structured Text Target Specific Function Description Details EEN Controls UART enable BOOLvar EZ_UartEnablelsr FD_x status Parameters FD X File Descriptor Status 0 or 1 True or False BOOL If False disables interrupt and disables UART read write functions won t work EZ_UartGetBytestoRead Gets the number of UART bytes available to read DINTvar EZ UartGetBytesToRead ED vi FD_x File Descriptor of bytes avalible to read in the receive buffer ies Notes If using RS485 this will turn off the RS485 tranmsitter after all of the characters have been transmitted Ska Reads data from a UART serial port DINTvar EZ_UartRead FD_x rxbuff offset len Parameters File descriptor Buffer to store received data ARRAY of USINT Zero based offset into buffer to start writing
51. ST_FUNC_BLKk Subtraction SUB Tangent TAN Convert to Timer TIMER Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 226 Chapter 23 Hardware Targets HEC P5100 Features Retentive Memory FRAM 480 bytes 16 Digital Inputs Sink Source DC 12 PWM On Off Digital Outputs DC 4 On Off Digital Outputs DC Quadrature Input 3 High Speed Counter Timer Inputs NPN PNP SD Card Support Supported Function Blocks Less Than lt Less Than Equal To lt Not Equal To lt gt Equal To Greater Than gt Greater Than Equal To gt Absolute Value ABS Arc Cosine ACOS Addition ADD Arc Sine ASIN Arc Tangent ATAN Bitwise AND AND Average AVG Bit Pack BIT_PACK Bit Unpack BIT _UNPACKk Convert to Boolean BOOLEAN Compare CMP Cosine COS Count Down CTD Count Up CTU Count Up Down CTUD Division DIV Drum Sequencer DRUM_SEQ EEprom Read EEPROM_READ EEprom Write EEPROM_ Write Exponential EXP Power Function EXPT Falling Edge Detect F_TRIG Floor FLOOR Get Date GETDATE Get Time GETTIME Hysteresis HYSTER Convert to Integer INTEGER J1939 Receive PGN J1939_ RX_PGN J1939 Transmit PGN J1939_ TX_PGN Jump JMP Label Latching Coil LATCH Limit LIMIT Natural Logarithm LN Base 10 Logarithm LOG Modbus Master MODBUS_MASTER Moving Average MAVG Maximum MAX 2 Analog Inputs Range Type Field Adjustabl
52. Series EZ LADDER Toolkit User Manual Beginning with this release of EZ LADDER Toolkit Windows 2000 and earlier versions are no longer Chapter 1 Getting Started 4 Complete the Name Organization fields and enter the Serial Number Do not click the SELECT LICENSE XML button This button should only be used under Divelbiss personnel supervision Click NEXT The serial number entered is used during O activation If the serial number is not correct you will not be able to activate your EZ LADDER Toolkit later 5 Use the default location for installing the EZ LADDER Toolkit or browse and select a different location Click NEXT 6 All the information is gathered Click INSTALL to install the EZ LADDER Toolkit The EZ LADDER installer will copy all the required files and create a shortcut 7 When installation is complete click FINISH Divelbiss Corporation P Series EZ LADDER Toolkit User Manual EZ EZ Ladder Toolkit 1 1 0 0 Setup gr e io Registration Information Please enter your information Serial Number 000 0001 001 License File C Program Files x86 Divelbiss Corporation EZ Ladder Toolkit 5 9S manm EZ EZ Ladder Toolkit 1 1 0 0 Setup e gr em e Lo Choose Install Location Choose the folder in which to install EZ Ladder Toolkit 1 1 0 0 Setup will install EZ Ladder Toolkit 1 1 0 0 in the following folder To install in a different folder click Browse and select another folder Click
53. Series EZ LADDER Toolkit User Manual 21 Chapter 3 Ladder Diagram Basics Direct Coil lt Also known as a normally open coil the direct coil may represent real world outputs or internal relay coils As a real world output when the coil is energized TRUE it will be cause the real world output to be TRUE energized As a real world output when the coil is de energized FALSE it will cause the real world out put to be FALSE de energized When used as an internal relay it controls it s contact s state Negated Coil Also known as a normally closed coil the negated coil may represent real world outputs or internal relay coils As a real world output when the coil is energized TRUE it will cause the real world output to be FALSE de energized As a real world output when the coil is de energized FALSE it will be cause the real world output to be TRUE energized When used as an internal relay it controls it s contact s state and is always opposite of the Direct Coil Power Rails and Links Power Rails As previously discussed an EZ LADDER Toolkit ladder diagram contains objects contacts coils and func tion blocks For the ladder diagram to operate correctly each rung must be complete on each side by con necting it to the left power rail and the right power rail This is required because all objects in a rung must have a power source the left power rail to provide power to the objects and a common retur
54. State Other Demis en tot Tx Ring vce err out x leren a a eer ef ow fi x Tre enti compel Example Circuit CRI LCD_PRINTI Text Message Formatting The LCD_PRINT function text formatted per ANSI C printf Variables as well as text may be printed These variables must be formatted correctly As variables are added to the text the function block will auto matically add the appropriate input for the variables Text Text is entered exactly as the message is intended Printing text longer than the display will support will result in truncated printing It is ideal to structure printing based on column and row and to verify length of the printing Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 297 Chapter 24 Function Reference Variables Variables are placed in the text using flags and print specification fields The following is the configuration for adding variables to the text flag width precision identifies the beginning of a variable or other type of text entry Example Text OIL PSI 3d flag This flag is optional Use the following flags to change the way data is transmitted Flag Description Left align the variable within the specified width Default is align right 0 If width is prefixed with 0 leading zeros are added until the minimum width is reached If 0 and are used together the 0 is ignored If O is specified in an integer format the 0
55. This should be the CAN port connected to the J1939 network With the CAN port selected other items then become available to configure The available l configuration items is dependent upon the mode selected previously listen or claim address Figure g 14 21 illustrates the dialogs configured each way In listen mode the amount of configuration items is reduced significantly Configure the items as required for the specific application requirements for interfacing to J1939 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 146 Chapter 14 CAN Networking Listen Only Mode al CANO Properties me J1935 Device E NMEAZ000 Device Prefered Fixed Source Address elt Ce te p test Wielt tay p teat te User J1939 Database Use Standard J1939 Database Figure 14 21 Configuration Items Claim Address Mode oJ CANO Properties Bit Rate 9 J1939 Device NMEA2000 Device Preferred Fixed Source Address Address Claim Arbitrary Address Capable Address Claim Start Address 128 Address Claim Stop Address 255 3 bit 4 bit Industry Group Vehicle System Instance 7 bit 8 bit Vehicle System Function 5 bit 3 bit 11 bit 21 bit Function Instance ECU Instance Manufacturer Code aj alk aj KR HL UK LR H 0 0 0 0 0 0 0 0 Identity Number User J1939 Database Use Standard J1939 Database The items that are to be configured must be
56. Write Multiple Coils 15 identify the type of communication to the slave Click the Map Data button to map registers to vari ables during the communication process Supported Function Codes Read Write Multiple Registers 23 Read Holding Registers 3 Write Multiple Registers 16 Read Discrete Inputs 2 Write Multiple Coils 15 Read Coils 1 Read Input Registers 4 Map Data For the MODBUS_MASTER function block to read or write data to from slaves variables and register assignments must be configured using the Map Data button Using the Modbus Master Map Data window variables may be assigned to transmit from and receive to See window example shown For additional details and information see Chapter 13 Modbus Networking Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 308 Chapter 24 Function Reference a Modbus Master Map Data Function Code Write Multiple Coils 15 Write Starting Address ee eed ke Example Circuit IBUS MAST EN JD SID ER Eror Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 309 Chapter 24 Function Reference MODBUS_SET_PROPERTY MODBUS_ SET_PROPERTY Description The MODBUS_SET PROPERTY function is used to set or change the Modbus Slave ID for the target from the ladder diagram program This feature is ideal for reading inputs Switches and setting the slave ID accordingly This function must be used to set the slave ID when usi
57. be present on the ER output If an error occurs the communication must be re attempted in the ladder program as it is not buffered While a function block is active it s ER out put will be set to 1 Figure 13 10 represents a ladder program using the MODBUS MASTER function block CRI JBUS MAST CRZ Figure 13 10 MODBUS_MASTER Function Block Errors The MODBUS _ MASTER function block provides an error ER output to identify errors detected during Mod bus Master communications to slave devices Figure 13 11 lists the supported error ID codes Error ID Title Description Code Exception Code Slave Device Failure An unrecoverable error occured while the slave was attempt ing to perform the requested function 5 Exception Code Acknowledge The slave has accepted the request but it will take a long duration ot time to to complete 6 Exception Code Slave Device Busy The slave is processing a long duration command function Exception Code Memory Parity Error A Parity error was detected in memory during a attempt to read a record file 10 Exception Code Gateway Path Unavailable For Gateways only Gateway was unable to allocate an inter nal communication path from the input port to the output port for processing the request 11 Exception Code Gatewary Target No Re For Gateways only Indicates no response was received sponse from the target device e Cientinvald Stato The olents current state is notvaia lt 8 Gent Check
58. configured specifically for your application requirements for proper operation Bit Rate J1939 Device NMEA 2000 Device Preferred Fixed Source Address Drop down box Select 250K or 500K Standard bus uses 250K Select between J1939 and NMEA 2000 network Choose the appropriate network Number from 1 to 100 This is the first address that the controller will try and use on the J1939 network This box works with the Arbitrary Address Capable box and addresses If the Arbitrary Address Capable box is checked then the Preferred Fixed Address is tried first If the address is not available on the network then the controller will aribtrarily try additional addresses based on the limits set If the Aribitrary Address Capable box is not checked then only this one address will be attemped even if it is not available This box is not available in listen mode Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 147 Chapter 14 CAN Networking Arbitrary Address Capable If this box is checked then the Preferred Fixed Address is tried first If the address is not available on the network then the controller will aribtrarily try additional addresses based on the Address Claim Start Stop addresses set This box is not available in listen mode Address Claim Start Address If arbitrary addressing is required this is the first arbitrary address that will be tried Address Claim Stop Address If arbitrary addressing is requ
59. deciding when to automatically restart R_TRIG6 AN TXNETE OptiError OptiHestart m Figure 14 6 All nodes on the network should begin communication upon receipt of the Start Network command With the network started and communicating it is now possible to broadcast to nodes and listen for node broadcasts Global Broadcasting to all Nodes To broadcast or listen a basic understanding of registers is required Typically controller registers 0 127 are available to be user defined and used while 128 255 are pre defined and cannot be altered The user defined registers are commonly used to communicate between controllers It is recommended that before programming is started that all nodes are identified assigned a node Q ID and documented For each device their register requirements should be identified registers assigned and registers documented This will verify the all requirements are met and help to promote proper functionality and design To send a global broadcast a variable must be identified and assigned to use an OptiCAN register To as sign an OptiCAN register to a variable using the Add Variable or Edit Variable dialog click the Epit button next to the Address Register field See Figure 14 7 The Edit Address Register dialog box will open See Figure 14 8 Using the drop down menu select GAN _ OptiCAN Fill in the Register Number only to transmit to the same register on all nodes The regis ter number must be
60. distributed by Licensee using the Licensed Software and Licensee expressly ac knowledges that it is solely responsible for any and all Resulting Products and applications developed tested installed or distributed using the Licensed Software and for any and all claims damages settlements expenses and attorney s fees arising from the distribution or use of the PLC ON A CHIP Kernel or Resulting Products by Licensee Licensee s customers or others DIVELBISS MAKES NO OTHER WARRANTIES OF ANY KIND WITH RESPECT TO THE LICENSED SOFTWARE OR THIS AGREEMENT AND EXPRESSLY DISCLAIMS ALL OTHER WARRANTIES EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY FITNESS FORA PARTICULAR PURPOSE AND NON INFRINGEMENT 6 Licensee Warranties d Licensee represents warrants and covenants that Licensee has all necessary authority to enter into and to fulfill its obligations under this Agreement Licensee will comply with all federal state and local laws and regulations applicable to the use or disposition of the Licensed Software including without limitation all export laws and regulations Licensee shall be solely liable for all Resulting Products any and all warranties on Resulting Products shall be made only by and on behalf of Licensee and Licensee shall make NO representations or warranties on behalf of Divelbiss For the term of this Agreement and any renewal thereof and for one 1 year thereafter Licensee will n
61. expression may contain variables constants operators and functions Refer to Figure 26 6 Expression Contains Variable where data is stored inside the function BOOL INT DINT REAL mn Description Definition Example A symbol that specifies a operation within an expression Vb1 Vb2 When executed a function call returns a single value Parenthesis are used to Functions contain the operand of a function call Functions can be used in expressions while functionname vbl instructions cannot Figure 26 6 Instructions are standalone statements that when executed povies one or more values that are part of it s data structure Instructions are terminated with a semi colon Instructions cannot be used in expressions A typical instruction would appear as instruction operand1 operatnd2 Constructs are conditional statements used to trigger additional structure text code depending upon the evaluation of a condition Conditional statements are terminated with a semi colon Typically used constructs IF THEN CASE FOR DO WHILE DO REPEAT UNTIL EXIT Figure 26 7 is a sample of using a construct in a function block Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 362 Chapter 26 Structured Text FunctionBlock1 FUNCTION BLOCK FunctionBlockl VAR INPUT Enable bool Vin dint d END VAR VAR OUTPUT QO bool Vout bool END VAR Or Enable IF Vin 1
62. fields attributes for variables Some must be completed while others are optional 1 Name The variable name is entered in this field This name will be used to identify this variable and will be the name viewed in the workspace and any cross reference and reports All names must begin with a letter and cannot contain any spaces A unique name is require for each variable Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 52 Chapter 5 Creating Ladder Diagram Projects 2 Description 3 Variable Type 4 Var I O Number 5 Default Value 6 Address Register Divelbiss Corporation P Series This is where a text based description may be entered for more clarification and details regarding this variable Descriptions appear in reports and in many dialog boxes This attribute is optional The variable type is selected in this box The choices are Input Select Input if the variable will actually represent a real world digital input on the target Selecting this option will require that physical address of the input to be entered in the Var I O Number field Output Select Output if the variable will actually represent a real world digital output on the target Selecting this option will require that physical address of the output to be entered in the Var I O Number field Internal Select Internal if the variable has no real world connection but is to be used internal in the ladder diagram project only
63. has sent the Network Start command To send the start command the OPTICAN_TXNETMSG function block is used Using the OPTICAN_ TXNETMSG function block is a two step process When placing the function block the OptiCAN Transmit Network Message dialog box will open See Figure 14 5 Using the drop down menu select the Network Message Start Network a OptiCAN Transmit Network Message Name JOPTICAN_TXNETMSG1 Description Network Message ES Network e eg Figure 14 5 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 134 Chapter 14 CAN Networking Click ox to place the function block in the ladder diagram project Figure 14 6 is a sample of a complete OPTICAN TXNETMSG circuit Note the use of contacts to control when the Start Network is sent The Network Start should be sent based on two conditions The network needs to start as ina start up or if communication errors are detected If a single node loses power it will appear as communication loss When node regains power it will not communicate on the network unless another Network Start is sent since nodes do not start on power up If at any time a communication is lost to a node re send the Network Start Restarting upon an error is entirely application dependent Some applications would benefit from an O automatica restart while other applications may find it beneficial to stop all functions when an error is detected Safety should be paramount when
64. hex character Prints hexidecimal always uses 4 characters Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 332 Chapter 24 Function Reference SETDATE SETDATE Description EN Q The SETDATE function sets the current date on the hardware real time clock The date is set by using variables to apply values to each of the inputs The enable EN must be true for the SETDATE function to be enabled The Q output is true when the function is en abled The MN input sets the month 1 12 the DY input sets the day of the month 1 31 the YR input sets the current year last two digits and the WD sets the day of the week MN 1 7 1 Sunday The MN DY YR and WD inputs must be connected to Integer variables Input Output Connections The SETDATE function block placement requires connections of 5 input pins EN MN DY YR WD and one output pin Q Output YR WD Example Circuit CRI SETDATE1 EN o Month rei MN Day key YR WD Related Functions SETTIME GETTIME GETDATE Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 333 Chapter 24 Function Reference SETTIME SETTIME Description EN Q The SETTIME function sets the current time on the hardware real time clock The time is set by using variables to apply values to each of the inputs The enable EN must be true for the SETTIME function to be enabled The Q output is true when the function is enabled The HR input sets th
65. inserts a Direct Coil Normally Open Coil into the ladder diagram project workspace wherever you click Can only be placed in last column om Negated Coil This inserts a Negated Coil Normally Closed Coil into the ladder diagram project workspace wherever you click Can only be placed in last column Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 21 Chapter 2 Navigating EZ LADDER Toolkit CTU Count Up Function This inserts a Up Counter Function into the ladder diagram project workspace wherever you click CTO Count Down Function This inserts a Down Counter Function into the ladder diagram project workspace wherever you click Count Up and Down Function This inserts an Up and Down Counter Function into the CTUD ladder diagram project workspace wherever you click Pulse Timer Function This inserts an Pulse Timer Function into the ladder diagram project TP workspace wherever you click TOW On Timer Function This inserts an ON Timer Function into the ladder diagram project workspace wherever you click TOF Off Timer Function This inserts an OFF Timer Function into the ladder diagram project workspace wherever you click SE This is used to insert any function specifically those Insert Function e functions that do not have a quick used tool bar o button Select the function from the drop down menu and click the Insert Function button This will place the function into the ladder diagram projec
66. integer Real Boolean Timer ActiveState OtherDetalls Oen ma Tx CL Jae o o D mt a II II o Pz f m y x yoo es e owt y x yo J S S e Example Circuit Related Functions ROR Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 325 Chapter 24 Function Reference ROR ROR Description The ROR function provides a right bit rotation of the P1 input P2 specifies the number of one bit rotations The P1 number is a integer representation of a binary number The P2 number is an integer representation of the number of binary rotations shifts to occur to P1 The actual bit only rotates when the minimum number is reached example 32 bit DI 0 rotation to the input number 32 The enable EN must be true for the ROR function to be enabled The Q output is true when the ROR function is enabled The O Output is the rotated number represented in integer form D Input Output Connections The ROR function block placement requires connections of 3 input pins EN P1 P2 and two output pins Q O Orin Type Integer Real Boolean Timer Active State OtherDetalls o wa x Activote PL mw PX D f m y x yoo e S S e owt y x yoo o S S e a owe E xx BE E Example Circuit Related Functions ROL Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 326 Chapter 24 Function Reference RS RS Description The RS function acts as a res
67. is drawn connecting both objects release the mouse button to complete the link If a vertical links are required as in parallel circuits select the Vertical Link Tool from the tool bar Using the same method click and drag until a vertical link is created Horizontal and Vertical links snap to grid locations and can only be started and stopped at one of these locations Take care when connecting links to objects and function blocks that the link actually connects to the block and not just near it If a link does not connect then an error will occur when Verifying or Compiling the ladder diagram project Figure 5 8 shows a connected link and a link that is not connected Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 56 Chapter 5 Creating Ladder Diagram Projects Le EZ EZ Ladder Standard Ladder Diagram Project Name did EZ File Edit View Project Reports Window Help xX D k tae amp 2 E JMP Edit Inst 4 k I Label Sare Vars d C MON Abc sl die d Vi CTU CTD CTUD TP TON TOF Insert Function DM v CRI CR2 e x 1 we e Contacts Functions Variables CR2 DI Labels 8 Bad Link p Good Vartiut Connected Links i Starting verify LINK ERROR Vertical link not found at 5 2 1 Errors found Figure 5 8 connected to the second function blocks variable input you must insert a variable between them Failure to place a variable between
68. is false the out put O will be equal to the input P1 If the enable EN is true the output O will be equal to the input P2 The Q output is true when the SEL function is enabled P QO Input Output Connections The SEL function block placement requires connections of 3 input pins EN P1 P2 and two output pins Q O D ege Type Integer Real Boolean Timer ActiveState Other Dotais ren mot TT x CAatveme er moet x x o Pz f wu LK 2 owt y x yxy S S e a owe E xx BE Example Circuit Vae jPi of Output Value2_ f P2 Related Functions MUX Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 329 Chapter 24 Function Reference SERIAL_PRINT SERIAL PRINT Description The SERIAL_PRINT function is the transmit block for sending serial information using a multi purpose serial port EN When then EN input senses a rising edge the block begins the serial transmission of its text that was provided when the SERIAL_ PRINT function was placed The Q output is set I1 ER true when the transmission is completed The ER output is set true if there is still data in the buffer when the function block is enabled to transmit again See Chapter 11 Serial Printing Input Output Connections The SERIAL_PRINT function block placement requires connections of at least one input pin EN and two output pins Q ER Additional inputs are based on variables in seria
69. is ignored width precision when using REAL variables Variable Formats This flag is optional Width is the number of characters that will be printed total This flag is optional The precision is the number of digits after the decimal point Variables are formatted based on the variable type The following are supported variable types and their format Yd Signed Integer You Unsigned Integer X Lower Case Hexadecimal O Octal Other Special Characters and Formats To Print Use Boolean 0O or 1 d Examples Format Result OIL d OIL 25 LS1 T LS1 TRUE TEMP 6 2f TEMP 234 12 Related Functions LCD CLEAR X Upper Case Hexadecimal ot Real or Float Variable Yb binary To Print Use OFF ON O FALSE TRUE T Format Result OIL 04d OIL 0025 LS1 O LS1 OFF TEMP 3 f TEMP 234 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 298 Chapter 24 Function Reference LESS THAN lt LESS THAN Description The LESS THAN provides an if less than comparison for the Px inputs The number of in puts is specified when the object is placed The output Q is true if P1 is less than P2 and P2 is less than P3 and so on The enable EN must be true for the LESS THAN function to be enabled P1 Input Output Connections The LESS THAN function block placement requires connections of at least 3 input pins EN P1 P2 and one output pin Q The EN is always considered an input in th
70. is used to select the type of function command for this instance of the MODBUS_MASTER function block to execute when active These are listed in Figure 13 4 Select the Function Code and Interface as required See Figure 13 5 oS Modbus Master Properties Name MODBUS_MASTER1 Description Interface UART1 k Function Code Read Input Registers 4 Figure 13 5 With the Interface and Function Code set it is now time to specify the variables used for this function block to capture values and send to the slave or read values from the slave and store to To configure the vari ables on this function block instance click the map pata button The Modbus Master Map Data window will open See Figure 13 6 a Modbus Master Map Data Function Code Read Input Registers 4 Starting Address Registers Variables Register Figure 13 6 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 111 Chapter 13 Modbus Networking The Modbus Master Map Data window is divided into two sections Write and Read One or both of the win dow sections will be active depending upon what actual Function Code was selected in the Modbus Master Properties dialog section is where variables are identified that will be used as the source point for writing to slave s while the Read section is where variables are identified that will be used to store data read from slave s Q The Write and Read sections are configured identically
71. ladder diagram and minor references to hardware when needed l ADS8341 SPI support is based on actual hardware targets Refer to the targets User Manual or Chapter 23 Hardware Targets to determine if SPI devices are supported Installing the ADS8341 in the Ladder Diagram Project To be able to use the ADS8341 in an EZ LADDER Toolkit ladder diagram project the ADS8341 must first be installed and configured As the PLC on a Chip is the most commonly used target for the ADS8341 it will be used as an example to install and configure the ADS8341 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 170 Chapter 15 SPI Devices and Support The ADS8341 is configured using the Project Settings Using the Project Menu choose Settings The Project Settings window will open as previously covered in Chapter 4 Configuring Targets Select the target and click the properties button The Target Properties window will open From the drop down menu DCPN select the model part number of the target If an ADS8341 device were installed it would be listed in the Devices pane under the Bus SPI section Click the app pevice button The Targets Devices window will open All the available devices and features for the target are shown in the Devices section Scroll down and find the ADS8341 Figure 15 12 shows the Target s Devices window The SPI port must be installed individually or no SPI ports will show available in later drop down config
72. memory than the ST_FUNC function The Enable is used to enable the function and the Q output is active when the function enable is true For understanding on Structured Text and how the ST FUNC_ BLK operates with structured text functions refer to Chapter 26 Structured Text Input Output Connections Before an ST_FUNC function may be used in a ladder diagram called from a ladder diagram pro gram certain criteria must be met Refer to Chapter 26 Structured Text for this criteria Input and Output connections are based on the structured text functions you create in EZ LADDER ST Function Editor The Enable and Q outputs are by default created em Type integer Real Tenable not x Te owm ffi x Active State Other Details awene OOS True when EN is true X X Input Output Name amp Type based solely on User Structured Text Function i Example Circuit CRI FUNC DU Related Functions ST FUNC Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 341 Chapter 24 Function Reference SUB Description The SUB functions subtracts the P2 input from the P1 input The output O is the result of the subtraction The enable EN must be true for the SUB function to be enabled The Q output is true when the SUB function is enabled Input Output Connections The SUB function block placement requires connections of 3 input pins EN P1 P2 and two output pins Q O UO Pin Active State
73. minimum of three input pins EN P1 P2 and two output pins Q O The number of inputs is specified when the func tion is inserted The EN is always considered an input in the total number of inputs there P2 fore always add one to the number of Px inputs that need to be used en Type integer Real Boolean Timer Active Sate omor Dorais Cen not TX ates e m ERR O eao yae o owm f x o ooo o o om x fx Example Circuit Related Functions MAVG Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 245 Chapter 24 Function Reference BIT PACK BIT_PACK Description EN The BIT PACK is a configurable function that will convert the inputs bits from binary to a single 32 bit integer number The Bx inputs are the bits to pack the EN enables the function when true The Q output is true when the function is enabled The output O is the 32 bit integer result of the packed inputs The number of bits must be identified when the function is placed in the ladder diagram 1 32 bits Only boolean variables or contacts may be used as bit inputs Included in the configuration is the bit offset The bit offset allows the programmer to use multiple BIT PACK functions and have a single 32 bit output integer by offsetting the bit B1 range for each function block Note the number of bits offset bits must be less than or equal to 32 Input Output Connections The BIT_PACK function bloc
74. or deleted Compile the project and then download to the target Invalid File Editor Mode The file you are trying to open in EZ LADDER Toolkit is not a valid EZ LADDER Toolkit ladder diagram file Invalid HEX file Monitor Mode When downloading to a target the file used to store compiled code is invalid or corrupt Re compile the ladder diagram project to correct this issue x is not supported by the current target Editor Mode The object or function block that you are trying to use and place is not supported on target selected in the Project Settings This can be caused if the hardware target is changes after a ladder diagram is created then function blocks are edited Either change the target or delete this function block object Ladder program is not present Monitor Mode No ladder diagram program was detected on the connected hardware target Link at x y had an invalid Grid point Editor Mode The link is open or not connected at a grid point Correct or re draw the link Link is not valid Editor Mode The link you are trying to create is not valid This is typically caused when trying to link one type of vari able integer real etc to a function block or object that does not support that type or all variables linked to the function block must be identical types and you are trying to link a variable that does not match the types already connected to the function block No acknowledgement sent from target x Monitor
75. program there are additional real time monitoring features available in the EZ LADDER Toolkit These features include Power Flow indication Scan Time Starting and Stopping program execution hover boxes and the ability to change variable values Power Flow Indication Monitoring a project in real time provides the ability to watch the state of contacts coils function blocks and variables See Figure 6 7 Contacts and Coils are actually represented in their current state On Off by color Blue represents the contact or coil in its rest state un powered state while Red represents a pow ered or flow condition As real world and internal objects change during program execution they are repre sented in color accordingly and the flow of power can be viewed Power Flow from the left power rail to the right power rail Although contacts and coils change colors based on their actual state some links may change color but most links and all function blocks remain the standard black and white color Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 68 Chapter 6 Downloading amp Running Projects 8 EZ EZ Ladder Standard AnotherProgram did EZ File Edit View Project Reports Window Help Le e Dat S e 4 u LDS ke Status Running Program Name AnotherProgram Red Indicates Power Flow Build Number Scan Time ms A 10 Program Version 0 0 0 0 CRI CR4 i E Coils
76. pull up internal P13 Chip resistance UDINT Return True is configuration is successful Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 370 Chapter 26 Structured Text Target Specific Function Description Details ce APO REAU Reads the current status of a digital input BOOLvar EZ_GPIO_Read GPIOnum UDINT GPlOnum Number of GPIO pin to read status Returns digital input state as true or false GE Sets the state of a digital output EZ GPIO Write GPIOnum State Parameters GPlOnum Number of GPIO output pin to set the state of UDINT State Desired output state true or false BOOL Return frome gg EZ_Lcdinit Initializes the LCD Display Return frome S Ee EEREEERR Writes to Displays data on the LCD Display EZ LcdWrite Row Column Data Parameters Row Row of the LCD Display to Write data to 0 to numrows DINT Column Starting Column of the LCD Display to Write data to DINT Data string to transmit data may be formated using EZ_FormatString ee eee ee eat ee Controls Modbus communication enable BOOLvar EZ _ModbusMaser_UartEnablelsr FD_x status Parameters SD File Descriptor Status Oor1 True or False BOOL If False disables interrupt and disables Modbus read write functions won t work a Writes data to SPI port device DINTvar EZ SpiWriteData FD_x flags clkrate GPIO txbuff rxbuff len Parameters FD_x File descriptor flags 16 10000 for active low
77. reaches its maximum value it will reset to zero and begin again Care should be taken to not allow this to occur in the ladder diagram Standard Timer When configured as a standard timer the timer channel capture input may not be used for any other func tion and is based on a 96MHz clock When using the capture input s as standard timers they may be used and configured to measure either the input frequency or the period between input pulses The TIMERCOUNTER function block is used to read the current value from the timer capture input See Chapter 24 Function Reference for details on specific function blocks When configured and the TIMER COUNTER function block is enabled the timer channel capture input will provide either the actual input frequency on the capture input or the period between pulses on the catpure input The timer may be reset by utilizing the reset R input Capture Inputs Configured as Counters Capture inputs may be configured as counters and must be configured using the Project Settings Menu as shown earlier this chapter Capture inputs configured as counters may be configured to count on rising edge falling edge or both edges The Counter Mode edge is configured in the Project Menu Settings As timers a input capture pin must be selected Refer to the actual hardware target s datasheet or manual for identifying the proper capture pin When a counter capture channel reaches its maximum value it
78. same as Broadcast Rate that was configured in the Project Settings Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 136 Chapter 14 CAN Networking Listening for Broadcasts While broadcasting can be global or to a specific node ID all listening for broadcasts are specific Fora controller to listen for a broadcast the specific node ID and register are required To listen for a broadcast a variable must be identified and assigned to use an OptiCAN register To assign an OptiCAN register to a variable using the Add Variable or Edit Variable dialog click the Epit button next to the Address Register field See Figure 14 9 wee Le ad Add Variable e Name TempWarl Description Variable Type 7 Input Var UO Number C Output Default Value 1 internal Address Register Edit e IT Retentive Figure 14 9 The Edit Address Register dialog box will open See Figure 14 10 Using the drop down menu select CAN_ OptiCAN Fill in the Node ID with the node ID number of the device you wish to listen for Fill in the Register Number that you are listening for on the specific node The register number must be a user defined register 0 127 Click the IN check box This identifies that this variable will be listening not broadcasting The Broadcast Trigger drop down is no longer available Click ok to close the dialog and click ok to close the Add Edit Vari able dialog a E
79. target PLCHIP PXX and click the properties button The Target Properties window will open From the drop down menu DCPN select the model part number of the target If any of the Quadrature Counter inputs are installed they will be listed in the Devices pane under the Internal PLCHIP_Pxx_qel section Click the app Device button The Targets Devices window will open All the available devices and features for the target are shown in the Devices section Scroll down and find the PLCHIP_Pxx_qei Figure 18 5 shows the Target s Devices window a PLCHIP PXX Devices Devices Name Description Low Voltage Sense Low Voltage Sense Active Low LS7366R 32 Bit Quadrature Counter SP MCP3204 Microchip 4 Channel 12Bit A D Converter SP Modbus Master Modbus Master Modbus Slave Modbus Slave OptiCAN Divelbiss OptiCAN PLCHIP_Pxx_eeprom Intemal PLCHIP PXX 4K EEProm PLCHIP_Pxx_qei Intemal Quadrature Encoder Interface PLCHIP Pe gc Intemal PLCHIP PXX Real Time Clock PWM Pulse Width Modulator SD_CARD SD Card Serial Print Serial Print SPIO SPIO SPI1 SPI 1 UART1 UART1 Variable Names Name QEI_IDX QEI_PHA QEI_PHB Figure 18 5 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 197 Chapter 18 Timers amp Counters Select PLCHIP_Pxx_qei and click ox The PLCH IP_Pxx_gqei Properties Window will open See Figure 18 6 a DLCHID Do oei Properties Quadrature Mode Flags E Non quadrature A DIR
80. the GREATER THAN function to be enabled Input Output Connections The GREATER THAN function block placement requires connections of at least 3 input pins EN P1 P2 and one output pin Q The EN is always considered an input in the total number of inputs therefore always add one to the number of Px inputs that need to be used ege Type Integer Real Boolean Timer Active State Other Dorais ren mot TT x Cater er fot xf x Pd dC otras nario ea fom x Example Circuit Related Functions gt lt lt lt gt Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 280 Chapter 24 Function Reference GREATER THAN OR EQUAL TO gt GREATER THAN OR EQUAL TO Description The GREATER THAN OR EQUAL TO provides an if greater than or equal to comparison for the Px inputs The number of inputs is specified when the object is placed The output Q is true if P1 is greater than or equal to P2 and P2 is greater than or equal to P3 and so on The enable EN must be true for the GREATER THAN OR EQUAL TO function to be enabled Input Output Connections The GREATER THAN OR EQUAL TO function block placement requires connections of at least 3 input pins EN P1 P2 and one output pin Q The EN is always considered an input in the total number of inputs therefore always add one to the number of Px inputs that need to be used Orin type integer Real Boolean Time
81. the actual actions are taken using other commands and statements such as For Next etc Figure 26 1 is a sample of a custom function block using structured text One of the important differences between other programming languages and Structured Text is program flow Itis possible to program Structured Text so that it will loop indefinately giving bw undesired results and operation Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 358 Chapter 26 E Function Editor File Edit User Declara e H X Type Declarations Global Variables Function 4 FunctionBlock DoubleN DoubleN FUNCTION BLOCK DoubleNn Enable bool VIN dint END VAR Structured Text VAR OUTPUT Or bool VOT dint END VAR Q Enable VOT VIN 2 END FUNCTION BLOCK Coll Coll Figure 26 1 ST Function Editor The example shown in Figure 26 1 is the ST code for a function block named DoubleN This bock es pur pose is to take an integer input double it and then output the result As shown the ST language is composed of statements separated by seimcolons These statements and subroutines are used to change variables defined These defined variables may be defined values such as constants internally stored variables input and outputs Spaces are used to separate variables from state ments Semcolons are used to signify the end of most code lines as shown in Figure 26 1 As shown in Figure 26 1 it is good form
82. the target or create a new project with the actual hardware target selected This project must have at least one rung of ladder Compile the program 3 Verify the Serial Port Settings and connect the target to the computer 4 Enter the Monitor Mode Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 38 Chapter 4 Configuring Targets 5 Press the F11 key on your computer s keyboard The dialog box in Figure 4 6 will open ad Recovery Options EI eem Figure 4 6 6 Disconnect power from the hardware target 7 Click the ENTER BOOTLOADER button in the dialog box A timing dialog box will appear This is amount of time that is remaining to re apply power to the hardware target 8 Apply power to the hardware target If the time has elapsed repeat steps 6 8 again The hardware target will now allow bootloader operations other buttons are now active 9 Choose the correct option to try and resolve your target issue Bootloader Bootloader will open the bootloader dialog box for updating kernels Erase LD Program Erases the ladder diagram project from the hardware target s memory In the event the program is hanging and preventing a normal connection this will erase the program to allow a normal connect Restart Target Causes the hardware target to reboot This is required when all other bootloader actions have been completed Without the restart the kernel will still not connect normally Using the Rest
83. to close the Internal Analog I O Properites window The Analog I O should now be listed in the De vices pane under Internal Click ok to close the Target Properties window Click ox to close the Project Settings window Be sure to save the ladder diagram project The analog output s are now installed and ready to be used EZ LADDER Toolkit automatically creates variables that represent the analog outputs They are labeled AOx for analog outputs Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 191 Chapter 17 Analog UO Using Analog Outputs in the Ladder Diagram Project With the hardware target selected and analog outputs installed if required it is now simple to use these analog outputs in the ladder diagram project For each analog output an integer variable exists that will be the digital representation of the real world analog output signal Typically this number ranges from 0 1023 with zero representing the low end OVDC OmADC etc and 1023 representing the upper end of the range 5VDC 20mADC etc Actual values and ranges are dependent upon the resolution of the analog output in this case the on board analog output is 10 bit or 0 1023 As these variables represent the analog outputs they can be tied directly to function blocks that have integer outputs As these function blocks change the variable values the actual analog output s voltage or current will change accordingly Figure 17 8 shows a la
84. will equal zero Error codes are divided into two groups Device specific errors are numbered 0 32767 while common error codes are numbered 32768 65535 Common Error Codes are as follows 65535 CAN Controller Receive Error 65531 CAN Controller Bus Off State 65534 CAN Controller Receive Warning 65530 CAN Controller Data Overrun 65533 CAN Controller Transmit Error 65519 OptiCAN Heartbeat Timeout 65532 CAN Controller Transmit Warning 65518 CAN Controller Error Related Functions OPTICAN_TXNETMSG Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 315 Chapter 24 Function Reference OPTICAN TXNETMSG OPTICAN_TXNETMSG Description The OPTICAN TXNETMSG function broadcasts the network control commands EN Q Start Network Stop Network and Reset Network on the OptiCAN network This function block globally broadcasts therefore affecting all connected nodes A Start Network command must be broadcast after power up to start the OptiCAN network nodes communications When placing the function a dialog box provides the selection of the type of com mand to send and an optional description box See Chapter 14 OptiCAN Networking for more information regarding using the function block and general OptiCAN networking Input Output Connections The OPTICAN TXNETMSG function block placement requires connections of one input pin EN and one output pin Q Oen m O o e aee o o om ff x S Example Circuit CR
85. will need to re enter the same password in the Verify Master Password box Until the Master Password and Verify Master Password boxes are equal no other window functions will be functional The Master Password should be recorded in a safe place There is no user provided way to remove or bypass the Master Password If you have lost your Master Password you will need to contact Divelbiss Corporation for options in recovering access to the program Once into the Password Setup window the Master Password can be changed by entering a new password in both the Master Password and the Verify Master Password boxes It may also be removed by completely clearing both boxes l If the password Setup is closed by clicking OK the passwords installed will take effect immediately Verify you have recorded the Master Password Creating Lower Level Passwords Additional passwords for lower level functions may be created Refer to Figure 25 2 To add a new password click the app button A new Row in the Passwords section of the Password Setup window will appear Refer to Figure 25 3 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 354 Chapter 25 E Password Setup Master Password Passwords Description Password Edit File Password Protection Verity Master Password Monitor Modity Variable Values Download LD Enter Bootloader Program Monitor Figure 25 3 Description Password Edit File
86. with ST_FUN_ BLK Variable Data Bee rete Use with Type H Sr EUNG BOOL Boolean value 0 1 True False DINT Double Integer 32 bit REAL Float real number with decimal point Figure 26 3 Variable Data Type for Input Output Declarations of Callable Functions amp Function Blocks Only the variable data types listed in Figure 26 3 may be used in ladder diagram callable functions or J function blocks as variable declaration types for input or output VAR_IN VAR OUT VAR_IN OUT The use of other data types for input or output variable declarations will result in the function or Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 360 Chapter 26 Structured Text function block not appearing in the selection menu for inserting the function or function block into the ladder diagram Other variable data types may be used internally to the function or function block As shown in 26 1 all variable declarations begin with the VAR see Figure 26 2 statement to identify the beginning of the variable declaration and end with the VAR_END statement to identify where the variable declaration ends All the previous Figures and examples have illustrated the variable declarations and data types that are sup ported for the inputs and outputs of callable functions and function blocks Other data types are supported for functions and function blocks provided they are internal to the function or function block and are not declared as an I
87. with the main difference that the Write Starting Address The Starting Address box for both the Read and Write sections is the base register number where data will be read from written to The register assignments for the Modbus Master is based on the Modbus specification and thus the starting address is 0 based Register 0 will always be the first available register in any group of registers for a Function Code type command Each Function Code command type per the Modbus specification support registers from 0 to 65535 and the register groups for each Function Code are independent For example Function Code 4 Read Input Registers will support from OU to 65535 registers and Function Code 3 Read Holding Registers will support from 0 to 65535 registers however these two groups of registers are unique and independent from each other l The actual number of registers supported on slave devices may vary by implementation of the J Modbus specification on the devices See the device s documentation for actual supported sizes Enter the register address in the Starting Address box Once a valid address is entered several buttons and the Registers Variables pane becomes active See Figure 13 7 ad Modbus Master Map Data Function Code Read Holding Registers 3 Read Starting Address 0 Registers Variables Register Varnable 1 Variable fad Vaile Figure 13 7 Divelbiss Corporation P Series EZ LADDER Toolkit User Man
88. 000 is installed in the project settings To receive data use the Functions drop down box on the toolbar and select J1939_RX_PGN Click the INSERT FUNCTION button and then click in the ladder diagram workspace where you want to insert the J1939 __ RX_PGN function block The J1939 RX Properties dialog box will open This box is used to configure this specific instance of the J1939 RX_PGN function used in the program Refer to Figure 14 24 The J1939 RX Properties must be configured for each insert of a J1939_ RX_PGN function block as each insert is a unique instance of the function block EZ J1939 Rx Properties Can Port Block Name J1939_RX_PGN1 PGN Description PGN Settings Tx Only Priority Broadcast Rate NMEA2000 PGN Access Priority Access B Cast Rate Access SPN Description SPN Field Settings Gain Offset Request Type A Request message will be transmitted every lsec if Request Type is choosen Source Address Destination Address dl Receive from all addresses di Receive only addressed to this device Source Address to Receive From Receive addressed to any device oz Specify Dest Address to Receive Map Variable oe Figure 14 24 Using the drop down menu select the CAN port for the J1939 NMEA 2000 network Along the left side of the dialog below the CAN port drop down is a pane with a list of PGNs PGNs in the configured database By selecting a PGN t
89. 1 Scan Time ms lt 1 00 A CR1 CR2 2 E Coils I e Contacts H Functions Variables i Labels Result Figure 6 1 Q In addition to the tool bar changes the Output Window is not available in the Monitor Mode as the program should be compiled in the Edit Mode prior to switching to the Monitor Mode Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 63 Chapter 6 Downloading amp Running Projects Switching to Edit Mode When in the Monitor Mode to switch back to the Edit Mode on the tool bar click the Edit button EZ LAD DER Toolkit will switch from Monitor Mode to the Edit Mode All Edit Modes standard tool bars menus and windows will reappear Monitor Mode Overview While the Monitor Mode generally looks similar to the Edit Mode the tool bars menus and windows can dif fer greatly Refer to Figure 6 2 for identification status fields Project Version Tool Bar EZ LaNder Standard Figure 6 Ldid R EZ File Bgit View Project Reports Window Help Project Name Estimated Scan Time Project Build sas Ded og a can RE Rb eS CRI CR2 fe I CR2 DIV CR3 Result d nm Status Running Program Name Figure 6 1 Program Version 0 0 0 0 Build Number 1 Scan Time ms lt 1 00 pm gt 2 Functions oy Variables i Labels Ready Figure 6 2 Divelbiss Corporation
90. 24 Function Reference LIMIT LIMIT Description EN Q The LIMIT function provides minimum and maximum limited output for the input IN The function compares the input IN If it is greater that the maximum MX then the output O is equal to the maximum MX If it is less than the minimum MN then the output O is equal to the minimum MN If it is in between the maximum and minimum then the MN O output O is equal to the actual input IN The enable EN must be true for the LIMIT function to be enabled Input Output Connections The LIMIT function block placement requires connections of four input pins EN MN IN MX and two output pins Q O IN Ma eps type integer Real Boolean Timer Active State Omer Deis cen ime X Cater Om mt x j e E cw me fx x wx me fx fx ef owe x if of owe x x S Example Circuit Minval_ MaxVal Related Functions CMP HYSTER Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 301 Chapter 24 Function Reference LN Description LN The LN function provides the natural logarithm of the P1 input The output O is the natural logarithm of the P1 input The enable EN must be true for the LN function to be EN Q enabled Input Output Connections P1 QO The LN function block placement requires connections of two input pins EN P1 and two output pins Q O en Type inte
91. 366R counter and other SPI devices the LS7366R does not use variables but instead relies on a function block to provide access to counter functionality in the ladder diagram project When the LS7366R is configured click ox to close the LS7366R Properties dialog 2 It is now listed in the LS7366R Properties dialog 1 Click ok to close the LS7366 Properites dialog 1 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 163 Chapter 15 SPI Devices and Support Click ox to close the Target Properties window and click ok to close the Project Settings window Be sure to save the ladder diagram project The SPI port is now installed and ready to be used and additional SPI devices may be installed and used in the ladder diagram a LS7366R Properties Quadrature Mode E Non quadreture A CLK B DIR XI A3 X4 LE AG DFLAG Hag on IDX Fag on CMP Fag on BW E Aag on CY Figure 15 6 SP Properties CS Output GPIO13 e Count mode Index Mode Free unning Disable index O Asynchronous Index Single cycle E Load CNTR Synchronous Index Range4imit Reset CNTR E Modulo n Load OTR LS7366R Configuration Parameters All modes are controlled by the hardware settings listed Functionality is achieved using a function block in the EZ LADDER Toolkit Quadrature Mode Non Quadrature A CLK B DIR A pulse on the A input will increment the counter or decrement the counter ba
92. 4 444 Display Decimal Hexadecimal Figure 14 17 When each of the registers of the node have been configured click the save amp Exit button to save changes and close the Configure Registers dialog box and return to the Node Configuration dialog In addition to changing the trigger from this dialog the Value for each register can be changed providing the register is writable The numbers can be represented in decimal or in hex Figure 14 16 is set to dis play in decimal As an example register number 1 Digital Outputs will directly control the outputs on the node By changing the Value the outputs can be set to be on or off The values that may be entered are decimals that represent the binary bits that correspond to each individu al output mle eels SS Al Corresponding Real T 5 4 3 2 1 World Output Off Examples If Decimal Number Value 128 then Real World Output 8 is ON If Decimal Number Value 8 then Real World Output 4 is ON If Decimal Number Value 40 then Real World Outputs 4 and 6 are both ON l Each non controller node has unique register assignments Refer to the actual product manual for d details regarding register assignments Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 142 Chapter 14 CAN Networking OptiCAN Node List Notes Notes can be added to the list of nodes to help with documentation and service later This is accessed from the OptiCAN Configuratio
93. 8552 must first be installed and configured As the PLC on a Chip is the most commonly used target for the DAC8552 it will be used as an example to install and configure the DAC8552 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 173 Chapter 15 SPI Devices and Support The DAC8552 is configured using the Project Settings Using the Project Menu choose Settings The Project Settings window will open as previously covered in Chapter 4 Configuring Targets Select the target and click the properties button The Target Properties window will open From the drop down menu DCPN select the model part number of the target If an DAC8552 device were installed it would be listed in the Devices pane under the Bus SPI section Click the app pevice button The Targets Devices window will open All the available devices and features for the target are shown in the Devices section Scroll down and find the DAC8552 Figure 15 16 shows the Targets Devices window The SPI port must be installed individually or no SPI ports will show available in later drop down configuration menus a PLCHIP PXX Devices Ethemet Ramtron FM24XXX FRAM LC 12c 0 12C 1 Low Voltage Sense Active Low 32 Bit Quadrature Counter SP Thermocouple SPI Figure 15 16 Click ox The DAC8552 Properties dialog will open Ths dialog selects the SPI Port and Chip Select to be used for this DAC8552 device See Fig
94. ADDER Toolkit If EZ Ladder is not registered it will prompt you to do so when the application is started To activate and register your EZ LADDER Toolkit follow the installation wizard as follows 1 When prompted to Activate EZ LADDER click yes You have not yet registered your EZ Ladder Would you like to register now Your EZ Ladder will not be fully functional until you have registered and received your activation license file 2 You must read and agree to the license agreement Le a License Agreement to activate the EZ LADDER Toolkit Click the I AGREE ea Setar a eee box and click NEXT then cick be New 9 gt Balto oherwie cic he ance Bon DT Agreement aaa Net Licensee or otherwise in violation of this Agreement is expressly prohibited Introduction Whereas Divelbiss has developed certain modules of computer software known as PLC ON A CHIP Kemel and EZ LADDER Toolkit and Licensee wishes to secure certain rights to use such software and Div vebis is prepared to license such rights subject to the tems and conditions of this Agreement bere in consideration of the mutual covenants contained herein and intending to be legaly bound hereby Divelbiss and Licensee agree as follows Licensed Software The PLC ON ACHIP Kemel and EZ LADDER Toolkit software whether in source code or object code format and all related documentation and revisions updates and modifications thereto do not agree agree
95. AN Controller Receive Error 65531 CAN Controller Bus Off State 65534 CAN Controller Receive Warning 65530 CAN Controller Data Overrun 65533 CAN Controller Transmit Error 65519 OptiCAN Heartbeat Timeout 65532 CAN Controller Transmit Warning 65518 CAN Controller Error Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 133 Chapter 14 CAN Networking Broadcasting to Other Controllers and Devices To broadcast from one controller to other controllers and devices the following steps should be completed before proceeding 1 All OptiCAN Devices and Controllers on the network must be identified with unique Node ID numbers and configured properly 2 Register assignments and uses should be defined as these register number will be needed to broadcast and listen 3 The heartbeat node should be identified l To broadcast to nodes several steps must take place in addition to the configurations listed above For the OptiCAN network to function correctly several steps must be taken Before any node can broadcast or listen the OptiCAN Network must be started To Start the OptiCAN Network The OPTICAN_TXNETMSG function block is used to send global network commands to all OptiCAN nodes on a network Using this function block a controller may send a Network Start Network Stop or a Net work Reset command On power up the OptiCAN network does NOT start by default and will not begin communication O until one controller
96. B CLK C Invert Direction x C Invert Index XA E Index Resets Position Counter Index Gating Pass the index when PHA 1 and PHB D otherwise block index Pass the index when PHA 1 and PHB 1 otherwise block index Pass the index when PHA 0 and PHB 1 otherwise block index Pass the index when PHA 0 and PHB D otherwise block index Maximum Position PHA Digital Filter PHB Digital Filter INS Digital Filter Figure 18 6 This PLCHIP_Pxx_qei properties window is used to configure specific parameters for the quadrature counter inputs Quadrature Mode The quadrature mode sets how the quadrature counter inputs will operate Non quadrature Counter increments for each pulse on B QEI_ PHB input A QEI_ PHA input sets the direction of count X2 X2 quadrature mode Only two edges are counted per quadrature pulses on inputs A and B X4 X4 quadrature mode All edges are counted per quadrature pulses on inputs A and B Flags Optional flags may be configured for added versatility These flags alter the way inputs are handled Invert Direction Inverts the count direction Invert Index Inverts the active state of the index input QEI IDX Index Resets A pulse on the Index input QEI_ IDX will cause the Position Counter to reset Counter Position Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 198 Chapter 18 Timers amp Counters Index Gating Index Gating flags may be configured
97. BeConstant 1007 Global Variable is defined as a constant so external must be constant message gt Variable 0 is defined as CONSTANT Variable_TooManylnit 1008 array has to many initializers message gt Variable 0 has too many initializers Function_NotDefined 2001 Function is not defined message gt Function 0 is not defined FunctionBlock 3000 Generic Function Block Error Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 219 Chapter 22 Troubleshooting Member Name Value Description FunctionBlock_InstanceUndefined 3001 Function Block Instance is not defined message gt Function Block instance is undefined 0 Function Block name 0 not supported here Errors During Structured Text Code Generatrion The following is a list of structured text specific error messages that may be encountered when structured text code is generated Member Name Value Description Variable _NotDefined 1001 Variable is not defined message gt Variable 0 is not defined Func_GenCode 2000 Generic code generation error message gt Failed generating code for 0 Func_GenCode_TooManyParams 2001 In function call user specified too many function parameters message gt Too many parameters for function call 0 Func_GenCode_TooLittleParams 2002 In function call user didn t specify enough function parameters message gt Too little parameters for function call 0 Common Ladder Diagram Errors When creating ladder d
98. C port and FM24XXX should be listed Both these items are required for retentive memory to operate correctly If these devices are not pres ent they must be installed See Chapter 4 Configuring Targets Click on the FM24XXX highlight and click the PRoPeRTEs button The RAMtron FM2xxx Properties dialog will open This dialog is used to configure the Retentive Memory See Figure 7 2 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 13 Chapter 7 Retentive Variables amp EEPROM Memory L Part Part Number Device Select ZAC Size Num Retentive Bytes Num User Bytes Figure 7 2 When configuring for PLC on a ChipTM select the I2C port from the I2C Port drop down menu and Q the FRAM part number from the Part Number drop down The Device Select should be 0 and the Size is based on the actual FRAM part number Q If the target automatically configures the FRAM device these settings are preset The number of bytes on the device is divided into Number of Retentive Bytes Num Retentive Bytes and the Number of User Bytes Num User Bytes The Num Retentive Bytes are where retentive variables are stored on power loss The Num User Bytes are used for the program to store information using the EEPROM_ WRITE and EEPROM_Read function blocks To set the amount of retentive memory int he Num Retentive Bytes box enter the desired number of bytes that should be retentive up to the maximum allowed for the device The Nu
99. DER Toolkit ccccsseeeeeeeeeeeeeeeeeeeeeeeeeeensenensanes 9 Activating the EZ LADDER TOoolkit ccccseceeeeeeeeeeeeeeeeeseeeeeeeeeeeeenees 11 Installing Additional Copies of EZ LADDER Toolkit cccsssseeeeees 13 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual Chapter 1 Getting Started What s New or Changed in V1 1 1 0 Updated release of this manual for EZ LADDER Toolkit V1 1 1 0 EZ LADDER for the P Series PLC ona Chip based product line For M Series based PLC on a Chip products refer to the M Series EZ LAD DER Toolkit User Manual New Networking J1939 amp NMEA 2000 With this version J1939 is supported on all P Series PLC on a Chip targets Additionally NMEA 2000 is also supported Refer to Chapter 14 New Hardware Target VB 2XXX New Model Versatile Base 2X Series based on P Series PLC on a Chip 12 Inputs 8 Outputs CAN Port 2 Serial Ports 7 Analog Inputs 1 Analog Output Ethernet Port and supports Display Keypad HMI Expand able with additional I O Thermocouple inputs and VBDSP HMI board Update to Hardware Target ICM BB P13 XX Added expansion option to ICM BB P13 XX Bear Bones controllers P Series for CM PUI 01 programmble user interface Adds direct control of all on board ICM PUI 01 I O to be controlled directly from ladder dia gram Updated Structured Text Functions Listed are some additional ST Functions and Features added for the P Se
100. E SETTIME SETDATE Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 2 8 Chapter 24 Function Reference GETTIME GETTIME Description EN Q The GETTIME function reads the current time from the hardware real time clock The values of the time are stored into the integer variables on the output pins The enable EN must be true for the GETTIME function to be enabled HR The Q output is true when the function is enabled The HR output returns the hour of the day 0 23 the MN output returns the minutes and the SC returns the seconds The HR MN and SEC outputs must be connected to Integer variables Input Output Connections MN The GETTIME function block placement requires connections of one input pin EN and four output pins Q HR MN SEC Torin Type Integer Real Boolean Timer Active state ren not TTX ame o om x if _ BE E WE D D BE Output Output Example Circuit CRI GETTIME Hp sg Hour _ MN eg Minute SC ei Seconds Related Functions GETDATE SETTIME SETDATE Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 219 Chapter 24 Function Reference GREATER THAN gt GREATER THAN Description The GREATER THAN provides an if greater than comparison for the Px inputs The num ber of inputs is specified when the object is placed The output Q is true if P1 is greater than P2 and P2 is greater than P3 and so on The enable EN must be true for
101. EMENT UNDERSTANDS IT AND AGREES TO BE BOUND BY ITS TERMS AND CONDITIONS
102. EZ LADDER Toolkit Ladder Diagram Project Save The Save menu item is used to save the currently selected EZ LADDER Toolkit Ladder Diagram Project If the project has not been saved previously the Save As dialog is displayed Save As The Save As menu item is used to save the currently selected EZ LADDER Toolkit Ladder Diagram Project under a new name Print Opens the Print dialog box for printing the currently selected EZ LADDER Toolkit Ladder Diagram Project with the settings defined in the Print Setup menu Print Preview Opens a window to view the ladder diagram project as it is to be printed Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 16 Chapter 2 Navigating EZ LADDER Toolkit Print Setup Opens a window to configure print and printer settings Exit Closes all currently opened ladder diagram projects and closes the EZ LADDER Toolkit application program EDIT MENU The EDIT Menu includes the standard windows functionality for editing and editing preferences The EDIT Menu items are Undo Redo Cut Copy Paste Select All Settings Undo The Undo will cause the last action performed to be undone Redo The Redo will cause an action that was undone using the Undo to be repeated or completed again Cut The Cut menu is disabled in the EZ LADDER Toolkit To delete an object or multiple objects select the object s using the selector tool and remove by press the DELETE key Copy The Copy is disable
103. FLAG Flag on IDX When index is true the LFLAG will set and latch while DFLAG will be set only while the condition is maintained Flag on CMP When actual count value value of the DTR register the LFLAG will set and latch while DFLAG will be set only while the condition is maintained Flag on BW When enabled when counter wraps from zero to maximum the LFLAG will set and latch while DFLAG will be set only while the condition is maintained Flag on CY When enabled when counter wraps from maximum to zero the LFLAG will set and latch while DFLAG will be set only while the condition is maintained The DFLAG and LFLAG is typically read using digital inputs that are specific to each target Refer to the target s User Manual In addition to the hardware inputs that control the LS7366R the CNTR_LS7366R function block is used in EZ LADDER to read the count reset the count and control the registers Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 202 Chapter 24 Function Reference Function Block Inputs EN RC LD LC PD PC Function block enable Boolean When true the function block is enabled Read Count Input Boolean When true the actual count is internally copied to OTR and then OTR is output at the count output CT When false the OTR is output at the count output CT without copying the actual count Load DTR input Boolean When true the DTR register is loaded with the value of the
104. GN 2 Serial Ports RS232 RS485 2 CAN Ports Ethernet Port EEPROM Storage 4000 bytes Modbus Master Slave Modbus TCP over Ethernet OptiCAN Networking J1939 NMEA 2000 Networking J1939 Transmit PGN J1939_ TX_PGN Jump JMP Label Latching Coil LATCH Limit LIMIT Natural Logarithm LN Base 10 Logarithm LOG Modbus Master MODBUS_MASTER Moving Average MAVG Maximum MAX Minimum MIN Modulo MOD Multiplication MULT Multiplexer MUX Bitwise NOT NOT Optican Node Status OPTICAN NODESTATUS Optican Transmit Message OPTICAN_TXNETMSG Bitwise OR OR PID PID PLCHIP Quad Counter CNTR_PXX_QEl PLCHIP Quad Counter Compare CNTR_PXX_CMP PLCHIP Quad Counter Velocity CNTR_PXX_VEL PWM PWM PWM Frequency PWM_FREQ Rising Edge Detect R_TRIG Random RANDOM Convert to Real REAL Rotate Left ROL Rotate Right ROR Reset Set Reset Dominant RS Seed Random SEED Select SEL Serial Print SERIAL_PRINT Set Date SETDATE Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 229 Chapter 23 Hardware Targets Set Time SETTIME Time Delay Off TOF Shift Left SHL Time Delay On TON Shift Right SHR Timer Counter TimerCounter Sine SIN Pulse Timer TP Square Root SQRT Uart Set Property UART SET PROPERTY Set Reset Set Dominant SR Unlatching Coil UNLATCH Structured Text Function ST_FUNC Bitwise XOR XOR Structured Text Function Block
105. I AN TXNETh Related Functions OPTICAN NODESTATUS Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 316 Chapter 24 Function Reference OR Description The OR function provides a bitwise OR function of the P1 and P2 inputs The enable EN must be true for the OR function to be enabled The Q output is true when the OR pr is enabled Input Output Connections The OR function block placement requires connections of 3 input pins EN P1 P2 and two output pins Q O Active State Other Details Output Output Example Circuit Related Functions XOR AND NOT OM P o S o a ee ee SS ae ee ee a RES ee ee E Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 317 Chapter 24 Function Reference PID PID Description The PID function provides an easy to use PID control algorithm Specific PID information is required when the function is placed as well as the PID inputs The Q is true when the function is enabled The CO Control Output is the output calculated by the PID The ER is the error calculation of the PID SP PV The PID function is defined by the difference Equation u n u n 1 Kp e n e n 1 Ki T e n Kd T e n 2 e n 1 e n 2 Where u n PID Output Kp Proportional Gain Ki Integral Gain Kd Derivative Gain e n Error Setpoint Process Variable T Sample Period a9 PidPropertiesForm Name Name of the PID funct
106. II Example Circuit Related Functions MIN Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 305 Chapter 24 Function Reference MIN MIN Description EN Q The MIN function compares all the Px input values and outputs the smalled of them on the O Output The number of inputs is specified when the object is placed The enable EN must be true for the MAX function to be enabled DI 0 Input Output Connections The MIN function block placement requires connections of at least 3 input pins EN P1 P2 and two output pins Q O The EN is always considered an input in the total number of inputs therefore always add one to the number of Px inputs that need to be used p en Type Integer Real Boolean Timer Active sts omer Dorais Cen not fT XT treme SC ot fx fx __ _Naberofinputsis anemic 2 owt y ee ee CH ee Example Circuit Related Functions MAX Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 306 Chapter 24 Function Reference MOD MOD Description EN H The MOD function calculates the modulo remainder of the division using the inputs P1 and P2 The P2 number should be greater than zero zero or less than zero will cause the function to return invalid data the output The enable EN must be true for the MOD func tion to be enabled DI O0 P2 Input Output Connections The MOD function block placement requires connections of three i
107. LIMIT Natural Logarithm LN Base 10 Logarithm LOG Modbus Master MODBUS_MASTER Moving Average MAVG Maximum MAX Minimum MIN Modulo MOD Multiplication MULT Multiplexer MUX Bitwise NOT NOT Optican Node Status OPTICAN NODESTATUS Optican Transmit Message OPTICAN_TXNETMSG Bitwise OR OR PID PID PWM PWM PWM Frequency PWM_FREQ Rising Edge Detect R_TRIG Random RANDOM Convert to Real REAL Rotate Left ROL Rotate Right ROR Reset Set Reset Dominant RS Seed Random SEED Select SEL Serial Print SERIAL_PRINT Set Date SETDATE Set Time SETTIME Shift Left SHL Shift Right SHR Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 228 Chapter 23 Hardware Targets Sine SIN Square Root SQRT Set Reset Set Dominant SR Structured Text Function ST_FUNC Structured Text Function Block ST_FUNC_BLKk Subtraction SUB Tangent TAN Convert to Timer TIMER VB 2100 Features On Board Real Time Clock Retentive Memory FRAM 480 bytes 12 Digital Inputs Sink Source DC 8 PWM On Off Digital Outputs DC 3 High Speed Counter Timer Inputs NPN PNP SD Card Support 7 Analog Inputs Range Type Field Adjustable 1 Analog Output Range type Field Adjustable 2 Serial Ports RS232 RS485 1 CAN Port Supported Function Blocks Less Than lt Less Than Equal To lt Not Equal To lt gt Equal To Greater Than gt
108. Licensee further acknowledges that any applications made by Licensee using the Licensed Software including any incorporated into Resulting Products are derivative works made solely with the authorization of Divelbiss in consideration for which Licensee agrees to provide upon request from Divelbiss copies of all such applications to Divelbiss and grants to Divelbiss a perpetual irrevocable royalty free license to copy and use such applications so long as Divelbiss is not competing with Licensee Licensee shall not nor will it assist others in attempting to decompile reverse engineer or otherwise re create the source code for or functionality of the Licensed Software Licensee shall not use the Licensed Software for the purpose of developing any similar or competing product or assisting a third party to develop a similar or competing product At no expense to Divelbiss Licensee will take any action including executing any document requested by Divelbiss in order to secure perfect or protect the rights of Divelbiss in the Licensed Software or Confidential Information as hereinafter defined 11 Confidentiality Except as expressly provided in this Agreement Licensee shall not disclose or permit disclosure to any third parties the Licensed Software including object code source code and documentation or any other confidential information provided by Divelbiss Confidential Information Further Licensee will use all reasonable pr
109. M f P2 Coils Contacts Functions Variables Labels Figure 22 2 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual m Z 221 Hardware Targets CHAPTER 23 This chapter provides detailed information for P Series PLC on a Chip based hardware targets including supported functions and features for each as well as specific information needed to use hardware features Chapter Contents P Series PLC on a Chip Integrated Circuits cccccsesseeeeeeeeeeeeees er NA E HEC P5xxx TT TEE FE G NEE HEC P5100 BEE VB 2XXX SOC S EEN VB 2000 ee VI O REN VBD 22O EE P Series Bear Bones ControllerS ccccccececececececscececececeneeeecacaeecsnennneaes ICM BB P13 30 cccececececscecececececcccceceeeeeanacaceaeauaeneceneneeeenaeaeaneanenneneaeneees Teil ak eee eee ee ee eee nnn nnn ennn Divelbiss Corporation P Series EZ LADDER Toolkit User Manual Chapter 23 Hardware Targets P Series PLC on a Chip Integrated Circuits Each P Series PLC on a Chip integrated circuit model supports different features and function blocks Typically the larger memory models support more features and function blocks For all P Series PLC ona Chip models any feature listed must be individually installed using the Project Settings Menu PLCHIP P13 5122X All listed features and function blocks listed are supported individually Using certain features or
110. M message Is a global transmit The message Transport Type is defined in the database and it determines the type of message None BAM or DIRECT CONNECT To set a PGN as a BAM message it must be configured in the J1939 User database Figure 14 33 illustrates the configuration options drop down boxes The controller will handle all the data manipulation required to transmit BAM messages if configured to use BAM in the database Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 157 Chapter 14 CAN Networking DIRECT CONNECT J1939 Direct Connect is supported in EZ LADDER Toolkit and can be selected as the Transport Type for a PGN in the J1939 User database No additional configuration is required Refer to the J1939 specification for more information regarding Direct Connect EZ Edit 11939 Database weg wg Parameter Group Information NMEA Fast Broadcast DLC Transport Type KE Packet FON Description Priority Rate 6550 PGN Description Parameter Information For NMEA 2000 message SPN Field SPN Descnption Start Byte Start Bit Bit Length Gain Offset Data Type Figure 14 33 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 158 CHAPTER 15 SPI Devices and Support This chapter provides basic information to understand how to install configure and use the SPI Devices and SPI features in the EZ LADDER Toolkit Chapter Contents SPI BUS DEVICES casi ercchuinceescsecsindsvanuatnad
111. MP Keypad KEYPAD Keypad2 KEYPAD2 Label Latching Coil LATCH LCD Clear LCD_CLEAR LCD Print _CD_PRINT Limit LIMIT LS7366R Quad Counter CNTR_LS7366R Natural Logarithm LN Base 10 Logarithm LOG Modbus Master MODBUS_MASTER Moving Average MAVG Maximum MAX Minimum MIN Modulo MOD Multiplication MULT Multiplexer MUX Bitwise NOT NOT Optican Node Status OPTICAN NODESTATUS Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 223 Chapter 23 Hardware Targets Optican Transmit Message OPTICAN_TXNETMSG Bitwise OR OR PID PID PLCHIP Quad Counter CNTR_PXX_QEl PLCHIP Quad Counter Compare CNTR_PXX_CMP PLCHIP Quad Counter Velocity CNTR_PXX_VEL PWM PWM PWM Frequency PWM_FREQ Rising Edge Detect R_TRIG Random RANDOM Convert to Real REAL Rotate Left ROL Rotate Right ROR Reset Set Reset Dominant RS Seed Random SEED Select SEL Serial Print SERIAL_PRINT Set Date SETDATE Set Time SETTIME Shift Left SHL Shift Right SHR Sine SIN Square Root SQRT Set Reset Set Dominant SR Structured Text Function ST_FUNC Structured Text Function Block ST_FUNC_BLKk Subtraction SUB Tangent TAN Convert to Timer TIMER Time Delay Off TOF Time Delay On TON Timer Counter TimerCounter Pulse Timer TP Uart Set Property UART SET PROPERTY Unlatching Coil UNLATCH Bitwise XOR XOR Divelbiss Corporation
112. Mode The target did not send a no acknowledgement during communications with EZ LADDER Toolkit This error can occur occasionally based on many factors Click ok to clear Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 217 Chapter 22 Troubleshooting Object already there Editor Mode An object already exists where you are trying to place another object Select a new location to place the object Object type X not found Aborting load Editor Mode Error loading program into EZ LADDER Toolkit The ladder diagram file may be corrupt Packet contained a formatting ERROR Monitor Mode An packet formatting error was detected in a packet during communication with a target Packet contained an invalid checksum Monitor Mode An invalid checksum was detected in a packet during communication with a target Packet length was invalid Monitor Mode An invalid communications packet length was detected during communications with the connected target Please save project before compiling Editor Mode EZ LADDER Toolkit projects must be saved prior to allowing them to be compiled Save the ladder diagram project Please select a target Editor Mode A target has not been selected You must select and configure a target in the Project Settings before placing any objects and function blocks Please select a target before compiling Editor Mode Unable to compile because no target was selected You must select and configure a t
113. NAL Name ZO mm Rung Description ElapsedTime Setpomt Setpomt FUNCTION Name Ruiigpe Description NOT USED AIQ All AD AOO ElapsedTime GPIO0 GPIO1 GPIO18 GPIO19 GPIO20 GPIO4 Setpoint CONTACTS WITHOUT COILS Name Rung Description COILS WITHOUT CONTACTS Name Run Page 1 of 1 Figure 20 3 Divelbiss Corporation EZ LADDER Toolkit User Manual 214 CHAPTER 22 Troubleshooting This chapter provides basic information to understand how to solve problems and to iden tify problems and common error message found using the EZ LADDER Toolkit Chapter Contents Leien LE 216 Structured Text Errors geed 219 Errors During Structured Text Verifying ccccssseeessseeeeseeeeeeeeenees 219 Errors During Structured Text Code Generatrion cc ssseesseeeeeeees 220 Common Ladder Diagram Errors sccccessseceeseeeeessneneeneeseeeeeseaseesenes 220 Connecting Functions to Functions Errors c cccscccssseesseeeeeeeeeeeees 220 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 215 Chapter 22 Troubleshooting Error Messages The following is a list of error messages that may be encountered when using the EZ LADDER Toolkit While you may experience any of these messages many are rarely encountered These error message may appear as pop up dialog boxes or in the Output window A different program is running Monitor Mode When connecting to a target the program runni
114. Next to continue poration EZ Ladder Toolkit 1 1 0 0 Space required 235 8MB Space available 742 8GB Nullsoft Install System v2 46 EZ EZ Ladder Toolkit 1 1 0 0 Setup ee bo Choose Start Menu Folder Choose a Start Menu folder for the EZ Ladder Toolkit 1 1 0 0 shortcuts ka Select the Start Menu folder in which you would like to create the program s shortcuts You can also enter a name to create a new folder Administrative Tools Adobe Adobe Design Premium CS4 10 Chapter 1 Getting Started Activating the EZ LADDER Toolkit Until EZ LADDER Toolkit is activated it will only operated in DEMO mode which does not connecting to actual hardware targets controllers or downloading programs Now that the EZ LADDER Toolkit is installed it must be activated to enable all the features You will need the following to activate your EZ LADDER Toolkit 1 An internet connection and web browser like Internet Explorer does not have to be the computer that EZ LADDER is installed on 2 Your EZ LADDER Toolkit CD Case You will need your CID Code located on the back of the case 3 EZ LADDER Toolkit installed Once activated EZ LADDER Toolkit is fully functional and will operate with hardware targets The process of registering and activating is completing the on line registration form receiving a counter key This key must be loaded into EZ LADDER Toolkit and when loaded it will activate your copy of EZ L
115. OF TOF Description IN Q The TOF off delay timer time delay on drop out is a programmable timer with a variable turn off time When the input IN input is true the output Q is true When the input IN sees a transition from true to false the timer begins timing When the elapsed time ET is equal to the preset time PT the output Q de energizes goes false When the input PT ET IN sees a false to true to false transition the timer is reset and begins timing again Input Output Connections The TOF function block placement requires connections of two input pins IN PT and two output pins Q ET n Type Integer Real Boolean Timer Active State Other Dotais On gll Falingeoge cer mt x se re gt e owe o d x E Example Circuit Timing Diagram mmm mm mmm 1 moO ET PT ET i E Ss ZS P S 0 Elapsed Time em PUE On 1 m ee ee o o l False Off p O EE EE E ee True On IN wen False Off Related Functions TON TP Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 346 Chapter 24 Function Reference TON TON Description N Q The TON on delay timer time delay on pick up is a programmable timer with a variable turn on time When the input IN input is true the timer begins timing When the elapsed time ET is equal to the preset time PT the output Q energizes goes true When the input IN s
116. OR Vin 5 THEN Vout 1 ELSE Vout Us END IF Figure 26 7 Comments are used in a function or function block to explain clarify and document what a section of struc tured text does and any information the programmer wants to include Comments are helpful when revisiting code in a function or function block Comments may appear anywhere in the structured text and have no effect on the structured text execution Comments are identified in structured text by the use of parenthesis and astericks or Figure 26 8 is an example of adding comments to a function block FunctionBlock1 e FUNCTION BLOCK FunctionBlockl VAR INPUT Enable bool Vin dint Input value END VAR VAR OUTPUT bool Vout bool Output value END VAR Oo Enable IF Vin 1 OR Vin 5 THEN Look for 1 or 3 input j Vout 1 Set Output to 1 if input is 1 or 5 ELSE Vout OQ Set Output to 0 for all others END IF 8 F Figure 26 8 Arithemtic Operators amp Functions A major advantage to programming in structured text is the ability to make custom functions or function blocks that include complex calculations and mathematical features Structured text supports many arithme tic operators and standard functions for creating these complex calcuations Figure 26 9 lists the standard arithmetic operators supported by EZ LADDER Toolkit s function ST Editor Although not shown a semi colon ends each operat
117. P Series PLC on a Chip Target supports one 1 on board analog output and it also uses pin 12 Al3 Therefore functionality on pin 12 may be configured as and analog input AI3 or an analog output AOO but not both Care should be taken when mapping analog I O as to fit this into the requirements Installing Analog Inputs for PLC on a Chip Targets Select the target PLCHIP PXX and click the properties button The Target Properties window will open From the drop down menu DCPN select the model part number of the target If any Analog Outputs are installed they will be listed in the Devices pane under the Internal Analog I O section Click the ADD DEVICE button The Target s Devices window will open All the available devices and features for the target are shown in the Devices section Scroll down and find the Analog I O Figure 17 7 shows the Targets Devices window a Internal Analog VO Properties Inputs Name Figure 17 7 Select Analog I O and click ox The Internal Analog I O Properties Window will open See Figure 16 2 Click the app outputs button to add analog outputs Anew Add Analog Outputs dialog will open Select the analog output channel s that are required AOx holding the CNTRL key will allow multiple selections if necessary and click ox The Add Analog Outputs dialog closes automatically and the analog outputs should now ap pear under the Outputs section of the nternal Analog I O Properties window Click ok
118. Q is true when the read cycle has completed Q The same variable type that writes to the EEPROM location should be used to read the EEPROM location A memory map is recommended for organizing variables stored in EEPROM Each EEPROM address is absolute and is one byte in size Boolean variables fill two bytes while all other variable types fill four bytes of EEPROM When reading variables from EEPROM storage it is important that use the exact address location for the variable only taking into account variable types and sizes See EEPROM_WRITE for more on how variables are written to EEPROM storage Input Output Connections The EEPROM_READ function block placement requires connections of two input pins EN AD and two output pins Q V eps type integer Real Boolean Timer ActiveState orner Dotais en mt X Rising ese a gt mt x 2 Lon LIT A Lo Is xs Tv TI Example Circuit PROM_REAI Related Functions EEPROM WRITE Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 211 Chapter 24 Function Reference EEPROM WRITE EEPROM WRITE Description EN Q The EEPROM_WRITE function allows variables to be stored in non volatile memory EEPROM The function is enabled when the EN sees a false to true transition AD provides the actual address to write to EEPROM and V is the actual value that is written Q is true when the write cycle has completed without error AD Q The same
119. Refer to the hardware target s User Manual for Updating the Kernel and Ladder Diagram An installed SD Card may be used to install or update a kernel or ladder diagram or both The SD Card must have a directory named update The files to be installed or updated are located in the update direc tory of the SD Card If the kernel is to be udpated or installed the actual target kernel file dat must be copied or loaded into the update directory on the SD Card This file can be found in the EZ LADDER kernel directory or other kernel files may used from other sources such as downloading from the website etc This file loading on the SD Card is done outside of EZ LADDER and the hardware target The kernel will only update from the SD Card when the kernel name dat matches the kernel name installed on the hardware target and the version of the kernel on the SD CARD is newer The kernel will install on a new target without kernel installed already if there is only one kernel file only 1 xxx dat in the update directory If the ladder diagram is to be udpated or installed the actual compiled ladder diagram file hex must be copied or loaded into the update directory on the SD Card This file is found where the actual ladder diagram dld file is located This file loading on the SD Card is done outside of EZ LADDER and the hardware target The compiled ladder diagram program hex will only update from the SD Card when the filename he
120. S7366R must first be installed and configured As the PLC on a Chip is the most commonly used target for the LS7366R it will be used as an example to install and configure the LS7366R The LS7366R is configured using the Project Settings Using the Project Menu choose Settings The Project Settings window will open as previously covered in Chapter 4 Configuring Targets Select the target and click the properties button The Target Properties window will open From the drop down menu DCPN select the model part number of the target If a _LS7366R device were installed it would be listed in the Devices pane under the Bus SPI section Click the app pevice button The Targets Devices window will open All the available devices and features for the target are shown in the Devices section Scroll down and find the LS7366R Figure 15 4 shows the Target s Devices window r ad PLCHIP PXX Devices Devices Name Description KEYPAD Keypad LCD LCD Display Low Voltage Sense Low Voltage Sense Active Low LS7366R 32 Bit Quadrature Counter SPI MCP3204 Microchip 4 Channel 12Bit A D Converter SPI Modbus Master Modbus Master Modbus Slave Modbus Slave PLCHIP_Pxx_eeprom Intemal PLCHIP PXX 4K EEProm PLCHIP_Pioxc_qei Intemal Quadrature Encoder Interface PLCHIP Po gc Intemal PLCHIP PXX Real Time Clock PWM Pulse Width Modulator Serial Print Serial Print SPI 1 Hardware Timer Counter Figure 15 4 Dive
121. SE it will be represented by a FALSE condition in the ladder diagram not allowing power to flow through it to any following objects and function blocks When used as an internal relay the state of the contact TRUE or FALSE depends upon its internal coil state Negated Contact el e Also known as a normally closed contact the negated contact may represent real world inputs or internal relay contacts As a real world input when the input is energized TRUE it will be represented by a FALSE condition in the ladder diagram not allowing power to flow through it to any following objects and function blocks As a real world input when the input is de energized FALSE it will be represented by a TRUE con dition in the ladder diagram causing power to flow through it to any following objects and function blocks When used as an internal relay the state of the contact TRUE or FALSE depends upon its internal coil state and is always opposite of the Direct Contact Coils Coils represent two types of devices The first is real world digital output devices such as solenoids valves and motors The second is that coils may represent internal relays also named control relays CRs When acting as a real world output the ladder diagram object will control the current state of the real world output it is assigned When used as an internal control relay the coil will control the current state of the control relay s coil Divelbiss Corporation P
122. SG will not apply hereto No waiver by either party of a breach of this Agreement shall operate or be construed as a waiver of any subsequent breach The invalidity illegality or unenforceability of any provision of this Agreement shall not affect the remainder of the Agreement and this Agreement shall be construed and reformed without such provision provided that the ability of neither party to obtain substantially the bargained for performance of the other shall have thereby been impaired All notices consents and other communications between the parties shall be in writing and shall be sent by i first class mail certified or registered return receipt requested postage prepaid ii electronic facsimile transmission iii overnight courier service iv telegram or telex or v messenger to the respective addresses that the parties may provide Licensee shall be deemed an independent contractor hereunder and as such shall not be deemed nor hold itself out to be an agent or employee of Divelbiss Under no circumstances shall any of the employees of a party hereto be deemed to be employees of the other party for any purpose This Agreement shall not be construed as authority for either party to act for the other party in any agency or other capacity or to make commitments of any kind for the account of or on behalf of the other except to the extent and for the purposes provided herein LICENSEE ACKNOWLEDGES THAT IT HAS READ THIS AGRE
123. Series FRAM Installing an IC Bus in EZ LADDER lC bus availability is based on actual hardware targets Refer to the targets User Manual or Chapter 23 Hardware Targets to determine if I C is supported I C devices must be connected to the P Series PLC on a Chip per design guidelines for proper operation using pull up resistors Using the Project Menu choose Settings The Project Settings window will open as previously covered in Chapter 4 Configuring Targets Select the target and click the properties button The Target Properties window will open From the drop down menu DCPN select the model part number of the target If any IC bus is installed it will be listed in the Devices pane under the Bus l2C section Click the app pevice button The Targets Devices window will open All the available devices and features for the target are shown in the Devices section Scroll down and find the 1 C buses I2CO I2C1 etc Figure 16 1 shows the Targets Devices window Le a PLCHIP PXX Devices Devices Name Analog 1 0 CANO CAN1 Ethemet Ethemet FM24XXX Ramtron FM24XXX FRAM 2C CH DC 0 1201 LC 12C2 12C 2 KEYPAD Keypad LCD LCD Display Low Voltage Sense Low Voltage Sense Active Low LS7366R 32 Bit Quadrature Counter SP MCP3204 Microchip 4 Channel 12Bit A D Converter SPI Modbus Master Modbus Master Modbus Slave Modbus Slave Variable Names Figure 16 1 Divelbiss C
124. T AD OUTPUT AO0 Name Type LO Number Default Value Description Setpomt INTERNAL 0 0 Setpomt TIMER Name Type LO Number Default Value Description ElapsedTime INTERNAL T 0ms Page 1 of 1 Figure 20 1 Divelbiss Corporation EZ LADDER Toolkit User Manual 212 Chapter 21 EZ LADDER Toolkit Reports Cross References Report The Cross Reference Report provides a summary of the objects that are in the ladder diagram project The project objects are sorted by the type of object The actual types of objects and data to view is selected prior to generating the Cross Reference Report To generate and view this report using the Reports Menu select Cross References The Cross Reference Report dialog box will open with the choices to what objects to include in the report See Figure 17 2 a Cross Reference Report Output intemal Unused Variables Contact Without Coil Coil Without Contact Drum Sequencer Tables F Retentive Variables Network Address Register Figure 20 2 Using the check boxes provided select or de select the items desired to be included on the Cross Refer ence Report The items to select are Input This will include all real world inputs on the report Output This will include all real world outputs on the report Internal This will include all internal contacts and coils on the report Function This will include all functions function blocks used on the report Unused Variables This will lis
125. TD CTUD TP TON TOF P Insert Function k D Stat Sep A ELEMENTS on RUNG 1 Maier See Z Ak gt BR Coils H Contacts Functions Variables cat Lk ELEMENTS on RUNG 2 cr Le i 3 gt Rung Numbers KR m NUM Figure 2 4 Cross Reference Window Pane EZ LADDER Toolkit provides a real edit time Cross Reference Window This window provides lists of contacts coils variables and functions as well as their location by rung This quick reference provides an easy method to locate where a contact or other function is located in the ladder diagram program Figure 2 5 shows the Cross Reference Window Cross references are updated S S Se automatically when objects change This window may be used to find objects quickly Double click on any Q of the object rung numbers listed for an object or function and EZ LADDER Toolkit will locate and display that section of the ladder diagram The Cross Reference Window may be viewed or hidden by using the aren View Cross References Menu Labels Figure 2 5 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 23 Chapter 2 Navigating EZ LADDER Toolkit Output Window Pane EZ LADDER Toolkit provides an Output Window pane where error messages are displayed Typically error messages are only updated and displayed during a Verify operation or Compile operation Figure 2 6 dis plays an example error identified during a compile process
126. TRIG is a function that may be used to trigger another function on the rising edge of a transition When the CLK detects a false to true transition the output Q is energized for one scan of the program only Input Output Connections The R_TRIG function block placement requires connections of one input pin CLK and one output pin Q Torin Type Integer Real Boolean Timer Active State Other Details os mwe x ating o om lt o OO eow Example Circuit CRI R_TRIG1 INTEGER Timing Diagram Program Scan Tinje Related Functions F_TRIG Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 324 Chapter 24 Function Reference ROL ROL Description EN Q The ROL function provides a left bit rotation of the P1 input P2 specifies the number of one bit rotations The P1 number is a integer representation of a binary number The P2 number is an integer representation of the number of binary rotations shifts to occur to P1 The actual bit only rotates when the maximum number is reached example 32 bit DI O0 rotation to the input number 1 The enable EN must be true for the ROL function to be enabled The Q output is true when the ROL function is enabled The O Output is the ro tated number represented in integer form Input Output Connections P2 The ROL function block placement requires connections of 3 input pins EN P1 P2 and two output pins Q O Wm Type
127. The Target s Devices window will open All the available devices and features for the target are shown in the Devices section Scroll down and find the Analog I O Figure 17 1 shows the Targets Devices window a PLCHIP PXX Devices Devices Name Description CANO CAN 0 CAN1 CAN 1 Ethemet Ethemet FM24XXX Ramtron FM24XXX FRAM LC LCD LC 0 LC 12C 1 12C2 12C 2 KEYPAD Keypad LCD LCD Display Low Voltage Sense Low Voltage Sense Active Low LS7366R 32 Bit Quadrature Counter SPI MCP3204 Microchip 4 Channel 12Bit A D Converter SPI Modbus Master Modbus Master Modbus Slave Modbus Slave Variable Names Figure 17 1 Select Analog I O and click ox The Internal Analog I O Properties Window will open See Figure 17 2 Click the app INpuTs button to add analog inputs Anew Add Analog Inputs dialog will open Select the analog input channels that are required AIO through Al7 holding the CNTRL key will allow multiple selections and click ok The Add Analog Inputs dialog closes automatically and the analog inputs should now appear under the Input section of the nternal Analog I O Properties window Click ok to close the Internal Analog I O Properites window The Analog I O should now be listed in the De vices pane under Internal Click ok to close the Target Properties window Click ox to close the Project Settings window Be sure to save the ladder diagram project The analog inputs are now installed and r
128. This setting identifies when to broadcast the CAN Receive errors identified by this controller node The broadcast trigger may be selected by clicking in the table The selections are Specified Interval Change of State and Specified Interval and Change of State When the OptiCAN properties have been configured click ox to close the OptiCAN Properties dialog and return to the the Target Properties window OptiCAN is now listed in the Devices pane under Device Click ox to close the Target Properties window and click ok to close the Project Settings window Be sure to save the ladder diagram project OptiCAN is now installed and ready to be used in the ladder diagram Controller OptiCAN Network Register Assignments The OptiCAN network operates based on preset and user defined registers The following are general reg ister assignments and information common for all OptiCAN enabled controllers For non controller devices please consult the product s data sheet for detailed register assignments and preset functions General Register Assignments These are the overall general register assignments common to all OptiCAN enabled devices Register Number Assigned Function Use 0 127 User Defined Controller Registers and I O Defined Registers 128 191 Common Broadcast Registers 192 255 Common Configuration and Command Registers User Defined registers for controllers are available for the user to define the use of during the ladder diagram project
129. USER MANUAL P Series Standard Edition EZ LADDER TOOLKIT ONE TOOLKIT FOR MULTIPLE SOLUTIONS Release Version 1 07 For EZ LADDER V1 1 1 0 Divelbiss Corporation 2004 2014 Table of Contents Table of Contents Chapter 1 Getting Staite eieegegegegeegee este cs ceeusentaenet ne eege 6 What s New or Changed in V1 1 1 0 Eer 7 HOw to Us this Manual eege eebe eege 8 installing the EZ LADDER TOOUK ssiscciscccccnceensecendcsnssisensewanecctasiwnsisnscsiinnes ENNER EAAEEESAENE KEEN ECKER EEN 9 Activating th EZ LADDER TOGUKIE scicsecncccsienasnddnstenccedendenceeresdoncctidvedewnctduvetouccucnabtoadnedvaiboncicdesemediiedesdonses 11 Installing Additional Copies of EZ LADDER Toolkit ccccssceeeseseeeeeseeseeeseseeeseeeeanesenenesseeneesoaeees 13 Chapter 2 Navigating EZ LADDER Toolkit cee cececceeeeeeeeeeeeeeeeeeseeesenenens 14 EZ LADDER Toolkit OVGRVIOW eege 15 EZ LADDER eet MENUS sisiraan eA EERE TEE EEA EEEE EA E EAE NEE ENE EEEREN EERENS 16 EZ LADDER Toolkit Tool Bars and Tool Bar Buttons ccc cceceeeeeeeeeeeeeeeeeeeeeeseeeseeeeeseeneeseeenseneneaaes 20 Ladder Di gram ett 22 Cross Reference Window Pane epes EEN 23 Output Window TEEN 24 Opening Existing Ladder Diagram Project Files cccssseeseeseeeseeeeeeeeeeeeeeeeeeeeseeseeseeesesneeseeneesneneeses 24 Chapter 3 Ladder Diagram Ba SICs ccccsccesseeseeeeeeeeeeeeeeeeeseneseeeseneseeesneaens 25 Relay L
130. Vars The Variables window will open as shown previously Use the app button to create variables as needed When function blocks are used with variables as previously covered only supported variable types Q are allowed Typically most function blocks will lock the types of variables linked to it s outputs as the same type linked to it s inputs When changing variable types that are an input or an output to a function block delete the variables and function block Then insert the function block and new variables to remove all the variable type associations that previously existed Variable Types There are four variable types supported in the EZ LADDER Toolkit They are Boolean BOOL REAL INTEGER and TIMER Each type of variable exists for specific purposes and each has pros and cons de pending upon the ladder diagram project needs Examples of Variables Boolean 0 or 1 False or True Off or On Real 234 56 192 345 Integer 1 525 1034 Timer Days Hours Minutes Seconds Milliseconds Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 51 Chapter 5 Creating Ladder Diagram Projects Boolean Variables Boolean variables are based on only being in one of two states typically either true or false 1 or 0 On or Off Boolean variables are most commonly used for contacts and coils but also may be used with function blocks as individual bits Boolean variables are 1 byte in size Real Variables Real vari
131. What is Pulse Width Modulation cccescceeeeeeeeeeeeeeeeeeeeeeeeeeeeeneeseeneeee 79 PWM Output E 79 Configuring PWM in Project SettingS cccccssseesssseesseeeeeseeeeeseaeeesenes 80 Controlling PWM in the Ladder Diagram Project ccsssseesseeeeeeees 81 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 18 Chapter 8 Pulse Width Modulation What is Pulse Width Modulation Pulse Width Modulation also referred to as PWM is a term common to the industrial controls and electronics industries Essentially PWM is generally an output that can be controlled in such a manner that will cause a device connected to have varying operation Consider a light dimmer changing the knob changes the light intensity this is how a PWM output can affect a load such as a light PWM does what it s name implies By turning a PWM output on at a fast rate the load device will appear to be on all the time even though it is actually being turned on and off quickly The rate at which the PWM output is turned on and off is called the frequency As the frequency changes faster or slower the result on the load device changes like the light example from bright to dim The PWM outputs a square wave and the time on vs the time off is the duty cycle Figure 8 1 illustrates an example PWM output waveform Frequency 1 Freq Freq 50 Duty Cycle 2 50 3 75 Duty Duty Cycle Cycle PWM OUTPUT CHANNEL Figure 8 1 PWM Outpu
132. When an error message identifies a location e ERROR Object Motor at 9 1 doesn t have a Q left link at 8 1 the first number in the location refers to the column in the workspace while the second number refers to the actual rung number where the error occurs Column Rung i Starting werify LINK ERROR Yertical or Object link not found at 1 1 ERROR Object Motor at 9 1 doesn t have a left link at 6 1 Errors found 10 1 Figure 2 6 If the Output Window is not visible and an error is detected during a compilation the Output Window will be reset to a visible state to announce the error Opening Existing Ladder Diagram Project Files Existing ladder diagram project files may be opened and manipulated by editing downloading and saving To open an existing ladder diagram project dld file use the File Open menu Password protection is enforced if enabled in the project settings When enabled to open the ladder diagram file you will be required to enter a password that will be compared against the ladder diagram file s credentials list Only allowed permissions for the password entered will be allowed If the password entered is not in the list then the ladder diagram file cannot be opened or viewed Refer to Chapter 25 Password Protection for password details Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 24 CHAPTER 3 Ladder Diagram Basics
133. Z LADDER Toolkit User Manual Day lt CH Di a 106 CHAPTER 13 Modbus Networking This chapter provides basic information to understand how to install configure and use the Modbus Networking feature in the EZ LADDER Toolkit Chapter Contents Modbus e e 108 Installing the Modbus Master csccccsseesseeesseeeseeeeeeeneseneneeneneenensaaes 108 Using the Modbus Master ccccssessseseeeeeeeseeeeeeneeseneeseneeeseseeseeeeeenees 110 Net eebe 116 Configuring for Modbus Slave cccccceeseeeeeseeeseeeeeseeeeeseeeneeeeneeseaeees 116 Updating Network and Variable Values csccssseeseeeeeeeeeeeeeeeneeeenees 120 Modbus Slave Communication Errors cccccssecesseeeeeeeeeeeeesseeeeesenes 120 Modbus Slave Supported Master Functions ccccsseeeeeeeeeeeeees 121 Modbus TCP over Ethernet ccccccsseecseseeeesseeeeeseeeeeeneeseeseeeeesneeeneneeses 121 Configuring for Modbus TCP over Ethernet cccssseesseseeseseeeseeees 121 Modbus using Multiple Ports cccscseeeseeesseeeeeeeeeeeeeseseseeseseeeeeeseeenees 123 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 107 Chapter 13 Modbus Networking Modbus Overview Modbus is a register based communication protocol connecting multiple devices to a single network De vices on this network are divided into two types Master and Slave There is only one master device on a netwo
134. a right bit shift of the P1 input The P2 input specifies the number of one bit right shifts If the enable EN is false the function is disabled If the en able EN is true the output O will be equal result of the right shifted input in integer form 32 16 8 4 2 1 A shift right when the output is 1 will cause the output to be zero bit is shifted off Zeros are always shifted on to the left side when a right shift occurs Input Output Connections The SHR function block placement requires connections of 3 input pins EN P1 P2 and two output pins Q O EN Output Output Example Circuit CR Related Functions SHL ON _ 2 a Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 336 Chapter 24 Function Reference SIN SIN Description The SIN function provides the sine O from the input value P1 The enable EN must be EN Q true for the SIN function to be enabled The Q output is true when the SIN function is en abled Input Output Connections The SIN function block placement requires connections of two input pins EN P1 and two DI 0 output pins Q O x Aavetue SS SS SSES Sa SCH out Example Circuit SIN EN BaseNump PI Oj NumOut_ Related Functions ASIN ATAN COS TAN ACOS Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 337 Chapter 24 Function Reference SQRT SQAT Description The SQRT function provides the squ
135. a target ERROR putting target into bootloader Monitor Mode An error occurred when EZ LADDER Toolkit was trying to access the target bootloader Verify the serial connections and settings cables and the target Error serial port not open Monitor Mode The serial port that is configured in EZ LADDER Toolkit cannot be opened for use This may caused when another application is using and locked the serial port as a resource Close the other application to correct this Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 216 Chapter 22 Troubleshooting ERROR programming target Monitor Mode EZ LADDER Toolkit detected an undefined error while attempting to store the project on the hardware target Repeat the download and store process to correct this issue Error staring program Program doesn t exist Monitor Mode The program that is trying to start does not exist on the target Download the program This is typically caused by clicking the Go button before the ladder diagram project is loaded on the target Error starting program Program could not be started Monitor Mode The program cannot be started Re compile and download the program Error while receiving packet Monitor Mode There was an error when receiving communications packets from the target File could not be opened Monitor Mode When downloading the program to target the file with the compiled code could not be opened The file could have been moved
136. a user defined register 0 127 When broadcasting leave the Node ID empty or blank on the network Global Broadcast This method will allow for any node to have the ability to isten for this register broadcast Q Leaving the Node ID blank causes this variable to be sent to the same register number on all nodes Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 135 Chapter 14 CAN Networking ad Add Variable Name owes Description M Variable Type C Input Var I O Number C Output Default Valu 1 Internal Address Register i Retentive ge Gei Figure 14 7 a Edit Address Register Node ID Register Number 25 Broadcast Trigger Specified Interval Address Register LAN OUT Za Figure 14 8 Using the Broadcast drop down menu select a broadcast trigger The choices are None Specified Inter val Change of State and Specified Interval and Change of State This register will be broadcast when this condition is met Click ox to close the dialog and click ox to close the Add Edit Variable dialog As the register type is selected and the number entered the Address Register displayed will be updated immediately The CAN_ and the register number is automatically entered In this example when this ladder diagram project is running value of the variable OilPSI will be transmitted globally to all nodes at register 25 The interval will the
137. ables are based on numbers that use floating point math use decimal points Real variables can range from 1 7x10 to 1 7x10 Real variables are typically used for calculations and with functions where decimal point accuracy is required Real variables used with function blocks result in a slower Scan Time Real variables are 4 bytes in size Integer Variables Integer variables are based on whole numbers no decimal points Integers can be ranged from 2147483648 to 2147483647 Integers are used when decimal points are not required Integer result in a faster Scan Time than real variables Integer variables Default Value can be entered in Hexadecimal for mat Integer variables are 4 bytes in size Timer Variables Timer variables are used in conjunction with timer function blocks to provide input set points and output elapsed time Timer variables consist of milliseconds seconds minutes hours and days Timer variables are 4 bytes in size Variable Attributes For each variable type specific attributes will apply For most variables these attributes are common While some attributes are optional such as description others are required prior to creating the variable When creating a new variable it is ideal to set it s attributes with as much detail as possible Integer Real and Boolean Variable Attributes When adding new integer real or boolean variables refer to Figure 5 5 for the Add Variable dialog box The following are
138. ach device on a Modbus network must have a unique ID number Duplicate ID numbers will result O in a malfunctioning network and communication errors Click ox to close the Add Interface dialog and click ox to close the Modbus Slave Properties dialog and return to the Target Properties window The Modbus Slave is now listed in the Devices pane under the Net work Section See Figure 13 14 The Modbus Slave Properties dialog and Add Interface dialogs may also be used to adjust settings Q and change the actual hardware interface by selecting the Modbus Slave in the Devices pane and clicking the Properties button Click ox to close the Target Properties window and click ok to close the Project Settings window Be sure to save the ladder diagram project The Modbus Slave is now ready to be used in the ladder diagram For all P Series targets the actual register numbers are always base zero per Function Code Master Function Code supported When a modbus master queries a slave the function code is identified and then the appropriate bank or block of registers are accessed Register 0 will always be the first available register in any group of registers for a Function Code type command Each Function Code command type per the Modbus specification support registers from 0 to 65535 and the register groups for each Function Code are independent For example Function Code 4 Read Input Registers will support from 0 to 65535 registers and Function Code 3
139. al 96 Chapter 11 UARTS amp Serial Ports Select the UART required and click ox The UARTx Properties dialog box will open The parameters for the UART are set in this dialog See Figure 11 2 a UARTI Properties Parity Data Bits Stop Bits Baud Rate Comm Mode RTS GPIO Pin Enable ST Buffers Figure 11 2 Configure the UART by setting each of the parameters to your hardware and applications needs Parity Parity Select from None Even and Odd Data Bits Number of Data Bits Select from 5 6 7 or 8 Stop Bits Number of Stop Bits Select from 1 or 2 Baud Rate Baud Rate Select from 9600 19200 28400 57600 and 115200 Comm Mode Communications Mode Select from RS232 RS422 or RS485 Select the type of communication interface Communications Mode is subject to the actual hardware features available RTS GPIO Pin Request to Send GPIO For RS485 a GPIO output is required to hand the transmit receive pin on the RS485 transceiver The connected GPIO to the transceiver should be specified here Enable ST Buffers Check box to enable the Transmit Receive buffers for use with Structured Text Receive Buffer Size Receive Buffer Size for Structured Text Enter the number of bytes to buffer Transmit Buffer Size Transmit Buffer Size for Structured Text Enter the number of bytes to buffer When configured click ox to close the UARTx Properties dialog and return to the Target Properties window Dive
140. and saved before it may be used See the User Defined Functions and Function blocks section of this chapter Output Pane The Output Pane is where important messages and status about the open structured text user defined func tions and function blocks are listed including when any function or function block is verified for proper syntax and content Figure 26 21 is an example of a function block that has failed verification with an error This error would need to be corrected before the function block can be used Note the location line and column are shown in the lower right hand corner identifiying the location where the error was detected Output FunctionBlock 9 21 ERROR STV04001 Type aint is not defined Verify Failed Figure 26 21 User Defined Functions amp Function Blocks As previously discussed custom structured text functionality is added using user defined functions or func Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 375 Chapter 26 Structured Text tion blocks These functions blocks can be called from other ST functions blocks or from the ladder diagram Restrictions apply depending how the user defined function block is to be called See earlier sec tions of this chapter Creating a New User defined Function or Function Block 1 To create a new user defiend function or function block open the ST Editor using the EDIT ST FUNCTIONS button The ST Editor will open Click the User
141. anessaneesaneees 129 Using Controllers on the OptiCAN Network ccccccsseeessseeeseeeeeseees 129 OptiCAN Controller Heartbeat ccccccccseeeseeeeeeeeeseeeeeeeeeseeeseeeeeeeaees 129 Installing a Controller on the OptiCAN Network ccccccsssesseeeeees 130 Controller OptiCAN Network Register Assignments csesseeeee 132 Broadcasting to Other Controllers and Devices scceeeeeeeees 134 Using the OptiCAN Configuration Tool ccccssseeeeseseeeseseeeeeeeesnees 139 J1939 Networking NMEA 2000 ccccccceeseeseeeeeeeeeeeeeaeeneesseaeeeeeseeneees 144 J1939 PGN Kee 144 J1939 SPN Re TT 144 Installing J1939 in EZ LADDER Toolkit cccccssseseeeeeeeeeeeeeeeeneeeees 144 Standard J1939 Database cccceccceeeeeeeeeeeeeeeneeeeeneeeeaseeeseeneeeeeneeseanees 148 User 3431939 D t b s Seege 149 Advanced J1939 Configuration cccccscecsesseeeseeeeeeeeeeeseeeeeseeeeesseenenees 150 Receiving Data with LK E 151 Transmitting Data with J1939 c cssssssssecsnsesessesessssossssocssscassssasescasenes 154 PON REGQUGSE teicsscsenscetctcrenesarqusseesseaucsdecasanteseeuesneeesceeedtieeceteesuseseceusuesenecis 156 BAM eegene 157 DIRECT CON NEG E 158 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 124 Chapter 14 CAN Networking What is CAN CAN is short for Controller Area Network CAN networks use a two wire backbone to provide c
142. appropriately In the RUN mode select the Project menu and the select Bootloader EZ LADDER will now attemp to con nect to the hardware target and initialize it s bootloader During this time you may see a small status window If the Bootloader does not respond or an error is encountered check the serial port settings and cables Q The bootloader is a factory installed utility program on all PLC on a Chip hardware targets This utilility is used for configuring options on the target and to update or install target software kernels When the Bootloader utility responds the Bootloader screen will automatically appear See Figure 20 1 ad Bootloader Current Target Settings Target Bootloader Version 1 1 0 6 Kemel Version 0 0 1 0 Serial Number 10031672 Target Options Upload File Filename Target Kemel Version Figure 20 1 Divelbiss Corporation EZ LADDER Toolkit User Manual 208 Chapter 20 EZ LADDER Toolkit Reports Click the TARGET options button Anew Target Options window will open This window had three tabs Ether net Options USB Options and SD Card Options See Figure 20 2 a Target Options Ethemet Options USB Options SD Card Options MAC Ethemet Enabled E DHCP Enabled Host Name NECON E IP v4 Auto Config Static P Options IP Addr 192 168 1 245 Subnet 255 255 25 0 Gateway 192 168 1 1 Figure 19 2 Select the SD Card Options Tab To enable the SD Card click chec
143. ard Functions Figure 26 14 lists the supported EZ LADDER Toolkits Structured Text standard functions These functions are standard in structured text and conform to the IEC 61131 3 standard Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 369 Chapter 26 Structured Text Function Function Function Function Function eeno morn moien 156_UUNT TOLARRAY RoR OON TOREN Dn uNTTouworo wo smrrousm _UNTTOLSNT Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 366 Chapter 26 Structured Text Function Function Function Function USINT_TO_UINT WORD_TO_DINT WORD_TO_LREAL WORD_TO_UDINT USINT_TO_ULINT WORD_ TO _DWORD WORD_TO_LWORD WORD_TO_UINT USINT TO WORD WORD TO INT WOpRD TO REAL WORD TO UUNT WORD_TO BYTE WORD_TO_LINT WORD_TO_SINT WORD TO_USINT Figure 26 14 Constructs amp Statements Figure 26 15 lists the supported EZ LADDER Toolkit s Structured Text constructs and statements Construct Statement Structure IF THEN ELSIF THEN ELSE IEF statement IF expression THEN statement_list ELSIF expression THEN statement_list ELSE statement_list END IF CASE OF ELSE CASE_ statement CASE expression OF case_element case_element ELSE statement_list END_CASE FOR WHILE REPEAT EXIT FOR_statement FOR control_ variable for_list DO statement_list END FOR control_ variable identifie
144. ardware Targets Bitwise NOT NOT Optican Node Status OPTICAN NODESTATUS Optican Transmit Message OPTICAN_TXNETMSG Bitwise OR OR PID PID PWM PWM PWM Frequency PWM_FREQ Rising Edge Detect R_TRIG Random RANDOM Convert to Real REAL Rotate Left ROL Rotate Right ROR Reset Set Reset Dominant RS Seed Random SEED Select SEL Serial Print SERIAL_PRINT Set Date SETDATE Set Time SETTIME Shift Left SHL Shift Right SHR Sine SIN VB 2200 Features On Board Real Time Clock Retentive Memory FRAM 480 bytes 12 Digital Inputs Sink Source DC 8 PWM On Off Digital Outputs DC 3 High Speed Counter Timer Inputs NPN PNP SD Card Support 7 Analog Inputs Range Type Field Adjustable 1 Analog Output Range type Field Adjustable 2 Serial Ports RS232 RS485 1 CAN Port Supported Function Blocks Less Than lt Less Than Equal To lt Not Equal To lt gt Equal To Greater Than gt Greater Than Equal To gt Absolute Value ABS Arc Cosine ACOS Addition ADD Arc Sine ASIN Arc Tangent ATAN Bitwise AND AND Square Root SQRT Set Reset Set Dominant SR Structured Text Function ST_FUNC Structured Text Function Block ST_FUNC_BLKk Subtraction SUB Tangent TAN Convert to Timer TIMER Time Delay Off TOF Time Delay On TON Timer Counter TimerCounter Pulse Timer TP Uart Set Property UART_ SET PROPERTY Unlatc
145. ardware target does not support a Real Time Clock then an error dialog box may appear if you were successfully connected to the hardware target prior to press the F11 button Click ok to continue From this dialog you can compare the actual computer time and date to the current time and date set on the hardware target If you wish to synchronize the time set the hardware target to the computer time click the sync wl pc button The times should now be synchronized The ladder diagram project can be erased from this dialog by pressing the ERASE USER PROGRAM button Use caution when deleting the ladder diagram project from the target There is no Undo To reload the hardware target the original ladder diagram project must be opened compiled and reloaded to the target Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 40 Chapter 4 Configuring Targets Bootloader Target Options amp Configurations When communications is present between EZ LADDER and the hardware target there are additional op tions available in the Bootloader dialog based on the actual target connected These options are target dependent and the dialogs associated are used to configure the options In the Bootloader dialog click the TARGET options button See Figure 4 8 The Target Options dialog box will open Curent Target Settings Target gS Bootloader Version 1 1 0 6 Kemel Version 0 0 0 18 Seral Number 100285594 Upload File File
146. are root O from the input value P1 The enable EN JEN Q must be true for the SQRT function to be enabled The Q output is true when the SQRT function is enabled Input Output Connections The SQRT function block placement requires connections of two input pins EN P1 and two 4 P 0 output pins Q O x Aavetue SS SS SSES Sa SCH out Example Circuit S RT EN BaseNump PI Ofm NumOut_ Related Functions EXP EXPT LOG LN Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 338 Chapter 24 Function Reference SR SR Description The SR function acts as a set dominant bistable If the set input S is true the output Q is true A true on the reset R input sets the output Q to false only if the set S input is also false Input Output Connections The SR function block placement requires connections of two input pins S R and one output pin Q n Type Integer Real Boolean Timer Active State Other Dotais O rR mw SS ESCHER RS s ma J x S T a owe Jo S x E E Example Circuit CR SR CR3 CR 8 Truth Table Related Functions RS Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 339 Chapter 24 Function Reference ST FUNC ST_FUNC Description Ena Q The ST FUNC function is a function block for using structured text functions created in EZ LADDER Toolkit The ST FUNC has only local variables and will not allow var
147. arget in the Project Settings before compiling Please select a target before verifying Editor Mode Unable to run program verification because no target is selected You must select and configure a target in the Project Settings before verifying Targets do not match Monitor Mode When connecting to a target the target specified in the ladder diagram project does not match the actual detected hardware target connected to the serial port Correct the target in the Project Settings Target does not support bootloader Monitor Mode This specific target is too old to support any bootloader functions Contact Support for options There is not enough room for the paste Increase the number of rungs Editor Mode There is not enough rung space to paste from the clipboard Increase the number of rungs where the paste is to occur There is not enough room to the right of the paste point Editor Mode There is not enough room at the insertion point to paste objects from the clipboard Paste the objects farther left This object must be place in the last column Editor Mode Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 218 Chapter 22 Troubleshooting The selected object can only be placed in the last column All coils can only be placed in the last column Timeout ERROR Entire packet was not received Monitor Mode During communication with a target part of a packet was lost or not received Timeout ERROR Target di
148. argets Devices window Le ad PLCHIP PXX Devices Intemal Analog 1 0 CAN 1 Ethemet Ramtron FM24XXX FRAM 12C 12C 0 12C 2 Keypad LCD Display Low Voltage Sense Low Voltage Sense Active Low LS7366R 32 Bit Quadrature Counter SP MCP3204 Microchip 4 Channel 12Bit A D Converter SPI Modbus Master Modbus Master Modbus Slave Modbus Slave i Divelbiss OptiCAN PLCHIP_Pxx_eeprom Intemal PLCHIP PXX 4K EEProm Variable Names Name CAN_RX1 CAN_TX1 Figure 14 1 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 125 Chapter 14 CAN Networking Select CANx and click ox The Target s Devices window will close and the previous target properties window will now list the CAN port as an installed device Click ox to close the Target Properties window and click ok to close the Project Settings window Be sure to save the ladder diagram project The CAN port is now installed and ready to be used in the ladder diagram l Baud Rate and other communication configuration items are controlled by the network protocol dJ ie OptiCAN and do not require configuration anywhere else Divelbiss OptiCAN Network OptiCAN is a Divelbiss proprietary CAN Controller Area Network that provides a communication link be tween Divelbiss OptiCAN enabled controllers and other OptiCAN enabled controllers and devices such as I O modules The Divelbiss OptiCAN network supports up to 64 nodes devices and is r
149. art Target is the same as resetting the power to the Q hardware target Both will cause the target to restart and operate normally If the incorrect kernel has been installed or there is a corrupt kernel installed from this Q screen press the F11 key A dialog will appear asking if you are sure you want to erase the kernel To erase the kernel and reset the target to a blank target click the yes If you dont wish to erase the kernel click no This is how the kernel may be erased O When a Kernel or User Program is erased there is no recovery Erasing a Kernel User Program should only be done after verification that these items are available to install re install Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 39 Chapter 4 Configuring Targets Target Utilities When communications is present between EZ LADDER and the hardware target there are additional op tions utilities available wnen connected to the target When Able to Connect to the Target If you can connect normally to the target there are only a few additional utilities available in the EZ LADDER Toolkit 1 If the target is connected to normally press the F11 key on your computer s keyboard The Device Properties dialog box will appear as in Figure 4 7 Device Properties oe Target Date 00 00 00 0 Sync w PC Target Time 00 00 00 i EES Erase User PC Date 09 02 2009 Program PC Time 10 52 33 Figure 4 7 If the actual h
150. ater Than Equal To gt Absolute Value ABS Arc Cosine ACOS Addition ADD Arc Sine ASIN Arc Tangent ATAN Bitwise AND AND Average AVG Bit Pack BIT_PACK Bit Unpack BIT_UNPACKk Convert to Boolean BOOLEAN Compare CMP Cosine COS Count Down CTD Count Up CTU Count Up Down CTUD Division DIV Drum Sequencer DRUM_SEQ EEprom Read EEPROM_READ EEprom Write EEPROM_ Write Exponential EXP Power Function EXPT Falling Edge Detect F_ TRIG Floor FLOOR Get Date GETDATE Get Time GETTIME Hysteresis HYSTER Convert to Integer INTEGER J1939 Receive PGN J1939_RX_PGN J1939 Transmit PGN J1939_ TX_PGN Divelbiss Corporation P Series EZ LADDER Toolkit User Manual EEPROM Storage 4000 bytes Modbus TCP over Ethernet OptiCAN Networking J1939 NMEA 2000 Networking Standard LCD Display Port Keypad Port EXP1 EXP2Plug in Expansion Ports Expandable I O Accepts ICM PUI 01 Expander Jump JMP Keypad Keypad2 Label Latching Coil LATCH LCD Display LCD Clear Limit LIMIT Natural Logarithm LN Base 10 Logarithm LOG Modbus Master MODBUS_MASTER Moving Average MAVG Maximum MAX Minimum MIN Modulo MOD Multiplication MULT Multiplexer MUX Bitwise NOT NOT Optican Node Status OPTICAN NODESTATUS Optican Transmit Message OPTICAN_TXNETMSG Bitwise OR OR PID PID Rising Edge Detect R_TRIG Random RANDOM Convert to Real REAL Ro
151. ave with the specified duty cycle DC at the frequency pre programmed this frequency is determined by the PWM channel and is configured when the PWM channel is installed in the target settings menu pc unless the PWM_FREQ function overrides this frequency with its own The Q output is true when the function is enabled When the PWM function is placed you must specify the actual hardware PWM channel that the function will control and the Polarity Starting Low will cause the PWM channel to start with a TTL low Starting High will cause the PWM channel to start with a TTL high Refer to Chapter 8 Pulse Width Modulation for details on PWM functionality Input Output Connections The PWM function block placement requires connections of two input pins EN DC and one output pin Q eps Type integer Real Boolean Timer ActiveState Other Dotais en mt X Catvetue OO ES EE ef owe x Example Circuit CRI PYM DutyCycles DC Related Functions PWM FREQ Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 320 Chapter 24 Function Reference PWM FREQ PWM FREQ Description The PWM_FREQ function controls the frequency of a hardware PWM output channel EN Q this channel is specified when the function is placed When the EN sees a low to high transition the hardware PWM channel s frequency is changed from it s current value either from when the PWM channel was installed using t
152. bled The output O is the random number The RANDOM function is designed to be used with the SEED function Without the SEED the output will not be random 0D Input Output Connections The RANDOM function block placement requires connections of one input pin EN and two output pins Q O ege Type Integer Real Boolean Timer Active State Other Dotais ren mot TT x ater o om x T O eene SCHECKT Example Circuit Related Functions SEED Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 322 Chapter 24 Function Reference REAL REAL Description EN Q The REAL function converts the input P into an real output O The enable EN must be true for the REAL function to be enabled The Q output is true when the REAL function is enabled In addition to converting a Boolean Timer or Integer to an real the REAL function block can be used to copy one real to another Input Output Connections The REAL function block placement requires connections of two input pins EN P and two output pins Q O ege Type Integer Real Boolean Timer Active State Other Dotais ren not TT x Cater E me x x x fx ee BE ee ee ee ee eee CH ee Example Circuit Related Functions TIMER BOOLEAN INTEGER Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 323 Chapter 24 Function Reference R_TRIG R_TRIG Description CLK o The R_
153. bles refer to Figure 5 6 for the Add Variable dialog box The following are fields attributes for timer variables Some must be completed while others are optional Typically time durations are entered as the unit of measure closes to the set point Larger times may be entered into fields provided that the total timer value does not exceed 24 days For example 1000 ms may be entered and will be considered 1 second when the program executes However if 750 hours is entered the time is greater than 24 days and the timer will malfunction 1 Name The variable name is entered in this field This name will be used to identify this variable and will be the name viewed in the workspace and any cross reference and reports All names must begin with a letter and cannot contain any spaces A unique name is require for each variable 2 Description This is where a text based description may be entered for more clarification and details regarding this variable Descriptions appear in reports and in many dialog boxes This attribute is optional 3 Days The time duration in number of days 4 Hours The time duration in hours 5 Minutes The time duration is minutes 6 Seconds The time duration in seconds 7 Milliseconds The time duration in milliseconds The millisecond resolution is target specific and is shown in parenthesis Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 54 Chapter 5 Creating Ladder Diagram Projects
154. bles present in the ladder diagram project and their specific information including name I O Number Default Value and their description Cross References The Cross Reference opens the Cross Reference Dialog box This box is where the criteria for the report is selected The following are the selectable criteria items Input Output Internal Function Unused Variables Contacts Without Coils Coils Without Contacts Drum Sequencer Tables Retentive Variables and Network Address Registers After the required items are selected or deselected click ox This generates the viewable and printable report WINDOW MENU The WINDOW Menu is the basic Window s menu for viewing and controlling open application windows This menu is typically found in every Window s based program Since this functionality is based on Windows it will not be described in detail Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 19 Chapter 2 Navigating EZ LADDER Toolkit HELP MENU The HELP Menu is useful to determine software versions and registration information Currently there is no active help built in to the EZ LADDER Toolkit About Opens the EZ LADDER Toolkit about dialog box The Toolkit version is displayed at the top of the dialog box The File Versions tab identifies versions of each of the EZ LADDER Toolkit components The License Information tab identifies the EZ LADDER Toolkit Serial Number and who it is registered to Splash Scre
155. c 7 Numeric 8 Numeric 9 I O Assignment KB CLEAR KB DP KB KB F1 KB F2 KB F3 KB F4 KB UP KB DOWN KB ENTER Button Description Clear Button Decimal Point Button Button F1 Button F2 Button F3 Button F4 Button Up Button Down Button Enter Button For more detail on all EZ LADDER Toolkit Function Blocks and objects refer to Chapter 24 Function Reference Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 94 CHAPTER 11 UARTS and Serial Ports This chapter provides basic information to understand how to install configure and use the UARTS Serial Ports and to enable the Serial Printing feature in the EZ LADDER Toolkit Chapter Contents WARTS amp Serial POW E 96 Serial Print Functionality ssicccsciinesaseccinscncwmsiiensnensesinssvsneneansnecesnnwcsbucwencees 98 Installing Configuring the Serial Print Device ccceeeeseeeeeeeeeees 98 Printing Data to a Serial Device using a Serial Port sccssseseeees 101 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 95 Chapter 11 UARTS amp Serial Ports UARTS amp Serial Ports EZ LADDER Toolkit provides provides the software interface to bring P Series hardware target s commun ciation ports to life These serial ports name UARTS in EZ LADDER may be used to communicate Modbus Master or Slave Print Serially to external devices and even transmit or receive data using Structured Text Fo
156. cation 2 3 4 and 5 bytes uses location 6 and 7 po EEPROMJADDRESS LOCATION Variable amp Type WL oft 2 ai 4 5 6 7 1A 9 ety tT A Variable 1 Boolean A C Verwezen x CET TTT Variable 3 Boolean Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 212 Chapter 24 Function Reference Example Circuit CHR PROM WEI Related Functions EEPROM READ Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 213 Chapter 24 Function Reference EXP EXP Description The EXP function provides the natural exponential of the P1 input The output O is the natural exponential of the P1 input The enable EN must be true for the EXP function to be enabled Input Output Connections The EXP function block placement requires connections of two input pins EN P1 and two output pins Q O x C Ate True SS es SS o Output Sa Example Circuit Related Functions EXPT LN SQRT LOG Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 2 4 Chapter 24 Function Reference EXPT D Description EN The EXPT function provides the exponentiation of the P1 and P2 inputs The output O is the is the result of the exponentiation P1P2 The enable EN must be true for the EXPT function to be enabled DI O0 Input Output Connections The EXPT function block placement requires connections of three input pins EN P1 P2 and two output pins
157. ce Address of Controllin Le nimm AA P amam 4 m Map Variable Destination Address Figure 14 30 Figure Figure 14 31 illustrates a complete J1939 TX _PGN function block inserted in a ladder diagram pro gram 939 Tv DI EN Q Figure 14 31 PGN Request J1939 NMEA 2000 PGN request is supported in EZ LADDER Toolkit If a specific PGN is required and it is not broadcast on a schedule or if the PGN data is required more often than the device is broadcasting it if the broadcast rate of the PGN is 10 seconds but you need the data every 4 seconds the PGN Request may be used The PGN Request is exactly as its name implies it re quests the device to broadcast the PGN Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 156 Chapter 14 CAN Networking This feature is accessed in the J1939_ RX PGN function block With a PGN and SPN selected a drop down box is available in the SPN Field Settings area of the Properties window Refer to Figure 14 32 Mapped variables to receive the data also required When the Request Type is set to J1939 REQUEST the controller will request the device broadcast the PGN The request is sent every 1 second The NMEA Request is the NMEA 2000 version of the PGN re quest EZ J1939 Rx Properties Can Port CANO Block Name J1939_RX_PGN1 PGN Description a PGN Settings Tx Only 61445 Electronic Transmission Cont Priority 6 65217 High Resolution Vehic
158. ces and features for the target are shown in the Devices section Scroll down and find LCD Figure 9 1 shows the Target Devices window Le si PLCHIP PXX Devices o Devices Name Description Analog 1 0 Intemal Analog 1 0 CANO CAN 0 CANT CAN 1 d Ethemet Ethemet F FM24XXX Ramtron FM24XXX FRAM DC DCH DC 0 DC 12C 1 S 12C2 12C 2 KEYPAD Keypad Low Voltage Sense Low Voltage Sense Active Low LS7366R 32 Bit Quadrature Counter SPI MCP3204 Microchip 4 Channel 12Bit A D Converter SPI Modbus Master Modbus Master Modbus Slave Modbus Slave S Variable Names Name LCD_DO LCD_D1 LCD_D2 LCD_D3 LCD_D4 Figure 9 1 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 84 Chapter 9 LCD Display Support Click LCD and click ox The LCDpropertiesForm dialog will open using this dialog set the number of Rows 1 4 and the number of Columns 8 40 Click OK when the LDC properties are entered to close the dialog and return to the Target Properties Window You will now see the LCD listed in the Devices pane See Figure 9 2 for setting the rows and columns Figure 9 2 Click the ok button to close the Target Properties window and click ok to close the Project Settings window Be sure to save the ladder diagram project program The LCD display can now be utilized from the ladder diagram project Displaying Messages on the LCD Display With the LCD display con
159. ch as pressure etc An analog input reading can be converted to another scale by using some math and conver sion function blocks For scaling to operate properly the analog input sensor must be sized correctly or the scaled analog Gi input will not truly represent the range of operation Simple Scaling If the analog input and sensor are sized accordingly analog input O 5VDC and the sensor 0 100 PSI then scaling is a simple matter It is recommended that averaging be used prior to converting to any scale Figure 17 5 illustrates a simple scaling circuit taking the analog input averaging it and then converting it as above 0 100 PSI to represent 0 5VDC on the analog input It uses this formula Scaled Reading Analog Input Reading Max Resolution X Max Scale Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 188 Chapter 17 Analog UO in this case Scaled Reading Al0 4095 0 X 100 MAGI REAL DI EN EN EN EN RTemp a P1 O S caledVal P If the analog input and sensor are designed with a range that does not start at zero as in the previous ex ample The analog input reading is still scalable but requires a more complex formula See Figure 17 6 It will take an analog input and scale it to 50 to 250 PSI Figure 17 5 Advanced Scaling It uses this formula Scaled Reading Analog Input Reading Max Resolution X Range Max Range Min Range Min in this case Sca
160. com The maintenance and support fee is specified in the applicable Divelbiss price list This agreement constitutes the entire agreement between the parties relating to the Licensed Software and the subject matter hereof supersedes all other proposals quotes understandings or agreements whether written or oral and cannot be modified except by a writing signed by both Licensee and Divelbiss In the event of any conflict between the terms of this Agreement and any purchase order or similar documentation prepared by Licensee in connection with the transactions contemplated herein this Agreement shall govern and take precedence notwithstanding Divelbiss s failure to object to any conflicting provisions Notwithstanding anything to the contrary herein except for payment obligations under Sections 3 or 15 neither party shall be liable for any failure of performance beyond its reasonable control Except as otherwise provided this Agreement will be subject to and construed in accordance with the laws of the State of Ohio U S A without regard to its conflict of laws provisions Exclusive venue for any legal action between the Parties arising out of or related to this Agreement or the subject matter hereof will be in the state or federal courts located or having jurisdiction in Knox County Ohio U S A which the Parties expressly acknowledge to have personal jurisdiction over them The 1980 UN Convention on the International Sale of Goods CI
161. ct the model part number of the target If the real time clock were installed it would be listed in the Devices pane under the Internal section Click the app pevice button The Targets Devices window will open All the available devices and features for the target are shown in the Devices section Scroll down and find the PLCHIP_Pxx_rtc Figure 12 1 shows the Target s Devices window oO PLCHIP PXX Devices Name Description LCD LCD Display Low Voltage Sense Low Voltage Sense Active Low LS7366R 32 Bit Quadrature Counter SPI MCP3204 Microchip 4 Channel 126i A D Converter SPI Modbus Master Modbus Master Modbus Slave Modbus Slave OptiCAN Divelbiss OptiCAN PLCHIF Px eeprom Intemal PLCHIP PXX 4K EEProm Intemal Quadrature Encoder Interface Intemal PLCHIP PX Real Time Clock Pulse Width Modulator SD Card Serial Print SPIO SPI 1 Variable Names Name Figure 12 1 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 104 Chapter 12 Real Time Clock Select the PLCHIP_Pxx_rtc and click ox The real time clock will install and the Targets Devices window will close returning to the Target Properties Window The real time clock will now be listed in the Devices pane Refer to Figure 12 2 a PLCHIP PXX Target Properties DCPN PLCHIP P13 5122 g El intemal z P LCHIF _Prx_rte Figure 12 2 There are no additional configuration or setup required to use the real time clock Click ok to close the Target Pro
162. ction block using the ST Editor menu click the File then Save op tion The function or function block is now saved Editing an Existing User defined Function or Function Block 1 To edit a new user defiend function or function block open the ST Editor using the EDIT ST FUNCTIONS button The ST Editor will open Click the User Declarations tab to view the user defined items Single Click to expand the FunctionBlock or Function heading in the User Declarations tab Double click the desired function or function block to edit The function block or function will be opened in the Function Pane This function can be edited by adding to or removing structured text as required Vy i lS Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 376 Chapter 26 Structured Text block place the cursor as the desired insertion point in the function function block click the appropriate tab and double click the desired function to add The item is added into the location selected in the user defined function function block Q To quickly add a standard function Target specific function or variable to the function function The next step with your code added is to verify the user defined function function block In the ST Editor window click the Verify item from the menu In the Output Pane either an error message will be seen or the Verify Passed will be seen If an error message is shown the error must be corrected before p
163. d by Licensee to any third party without the express written consent of Divelbiss 14 Dispute Resolution a 15 Maintenance a b 6 General a In the event of any dispute arising between the parties related to the subject matter of this Agreement except regarding the payment of fees under Sections 3 or 15 of this Agreement or as provided in Subsection b below Dispute the parties agree to attempt to resolve such Dispute according to the procedures set forth below i In the event either Divelbiss or Licensee notifies the other party of a Dispute representatives of each party with adequate authority to settle such Dispute will promptly engage in direct negotiations If such representatives are unable to resolve such Dispute within ten 10 business days after commencing negotiations or twenty 20 business days after the initial notice of Dispute then either party may initiate mediation of the Dispute as provided in Subsection a ii below ii In the event either party initiates mediation of the Dispute by sending a written notice of mediation to the other party then the Dispute shall be subject to mediation in Mt Vernon Ohio before a single mediator to be proposed in the first instance by the party initiating mediation who will be reasonably familiar with the computer industry and mutually acceptable to the parties The parties agree to participate in such mediation in good faith through representative
164. d click the PROPERTIES button The J1939 Properties dialog will open Select the CAN port for the J1939 and click the PROPERTIES button The CAN port Properties window will open A built in editor is included in EZ LADDER Toolkit for creating and editing user J1939 databases Refer to Figure 14 21 To create a new user J1939 database click the CREATE new button The Edit J1939 database window will open Refer to Figure 14 22 r EZ Edit J1939 Database Parameter Group Information PGN Description Priority iena DLC Transport Type s Se 6550 PGN Description Parameter Information For NMEA2000 message SPN Field SPN Description Start Byte Start Bit Bit Length Gain Offset Data Type Figure 14 22 Click into the fields provided and add the PGN PGN number PGN Description Priority Broadcast Rate DLS and Transport Type for each PGN If this for NMEA 2000 click the NMEA Message chechbox and if it is a Fast Packet for NMEA 2000 click the Fast Packet checkbox For each PGN added in the top pane SPNs may be added in the bottom pane With the PGN selected in the top PGN pane Parameter Grou Information add SPNs in the SPN pane at the bottom Parameter Information The data for the PGN SPN is provided by the manufacturer of the device or the J1939 NMEA 2000 specification Enter the data for SPN Description Start Byte Start Bit
165. d from The file descriptors for devices may be found in the Structured Text Editor Click the Variables tab at the bot tom left All devices listed under FD_ are actual file descriptors Refer to Figure 26 16 With an open function block to edit double clicking on any variable including file descriptors FD_ will insert the it into the cursors location in the function block Only devices installed in the Project Settings will appear If the device does not appear check the Project Settings and install the device File Descriptor List E Function Editor File Edit Verb Variables ad E D FD_PLCHIP_PAX_EEPROM Varia User Output Figure 26 16 The following table lists the target specific ST functions and descriptions of each Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 369 Chapter 26 Structured Text Target Specific Function Description Details aia Gelee Reads Data from EEPROM memory DINTvar EZ_EEPromRead FD_x StartAdr Datavar Parameters FD x File Descriptor StartAdr EEPROM address to start reading from DINT Datavar Variable to hold read data any variable type of bytes read dependent upon type of variable used for Datavar Ge Reads Data array from EEPROM memory DINTvar EZ_EEPromReadArray FD_x StartAdr Buffer offset len Parameters FDT File Descriptor StartAdr EEPROM address to start reading from DINT Buffer Destination buffer to hold
166. d in Section 2 of this Agreement install on a network or permit use by more than a single user in whole or in part the Licensed Software or sublicense convey or purport to convey any such right to any third party d Licensee Licensee s customers and others who obtain Resulting Products are expressly prohibited from using in whole or in part the Licensed Software and any Resulting Product in any use or application i intended to sustain or support life ii for surgical implant iii related to the operation of nuclear facilities iv in which malfunction or failure could result in death or personal injury or v in environments otherwise intended to be fault tolerant 3 License Fee a Except when Licensee obtains the EZ LADDER Toolkit from an approved distributor or OEM pursuant to other fee arrangements Licensee will pay to Divelbiss the license fee for the EZ LADDER Toolkit specified in the applicable Divelbiss price list which is due and payable upon delivery of same b If Licensee fails to make any payment when due Divelbiss may at its sole option terminate Licensee s rights under this Agreement to use the Licensed Software If Licensee fails to pay any balance within thirty 30 days after being notified by Divelbiss that payment is overdue Divelbiss may take whatever steps it deems necessary to collect the balance including referring the matter to an agency and or suing for collection All expenses and fees associa
167. d in the Devices pane it must be installed and configured Figure 8 2 shows no installed devices a PLCHIP PXX Target Properties DCPN PLCHIP P13 5122 M Devices Figure 8 2 To install the PWM click the app pevice button The Devices window will open Choose PWM from the de vices click to highlight and then click ox The PWM Properties window will open See Figure 8 3 Click the app button the Add PWM Channels dialog will open Select the channel s and click ox to add them frequency and channels 6 11 operate on a different base PWM frequency These frequencies are gt 0 Hz and up to 10 MHz Enter the base frequency desired for the channels that have been added Click ok to close the PWM Properties window click ok to close the Target Properties window and click ok to close the Project Settings window Be sure to save the ladder diagram project program There are up to 12 channels available based on the target Channels 0 5 operate on a base PWM Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 80 Chapter 8 Pulse Width Modulation ad PWM Properties Min Frequency gt 0 0Hz Max Frequency 10Mhz PWM Frequency 0 5 Hz PWM Frequency 6 11 Hz Figure 8 3 The actual PWM base frequency will be application dependent The PWM frequency can be changed in the ladder diagram program using the PWM_FREQ function block Controlling PWM in the Ladder Diagram Project With PWM channels configured i
168. d in the EZ LADDER Toolkit To copy an object or multiple objects select the object s using the selector tool right click the mouse and select copy This will copy all the selected objects to the Windows clipboard Paste The Paste menu item is disabled in the EZ LADDER Toolkit To paste an object or multiple objects position the mouse at the starting point to paste right click the mouse and select paste This will paste the Windows clipboard contents into the ladder diagram project When pasting objects and rungs enough space must be available at the pasting point for the Windows clipboard contents The paste will not complete unless sufficient space is provided of rungs and space on each rung Select All The Select All menu item is disabled in the EZ LADDER Toolkit Settings The Settings menu item opens the LD ladder diagram settings window This window allows general setting to be configured such as displaying grid fonts etc Typically it is recommended to leave the settings at the factory defaults Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 17 Chapter 2 Navigating EZ LADDER Toolkit VIEW MENU The VIEW Menu is used to view currently selected target information and to view or hide tool bars and op tional windows Target Information The target information window provides details of the selected hardware target selected in the Projects Settings menu including target name minimum kernel ver
169. d is entirely dependent upon the actual target selected The P Series PLC on a Chip for example only installs very minimum features while the HEC P5XXX controller installs some features and devices but leaves oth ers to the actual user to install and configure For devices and features that are not automatically installed they must be installed manually The following steps are shown as basics for installing additiona devices and features These are general steps only and some variances will occur based on the target and devices to be installed To select the target either try to place a ladder diagram object in the workspace or use the Project Menu and click Settings The Project Settings Window Dialog box will open Figure 4 1 is an example of the Project Settings Window and identifies the main components of it Select highlight the target and click the properties button The XXXX XXX represents the target Target Properties window will open Using the DCPN drop down menu select the model number of the target if available Refer to Figure 4 10 This window consists of an Installed Devices pane DCPN drop down menu and four buttons used to config ure devices Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 42 Chapter 4 Configuring Targets DCPN Select Drop Down Menu Installed Devices Pane Setup GPIO button Add Device button Properties button Remove button Figure 4 10 The Devices Pane shows all
170. d to be used Installing unused features may degrade target performance Understanding Objects amp Variables Ladder diagram projects in EZ LADDER Toolkit are comprised of a combination of objects function blocks variables and links Itis important to understand the basic relation of these items These items will be cov ered first generally then in more detail as this chapter progresses Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 48 Chapter 5 Creating Ladder Diagram Projects Nearly all ladder diagram objects and function blocks rely on variables either as a definition for the object or addition to the function block to provide required data to function properly A variable is a placeholder that represents values that can change A variable can represent any number depending upon its type Variables are an important part of understanding how EZ LADDER uses functions and objects Some ob jects such as Direct Contacts or Direct Coils are actually defined as variables themselves while other func tion blocks such as TON will require variables created inserted and connected using links to the function block itself to provide set points and other functional requirements Variables in the EZ LADDER Toolkit are global meaning that each variable must be uniquely named and can be changed or used anywhere in the ladder diagram project Using function blocks variables can pass data copy or move to other variables fu
171. data DINT Numbef of bytes to read DINT of bytes to read This will read up to len bytes from the receive buffer This function will not wait until len bytes have been received so check the return value to see how many bytes have been read EZ_UartSetBaudRate Set the UART baud rate DINTvar EZ_UarSetBaudRate FD_UARTx baudrate Parameters FD _UARTx File Descriptor baudrate Baud rate for Uart to use ie 19200 9600 UDINT 0 when Baud rate set is successful SEH Writes data to a UART serial port DINTvar EZ_UartWrite FD_UART txbuff offset len Parameters FD_UARTx File Descriptor txbuff Buffer to data to transmit ARRAY of USINT offset Zero based offset into buffer to start reading transmit data DINT len Number of bytes to write DINT of bytes written or 0 if busy This will copy en bytes to the transmit buffer start transmitting the data using an interrupt This function will return before all of the data has been transmitted so use EZ UartlsTxFinished to see if the data has finished transmitting Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 372 Chapter 26 Structured Text Target Specific Function Description Details SE Description Writes a string to a UART serial port Format DINTvar EZ_ UartWriteStr FD_UART strbuff Parameters FD_UARTx File descriptor for Uart strbuff string to transmit Return of bytes written or 0 if busy Notes This w
172. dder diagram project by use of the PWM_FREQ function block The PWM_FREQ function block has two inputs EN for enable and F for frequency and one output Q When the EN is true the PWM channel frequency is changed to the value of the variable connected to the F input of the function block Figure 8 4 illustrates a sample circuit using PWM_FREQ When using the PWM_FREQ to change the frequency the actual CLK A or CLK B frequency is changed This affects all channels that use that specific CLK signal For example if PWM channel O uses CLK A and PWM channel 2 uses CLK A then adjusting the frequency using PWM_FREQ to CLK A affects all the PWM channels that use CLK A in this case 0 and 2 respectively Q When placing the PWM_FREQ function block a new dialog is opened to select the PWM channel Clock The PWM clock frequency will be equal to the value of the F input of the PWM_FREQ function block thus allowing real time frequency changes CRI MM FREQ F Figure 8 5 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 82 CHAPTER 9 LCD Display Support This chapter provides basic information to understand how to install configure and use an LCD Display with the EZ LADDER Toolkit Chapter Contents ECD Display dite UN 84 Configuring the LCD Display in the Project SettingS sssseee 84 Displaying Messages on the LCD Display c sscecsesseeesseeeeeeeeenees 85 Divelbiss Corporation P Se
173. dder diagram using the analog output variable AOO as an output from a function block PID1 INTEGER EN RTemp P oz AOD Error Process a Figure 17 8 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 192 CHAPTER 18 Counters amp Timers This chapter provides basic information on installing and using on board P Series PLC on a Chip Timers and Counters Chapter Contents Counter Timer Capture Inputs cccecceseeeeeeeeeeeeeeeeeeeeeeeeeeeeseaneesanes 194 Installing Counter Capture Inputs cccccceseeeceeeeeeeeeeeeeeeseeeeeenensanes 194 Capture Inputs Configured aS Timers ccsccceseeeeseeeeeeeeeeeeeeeneseanes 196 Capture Inputs Configured as Counters cccccceeseeeeeeeeeeeeeeeeeeeeeeees 196 Quadrature Counter INPUuts cccccccssseecssseeeeseeccsseeceseeeeeseeeeesseesaeses 197 Installing Quadrature Counter INputs ccccseeeeseeeeeseeeeeeeeeeeseeeeesenes 197 Using the Quadrature Counter Inputs ccceceeeeeeeeeeeeeeeeeeeeeeaeeeeees 199 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 193 Chapter 18 Timers amp Counters Counter Timer Capture Inputs The P Series PLC on a Chip based products provide up to three hardware capture inputs that may be con figured and utilized as either timers or counter inputs These inputs are based on actual hardware inputs and internal frequenci
174. dit Address Register Prefix CAN ep AN I IN Node ID D Register Number j4 Broadcast Trigger Address Register CAN_IN 11 14 Figure 14 10 O Leaving the node ID blank while is allowable but is not a valid address and no data will be received Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 137 Chapter 14 CAN Networking When this ladder diagram project is running if a broadcast from node ID 11 register 4 is seen on the net work it will be heard and the register variable on this controller will be updated Determining Node Status As discussed earlier in this chapter that a Start Network command must be transmitted to start the network communicating and that it should happen on start up In addition it was recommended to monitor nodes status and possible resent the Start Network command in the event of a communications loss to a node To determine the status of a specific node the OPTICAN NODESTATUS function block is used Using the OPTICAN_NODESTATUS function block is a two step process When placing the function block the Opti CAN Node Status Properties dialog box will open See Figure 14 11 In the Node ID field enter the node ID that is to be monitored for communication loss and in the Timeout ms field enter the amount of time that communication is lost before the node status is changed in millisec onds When enabled the OPTICAN NODESTATUS block s Q output will be true if mes
175. dn t respond Monitor Mode During communication with a target the target did not respond Check the cables connections target and Serial port settings in EZ LADDER Toolkit Undefined packet type Monitor Mode EZ Ladder has detected a undefined communications packet during communications with the connected target Structured Text Errors The following is a list of structured text specific error messages that may be encountered when using the EZ LADDER Toolkit These error message may appear as pop up dialog boxes or in the Output window For more details on structured text refer to Chapter 26 Structured Text Errors During Structured Text Verifying The following is a list of structured text specific error messages that may be encountered when structured text is verified Verification may be manually initiated in the Structured Text Editor It is also performed auto matically as a prerequisite during a ladder diagram Compile This error message gets formatted as POU Name Location ERROR STV Error Num Description Member Name Value Description Variable_NotArray 1004 Variable is not an array don t use message gt Variable 0 is not an array Variable_ IsArray Variable is an array make sure use message gt Variable 0 is an ar ray but subscript list is missing Variable _ConstantNotlnialized 1006 constant variable is not initialized message gt CONSTANT Variable 0 not initialized Variable _ExternMust
176. e Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 11 Chapter 1 Getting Started 2 Click the link provided A web browser window will mmm open to the registration and activation page on Serres Divelbiss com Visit http www divelbiss com products software E4 Ladder activate aspx or call 1 800 245 2327 to activate this product Provide the Activation Rey printed below and your user information and you will i be a provided with a Counter Key Type or copy amp paste the provided Counter You will need the Activation key provided by Key below then click Proceed EZ LADDER and your CID Code located on the back of your EZ LADDER Toolkit CD case Activation Key ED Counter Rey If you do not have your CID Code W you must cancel _ CTA obtain it prior to continuing the activation Contact Divelbiss Customer Support O If you close EZ LADDER prior to completing activation the original Activation Key cannot be used A new Activation Key must be used to activate the EZ LADDER Toolkit Click on the link provided to open the browser and go to the Activation Page Copy Paste or type your Activation key into the Activation key form box on the ESCHER web site Activation and Registration page if NOt already oe e pre loaded Internet Explorer will preload this for you se 1D ivelbiss E HOR RODUCTS ENGINEERING Complete all other form entries All information must be completed The CID Code is fo
177. e Trus one scan when key is pressed Te fom xf Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 292 Chapter 24 Function Reference Example Circuit KEYPAD 1 leyPresse Related Functions KEYPAD Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 293 Chapter 24 Function Reference LABEL Description The LABEL function works with the JMP function to skip ladder diagram sections A LA BEL must be placed first then the JMP inserted When the condition is true to trigger the jump the program scan jumps to the LABEL skipping any ladder between the jump and label Labels Input Output Connections There are no Input or Output Connections Example Circuit Input s gt gt LabelA Outputl LabelA Output2 Related Functions JMP Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 294 Chapter 24 Function Reference LATCH COIL LATCH COIL Description Lit The LATCH coil operates similar to the DIRECT COIL except when true energized it will remain energized until a true is seen on the UNLATCH coil LATCH and UNLATCH coils work as pairs Any boolean variable can be used as a LATCH UNLATCH coil Example Circuit LH CRI L CRI Related Functions UNLATCH DIRECT COIL INVERTED COIL Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 295 Chapter 24 Function Reference LCD CLEAR LCD_CLEAR D
178. e 2 CAN Ports EEPROM Storage 4000 bytes Modbus Master Slave OptiCAN Networking J1939 NMEA 2000 Networking Minimum MIN Modulo MOD Multiplication MULT Multiplexer MUX Bitwise NOT NOT Optican Node Status OPTICAN NODESTATUS Optican Transmit Message OPTICAN_TXNETMSG Bitwise OR OR PID PID PLCHIP Quad Counter CNTR_PXX_QEl PLCHIP Quad Counter Compare CNTR_PXX_CMP PLCHIP Quad Counter Velocity CNTR_PXX_VEL PWM PWM PWM Frequency PWM_FREQ Rising Edge Detect R_TRIG Random RANDOM Convert to Real REAL Rotate Left ROL Rotate Right ROR Reset Set Reset Dominant RS Seed Random SEED Select SEL Serial Print SERIAL_PRINT Set Date SETDATE Set Time SETTIME Shift Left SHL Shift Right SHR Sine SIN Square Root SQRT Set Reset Set Dominant SR Structured Text Function ST_FUNC Structured Text Function Block ST_FUNC_BLKk Subtraction SUB Tangent TAN Convert to Timer TIMER Time Delay Off TOF Time Delay On TON Timer Counter TimerCounter Pulse Timer TP Uart Set Property UART SET PROPERTY Unlatching Coil UNLATCH Bitwise XOR XOR Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 221 Chapter 23 Hardware Targets VB 2xxx Series Each VB 2XXX model supports different features and function blocks based differences of the on board hardware When any VB 2XXX model is selected in the Project Settings some suppo
179. e ABS function is enabled Input Output Connections The ABS function block placement requires connections of two input pins EN P1 and two output pins Q O Orin type integer Real Boolean Timer ActiveState Omer Deras cen mt X Cater ei me x x oo J Outpt y o a S T D ow y x x TI T Example Circuit CRI ABS EN Q Number raf Of AbsNum Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 239 Chapter 24 Function Reference ACOS CC AC OS Description The ACOS function provides an Arc cosine O from the input value P1 The enable EN EN Q must be true for the ACOS function to be enabled The Q output is true when the ACOS function is enabled Input Output Connections om o The ACOS function block placement requires connections of two input pins EN P1 and two output pins Q O UO Pin Active State Other Details x L mmes SS es SS RSC Sa Example Circuit Related Functions ASIN ATAN COS SIN TAN Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 240 Chapter 24 Function Reference ADD ADD Description EN Q The ADD functions sums all the inputs Px together and outputs this number O The num ber of inputs is specified when the function is placed in the program The enable EN must be true for the ADD function to be enabled The Q output is true when the ADD function is bled enable o 0 Input Output Connection
180. e Names Figure 15 20 Click ox The MAX31855 Properties dialog will open Ths dialog selects the SPI Port and Chip Select to be used for this MAX31855 device See Figure 15 21 ail MAX31855 Properties ew w lt SPIPot C5 Output Varnable Figure 15 21 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 177 Chapter 15 SPI Devices and Support Multiple MAX31855 devices may be added to an SPI port provided that each device has a unique chip select output specified Click the app button An additional MAX31855 Properties window will open Select the SPI port from the drop down menu and select the general purpose output pin GPO that will serve as this device s chip select CS See Figure 15 22 Any chip select pins reserved for structured text will not be visible in the drop down menu With the SPI Port and CS Output selected an automatic Variable name is shown Q The variable name is automatically created when SPI port and CS are selected The name can be changed by typing the desired variable name in the Variable Name box all MAX31855 Properties SFI Properties SPI Port SPIO Y CS Output GPIO16 z Variable Name TC_0_16 Figure 15 22 Refer to the MAX31855 integrated circuit data sheet for details on the MAX31855 and its limitations The MAX31855 thermocouple input values are always stored and can be accessed in the ladder diagram program by the variable names configu
181. e allows an object be placed multiple times without the need of re selecting the object Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 55 Chapter 5 Creating Ladder Diagram Projects l To place an object or function there must be enough space in the ladder diagram workspace at the point of insertion If there is insufficient space an error message will display EZ EZ Ladder Standard EZ Ladder ggf yy Trrpg T a mmm mm re m EZ File Edit View Project Reports Window Help Deh tae amp Sg Edit Inst K eme og ig C MON Abc i CTU CTD CTUD TP TON TOF MotorStart Placed Direct Coil Figure 5 7 Refer to Figure 5 7 note when placing objects near the left or right power rails links are automatically drawn to the power rails This also applies when variables are inserted next to functions the links are automatically drawn from the inserted variable to the function To finish the circuit shown in Figure 5 7 it will be necessary to draw a horizontal link between the contact and coil on rung 1 Select the Horizontal Link Tool from the tool bar Refer to Chapter 2 Navigating EZ LADDER Toolkit for details on tool bars and buttons To draw the link click and hold the click at the location where the link will start at the right side of the contact on rung 1 Holding the mouse button down clicked drag the pointer to the left side of the coil on rung 1 When the link
182. e configuration items assuming that no advanced changes were made previously See Figure 14 23 a J1939 Advanced Properties Rx Buffer Size Maximum Rx Parameter Groups Maximum Rx Parameters Maximum Simultaneous Rx BAM Connections Maximum Simultaneous Rx Connect Connections Tx Buffer Size x 24 bytes Maximum Tx Parameter Groups x 28 bytes Maximum Tx Parameters sl x24 bytes Maximum Simultaneous Tx BAM Connections 1 A x 228 bytes Maximum Simultaneous Tx Connect 1 Connections x 228 bytes For details of each setting please refer to the user manual Figure 14 23 From inside this window items such as transmit and receive buffer size number of PGNs etc may be ad justed These advanced parameters should only be adjusted if necessary for the application Adjusting these Gi numbers affects the amount of RAM used and available for the entire ladder diagram project during Compilation Cautionmust be taken to not use excessive RAM for J1939 unnecessarily as it is possible to run out of RAM memory Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 150 Chapter 14 CAN Networking Receiving Data with J1939 With the J1939 network configured in the Project Settings of EZ LADDER Toolkit data may be received in the ladder diagram To receive data using J1939 NMEA 2000 the J1939_RX_PGN Function block is used This function block is automatically added to the functions drop down list when J1939 NMEA 2
183. e connected but compile errors will result Example Circuit CRI BOOLEAN Related Functions INTEGER REAL TIMER Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 248 Chapter 24 Function Reference CEIL CEIL Description The CEIL function provides a rounded up result of the P1 Input and outputs this number O The enable EN must be true for the CEIL function to be enabled The Q output is true when the CEIL function is enabled Input Output Connections The CEIL function block placement requires connections of two input pins EN P1 and two output pins Q O UO Pin Active State Other Details x C Ate True SS es SS o Output Sa Base Number Rounded Up P1 Base Number Example Circuit Related Functions FLOOR Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 249 Chapter 24 Function Reference CMP CMP Description EN LT The CMP function compares the P1 and P2 inputs LT is true when the P1 input is less than the P2 input EQ is true when the P1 input equals the P2 input GT is true when the P1 input is greater than the P2 input The enable EN must be true for the CMP function to be enabled When the function is disabled all outputs LT GT and EQ are off DI EQ Input Output Connections The CMP function block placement requires connections of three input pins EN P1 P2 and three output pins LT EQ GT There is no Q output on the CMP function bl
184. e hour of the day HR 0 23 the MN input sets the minutes 0 59 and the SC sets the seconds 0 59 The HR MN and SEC inputs must be connected to Integer variables Input Output Connections The SETTIME function block placement requires connections of one input pin EN and MN four output pins Q HR MN SEC Torin Type Integer Real Boolean Timer Active State ren not TTX ame sc o fom E Example Circuit Related Functions SETDATE GETTIME GETDATE Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 334 Chapter 24 Function Reference SHL Description The SHL function provides a left bit shift of the P1 input The P2 input specifies the num ber of one bit left shifts If the enable EN is false the function is disabled If the enable EN is true the output O will be equal result of the left shifted input in integer form 1 2 4 8 16 32 A shift left when the output is 32 will cause the output to be zero bit is shifted off Zeros are always shifted on to the right side when a left shift occurs Input Output Connections The SHL function block placement requires connections of 3 input pins EN P1 P2 and two output pins Q O EN Output Output Example Circuit CR Related Functions SHR ON _ 2 a Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 330 Chapter 24 Function Reference SHR Description The SHR function provides
185. e in the Variable Name box for each channel Gl ADS8341 Properties Ste SPI Properties CS ouput Channels CHO Enabled Varnable Name AD SPIO 70 CH1 Enabled Variable Name AD SPIO 71 CH Enabled Vanable Name AD SPIO 7 2 CH3 Enabled Variable Name AD Sp D 7 3 Figure 15 14 l Refer to the ADS8341 integrated circuit data sheet for details on the ADS8341 and its limitations O The ADS8341 analog input analog to digital converter channel values are always stored and can be ac cessed in the ladder diagram program by the variable names configured in the ADS8341 Properties 2 dialog When the ADS8341 is configured click ok to close the ADS8341 Properties dialog 2 It is now listed in the ADS8341 Properties dialog 1 Click ok to close the ADS8341 Properites dialog 1 Click ox to close the Target Properties window and click ok to close the Project Settings window Be sure to save the ladder diagram project The ADS8341 port is now installed and ready to be used in the ladder diagram This installation is to configure the ADS8341 as a device in EZ LADDER Toolkit and the target The l ADS8341 requires additional circuitry to amplifiy and or scale real world analog signals that are a separate from the ADS8341 and EZ LADDER Toolkit Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 172 Chapter 15 SPI Devices and Support Using the ADS8341 in the Ladder Diagram Project The ADS8341 analog input analog
186. e objects will be pasted When pasting objects or rungs there must be enough room to paste the copied section horizontally and vertically or an error will occur When pasting rungs move the pointer near the left power rail as an pasting point Inserting and Deleting Rungs During development of a ladder diagram project it often becomes necessary to insert new rungs between existing rungs or to delete rungs that will not be required Inserting Rungs To insert a new rung in EZ LADDER Toolkit position the pointer where the insertion needs to occur typically near the left power rail Right click and choose Insert Rung A rung will insert at this location All later rungs will be moved accordingly and all cross references will update with the new rung numbers Deleting Rungs To delete a rung position the pointer on the rung to be deleted Right click and choose Delete Rung The selected rung will be deleted Only empty rungs may be deleted Saving EZ LADDER Toolkit Projects Saving an open ladder diagram project can be done two ways Click the Save button on the tool bar or use the File Menu and choose Save If the project has not been previously saved a dialog box will appear to enter name and save the project The Save As selection in the File Menu always provides a dialog box for naming the project Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 58 Chapter 5 Creating Ladder Diagram Projects Verifying and C
187. e properties button The Target Properties window will open From the drop down menu DCPN select the model part number of the target Click ok to save the Target Properties and close the Target Properties Window You are now back at the Project Settings Window See Figure 25 1 EZ Project Settings Divelbiss Corporation Harsh Environment PLC Divelbiss Corporation Micro Bear Controller Divelbiss Corporation PCS Divelbiss Corporation PCS Divelbiss Corporation PLCHIP PXX d II Communications Settings Pott Figure 25 1 In the bottom left corner of the Project Settings window click the EDIT PAssworps button The Password Setup window will open This window is used to configure the passwords for the ladder diagram project See Figure 25 2 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 353 Chapter 25 Password Protection E Password Setup Master Password Verity Master Password Passwords Monitor Modify Download LD Variable Values Program Description Password Edit File Monitor Figure 25 2 Master Password The Master Password is exactly as phrased This password is the highest level password in the ladder diagram project This password should be set and kept closely guarded When this password is entered it provides access to all EZ LADDER Toolkit features of the ladder diagram project and allows editing of other level passwords Enter a master Password in the Master Password box You
188. e taken to limit variables to only those needed As a MODBUS MASTER function block supports only one Function Code command additional function block instances may need to be placed based on the application Understanding MODBUS_MASTER Function Block The MODBUS _ MASTER function block has two inputs EN and ID and two outputs Q and ER These inputs and outputs are all that are required to use the MODBUS_ MASTER function block EN Function block Enable Input The EN is active on rising edge only A rising edge on EN enables the function block to begin communications ID Slave ID Input This number is the number of the slave ID that this function block communicates to A valid address is 1 to 255 Q Q Output Only goes high for one scan when the communication initiated by the EN rising edge is completed or a timeout has occured ER Error Output Ouputs an integer number for the status of any errors detected during the communications initiated by the rising edge on EN Zero indicates NO errors See the MODBUS_MASTER Function Block Errors section of this chapter for a list of error codes Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 114 Chapter 13 Modbus Networking When the EN rising edge is detected the function block will attempt communication with the slave device If an error occurs including if the device is already busy or another MODBUS_MASTER function block is already communicating the error will
189. e the dialog win dow GPIO pins are designed to be configured as Inputs or as Outputs but cannot be both simulteanously Based on the Target selected there may be no GPIO configuration available as GPIO as they are used as PWM GPIO pins can only be used as either Outputs or PWM not both l When PWM Pulse Width Modulator is configured the GPIO pins associated with it are not available simulatenously in the same program ad PLCHIP PXX GPIO GPIO Pins Add To Inputs Variable Name emgeet GPIO0 Add To Outputs Variable Name GFG e GPIO19 GPIO1 Figure 4 11 Adding Devices The app DEvicE button is used to add remove devices such as serial ports Ethernet Quadrature Inputs etc Any device to be used in the ladder diagram program must be installed in the target s devices To add ad device click the app pevice button The targets Devices window dialog box will open Refer to Figure 4 12 Q All supported devices are shown for the target The window dialog is divided into two panes Devices and Variable Names As devices are selected the associated variables that will be installed with them are shown in the Variable Names pane Select a device from the Devices pane by clicking on the Name highlight and click ox to install it Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 44 Chapter 4 Configuring Targets Depending upon the device additional dialog boxes may appear with addtional config
190. e total P number of inputs therefore always add one to the number of Px inputs that need to be used ege Type Integer Real Boolean Timer Active State Other Dotais ren mot TT x ater Ce eet ce owe x Example Circuit i Related Functions lt gt gt lt gt Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 299 Chapter 24 Function Reference LESS THAN LESS THAN OR EQUAL TO lt EQUAL TO Description The LESS THAN or EQUAL TO provides an if less than or equal to comparison for the Px inputs The number of inputs is specified when the object is placed The output Q is true if P1 is less than or equal to P2 and P2 is less than or equal to P3 and so on The enable EN must be true for the LESS THAN or EQUAL TO function to be enabled Input Output Connections The LESS THAN or EQUAL TO function block placement requires connections of at least 3 input pins EN P1 P2 and one output pin Q The EN is always considered an input in the total number of inputs therefore always add one to the number of Px inputs that need to be used ege Type Integer Real Boolean Timer Active State Other Dotais ren mot TT x ae S o o Ce eet ce fo x Example Circuit C Al lt CH EN Q Numi rap Num2_ rap Related Functions lt gt gt lt gt Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 300 Chapter
191. eady to be used EZ LADDER Toolkit automatically creates variables that represent the analog inputs They are labeled AIO through Al7 for analog input 1 through analog input 8 respectively 12 Al3 Therefore functionality on pin 12 may be configured as and analog input AI3 or an analog output AOO but not both Care should be taken when mapping analog I O as to fit this into the requirements The P Series PLC on a Chip Target supports one 1 on board analog output and it also uses pin Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 186 Chapter 17 Analog UO Removing Analog Inputs is accomplished in the same manner as adding inputs except the analog Q input s to remove is selected and the Remove inPuTs button is used in the Internal Analog I O Properties window ad Internal Analog VO Properties Figure 17 2 Using Analog Inputs in the Ladder Diagram Project With the hardware target selected and analog inputs installed if required it is now simple to use these ana log input readings in the ladder diagram project real world analog input signal Typically this number ranges from 0 4095 with zero representing the low end OVDC OmADC etc and 4095 representing the upper end of the range 5VDC 20mADC etc For each analog input an integer variable exists that will be equal to the digital representation of the As these variables represent the analog inputs they can be tied directly to function bloc
192. eal Time Clock ccccccsseecceeeeeeeeseeeeeseeeseeneeseeseeseaeeessnenenses 105 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual Chapter 12 Real Time Clock Installing the Real Time Clock P Series targets targets based on P Series PLC on a Chip support the use of a Real Time Clock device Most P Series based targets support an on chip Real Time Clock Additional real time clock devices may be connected via an SPI port on the PLC on a Chip and SPI real time clock devices Refer to other target s user manuals or Chapter 23 Hardware Tar gets for targets that support the real time clock For proper operation the real time clock requires a battery and crystal Standard product P Series targets will include the battery and crystal as part of the product When using the PLC on a Chip itself the battery and crystal must be provided external to the chip itself Real Time Clock support is target dependent The PLC on a Chip target itself supports on board Prior to using the Real Time Clock in EZ LADDER Toolkit the Real Time Clock must be installed and config ured in the target The Real Time Clock is configured using the Project Settings Using the Project Menu choose Settings The Project Settings window will open as previously covered in Chapter 4 Configuring Targets Select the target and click the PRoPeRTIEs button The Target Properties window will open From the drop down menu DCPN sele
193. eal Time Clock Pulse Width Modulator SD Card Serial Print SPI 0 SPI 1 Hardware Timer Counter Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 130 Chapter 14 CAN Networking Select the OptiCAN and click ox The OptiCAN Properties dialog will open This dialog is used to specify which CAN port is to be used the Node ID Broadcast Rate Heartbeat and Broadcast Register setup This dialog box is used to configure the controller on an OptiCAN Network Figure 14 4 show the OptiCAN Properties dialog box The following items must be configured 1 CAN Port Using the drop down menu select the physical CAN port that will be connected to the OptiCAN network All installed and not used CAN ports are displayed 2 Node ID The Node ID serves as the controller s address on the network It may be numbered up to the maximum number of nodes allowed All Node IDs on an OptiCAN Network must be unique Duplicate Node O IDs will result in communication errors or communication loss The node ID may also be set from the ladder diagram project using Q a variable This variable must be configured as node 255 The vari able integer value then becomes the OptiCAN node ID It is important to keep this ID number in the proper range 3 Broadcast Rate The rate that the controller will broadcast registers is entered here in milliseconds This timing requirement should be identified during network planning aS OptiCAN Pr
194. ecautions and take all steps necessary to prevent any Confidential Information from being acquired in whole or in part by any unauthorized party will use Confidential Information solely in furtherance of this Agreement and will permit access to any Confidential Information only by those employees of Licensee with a legitimate need to know In the event that Licensee learns or has reason to believe that Confidential Information has been disclosed or is at risk of being disclosed to any unauthorized party Licensee will immediately notify Divelbiss thereof and will cooperate fully with Divelbiss in seeking to protect Divelbiss s rights in the Confidential Information 12 Term and Termination a b f This Agreement shall remain in effect from the date it is accepted until terminated as provided below Divelbiss may terminate this Agreement and all license rights hereunder upon the occurrence of any of the following i Licensee fails to cure any material breach of this Agreement within thirty 30 days after receiving notice of such breach ii Licensee becomes insolvent or unable to pay its debts makes an assignment for the benefit of creditors ceases to be a going concern files for protection of the bankruptcy laws becomes the subject of any involuntary proceeding under federal bankruptcy laws or has a receiver or trustee appointed to manage its assets iii Licensee consolidates or merges into or with any other enti
195. ed on that status Figure 26 12 lists the supported logical operators in EZ LADDER Toolkit s Structured Text Parenthesis should be used to control logical flow Operator Description Example Logical AND IF X 1 AND Y 2 THEN OR Logical OR IF X 2 OR X 4 THEN Logical Exclusive OR IF XOR A B 1 THEN Logical Complement IF NOT A 1 THEN Figure 26 12 The combination of aritmetic relational and logic operators allow for complex control of multiple inputs and outputs in a control scheme Bitwise Operators Bitwise operators are used to manipulate bits within values based on two additional values Different from logical operators bitwise operators actually compare the bits of the number and not the entire number The results will differ Operator Description Example Bitwise AND Z XAND Y OR Bitwise OR Z XORY Bitwise Exclusive OR Z A XORB Bitwise Complement Z NOTB Figure 26 13 Order of Execution Operation written into structured text expressions are performed in a prescribed order This order may be from left to right but not always depending upon the operators and language used Operations that have equal order will be performed left to right group the condtions This will control the order or flow of execution and also makes it easier to read When writing expressions with multiple operations and functions it is ideal to use parenthesis to and understand the expression Stand
196. eeeenensensenenees 58 Saving EZ LADDER Toolkit Projects ccccsssseeeesseeeeseeeeeeeeeeeeeneeeeees 58 Verifying and Compiling Ladder Diagrams cssssseesseeeeeeeeenseenees 59 Bit Addressable Variables sicictnseasiionsnncestvancascaanenveesustesanmncwaneneaespenseaiwenxanees 60 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual Chapter 5 Creating Ladder Diagram Projects Creating Ladder Diagram Projects When EZ LADDER Toolkit is opened it will automatically create a new blank project and it s corresponding workspace as shown in Figure 5 1 Anew project may be created at any time by choosing New from the File menu EZ EZ Ladder Standard EZ Ladder1 EZ File Edit View Project Reports Window Help BG Dee sae e g h sal Label Edit Inst Vars Yars C MON Abc le Vie He Vi CTU CTD CTUD TP TON TOF Insert Function k D Edit ST Functions Coils 1 Contacts Functions s Variables Figure 5 1 Before adding any objects functions or variables to the new workspace the Target must be selected and configured according to the target needs and your program requirements Select your target by choosing Settings from the Project menu See Chapter 4 Configuring Targets and Chapter 23 Hardware Targets for details When configuring your target it is recommended to only install and configure features that are intende
197. ees a true to false transition the timer is reset and the output Q is de ener PT ET gized goes false Input Output Connections The TON function block placement requires connections of two input pins IN PT and two output pins Q ET W ps type Integer Real Boolean Timer ActiveState Gi Dote Omn mw x tote o y mwe ooo LI TI x TI ET S T T gt e owe o d x S O Example Circuit Timing Diagram S ee ET PT pm Elapsed Time mmm mmm mmm mm True On oo 0 L False Off False Off Related Functions TOF TP Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 347 Chapter 24 Function Reference TP TP Description IN Q The TP pulse timer is a programmable one shot timer with a variable turn on time When the input IN input is true the timer begins timing and the output Q is energized When PT ET the elapsed time ET is equal to the preset time PT the output Q de energizes goes false When the input IN goes from true to false the timer is only reset if the elapsed time ET is equal to the preset time PT If they are not equal the reset will not occur until they are equal and IN must still be false Input Output Connections The TP function block placement requires connections of two input pins IN PT and two output pins Q ET Active State Other Details x a an WW WE WR RH BE WEE WE BE ll
198. egister based Each node supports up to 256 registers and communication can be triggered based on time or on an event Divelbiss OptiCAN can perform the following major functions 1 Allow controllers to access external I O Devices 2 Allow controllers to access other controllers 3 Allow the user to configure devices utilizing the CAN protocol Only Divelbiss OptiCAN enabled devices will communicate on the network OptiCAN network Connecting non OptiCAN devices will result in network errors including loss of communication Planning the OptiCAN Network As with any network or communication scheme the network should be planned taking into account the amount of communication broadcast rate communication triggers register assignments and timing require ments This plan is essential for a successful implementation of a network It is suggested that register needs should be identified and assigned for each device prior to the start Q of the programming While any legal register may be used it is recommended that register assignments start at the high end of available registers and work backward i e start with register 127 and then assign 126 and so on As some devices utilize lower register numbers this will ensure that the controller register assignments will not interfere with the device register assignments All OptiCAN controllers have the ability to broadcast send data and isten receive data OptiCAN Control lers broadcast to all u
199. el enable check boxes are now functional Place a checkmark in the channels that are to be used by clicking in the check box next to CHO to CH3 As a chan nel is enabled an automatic Variable name is shown The variable names are automatically created when a channel is enabled The name can be changed by typing the desired variable name in the Variable Name box for each channel ad MCP3204 Properties SP Properties SPI Port SPIO z CS Output GPIO1 v Channels CHO Enabled Vanable Name AD_SPI_O 1_0 CH1 Enabled Vanable Name AD GI DI CH Enabled Variable Name AD SPIO 1 CH3 Enabled Variable Name AD Sp D 13 Figure 15 10 l Refer to the MCP3204 integrated circuit data sheet for details on the MCP3204 and its limitations O The MCP3204 analog input analog to digital converter channel values are always stored and can be ac cessed in the ladder diagram program by the variable names configured in the MCP3204 Properties 2 dialog When the MCP3204 is configured click ok to close the MCP3402 Properties dialog 2 Itis now listed in the MCP3204 Properties dialog 1 Click ox to close the MCP3204 Properites dialog 1 Click ox to close the Target Properties window and click ox to close the Project Settings window Be sure to save the ladder diagram project The MCP3204 port is now installed and ready to be used in the ladder diagram This installation is to configure the MCP3204 as a device in EZ LADDER Toolkit and the
200. en Opens the EZ LADDER Toolkit splash screen This screen is normally viewable for a few seconds when EZ LADDER Toolkit is started EZ LADDER Toolkit Tool Bars and Tool Bar Buttons The EZ LADDER Toolkit provides tool bars for many common functions for ease of use and to increase efficiency when programming ladder diagram projects As discussed earlier many of these tool bars may be either viewed or hidden EZ LADDER Toolkit defaults these tool bars as viewable EZ File Edit View Project Reports Window Help Pee Ar g a JMP Edit Inst Ys ia ER gt gt Label vers Vars a C MON Abc JH o en CTD cTUD TP TON TOF Insert Function lk d Edit ST Functions Figure 2 3 Each tool bar contains multiple buttons The following describes the function of each button 1 New Project Opens a new blank EZ LADDER Toolkit Project Window Sen Ge Open Project Browse and open an existing EZ LADDER Toolkit Project Kl Save Project Saves the currently selected EZ LADDER Toolkit Project Cut Cuts Deletes the selected Items Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 20 Chapter 2 Navigating EZ LADDER Toolkit Copy Copies the currently selected items to the Window s Clipboard amp Print Project Opens the Print dialog for printing the EZ LADDER Toolkit Project Ei Help Opens the Help About dialog Select Tool Se
201. en all the SPNs required have been mapped to variables The function block is now placed in the ladder diagram The EN enable should be tied to the left power rail or using a contact to control when the specific J1939 __ RX_PGN function block is enabled and receives data The Q output goes true when the data is received for one ladder diagram scan and then goes false on the next ladder diagram scan Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 152 Chapter 14 CAN Networking The ER is the error output It must be connected to an integer variable This variable will store the status of the last receive O Valid Data or No Error 1 PGN Not Seen 2 PGN Failed Update or No data received in last 5 seconds EZ J1939 Rx Properties Can Port CANO S PGN 61442 Description Electronic Transmission Cont Electronic Engine Controller Electronic Engine Controller Electronic Transmission Cont High Resolution Vehicle Dist Fi AA HH a Im gt Descriptio Transmission Input Shaft Spe Transmission Output Shaft S Percent Clutch Slip WR Transmission Driveline Enga Transmission Torque Conver sees ewe Ch ft T Mh mz mm sm d Source Address Map Variable Receive from all addresses Source Address to Receive From D Figure 14 26 Block Name J1939_RX_PGN1 PGN Settings Tx Only Priority Broadcast Rate NMEA2000 PGN Access Priority Acce
202. endent on cable selection and bus loading See Application Note for CAN Transceiver NXP AN00020 or your CAN transceiver Using Controllers on the OptiCAN Network A typical application involves a controller running it s own ladder diagram project monitoring inputs and controlling outputs based upon the project that is running When connected to an OptiCAN network the con troller will operate the same but now using OptiCAN it can communicate to other devices including other controllers with OptiCAN and OptiCAN IO Modules The following describes how a controller can operate when used on a active OptiCAN network 1 Local Control Monitor Inputs and Control Outputs 2 Globally broadcast data to all OptiCAN Nodes on the OptiCAN Network 3 Listen for Broadcasts from a specific Node on the OptiCAN Network All EZ LADDER Toolkit programmed OptiCAN network controllers are configured using the EZ LADDER Toolkit and maintain their network settings parameters and register settings in the actual ladder diagram project Each controller on the OptiCAN Network may have different settings and all will be required to have a different Node ID address OptiCAN Controller Heartbeat Each OptiCAN controller has the ability to broadcast a signal called a heartbeat This signal is broadcast at a regular interval and is used to ensure that all devices on the network are communicating properly Each node automatically listens for this heartbeat and adjusts
203. ents Chapter 21 EZ LADDER Toolkit Reports ccccccscceseeeeeeeneeneeeeeeneeeneeeeeenees 211 EZ LADDER 1OOMIE ROD OMS iiss ce sscnetnssascsnvaesevessactnerneccctiadsnesansasarsaunineunyuaedtanetesaviensvaeinsanessesstisanncenmwontel 212 Chapter 22 TroubleShooting ccccceceeeeeeeeeeeeeeeeeeseneceeeceneeseeeneeneseneeeeesenesees 215 GIO MESSAGES sac senttes cawascaeoseteucewenenecasetrs aaa GEE aparis 216 SERCH COM CO Text EONS rres nere Er EA EEEE E EEA EEA EETA EEn E EREET E 219 Common Ladder Diagram Errors ccccceeseeeesseeeeeeeeeeeseeeeesneseeeseseeeeeeeeseeeseaneeeueneseeaeeeeaeeseaeeessnenenses 220 Chapter 23 Hardware Targets ccccccssecceessseceeeceeeeeeeceseeeneeseseeeeeneeeeeseeesenenees 222 P Series PLC on a Chip Integrated Circuits cece ecceeeceeeeeeeeeeeeeeeeaneeeeeseeaaeeeeeeseaaaaeeeeseaaaaseeesessaaes 223 HE C POX TE 225 A I EE 228 P Series Bear Bones Controllers euer ee EE Eege eegen 232 Chapter 24 Function Reference ccccceceeeeeeeeeeeeeneeeeeeeeeneensenseneeaeeeesensensoness 235 Object and Function Block Eegeregie 238 Chapter 25 Password Protection ccccsccscceeeeeeeeeceeeeeeneeeesensenseeseeeeeeseneensenees 352 Password Protection Overview s ssssssssssssnsnnsnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn ennnen mnnn 353 Configuring Password Protection sssssssesssnnunnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
204. er Figure 18 1 shows the Target s Devices window r ad PLCHIP PXX Devices Devices Name Description OptiCAN Divelbiss OptiCAN PLCHIP_Pxx_eeprom Intemal PLCHIP PXX 4K EEProm PLCHIP_Pxx_gei Intemal Quadrature Encoder Interface PLCHIP Be gc Intemal PLCHIP PXX Real Time Clock PWM Pulse Width Modulator SD_CARD SD Card Serial Print Serial Print SPIO SPI 0 SPI1 SPI 1 Hardware Timer Counter Figure 18 1 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 194 Chapter 18 Timers amp Counters Select TimerCounter and click ox The Jimer Counter Properties Window will open See Figure 18 2 a Timer Counter Properties Figure 18 2 Click the app button to add capture inputs Anew Select Timer Counter Chanel dialog will open Select the capture input channels that are required TmrCntrO TmrCntr2 holding the CNTRL key will allow multiple selections and click ox See Figure 18 3 The TmrCntrX X Channel Properties for dialog will open Using the drop down Mode menu select the mode of operation for the timer counter capture input The choices are Free running Timer Timer or Coun ter When selecting the mode as a free running timer no additional configuration is required When configur ing as either a timer or a counter additional configuration is required by selecting the Timer Mode or Coun ter Mode and the Pin capture pin For the capture pin refer to the target s
205. er Workspace Area where the ladder diagram is drawn 6 Output Window This is where status messages are displayed when Verifying or Compiling ladder diagram programs Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 15 Chapter 2 Navigating EZ LADDER Toolkit EZ LADDER Toolkit Menus The EZ LADDER Toolkit has many features and options Basic commands features and options are used and controlled through drop down menus Figure 2 2 shows the standard EZ LADDER Toolkit Menu bar As with any Windows based application clicking on a menu heading will cause the drop down menu to open EZ File Edit View Project Reports Window Help Figure 2 2 The menus found in the EZ LADDER Toolkit are File Edit View Project Reports Window and Help Some of these menus are specific to EZ LADDER Toolkit features while others are part of the basic Windows struc ture FILE MENU The FILE Menu includes the standard windows functionality for file control and printing The FILE Menu items are New Open Close Save Save As Print Print Preview Print Setup and Exit A recently opened file list is also included for quick recall of recently opened ladder diagram projects New The New menu item is used to create a new blank EZ LADDER Toolkit Ladder Diagram Project Open The Open menu item is select and open a previously saved EZ LADDER Toolkit Ladder Diagram Project Close The Close menu item closes the currently selected
206. ergized An internal DIRECT CONTACT may also be referred to as a control relay CR A true condition on the input if internal coil is true for internal contacts or real world input is true then the contact will allow power flow and devices located to the right of the DI RECT CONTACT may operate Example Circuit CHI COIL Related Functions DIRECT COIL INVERTED COIL INVERTED CONTACT Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 266 Chapter 24 Function Reference DIV DIV Description The DIV function divides the P1 input by the P2 input and outputs the result O The en able EN must be true for the DIV function to be enabled The Q output is true when the DIV function is enabled The result O is the whole number quotient only No remainder is provided P o Input Output Connections The DIV function block placement requires connections of three input pins EN P1 P2 and two output pins Q O eps type Integer Real Boolean Timer Active Stato Other Details e f me x cttw Cm f e A ESCHER EE e ma x x S T o owm EE o owm x x O o o oe Example Circuit Related Functions ADD SUB MULT Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 267 Chapter 24 Function Reference DRUM SEQ DRUM SEQ Description Hal Q The DRUM_SEQ function is comprised of a matrix table of steps rows of table and the channels columns of table For each chan
207. ernels When the Bootloader utility responds the Bootloader screen will automatically appear See Figure 19 1 Le a Bootloader 1 1 0 6 0 0 0 22 10031671 Figure 19 1 Divelbiss Corporation EZ LADDER Toolkit User Manual 202 Chapter 19 Ethernet Click the TARGET options button Anew Target Options window will open This window had three tabs Ether net Options USB Options and SD Card Options See Figure 19 2 a Target Options USB Options 5D Card Options DHCP Enabled IP v4 Auto Contig Figure 19 2 If not selected select the Ethernet Options Tab Click the Ethernet Enabled check box to enable Ethernet The Ethernet configuration defaults to DHCP Enabled and IP v4 Auto Config enabled the target gets it s IP address from the network s DHCP server Static IP Addressing may also be configured DHCP Configuration When configuring for receiving the IP address from the network a Host name is recommended to identify the hardware target on the Ethernet network See Figure 19 3 Enter a Host name in the Host Name box DHCP IP addressing is assigned by the network s DHCP server and therefore can be any address and is controlled can change at will by the DHCP server a Target Options USB Options 5D Card Options Ethemet Enabled DHCP Enabled Host Name PLCONCHIP1 IP v4 Auto Contig Figure 19 3 Divelbiss Corporation EZ LADDER Toolkit User Manual 203 Chapter 19 Ethernet
208. es therefore are more accurate than standard software timers and counters Additional EZ LADDER software Counter CTU CTD and Timer TON TOF functions exist See Chapter 24 Function Reference As this manual is a generic EZ LADDER Toolkit manual for P Series PLC on a Chip target programming the counter and timer capture inputs are covered To determine if the actual hardware target model supports these inputs refer to Chapter 23 Hardware Targets All the counter timer capture inputs are based off the PLC on a Chip CAPx x pins Depending upon the hardware target only some or even none of the inputs may be available Installing Counter Capture Inputs Prior to using the TIMERCOUNTER function block the actual capture input s must be installed in EZ LAD DER Toolkit and configured for the operational mode desired The examples shown are for the P Series PLC on a Chip Other targets will operate and configure similarly Select the target PLCHIP PXX and click the properties button The Target Properties window will open From the drop down menu DCPN select the model part number of the target If any of the Timer Counter capture inputs are installed they will be listed in the Devices pane under the Internal TimerCounter section Click the App Device button The Target s Devices window will open All the available devices and features for the target are shown in the Devices section Scroll down and find the TimerCount
209. es Pane Click OK to close the VB 2XXxX Properties 9 Click OK to close the Project Settings Window 10 Save your ladder diagram using the menu FILE and SAVE or SAVE AS to save the current settings in your program The EEPROM functionality is now installed in the ladder diagram program The EERPROM_ WRITE and EE PROM_READ function blocks should now be available in the function block drop down list Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 15 EZ VB 2000 Properties Part Number VB 2000 Devices Bus k Internal Analog I O i Low Voltage Sense Add Device Properties Remove oJ PLCHIP PXX Devices PLCHIP_Pooer_eeprom PWM SD_CARD Serial Print TimerCounter UART UARTS Description CAN 0 Modbus Master Modbus Slave Divelbiss OptiCAN Intemal PLCHIP PXX 4K EEProm Pulse Width Modulator SD Card Serial Print Hardware Timer Counter UART UARTS Expansion Description Expansion Board Properties Variable Names User Interface Expansion None Name I O Expansion None Figure 7 3 Figure 7 4 Using EEPROM Memory EEPROM memory is accessed by using the EERROM_ WRITE and EEPROM_READ function blocks The EEPROM WRITE and EEPROM_READ function blocks use variables to set the EEPROM address To write and read values from the EEPROM you must understand that the EEPROM memory is basically a bank of memory and the variable val
210. escription eil The LCD_CLR function block is used to clear the LCD display When the EN input detects a rising edge the LCD Display is set to be cleared The LCD display is cleared and up dated at the END of the ladder scan Input Output Connections The LCD_CLR function block placement requires connections of one input pin EN and one output pin Q Torin Type Integer Real Boolean Timer ActiveState Other Dotais cen me XY CRsing Ege o om lt Example Circuit CRI CD_CLEARI1 Related Functions LCD _PRINT Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 296 Chapter 24 Function Reference LCD PRINT LCD PRINT Description The LCD_PRINT function is used for printing data to the LCD Display When then EN input senses a rising edge the block prepares the text that was provided when the LCD_ PRINT function was placed and marks it to update at the end of the current ladder scan The Q output is set true when the print is completed The ER output is set DU ER to non zero if the printed data is larger than the LCD will display At the end of the ladder scan the display is updated See Chapter 9 LCD Display Support Input Output Connections The LCD PRINT function block placement requires connections of at least one input pin EN and two output pins Q ER Additional inputs are based on variables in printing text en ype Integer Real Bootean Timer Active
211. escription of the function or block operation is provided When applicable truth tables timing diagrams or other functions details are provided This information is to provide basic practices of how each function or object works and is not intended to provide complete applications or uses As this chapter is a reference providing function block and object details on ALL functions available EZ LADDER Toolkit the presence of a function does not guarantee availability of the function on all hardware targets Availability of functions and objects is determined by the hardware target that is configured for the ladder diagram projects Some functions and objects are not available on some targets Refer to the actual hard ware target s data sheet manual or Chapter 22 Hardware Targets for a list of supported functions and objects based on target selection Q It is important to formulate which function blocks may be used in a ladder diagram project and then verify and select the target that supports the desired features and function blocks All objects and function blocks described in this chapter are organized in alphabetical order Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 238 Chapter 24 Function Reference ABS ABS Description EN Q The ABS function provides an absolute value output O from the input value P1 The en able EN must be true for the ABS function block to be enabled The Q output is true when th
212. esssessseeeeees 90 Getting Data from the Keypad ccccccsceceseeeeeseeeeeeeeeeeseeeeeseeeeeaeeeesaaes 91 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual Chapter 10 Keypad Support Keypad Functionality EZ LADDER Toolkit provides the ability for the addition of keypad functionality EZ LADDER Toolkit supports a basic 4 row 5 column keypad matrix This keypad matrix includes the numbers 0 9 Enter Clear Up Down Decimal Point and F1 F4 programmable function keys Using this keypad matrix and the built in EZ LADDER functions menus and user interactions may be programmed into a ladder diagram project Keypad support is based on actual hardware target specifications PLC on a Chip Integrated Circuits and Modules support Keypad functionality For PLCs and controllers refer to the supported features See Chapter 23 Hardware Targets Configuring the Keypad in the Project Settings To be able to use an keypad in an EZ LADDER Toolkit ladder diagram project the keypad must first be in stalled and configured The keypad is configured using the Project Settings Using the Project Menu choose Settings The Project Settings window will open as previously covered in Chapter 4 Configuring Targets Select the target and click the properties button The Target Properties window will open From the drop down menu DCPN select the model part number of the target If the Keypad were installed it would be
213. et dominant bistable If the set input S is true the output Q is true A true on the reset R input sets the output Q to false regardless of the set S input state Input Output Connections The RS function block placement requires connections of two input pins S R and one output pin Q n Type Integer Real Boolean Timer Active State Other Dotais O rR mw SS ESCHER RS s ma J Sx S T a owt E x E E Example Circuit CRI RS1 CR4 CRZ 8 Truth Table Related Functions SR Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 32 Chapter 24 Function Reference SEED SEED Description The SEED function provides the number which the RANDOM function uses as the basis EN Q for generating a random number The enable EN must be true for the SEED function to be enabled The Q output is true when the SEED function is enabled Input Output Connections The SEED function block placement requires connections of two input pins EN P and D one output pins Q ege Type Integer Real Boolean Timer Active State Other Dorais ren mot TT x Cater P me y xy S S S e a owt Jo d EE BE Example Circuit SEED EN Q Number ke P Related Functions RANDOM Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 328 Chapter 24 Function Reference SEL SEL Description The SEL function provides selection of the P1 or P2 inputs If enable EN
214. ethernet port may be configured to use Modbus TCP Regardless of the configuration all the modbus registers are universal meaning all the ports may use exactly the same register numbers each port does not have individual register sets This allows for multiple devices to access the same register and variable and therefore share the same data easily divided based on register numbers on a per port basis Using variables for each mapped network register section per port will allow this separate values to be accessed by the ladder variables based on register number If the data in registers must be unique to each port then the network registers must be mapped and Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 123 CHAPTER 14 CAN Networking This chapter provides basic information to understand how to install configure and use the OptiCAN Networking J1939 Networking and NMEA 2000 Networking feature in the EZ LADDER Toolkit Chapter Contents UO CH e KEE 125 Installing CAN Network Ports ccc ccccsssseesesseeeseeeeseeseeseeseesseseesseenenses 125 Divelbiss OptiCAN Network cccccccsseesesseeeeeeeceeeeeseseeseecaseesaeeesseeeseas 126 Planning the OptiCAN Network ccccsscsccssseeessseeeeeseeeseeseeeeesseseeneesenens 126 Hardware Requirements amp Recommendations c ccceeseseeeeeeeees 127 OptiCAN Specifications cc cceceececeeceeeeeeeeeeeceeeeeeneeseeeeseeees
215. eviously covered in Chapter 4 Configuring Targets Select the target and click the properties button The Target Properties window will open From the drop down menu DCPN select the model part number of the target If J1939 were installed it would be listed in the Devices pane under the Device section Click the app Device button The Targets Devices window will open A CAN port must be installed prior to installing J1939 NMEA 2000 See Installing CAN Network Ports earlier in this chapter All the available devices and features for the target are shown in the Devices section Scroll down and find the J1939 Figure 14 19 shows the Target s Devices window a PLCHIP PXX Devices Devices Name Description CAN1 CAN 1 Ethemet Ethemet J1939 J1939 Modbus Master Modbus Master Modbus Slave Modbus Slave PLCHIP_Pxx_eeprom intemal PLCHIP PXX 4K EEProm PLCHIP_Pxx_qei Intemal Quadrature Encoder Interface PWM Pulse Width Modulator SD_CARD Serial Print TimerCounter UART2 UART3 Variable Names Name Figure 14 19 Select the J1939 and click ox The J1939 Properties dialog will open This dialog is used to specify which CAN port is to be used as well as the J1939 Universal Settings The configuation here will decide how J1939 is implemented Refer to Figure 14 20 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 145 Chapter 14 CAN Networking oJ J1939 Properties Universal Settings
216. eypad With the keypad configured in the ladder diagram project it is now possible to use the EZ LADDER Toolkit s function blocks and objects to input user data and set points The keypad can be read using two methods The two methods are Integer and Real Variable entry using the Keypad Function block and the second is identifying discrete key presses using contacts Real and Integer Inputs using the Keypad Function Block s There are two Keypad function blocks provided for use in the ladder diagram program Keypad and Key pad2 Using the KEYPAD Function To read data integer or real from the keypad using the KEYPAD function block select the KEYPAD function block from the drop down menu and place it in the ladder diagram at the desired location The Keypad block will be inserted into the ladder diagram Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 91 Chapter 10 Keypad Support Each keypad function block has three inputs and three outputs As with all function blocks the EN enable will enable the keypad function block or disable it The MI and MA inputs are used to identify Minimum and Maximum allowed entries respectively The Q Output is true when the function is enabled The KB output will maintain the contents of the keypad buffer while KO is the actual value that was entered on the keypad and ENTER pressed Figure 10 3 represents a typical keypad function in a ladder diagram project The Keypad function b
217. figured in the ladder diagram project it is now possible to use the EZ LADDER Toolkit s function blocks to display messages and variables Two basic function blocks that are used control the display are LCD CLEAR and LCD_ PRINT Clearing the Display To clear the LCD display blank all rows and columns the LCD CLEAR function block is used The LCD __ CLEAR will clear the display when it senses a rising edge on it s enable input EN Figure 9 3 shows an example program using the LCD CLEAR function block CRI CD_CLEARI Figure 9 3 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 85 Chapter 9 LCD Display Support Writing to the Display To write messages to the LCD Display the LCD PRINT function block is used Using the LCD_PRINT func tion block is a two step process When placing the function block a new Lcd Print Properties dialog box will open See Figure 9 4 The Text field is where the message is typed that will be displayed The Row field is the row of the display where the text will be displayed The Column field is the column where the text will begin displaying gl Led Print Properties Name LCD_PRINT1 Description Text Hello World Figure 9 4 The first row and first column are always zero 0 and are limited by the actual hardware target Q display size If text in a row is more than can be displayed on the LCD it will be truncated It does not automatically wrap to the next
218. figuring Targets 5 Properties When a target has been selected the properties button may appear target specific If this button appears clicking the PROPERTIES will allow additional configurations for the selected target Properties may include Model Number and installing removing additional target supported features Modbus OptiCAN Ethernet etc Version Tab Settings The Version Tab will display the current build and version of the ladder diagram that is currently active in the EZ LADDER Toolkit The build and version information is useful when determining if a program version is current Figure 4 2 shows the Version settings tab of the Project Setting Window Version setting may be changed in this window if required 1 Version Number A version number for the ladder diagram may be entered here This number will not change automatically It must be manually adjusted for each revision or release of the ladder diagram project 2 Build Number The current build number is displayed here Each time the ladder diagram project is Compiled the build number automatically increments This number may be over written in this window if needed EZ Project Settings Figure 4 2 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 34 Chapter 4 Configuring Targets Options Tab Settings The Options Tab will display the currently selected options and preferences Some of these options are tar get specific while othe
219. for added versatility These flags alter the way the index pulses are handled base on conditions of the A and B inputs Phase A OEI PHA and Phase B QEI_ PHB Care must be taken when altering the Index Gating flags as changes may cause undesired results Additional Settings Maximum Position This is the maximum position for the encoder counter position In the forward direction when the position counter exceeds this value the index counter is incremented and the position counter is set to zero In a reverse direction when the position counter his zero the index counters is decremented and the Position counter is set to the this value maximum position PHA Digital Filter Sampling counter for digital input filter for Phase A Input If set to zero the filter is disabled When not zero the value is the number of sample clocks that the input signal must remain in a new state high low for the new state to be seen as a valid state The sample clock is 120MHz 8 33333ns PHB Digital Filter Sampling counter for digital input filter for Phase B Input If set to zero the filter is disabled When not zero the value is the number of sample clocks that the input signal must remain in a new state high low for the new state to be seen as a valid state The sample clock is 120MHz 8 33333ns INX Digital Filter Sampling counter for digital input filter for Index Input If set to zero the filter is disabled When not zero the value is the
220. function blocks may limit the availability of other features and function blocks Features On Board Real Time Clock Retentive Memory using FM24xxx Up to 164 I O Digital I O Up to 12 PWM Outputs Quadrature Input 3 High Speed Counter Timer Inputs Up to 8 Analog Inputs On Board Up to 1 Analog Output On Board Up to 4 Serial Ports Up to 2 CAN Ports Ethernet Port Supported Function Blocks Less Than lt Less Than Equal To lt Not Equal To lt gt Equal To Greater Than gt Greater Than Equal To gt Absolute Value ABS Arc Cosine ACOS Addition ADD Arc Sine ASIN Arc Tangent ATAN Bitwise AND AND Average AVG Bit Pack BIT _PACK Bit Unpack BIT_UNPACKk Convert to Boolean BOOLEAN Ceiling CEIL Compare CMP Cosine COS Count Down CTD Count Up CTU Count Up Down CTUD Division DIV Drum Sequencer DRUM_SEQ EEprom Read EEPROM_READ EEprom Write EEPROM_ Write Exponential EXP Power Function EXPT Up to 3 IC Ports Up to 2 SPI Ports EEPROM Storage 4000 bytes Modbus Master Slave Modbus TCP over Ethernet OptiCAN Networking J1939 NMEA 2000 Networking LCD Support Keypad Support Expandable Analog using SPI I2C SD Card Storage Falling Edge Detect F_TRIG Floor FLOOR Get Date GETDATE Get Time GETTIME Hysteresis HYSTER Convert to Integer INTEGER J1939 Receive PGN J1939_RX_PGN J1939 Transmit PGN J1939_TX_PGN Jump J
221. function blocks variable inputs and outputs only will result in the ladder diagram project Compiling successfully but it will not operate as intended CG When connecting two function blocks in series where a variable output of the first needs to be Using Copy and Paste EZ LADDER Toolkit being a Windows based application allows the copy and paste functions inherit to Windows with certain limitations imposed It is possible to copy any single or combination of objects function blocks variables and links to the Windows Clipboard To Copy object s choose the Select Tool from the tool bar To choose a single object left click on the object to select it To select multiple objects click and drag across the objects Objects may be selected by hold ing the ctrt key while clicking on them With the items selected using the Edit Menu choose Copy or right click and choose Copy The objects are now copies to the Windows Clipboard Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 57 Chapter 5 Creating Ladder Diagram Projects Unlike a standard windows application objects on the clipboard cannot be pasted using cTRL v or by using the Edit Menu s Paste feature To paste an object or multiple objects in EZ LADDER Toolkit use the Select Tool from the tool bar and hover the point at the location to paste if pasting multiple objects this would be the top left of the objects that will be pasted Right click and choose Paste Th
222. function listens for OK of the status register 191 EN for the specified node over the OptiCAN network When placing the function the NODE ID is specified as well as the Timeout The function block will isten for the node status register broadcast of the Node ID and update VAL and Q accordingly The Timeout value is the duration that the function block will isten and not receive a status prior generating an Error on the VAL output pin and the Q output The Q output is true when the VAL output is valid See Chapter 14 OptiCAN Network ing for more information regarding using the function block and general OptiCAN networking OPTICAN NODESTATUS YAL Input Output Connections The OPTICAN NODESTATUS function block placement requires connections of one input pin EN and two output pins Q VAL Torin type integer Real Boolean Timer Active State Other Deas en mt XY Cater o om x d emo e owe fx fT S Example Circuit AN NODEST R2 CRI C EN Q VAL Error Codes The Node Status register 191 is represented by a 32 bit number The lower 16 bits represents the current status code while the upper 16 bits represents the error code There are three status codes supported on the OptiCAN network The status codes are 1 Reset 2 Ac tive and 4 Reset The Q output will be true if the VAL output is valid If invalid no response from node then the Q output will be false and the VAL output
223. g ccccccssessseeseeeeeeeseseeeeeeeseneseessenesenesenenens 107 NIG CDS OV CIC WV risian iren EA canon E E E T EEE EEEE AER D 108 Installing the Modbus Master ssassnansnnsnnnnsnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nennen nenna 108 Usmo TNE Modbus Master eege 110 MOODUS SIAVE E 116 MOGDUS TGP over Ethernet sesinin anen EE ENEE EREET 121 M dbu us using M HI Ie POTTS ansni ea aa aE E En 123 Chapter 14 CAN Networking cccccceseessceeeeeeeeceeeeenecneseeesenesonesenssenesenssnesens 124 et IS CAN KT 125 Installing CAN Network A e Un CH 125 DivelbisS OptiCAN Network es eggeeude see ccecventes sce cticdelencccec eb eriveussceuepaveniacuceadedencuevecsaveeadvencerec cubeiedeeceesdeceec 126 J1939 Networking NMEA 2000 cccsssecssssssccssseseenseeesnsseesenseeeonseesoasseecessesooaseeooassesoessesnonseesoaseesoans 144 Chapter 15 SPI Devices and Support ccccccccceeeeeeeeeeeeneeeeeeneeeneeneseneeeeeenees 159 ei 160 SVS Cea EE GN TE 160 Installing Supported SPI Bus Devices ccc ceecccesceeeeee eee neeeeeeeecas esses REENEN eesaa esses essoaesseaasseaaeaeenesanaes 162 Chapter 16 PC Devices cccecccseeceeeeuseeceeeeeseeueeeceneeaneeueseeeseeuseeneeeeneeenasesueees 180 TO OVEVIEW ee 181 Installing an FG Bus in EZ nie 181 Chapter 17 Analog I O DEE 184 ANIO TTC 185 Andog OES oere E E E E EEE 190 Chapter 18 Counters amp Times s
224. g EEPROM Fuctionality For P Series based PLC on a Chip targets the EEPROM functionality may or may not be automatically installed based on the actual hardware target If the target automatically installs the EEPROM functionality then no other configuration is required If the EEPROM READ and EEPROM WRITE function blocks are in the function block drop down list then the EEPROM functionality is installed and may be used If the EEPROM functionality is not installed and it is required for a ladder diagram project it must be in Stalled before the EEPROM may be utilized To install the EEPROM device some target knowledge is assumed refer to the hardware target s user manual follow these basic steps A VB 2000 is used as the example hardware target All others will install similarly 1 In EZ LADDER from the File Menu at the top click PROJECT then SETTINGS This will open the Project Settings Window Select VB 2000 as the target from the choices 2 Click the PROPERTIES button to the right side of the window The VB 2000 Properties Window will open Make sure the proper model Part Number is selected in the drop down menu Refer to Figure 7 3 3 Click the ADD DEVICE button The PLCHIP PXxX Devices window will open Locate the PLCHIP_Pxx_eeprom in the Devices pane of this window Refer to Figure 7 4 4 Click the PLCHIP_Pxx_eeprom device highlight and click OK 5 The PLCHIP_Pxx_eeprom is now listed as an internal device in the Devic
225. g Objects amp Variables c sccccsssseeeeeeeeeeeeeeeeesneeeeeneeeeeeeeeeseeeseaneeseaneeeeeneesensaeseonaessonsees 48 Creating and Placing Variables cccccceseseeeeeeeeeneeeeeneeeeesneseeeseseeesseeeseeeseeneeeeaseseeanessoegeesenenessneaenses 50 VALAIS Eege 51 NAN AG le TE 52 Keeping Variable Values on Power LOSS cccscecsseeeeeeeeeeeeeeeeeeeeeneeeeseeceneeseneeeeneeseeeesesaseenaeneeaenesensaaes 55 Placing Objects and Drawing Links ei seguet 2sgeegeeeb eege EEN EE EEE ng 55 Using CODY andi Pas ie EE 57 Inserting and Deleting RUINGS ccccccscsseseeeeeeeeeeeseeseeeeseeeeneeeeneeeeeseeeenseeeneseeneeoeneeseneesenesensesseasenenenneaes 58 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual Z Table of Contents Saving EZ LADDER Toolkit PrOl GGUS ciciccssestewcdicmuemnnccrscnduesebacasisncocsundestassmenm tentecuccousnenesiemteasenseteotsenmetes 58 Verifying and Compiling Ladder Diagrams ccccsscceseeeeeseeeeeeeeeeeeseeneeseeneeeseneeseeneeseeneeseaneensanneesones 59 ESTE PRG SSS euer xen ts eee ERA AENEA EAEEREN eweeemecedrewaetecabmeccensannes 60 Chapter 6 Downloading and Running Projects cccssseeeeeeeeeeeeeeeeeeeenees 62 Switching Modes in EZ LADDER Toolkit ccceecseeeeeseeeeeeeeeeeseeeeeeseeeseseeeseaseeeeeeeseeseseasneseeenessessenees 63 Monitor Mod OV STOW eet 64 Co onnecing itoa TARO EE 65 Connecting for the First Time to a New Target
226. ge This variable may be used as outputs from function blocks in the ladder diagram program Figure 15 23 is an example ladder diagram using a variable from the MAX31855 CRI lt CRZ Figure 15 23 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 179 CHAPTER 16 C Devices This chapter provides basic information to understand how to install configure and use the I2C Devices in the EZ LADDER Toolkit Chapter Contents Reser 181 Installing an IC Bus in EZ LADDER cccceeeeseeeeeeeeeeeeeeeeeeeeeaaeeeeeeeeeas 181 FM24XXX RAMTRON FRAM Storage Devices c sscceseseeeeeeeeeeeees 182 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 180 Chapter 16 I2C Devices BC Overview EZ LADDER Toolkit supports the use of FC Devices These devices expand the capability of the P Series PLC on a Chip Only supported FC devices may be used with the P Series PLC on a Chip and not all P Series PLC on a Chip targets will support these devices Refer to Chapter 23 Hardware Targets for complete target information including supported devices and commands standard pull up resistors typically 1 5K Ohms In addition the device must be installed in EZ LADDER Toolkit For supported I2C devices they must be connected to the P Series PLC on a Chip correctly using The following FC devices are currently supported in EZ LADDER Toolkit and P Series targets FM24XXX Ramtron 24xxx
227. ger Real Boolean Timer Active State Other Details ren trot X e et mo x o owe fo x o om fx 9 WE BN WE _ Natural Logarithm of P1 Base Number a ee Example Circuit LN EN Daschumsa P1 O j NumOut_ Related Functions EXP EXPT SQRT LOG Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 302 Chapter 24 Function Reference LOG Description eek The LOG function calculates the logarithm base 10 of the P1 input The output O is the EN Q cacluated base 10 logarithm value of the P1 input The enable EN must be true for the LOG function to be enabled Input Output Connections ao The LOG function block placement requires connections of two input pins EN P1 and two output pins Q O en Type integer Real Boolean Timer Active State Other Details ren trot X e et mo x o owe fo x o om fx 9 WE BN WE o D ES ll Example Circuit LOG EN Reall pPI Olka NumOut_ Related Functions EXP EXPT SQRT LN Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 303 Chapter 24 Function Reference MAVG MAVG Description a i The MAVG function calculates the moving average of the P input The number of samples is specified when the object is placed The output O is the calculated moving average value of the P input The enable EN must be true for the MAVG function to be enabled When EN is true the output is the m
228. ger may be used as a bit addressable variable As a bit addressable variable each variable has 32 individual bits that are numbered 0 31 and each bit represents the binary bit of the total integer variable number To understand bit addressable variables you must have a basic understanding of the binary num bering system where numbers are created using ones and zeros in specific placeholder bits that represent an actual number 6 5 2 4 3 Placeholder 64 3 6 8 O 1 H Bit Number 0 31 zech Add the placeholder numbers of bits with 1 s only 8 4 1 13 Binary Bits The integer variable value would be 13 Setting the bit of a Variable To set the bit of an integer variable identify or create the variable In addition to the variable that will be bit addressable the one you just identified additional variables will be required to write to the bits of the origi nal bit addressable variable one for each bit that you intend to use These additional variables will be boolean output variables representing a boolean 0 or 1 for the actual bit In Figure 5 10 the Add Variable dialog box shows the creation of one of the actual bit controlling boolean variables These bit controlling variables are always set as Output and the Var I O Number is the variable name of the bit addressable variable and the bit number to control separated by a period In Figure 5 10 the bit addressable variable is named Limit and the bit shown being con
229. gram Standard J1939 Database Included as part of EZ LADDER Toolkit is the Divelbiss Standard J1939 database This database has been preloaded with common J1939 PGNs and SPNs During the configuration previously shown the data base that is used for the storing J1939 PGNs is identified The Standard J1939 database cannot be modi fied added to or deleted from If additional PGNs are required that are not included in the Standard J1939 database then the User J1939 database must be identifed and used during the configuration To use the Standard J1939 database ensure the check box Use Standard J1939 Database is checked If a user J1939 database is to be used then uncheck the box Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 148 Chapter 14 CAN Networking User J1939 Database If the Standard J1939 database does not include all the PGNs that are required the option is provided to use a User J1939 database This custom database may be configured and used to store the PGN list for your projects Using the Project Menu choose Settings The Project Settings window will open as previously covered in Chapter 4 Configuring Targets Select the target and click the properties button The Target Properties window will open From the drop down menu DCPN select the model part number of the target If J1939 were installed it would be listed in the Devices pane under the Device section Select the J1939 under Network an
230. hardware manual See Figure 18 4 aw Select Timer Counter Channel a TmrCntrO Properties Name Pin Tom rr Tom rgr Figure 18 3 Figure 18 4 Click ox to close the TmrCnitrX Properites window Click ok to close the Timer Counter Properites window The TimerCounter should now be listed in the Devices pane under Internal Click ox to close the Target Properties window Click ox to close the Project Settings window Be sure to save the ladder diagram project The timer coun ter capture input s are now installed and ready to be used Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 195 Chapter 18 Timers amp Counters Capture Inputs Configured as Timers Capture inputs may be configured as either standard timers or free running timers and must be configured using the Project Settings Menu as shown earlier this chapter Free Running Timer When configured as a free running timer the timer channel capture input may not be used for any other function and is based on a 1MHz reference clock The TIMERCOUNTER function block is used to read the current value from the timer capture input See Chapter 24 Function Reference for details on specific function blocks When configured and the TIMERCOUNTER function block is enabled the timer channel capture input will time based on 1MHz or one count for each microsecond The timer may be reset by utiliz ing the reset R input When a timer capture channel
231. he FM24XXX Figure 16 2 shows the Target s Devices window di PLCHIP PXX Devices Sail Devices Name Description Analog 1 0 intemal Analog 1 0 CANO CAN 0 CAN1 CAN 1 Ethemet Ethemet FM24XXX Ramtron FM24XXX FRAM LX 12C0 LC 0 LC 12C 1 LC LC 2 KEYPAD Keypad LCD LCD Display Low Voltage Sense Low Voltage Sense Active Low LS7366R 32 Bit Quadrature Counter SP MCP3204 Microchip 4 Channel 12Bit A D Converter SPI Modbus Master Modbus Master Modbus Slave Modbus Slave Variable Names Name Figure 16 2 Select FM24XXX and click ox The Ramtron FM24XXX Properties Window will open See Figure 16 3 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 182 Chapter 16 I2C Devices Figure 16 3 Using the I2C Port Dropdown select box select the I2C port that will interface to the Ramtron device This bus should have been installed prior to this step Select the Ramtron Device part number from the Part Number Dropdown select box The Device Select 0 should not be edited unless multiple devices are installed on the same bus Consult the factory for configuring and using multiple I2C devices on one ZC port for P Series Targets The Num Retentive Bytes may be adjusted to reflect the amount of retentive memory required See Chap ter 7 Retentive Variables and Chapter 4 Configuring Targets for more details Click ok to install the FM24XXX device and close the Ta
232. he SPN pane below populates with the supported SPNs for the highlighted PGN As differ ent PGNs are selected highlighted in the PGN pane the PGN settings to the right change as do the SPN pane Select the PGN to receive data from The SPN pane will update Select the desired SPN in the SPN pane The SPN Field setting will update with information based on the J1939 User database Q The Gain Offset and Request Type are stored in the database but may be overridden for this instance of the J1939_RX_PGN function block Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 151 Chapter 14 CAN Networking The Source Address area determines what J1939 address are may be received from for the selected PGN If the Receive from all addresses is checked then any device on the network that broadcasts this PGN will be received from If only specific a specific J1939 network address should be received from uncheck the Receive from all addresses checkbox and use the Source Address to Receive From box to set the J1939 network address The source of the J1939 broadcasts received may be configured as Receive from all addresses or may be limted to a specific address based on the Source Address area settings In addition to controlling which Source Addresses are received the receive function block may be configured based on a Destination address in the Destination Address section Using these settings the function block will receive all globa
233. he Target Settings menu or a PVWM_FREQ function F The PWM_FREQ only changes the hardware PWM channel s frequency with a low to high transition on EN This frequency will be maintained regardless of the EN state The only time this fre quency will change again is when the actual frequency input variable input F changes and the EN detects another low to high transition Q is true during the ladder diagram scan when the frequency is newly ap plied All other times the Q output is low When the PWM function is placed you must specify the actual PWM channel group CLK A or CLK B that the function will change the frequency to O If an invalid frequency is applied to input to F then the Q Output will remain low as well as the actual PWM output Input Output Connections The PWM function block placement requires connections of two input pins EN F and one output pin Q eps type Integer Real Boolean Timer ActiveState Other Dotais en mt x Rising ese F Lat ut Frequency CH Output EE BE E Example Circuit VM FHEOI R3 CRI C EN Q F Related Functions PWM Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 321 Chapter 24 Function Reference RANDOM RANDOM Description The RANDOM functions provides a random number based on the SEED function value EN Q The enable EN must be true for the RANDOM function to be enabled The Q output is true when the RANDOM function is ena
234. he device s Index input will have no affect on operation Load CNTR Configures the device s Index input to act as a load counter This will load the value of the function block input PD DTR as the actual count Reset CNTR Configures the device s Index input to act as a reset counter This will reset the actual counter to zero Load OTR Configures the devices Index input to transfer the actual count into the OTR register The OTR register is a temporary register for storing the count Asynchronous Index Asynchronous index mode Valid in all modes Synchronous Index Synchronous index mode Only valid in quadrature mode Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 165 Chapter 15 SPI Devices and Support Clock Filter Divide by 1 The clock input to the device is divided by 1 to create a filter frequency This filter frequency must be at least 4 times larger than the frequency on the device A input Divide by 2 The clock input to the device is divided by 2 to create a filter frequency This filter frequency must be at least 4 times larger than the frequency on the device A input LFLAG DFLAG Flag on IDX This check box enable the index flag bit that is output on the status register ST of the CNTR_LS7366R function block Flag on CMP This check box enable the compare flag bit that is output on the status register set if DTR actual count Flag on BW This check box enable the borrow flag bit tha
235. he variable connected to the output KO The output Q is true for the ladder diagram scan in which the ENTER was pressed Pressing the clear button on the keypad erases the buffer KB The MI input specifies the minimum value allowed to be entered on the keypad while the MA input specifies the maximum value allow to be entered on the keypad Input Output Connections The KEYPAD function block placement requires connections of three input pins EN MI MA and three out put pins Q KB KO es wpe Integer Real Boolean Timer Active State omor Domis Hen me x omn S mf me x x __ __MinimumAlonedvaue wa m x x _ T Maxinumtowedvaue e owm x x O o O e o oma x O O O O oaa ef owe ff xf T Example Circuit KEYPADI EN Minval MI KB Buffer MA KOjm Output _ Related Functions KEYPAD2 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 291 Chapter 24 Function Reference KEYPAD2 KEYPAD2 Description The KEYPAD2 function is used to allow users to input data It operates similar to the KEY PAD function This function requires the Keypad feature be installed on the target s hard ware and target settings See Chapter 10 Keypad Support for details on keypad use The Keypad2 function block provides additional features over the Keypad function block These featues allow menus and Discrete key press menu items to be combined allowing for a more powerful a
236. hing Coil UNLATCH Bitwise XOR XOR Ethernet Port EEPROM Storage 4000 bytes Modbus Master Slave Modbus TCP over Ethernet OptiCAN Networking J1939 NMEA 2000 Networking Standard LCD Display Port Keypad Port Din Rail Mount EXP Plug in Expansion Port Average AVG Bit Pack BIT_PACK Bit Unpack BIT_UNPACKk Convert to Boolean BOOLEAN Compare CMP Cosine COS Count Down CTD Count Up CTU Count Up Down CTUD Division DIV Drum Sequencer DRUM_SEQ EEprom Read EEPROM_READ Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 230 Chapter 23 Hardware Targets EEprom Write EEPROM_ Write Exponential EXP Power Function EXPT Falling Edge Detect E TRIG Floor FLOOR Get Date GETDATE Get Time GETTIME Hysteresis HYSTER Convert to Integer INTEGER J1939 Receive PGN J1939_ Rx DON J1939 Transmit PGN J1939_ TX_PGN Jump JMP Keypad Keypad2 Label Latching Coil LATCH LCD Display LCD Clear Limit LIMIT Natural Logarithm LN Base 10 Logarithm LOG Modbus Master MODBUS_MASTER Moving Average MAVG Maximum MAX Minimum MIN Modulo MOD Multiplication MULT Multiplexer MUX Bitwise NOT NOT Optican Node Status OPTICAN NODESTATUS Optican Transmit Message OPTICAN_TXNETMSG Bitwise OR OR PID PID PWM PWM PWM Frequency PWM_FREQ Rising Edge Detect R_TRIG Random RANDOM Convert to Real REAL Rotate Left ROL R
237. how available in later drop down configuration menus al PLCHIP PXX Devices o Descripti Keypad LCD Display Low Voltage Sense Active Low 32 Bit Quadrature Counter SP Microchip 4 Channel 12Bit A D Converter SPI Modbus Master Modbus Master Modbus Slave Modbus Slave OptiCAN Divelbiss OptiCAN PLCHIP_Pxx_eeprom Intemal PLCHIP PXX 4K EEProm PLCHIP_Pxx_gei Intemal Quadrature Encoder Interface PLCHIP Pe gc Intemal PLCHIP PXX Real Time Clock PWM Pulse Width Modulator SD_CARD SD Card Serial Print Serial Print SPI1 SPI 1 Variable Names Name Figure 15 8 Click ox The MCP3204 Properties dialog will open Ths dialog selects the SPI Port and Chip Select to be used for this MCP3204 device See Figure 15 9 ad MCP3204 Properties SPI Pot CS Output Input Channels Vanables Figure 15 9 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 168 Chapter 15 SPI Devices and Support l Multiple MCP3204 devices may be added to an SPI port provided that each device has a unique chip si select output specified Click the app button An additional MCP3204 Properties window will open Select the SPI port from the drop down menu and select the general purpose output pin GPO that will serve as this device s chip select CS See Figure 15 10 Any chip select pins reserved for structured text will not be visible in the drop down menu With the SPI Port and CS Output selected the Chann
238. iable and the bit number to read separated by a period In Figure 5 11 the bit addressable variable is named Limit and the bit shown being read is 3 or the placeholder for the number 8 in integer form and the variable that is reading and storing the bit is named RBit3 Therefore RBit3 will be equal to the actual binary status 0 or 1 of bit 3 of the Limit variable Bit Reading Input Variable Boolean Name ad Add Variable Name RBt3 st Description This will be equal to Bit 3 of the variable Limit 8 s position Variable Type Input Var I O Number Limt3 Default Value it Name of the Bit Addressable variable and bit number to be read Format is Output C Internal Name BitNumber Retentive Variable Type Input Figure 5 11 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 61 CHAPTER 6 Downloading and Running Projects This chapter provides basic information needed to connect to hardware targets download ladder diagram projects and use real time EZ LADDER Toolkit features Chapter Contents Switching Modes in EZ LADDER TOoolKit ccccssseeeesseeeeeeeeeeeeneeeeees 63 Monitor Mode Overvie W ceccivoisccssnecssticnicnecsniexccdtsiencietssciacecaevanuesnaendeiessianess 64 Connecting to a re cissieisivesinncassindanscansadiaciiusstoncinsessouiewbandinouadddelennatens 65 Connecting for the First Time to a New Target cccccsseee
239. iables items to pass from one ladder scan to another ie keeping track of a count As this uses less memory it is ideal for using when scan passing is not required as it uses less over head memory The Enable is used to enable the function and the Q output is active when the function enable is true For understanding on Structured Text and how the ST FUNC operates with structured text functions refer to Chapter 26 Structured Text Input Output Connections Before an ST_FUNC function may be used in a ladder diagram called from a ladder diagram pro gram certain criteria must be met Refer to Chapter 26 Structured Text for this criteria Input and Output connections are based on the structured text functions you create in EZ LADDER ST Function Editor The Enable and Q outputs are by default created Pee reef a a True when EN is true Input Output Name amp Type based solely on User Structured Text Function Example Circuit CR2 al FUNC Related Functions ST FUNC BLK Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 340 Chapter 24 Function Reference ST_FUNC_BLK ST_FUNC_BLK Description Ena Q The ST_FUNC_BLK function is a function block for using structured text functions created in EZ LADDER Toolkit The ST FUNC may use local or global variables and will allow vari ables items to pass from one ladder scan to another ie Keeping track of a count This function uses more
240. iagram projects using EZ LADDER Toolkit here are some of the common errors made during the creating process Connecting Functions to Functions Errors When connecting Variable outputs of one function to a variable input of another function a variable must be placed between the two functions Figure 22 1 illustrates the incorrect way of connecting functions to func tions variable inputs and outputs Figure 22 2 illustrates the same ladder diagram project but with the corrections made a variable between the function blocks If a function s variable output is connected directly to another functions variable input the program will compile successfully however the program will not function as designed A variable must be placed between the output and the input for proper operation Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 220 Chapter 22 EZ Ladder Standard vartest dld EZ File Edit View Project Reports Window Help Troubleshooting Dep ip eg DW LO Label ae aa K C MON me A Vie E Vi cru CID cTuD TP TON me Insert Function MAVG e Coils Contacts Functions Variables Labels Figure 22 1 EZ Ladder Standard vartest dld EZ File Edit View Project Reports Window Help O Cannot connect directly T ELNE k 2 Bae Label eae d oe C MON e Ve it VW Vi cw CID cTuD TP TON TOF Insert Function MAVG e LI DIVNU
241. ic IP address l The MAC field is factory set and should not be changed Divelbiss Corporation EZ LADDER Toolkit User Manual 204 Chapter 19 Ethernet Ethernet as the Programming Port By completing the configuration of the Bootloader Ethernet settings DHCP or Static the port is configured to be used as the hardware target s Programming Port for configuration and downloading ladder diagram programs Q For Modbus functionality additional configuration items are required To use the Ethernet port as the programming port in the ladder diagram s Project Settings select Eth XXXX from the Communications Settings drop down box to configure the Ethernet as the port to use See Figure 19 5 EZ Project Settings Divelbiss Corporation Micro Bear Controller PCS 1XX Divelbiss Corporation PCS H PCS 2XX Divelbiss Corporation PCS Ly PLCHIP PXX Divelbiss Corporation PLCHIP PXX PLC ON ACHIP Divelbiss Corporation PLC ON A CHIP m m mei c ications Setti Por COM1 COM8 Eth Local Area Connection 192 168 1 111 Figure 19 5 When connecting to the target in RUN mode a dialog box Browse Ethernet Devices will appear listing all the hardware targets found on the Ethernet network Select the target to use and click ox See Figure 19 6 i 7 ad Browse Ethernet Devices 00 50 C2 E2 00 FF 192 168 1 245 NECON Figure 19 6 Divelbiss Corporati
242. ides an easy to use interface to read analog inputs and then using the built in function blocks act on the analog input values Analog inputs provide a digital representation of an analog input signal Analog inputs values are ranged as integers based on the resolution of the analog input The on board analog inputs of the P Series PLC ona Chip are 12 bit resolution and the integer values that represent the signal ranges from 0 to 4095 As the ladder diagram scans it reads the analog signal level and digitizes it and converts it into an integer that represents it For example if the analog input signal can range from 0O 5VDC then the integer repre sentation at OV would be approximately 0 and at 5V would be approximately 4095 This integer number can then be scaled in the ladder diagram into engineering units The integer representation of the analog input is typically zero at the lower end OV OmA etc and Q 4095 at the high end of the scale 5VDC 20mA The highest allowed for the analog input resolution is hardware dependent 10 bit 1023 12 bit 4095 15 bit 32767 SPI analog input devices may support different resolutions than the on board 12 bit There are two ways to achieve analog input functionality in the EZ LADDER Toolkit hardware target One way is to add supported SPI bus analog input devices integrated circuits This requires additional hardware circuitry and interfacing See Chapter 15 SPI Devices and Support for a
243. ig ure 6 4 This warning can be caused because the projects differ or the project open in EZ LADDER Toolkit was renamed or saved with a different name using the Save As since it was loaded on the target Download ing the project will clear this watermark text shown r a kaiekeed x EZ File Edit View Project Reports Window Help Del Ap S T eat FY ES BD 3 Status Running Program Name Figure 6 1 Program Version 0 0 0 0 Build Number 1 Scan Time ms lt 1 00 CRI A different program is running cR2 een 5 A different program is running 1 m el r Figure 6 4 When Target has the Same Project If the ladder diagram project name of the project open in EZ LADDER Toolkit does match the name of the ladder diagram project that is loaded on the target two results can occur If the build number that automatic number that increments each time a project is compiled See Chapter 4 Configuring Targets is the same as the build number of the project loaded on the target no dialog boxes are displayed The Status Program Name Program Version Build Number and Scan Time are updated Now ladder diagram project can be viewed in real time Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 66 Chapter 6 Downloading amp Running Projects If the two build numbers differ then the warning water mark test in Figure 6 5 is displayed This text
244. igured using the Project Settings Using the Project Menu choose Settings The Project Settings window will open as previously covered in Chapter 4 Configuring Targets Select the target and click the properties button The Target Properties window will open From the drop down menu DCPN select the part number model number if not selected Verify the UART to be used for serial printing is installed The UART to be used must be installed prior to installing the Serial Printing device feature See Figure 11 3 If not installed please see the UARTS amp Serial Ports section of this Chapter Click the App pevice button The Targets Devices window will open All the available devices and features for the target are shown in the Devices section Scroll down and find Serial Print Figure 11 4 shows the Device Properties window Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 98 Chapter 11 UARTS amp Serial Ports a PLCHIP PXX Target Properties DCPN PLCHIP P13 5122X Zz Intemal PLCHIP PXX 4K EEProm Intemal Quadrature Encoder Interface Intemal PLCHIP PXX Real Time Clock SD Card Serial Print SPIO SPI 1 Hardware Timer Counter UART UARTS3 UART4 Figure 11 4 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 99 Chapter 11 UARTS amp Serial Ports Click Serial Print and click ox The Serial Print Properties window will open This window is used to configure the Serial Print
245. ill be updated immediately The MB_ and Function code is automatically entered Only the actual register number needs to be added This register number is always between 0 and 65535 This register number is automatically added to the MB_ Xand type to create the register number in the correct range Select the type of variable to write or read 16 bit 32 Bit LSB ordered Least Significant Bit or 32 Bit MSB oredered Most Significant Bit 32 bit variables will use multiple registers while 16 bit variables use one Click ox to close the Edit Address Register dialog box and return to the Add Edit Variable dialog box The register address is transferred to the text box automatically Click ok to save the variable The register is now assigned to a variable Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 119 Chapter 13 Modbus Networking a Edit Address Register Prefix Register Type Holding Register 4 000c M Register Index Ol 9 16 Bit 6 32 Bt LSB 6 32 Bit MSB Figure 13 16 A Modbus address may be directly typed into the Address Register box without using the eo button Updating Network and Variable Values When network registers are assigned to variables any change to the variable locally in the ladder diagram project is available to the master to see without additional programming If the master chooses to view the register it will see the variables current value If the master cho
246. ill copy en bytes to the transmit buffer start transmitting the data using an interrupt This function will return before all of the data has been transmitted so use EZ UartlsTxFinished to see if the data has finished transmitting EZ LADDER Structured Text Editor To create structured text funtions and functionblocks EZ LADDER Toolkit has a built in editor To open the ST Editor click the eniT st FuNcTiIoNs button located on the toolbar Refer to Figure 26 17 EZ EZ Ladder Standard STsample did _ 2 EZ File Edit View Project Reports Window Help Deh sbe JMP Edit Inst 4 gt gt ES Vars Vars Igy C MON Abc dk dit i CTU CTD CTUD TP TON TOF Insert Function I lt DI Edit ST Functions Coils Contacts Functions Click to Open ST Editor Figure 26 17 The ST Editor window labeled Function Editor will open It has it s own menu and is divided into three dis tinct sections Function List Pane Function Pane and Output Pane Each pane has it s own purpose Refer to Figure 26 18 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 373 Chapter 26 Structured Text Menu Function List Pane Function Pane fa rr FunctionBlock1 BYTE_TO_WORD f FUNCTION BLOCK FunctionBlockl CONCAT VAR_INPUT Enable bool cos Vin dint Input value DELETE END VAR DINT_TO_BYTE VAR_OUTEUT Q bool Vout bool
247. ils to install such a modification when so advised by Divelbiss Divelbiss shall be relieved of any obligation pursuant to the limited warranty set forth in Section 5 hereof Should Licensee request modifications to the Licensed Software Divelbiss may charge for and make such changes subject to the terms of a separate agreement between the parties Licensee may not modify the Licensed Software or engage any third party to modify the Licensed Software without the express written consent of Divelbiss Any and all modifications made to the Licensed Software whether by Licensee or any third party and all rights therein are hereby assigned to and shall be the sole and exclusive property of Divelbiss 10 Ownership of Licensed Software a Licensee acknowledges that subject only to the license specifically granted herein all right title and interest in and to the Licensed Software all revisions and copies thereof provided to or created by Licensee and all modifications thereof by whomever made are and shall remain the sole and exclusive property of Divelbiss LICENSEE ACKNOWLEDGES THAT VARIOUS ASPECTS AND FEATURES OF THE LICENSED SOFTWARE MAY BE PROTECTED UNDER APPLICABLE PATENT COPYRIGHT TRADEMARK AND TRADE SECRET LAW AND THAT EXCEPT AS EXPRESSLY AUTHORIZED IN WRITING BY DIVELBISS LICENSEE MAY NOT USE DISCLOSE OR REPRODUCE OR DISTRIBUTE ANY COPIES OF THE LICENSED SOFTWARE IN WHOLE OR IN PART NOR AUTHORIZE OR PERMIT OTHERS TO DO SO
248. ing Registers 4 Read Input Registers 5 Write to a Single Coil 6 Write to a Single Register 15 Write to Multiple Coils 16 Write to Multiple Registers For more details regarding master functions and how to use them refer to the network Master s documentation Modbus TCP over Ethernet In addition to supporting Modbus Master and Slave via UART s or Serial Ports the P Series based targets also support Modbus TCP over Ethernet Modbus TCP over Ethernet support is based on actual hardware target specifications PLC ona Chip Integrated Circuits and Modules support Modbus Slave as well as do some standard Divelbiss PLCs and Controllers For PLCs and controllers refer to the supported features See Chapter 23 Hardware Targets Configuring for Modbus TCP over Ethernet Prior to using the Modbus TCP over Ethernet in EZ LADDER Toolkit it must be installed and configured in the target The Modbus TCP is configured using the Project Settings Using the Project Menu choose Settings The Project Settings window will open as previously covered in Chapter 4 Configuring Targets Select the target and click the properties button The Target Properties window will open From the drop down menu DCPN select the model part number of the target If the Modbus were installed it would be listed in the Devices pane under the Network section Click the app pevice button The Target s Devices window will open Divelbiss Corporation
249. ing that all the SPNs are part of the same PGN selected PGN Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 155 Chapter 14 CAN Networking Click ok when all the SPNs required have been mapped to variables The function block is now placed in the ladder diagram The EN enable should be tied to the left power rail or using a contact to control when the specific J1939 __ TX_PGN function block is enabled and transmits data The Q output is true when the function block is enabled When the Enable input is true the function block is active and the PGN SPNs will broadcast based on the rates set in the database or the overridden values when the function block was placed If the Enable is false the function block is disabled and the PGN SPNs will not transmit broadcast 8 EZ J1939 Tx Properties Can Port CANO sl Block Name 1939_TX_PGN1 PGN Description PGN Settings Tx Only Mapped Variables 61442 Electronic Transmission Conil Priority SPN Field 190 61443 Electronic Engine Controller Broadcast Rate 61444 Electronic Engine Controller NMEA2000 61445 Electronic Transmission Cont PGN Access Rx Command NMEA2K DtRx 65217 High Resolution Vehicle Dist Priority Access eaae RE a B Cast Rate Access F m Tx Data datal Descri SPN Field Settings Engine Speed Gain Offset Driver s Demand Engine Pe Actual Engine Percent Tora 899 Engine Torque Mode Sour
250. input pins CU CD R LD PV and three output pins QU QD CV Active State Other Details Rising Edge Rising Edge Reset is dominant True when CV PV True when CV 0 Example Circuit CRZ CRE LH CRA CUSetpt Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 263 Chapter 24 Function Reference Timing Diagram QU o Eos e 8 TT T Te i T co Lo rn LI TA Tt Related Functions CTU CTD Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 264 Chapter 24 Function Reference DIRECT COIL DIRECT COIL Description i H The DIRECT COIL is a representation of an internal boolean variable output coil or an actual hardware real world output Its normal state is false or normally de energized An internal DIRECT COIL may also be referred to as a control relay CR If there is power flow to the DIRECT COIL then it will be true on If there is no power flow to the DIRECT COIL then it will be false off The DIRECT COIL may only be placed in the last column Example Circuit CHI COIL Related Functions INVERTED COIL DIRECT CONTACT INVERTED CONTACT Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 265 Chapter 24 Function Reference DIRECT CONTACT DIRECT CONTACT Description The DIRECT CONTACT is a representation of an internal boolean variable input or an actual hardware real world input Its normal state is false or normally de en
251. ion Name PID Description Enter a description a Sample Period Secs The sample period in seconds ee Min 01S Max 86 4008 sample period resolution 50uS Sample Period secs 01 Minimum Output Value Minimum PID Output value Min Output Value M5 allowed Max Output Value 100 0 Maximum Output Value Maximum PID Output value allowed If SP PV or process error is determined not to be infinite values the error flag is set and the CO is set to the IO value When these values are valid infinite again the PID function will return to normal Input Output Connections The PID function block placement requires connections of 7 input pins EN SP PV KP KI KD IO and 3 output pins Q CO ER ee o Integral Gain Initial Value PID is init to this value Control Output Calculated Signal Error Amount of error from set point WEE ll ll S S o S S S S fo Deveci re S o S S NEE S CA ae Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 318 Chapter 24 Function Reference Example Circuit CRI PID1 CO jes CntrlV al ER setptErr Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 319 Chapter 24 Function Reference PWM PWM Description The PWM function controls the function of a hardware PWM output channel this EN Q channel is specified when the function is placed When the EN is true the hard ware PWM channel outputs a square w
252. ion block placement requires connections of two input pins EN 1 and a minimum of two output pins Q Bx The number of bits is specified when the func tion is inserted The EN is not considered a bit to unpack and is not included in the number of bits to unpack when placing the function block en Type Integer Real Boolean Timer Active State Other Domis Oen m O S O e me ESCH ES OO e a e o i O O esye Although the output type for the Bx bit outputs is boolean boolean variables must be connected to the Bx outputs Itis not allowed to connect coils B2 Example Circuit CRI IIT_UNPACK EN Q Numi tal BO B1 B2 Related Functions BIT_PACK Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 247 Chapter 24 Function Reference BOOLEAN BOOLEAN Description The BOOLEAN function converts the input P into a boolean zero or non zero output O The enable EN must be true for the BOOLEAN function to be enabled The Q output is true when the BOOLEAN function is enabled Input Output Connections The BOOLEAN function block placement requires connections of two input pins EN P and two output pins Q O Orin type integer Real Boolean Timer ActiveState Other Deras en ime X Cater ce me x x x 2 J Output let II o Lommel III II Although the output type for the O output is boolean a boolean variable must be connected to the O output A coil may b
253. ired this is the last arbitrary address that will be tried Industry Group Vehicle System These items are specific items that may be used on the J1939 Instance Function Function bus for communication and aribitration These items are Function Instance ECU Instance optional and would be provided by the actual J1939 bus Manufacturer Code Identity Number or equipement manufacturer Note if NMEA 2000 is selected instead of J1939 above then some of these names will change as required by NMEA 2000 User J1939 Database This location box and check box for Use Standard J1939 Database identifies the J1939 database of PGNs and SPNs to be used on this project The Use Standard J1939 Database checkbox forces the use of the EZ LADDER Toolkit standard PGN and SPN database l EZ LADDER Toolkit supports the ability to add new PGNs and SPNs that are not currenlty in the standard database as needed This topic will be covered in a later section With all the items configured click the ox button to close dialog and save the settings Click ox to close and save the J1939 properties dialog Q Up to two J1939 networks may be accessed one for each CAN port up to 2 maximum by repeating the same steps for the addtional J1939 network with a different CAN port click the ox button to close the target s properties Click ox to close and save the Project Settings The J1939 is now installed and configured and is ready to be used in the ladder diagram pro
254. is installed They are typically found in C Program Files Divelbiss EZ Ladder Kernel l Hardware targets ship from the factory without a kernel installed The kernel must installed prior to downloading the first ladder diagram program The target is shipped without a kernel to provide greater flexibility in version control The Project Settings Window To create a ladder diagram project in EZ LADDER Toolkit you must first select the hardware target If you attempt to place any ladder diagram objects in the workspace prior to selecting a target the Project Settings Window will open requiring you to select the target automatically EZ LADDER Toolkit uses the target selec tion to filter and display only ladder diagram objects and functions supported by the selected target l Only the actual hardware target that will be used should be selected Selecting a different target will allow the use of objects and function blocks that may not be supported by the actual hardware target as well as not allow use of objects and function blocks that are supported To select the target either try to place a ladder diagram object in the workspace or use the Project Menu and click Settings The Project Settings Window Dialog box will open Figure 4 1 is an example of the Project Settings Window and identifies the main components of it While all targets are displayed in the Project Settings M Series or P Series the focus will be on the P Se ries products a
255. it Select the SPN s to transmit from variables as the selected PGN SPN Clicking this button opens the map variable dialog to map the selected SPN to variables storing the data Double clicking the SPN in the SPN pane will also open the map variable dialog The PGN settings will update as different PGNs are selected These values are based on the PGN settings in the J1939 database The Priority and Broadcast rate can be overridden by entering new values Values changed will only affect this function block not the J1939 database For NMEA 2000 optional checkboxes determine specific parameters for NMEA 2000 Refer to the NMEA 2000 specification for details The SPN settings will update as different SPNs are selected These values are based on the SPN settings in the J1939 database The Gain and Offset may be overridden by entering new values Values changed will only affect this function block not the J1939 database This area determines the destination address in the broadcast packet to send data to If the destination address is set to 255 then the broadcast will be global If set to a number other than 255 it is specifically addressed to that ID The availability of setting the destination address depends on the PGN SPN selected Global may the only type supported based on the actual PGN SPN As variables are mapped to SPNs they will be listed in this area 939 TX DI EN Q Related Functions J1939 RX_PGN Divelbiss Corporatio
256. ject Settings Window must match your computers setup the appropriate programming cable must be connected from the computer s serial port to the hardware target s programming port and the hardware target must be turned on To connect to target click the connecT button located on the tool bar If an error occurs check the Serial Port Settings cable and target Also see Chapter 22 Troubleshooting Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 65 Chapter 6 Downloading amp Running Projects When connecting to a target the background of the workspace may change with watermark text identifying conditions such as when a different program is runnng than is open in EZ LADDER Toolkit When Target has no Project Loaded If the target does not have a previously loaded ladder diagram project then no dialog boxes will open when the Connect button is clicked The Status window typically will change to Waiting to identify that the connec tion is complete and the hardware target is waiting for a ladder diagram project to be downloaded Figure 6 3 illustrates the status as described Status Waiting Program Name Program Version Build Number Scan Time ms Figure 6 3 When Target has Different Project Loaded If the ladder diagram project name of the project open in EZ LADDER Toolkit does not match the name of the ladder diagram project that is loaded on the target workspace background will change as shown in F
257. k In addition to controllers other de vices support OptiCAN including I O modules As these devices are not programmed with an EZ LADDER Toolkit ladder diagram project other means must be used to identify and configure them There are two tools that may be used to configure non controller OptiCAN devices The first option is to purchase the OptiCAN Configuration Tool Professional The Professional version is sold separately and requires additional hardware included in the purchase The Professional version does not have a limitation on the number of nodes that may configured In addition it also has more advanced controls diagnostics and reporting features The OptiCAN Configuration Tool Professional has it s own User s Manual If the OptiCAN network will host more than 10 non controller nodes then you must purchase and use the OptiCAN Configuration Tool Professional to configure the non controller nodes The OptiCAN Configuration Tool Basic is part of the EZ LADDER Toolkit and is capable of configuring up to 10 total non controller nodes on an OptiCAN network As this is a feature of the EZ LADDER Toolkit and does not require additional hardware or software it will covered in detail The can detect up to 10 nodes returning the Node ID Device Type Name and it s Serial Number To use the OptiCAN Configuration Tool a ladder diagram project with OptiCAN enabled must be loaded compiled and running on a target Using EZ LADDER Tool
258. k the SD Card Enabled check box This enables the SD Card Features in the target If you wish to allow kernel updates from an installed SD Card click check the Allow Kernel Updates check box How kernels are installed or updated is covered later in this chapter If you wish to allow Ladder Diagram updates from an installed SD Card click check the Allow LD Updates check box How ladder diagrams are installed or updated is covered later in this chapter Click ok to accept the SD Card settings and close the window Click RESTART TARGET to exit the Bootloader and force the software kernel to restart accepting the changes The SD Card is now configured to operate as configured Using the SD Card The SD Card Support must be installed using the Bootloader before any SD Card may be used As this manual is a generic EZ LADDER Toolkit manual for P Series PLC on a Chip target programming SD Card Support is covered To determine if the actual hardware target model supports the use of SD Cards refer to Chapter 23 Hardware Targets For targets that support the SD Card Secure Digital Card it is typically plugged in or inserted into a socket located on the hardware target Divelbiss Corporation EZ LADDER Toolkit User Manual 209 Chapter 20 EZ LADDER Toolkit Reports details on the type of SD Card supported and details for accessing and installing a supported SD Card Q The type of SD Card and socket is target dependent
259. k placement requires connections of a minimum of two input pins EN BO and two output pins Q O The number of bits is specified when the function is inserted The EN is not considered a bit to pack and is not included in the number of bits to pack when placing the function block UO Pin Type B2 Real Boolean Active State Other Details integer Cen me X Cates Example Circuit CRI BIT HACK C R3 Related Functions BIT_UNPACK Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 246 Chapter 24 Function Reference BIT UNPACK BIT _UNPACK Description EN The BIT UNPACK is a configurable function that will convert a 32 bit integer into up to 32 individual boolean outputs bits The input is the 32 bit integer input the EN enables the function when true The Q output is true when the function is enabled The Bx outputs are the result of the integer being converted to bit outputs binary equivalent The number of bits must be identified when the function is placed in the ladder diagram 1 32 bits Only boolean variables may be used as bit outputs Included in the configuration is the bit offset The bit offset allows the programmer to use multiple BIT UNPACK functions and have a single 32 bit input integer by offsetting the bit B1 range for each function block Note the number of bits offset bits must be less than or equal to 32 Input Output Connections The BIT_UNPACK funct
260. kit change to the Monitor Mode In the Monitor Mode using the Project Menu select OptiCAN The Divelbiss OptiCAN Configuration Tool will open in a new window See Figure 14 13 EZ LADDER Toolkit must have a project loaded and be in Monitor mode with OptiCAN enabled to open the OptiCAN Configuration Tool Itis not necessary to connect to the target controller If connected to the controller the OptiCAN Configuration Tool will disconnect EZ LADDER Toolkit from the controller when it opens Whenever the OptiCAN Configuration tool connects it automatically sends the Stop Network O command The network will have to be restarted for proper operation Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 139 Chapter 14 CAN Networking EF Divelbiss OptiCAN Configuration Tool Oo rl Le Hel e Reports Help Node ID Type Serial Number HEC 1000 Harsh Environment Controller OF 240004 HEC 1100 Harsh Environment Digital 1 0 07240006 Configure Node Figure 14 13 As shown in Figure 14 13 there are two devices on the OptiCAN network The tool shows the Node ID Type and Serial Number for each of the devices These two devices are already configured as they have Node ID s assigned When configuring a non controller device for the first time the device will display with a Node ID of 255 The 255 designation is reserved for devices that have not been configured See Figure 14 14 For multiple new devices they wi
261. ks that have integer inputs and if necessary these variables may be converted to REAL variables using the REAL function block Figure 17 3 shows a ladder diagram using the analog input variable AIO as an input to a function block CMP CRI EN LT CR2 A0 kaft EQ CR3 Setpoint p P2 GT Figure 17 3 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 187 Chapter 17 Analog UO Averaging Analog Input Readings As analog signals are susceptible to many environmental factors such as noise etc when connected Q to analog inputs the analog input variables values will change frequently Typically analog inputs will toggle normally one bit of resolution To minimize the effect of this bit toggle and environmental conditions it is recommended to average each analog input It is recommended to use the MAVG function block Moving Average When placing this block you must enter the number of samples to be averaged block output to input changes Size the number of samples to give the best suited reaction time and The larger the number of samples the more RAM is used and the slower the reaction time of the to use the least amount of RAM needed accomplish to meet the operation specifications Figure 17 4 illustrates an analog input being averaged by the MAVG function block Figure 17 4 Scaling Analog Input Readings It is often desirable to scale analog input reading to match the range of some control parameter su
262. l Variable values are not kept from one execution or scan to another while functionblocks pass their variables from one execution scan to another making them ideal when variables would need to be passed from scan to scan such as a count For a user defined functionblock to be usable as a callable function inserted in the ladder diagram it must mee the following criteria e First Output type must be a BOOL e May only contain input output variable declarations VAR_INPUT VAR_OUTPUT VAR VAR_EX TERNAL VAR_TEMP e Variable Input Output types may only be BOOL DINT or REAL Internal variables may be any sup ported type Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 368 Chapter 26 Structured Text Target Specific ST Functions Target specific ST Functions refers to functions in addition to the stardard functions listed earlier that are required interact with specific features on the actual hardware target such as Uarts SPI ports etc These functions are provided by Divelbiss Corporation as part of EZ LADDER Toolkit and cannot be edited deleted or added to exept by Divelbiss File Descriptors Many of the target specific functions require a File Descriptor that acts as a device locator that the structured text uses to locate the specific resource They listed in the table as FD_x For example to use the EZ_EE PromReadArray you must have the file descriptor for the actual EEPROM that is the device to rea
263. l broadcasts of a PGN Receive addressed to any device broadcasts to this specific controller or device Receive only addressed to this device or it may listen in on a broadcast to a specific address broadcast Specifiy Dest Address to Receive These configuration items are set by check boxes and an Address box in the Destination Address area The function block instance may be configured to receive all global broadcasts to this PGN only broadcasts to this specific address or to any specific address based on the settings in the Destination Address area The next step is to identify where the SPN data that is received will be stored All J1939 data is stored in variables To set the variable s used click the MAP VARIABLE button The Map Variable dialog will open Us ing the BRowseE buttons select the variable to store the received data to Rx Data and optionally select the variable to store the received data status ie valid not seen etc Click ok when the variables have been set Refer to Figure 14 25 EZ Map Variable Rx Data Rx Status Figure 14 25 Repeat these steps for any SPN of the selected PGN you want to receive data from in this instance of the J1939 RX_PGN function block Figure 14 26 shows two SPNs selected and mapped to variables for PGN 61442 Multiple SPNs may be mapped to a variables in one J1939_ RX_PGN function block instance providing that all the SPNs are part of the same PGN selected PGN Click ok wh
264. l text Sei Boolean Timer Active State Other Detais Tt x Risingewge Output x x i Crain LL Leet _ wm eer our x EE SC Sp Example Circuit CRZ RIAL_PRIN Text Message Formatting The SERIAL_PRINT function text formatted per ANSI C printf The function block examples shown are for VT100 terminals Variables as well as text may be printed These variables must be formatted correctly As variables are added to the text the function block will automatically add the appropriate input for the vari ables Text Text is entered exactly as the message is intended Variables special formats and escape codes are also added to this field See the Variables Other Special Variables and Formats and the Escape Sequence sec tions for details regarding adding special codes for specific needs Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 330 Chapter 24 Function Reference Variables Variables are placed in the text using flags and print specification fields The following is the configuration for adding variables to the text flag width precision Example Text OIL PSI 3d identifies the beginning of a variable or other type of text entry flag This flag is optional Use the following flags to change the way data is transmitted Flag Description Left align the variable within the specified width Default is align right 0 If width is prefixed with 0 leading zeros a
265. lbiss Corporation P Series EZ LADDER Toolkit User Manual 162 Chapter 15 SPI Devices and Support Click ox The LS7366R Properties dialog will open Ths dialog selects the SPI Port and Chip Select to be used for this LS7366R device See Figure 15 5 Multiple LS7366R devices may be added to an SPI port provided that each device has a unique chip select output specified l The SPI port must be installed previously or no SPI ports will show available in drop down configuration menus ail L57366R Properties SPI Pot CS Output Figure 15 5 Click the app button An additional LS7366R Properties window will open Select the SPI port from the drop down menu and select the general purpose output pin GPO that will serve as this device s chip select CS With these two devices selected additional channel information will be available to configure See Figure 15 6 Any chip select pins reserved for structured text will not be vis ible in the drop down menu The LS7366R may be configured to run in several modes Each mode has specific operation parameters and features that may be utilized in the ladder diagram project These modes and parameters are config ured in this dialog box Refer to the LS7366R integrated circuit data sheet for details to understand options features and configurations Failure to review the data sheet may result in a loss of understanding of how to configure and use this device As a difference between the LS 7
266. lbiss Corporation P Series EZ LADDER Toolkit User Manual 29 Chapter 3 Ladder Diagram Basics Complex Series Parallel Connection CRI CR2 CHA CHE CH CR3 CR CR5 Figure 3 8 Understanding Ladder Diagram Functionality When a ladder diagram is installed on a PLC or other controller it will scan the program from top to bottom and left to right A scan is similar to reading a page A page is read from top to bottom reading each line left to right One complete reading of the program is considered a scan The larger the scan time one complete read cycle the less often any real world I O devices are monitored and controlled Scan time is an important consideration in the design of a ladder diagram This scan time may be viewed in the Monitor Mode when running a ladder diagram with a hardware target Figure 3 9 diagrams the functionality and order which a ladder diagram functions All real world inputs are read All real world outputs are set for their state true false to their new state true false Rung 1 is scanned from Left to Each additional rung is Right Setting any internal scanned left to right in order variables immediately and internal variables are set Figure 3 8 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 30 CHAPTER 4 Configuring Targets This chapter provides basic information and steps required to identify select and configure hardware targets actual hardware controllers or PLC
267. lbiss Corporation P Series EZ LADDER Toolkit User Manual 97 Chapter 11 UARTS amp Serial Ports Click ok to close the Target Properties window and click ok to close the Project Settings window Q The UART is now installed The UART supports the use of Modbus Master Modbus Slave Serial Printing and Structured Text The UART baud rate may be changed in the ladder diagram program by using the UART_SET _ PROPERTY function block For Modbus Master Slave see Chapter 13 Modbus Networking For Structured Text see Chapter 26 Structured Text Serial Print Functionality EZ LADDER Toolkit provides the ability to serially print text and variables to other devices using a serial port This feature can be useful to send data to data loggers displays and other devices The serial print feature utilizes a standard serial port UART that may be configured as RS232 RS422 or RS485 and can operate with multiple baud rates Serial Printing support is based on actual hardware target specifications PLC on a Chip Integrated Circuits and Modules support Serial Printing functionality as well as do some standard Divelbiss PLCs and Controllers For PLCs and controllers refer to the supported features See Chapter 23 Hardware Targets Installing Configuring the Serial Print Device As with most features the Serial Print feature must be installed and configured in the EZ LADDER Toolkit before it may be used The Serial Print is conf
268. ld input Its normal state is true or normally energized An inter nal INVERTED CONTACT may also be referred to as a control relay CR A false condition on the input if internal coil is true for internal contacts or real world input is false then the contact will allow power flow and devices located to the right of the DIRECT CONTACT may operate A true on it s coil or real world input will result in its contacts to not allow power flow Example Circuit CRI CRA Related Functions DIRECT CONTACT DIRECT COIL INVERTED COIL Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 285 Chapter 24 Function Reference J1939 RX PGN Description J1939 RX PGN FN Q The J1939_RX_PGN function block is used to receive data over the J1939 NMEA 2000 CAN network There are several configurable items for receiving data refer to Chapter 14 CAN Networking J1939 NMEA 2000 The J1939_RX_PGN function block receives data and stores it in variables located in the ladder diagram program These variables are mapped when the J1939_RX_PGN function block is placed Each function block insertion instance is treated individually in the ladder diagram program Input Output Connections When the EN ENABLE is true the function block is active and will receive J1939 NMEA 2000 data as configured The data is stored in the mapped variables The Q Output is true for one ladder diagram scan when data is received The
269. le Dist Broadcast Rate 65226 DM1 Receive NMEA2000 65227 DM2 Receive PGN Access Priority Access 65251 Engine Configuration 1 B Cast Rate Access ec xc Fe ee E EE NK td En p d UI I SPN Description SPN Field Settings 917 High Resolution Total Vehicle D Gain i Drop Dow Box Select Request Type from N OT_REQU EST ED J1939_REQUEST A Request message will b J1939_REQUEST e sec if Request Type is chd NMEA REQUEST and NMEA_REQUEST High Resolution Trip Distance Offset Source Address Destination Address Map Variable Receive from all addresses d Receive only addressed to this device Source Address to Receive From Receive addressed to any device Specify Dest Address to Receive 0 Figure 14 32 BAM In the event that data needs to be transmitted that is larger than the standard 16 bytes for the normal J1939 PGN SPN communication J1939 also provides the BAM message EZ LADDER Toolkit support the BAM message Generally the BAM message will take larger amounts of data that need trasmitted an break it into smaller sizes The J1939 BAM message will transmit the information regarding the message size and number of packets that are required and then transmit the packets of data The data is transmitted with a 50 millisecond transmit time then waits 50 milliseconds to send the next packet This repeats until all the data of the BAM message has been transmitted The BA
270. lects individual or multiple items Click on item to select or click and drag to k select multiple items Horizontal Link Used to draw horizontal links between functions object and variables Vertical Link Used to draw vertical links between functions object and variables Edit Edit Variables Opens the Edit Variables Dialog Variables are created edited and deleted Yars using this dialog box Inst Insert Variables Clicking in the ladder diagram workspace inserts a variable in that location Yars The inserted variable is selected from a dialog box that opens Ve Verify Program Verifies the ladder diagram and elements are complete and do not break fy any rules This is automatically done when the compie button is clicked Compile Program This does an automatic verify and then compiles the ladder diagram L project for the specific hardware target controller Monitor Mode This changes the EZ LADDER workspace from the Edit Mode to the Monitor MON Mode The Monitor Mode is where ladder diagram projects are downloaded to and monitored on targets Abc Insert Comment This inserts a comment block into the ladder diagram project 4 Direct Contact This inserts a Direct Contact Normally Open Contact into the ladder diagram project workspace wherever you click Negated Contact This inserts a Negated Contact Normally Closed Contact into the ladder diagram project workspace wherever you click d Direct Coil This
271. led The Q output is true when the ASIN function is enabled DI 0 Input Output Connections The ASIN function block placement requires connections of two input pins EN P1 and two output pins Q O UO Pin Active State Other Details x L mmes SS a o SS SSES RSC Sa Example Circuit Related Functions ACOS ATAN COS SIN TAN Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 243 Chapter 24 Function Reference ATAN ATAN Description The ATAN function provides an Arctangent O from the input value P1 The enable EN EN Q must be true for the ATAN function to be enabled The Q output is true when the ATAN func tion is enabled Input Output Connections D o The ATAN function block placement requires connections of two input pins EN P1 and two output pins Q O x C Aatve True SS es SS o Output Sa Example Circuit Related Functions ACOS ASIN COS SIN TAN Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 244 Chapter 24 Function Reference AVG AVG Description EN Q The AVG function averages all the inputs Px together and outputs this number O The number of inputs is specified when the function is placed in the program The enable EN must be true for the AVG function to be enabled The Q output is true when the AVG func tion is enabled P o Input Output Connections The AVG function block placement requires connections of a
272. led Reading Al0 4095 0 X 250 50 50 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 189 Chapter 17 Analog UO MAYG1 REAL Tel Pl o R_Max Fab i 8 P2 R Min kp R100 f P2 ADD EN Q PI O R Min ken Figure 17 6 Analog Outputs As analog outputs are a common requirement in today s control world EZ LADDER Toolkit provides an easy to use interface to control analog outputs Analog outputs convert a digital value into an analog signal Analog outputs values are ranged as integers based on the resolution of the analog input The on board analog output of the P Series PLC on a Chip is 10 bit resolution and the integer values that represent the signal ranges from 0 to 1023 There are two ways to achieve analog output functionality in the EZ LADDER Toolkit hardware target One way is to add supported SPI bus analog output devices integrated circuits This requires additional hardware circuitry and interfacing See Chapter 15 SPI Devices and Support for a list of the supported devices how to install and use them The seconds is using the on board analog output s if supported l All analog output support whether on board or SPI device based are subject to the actual hardware target Refer to the targets User Manual or Chapter 23 Hardware Targets to determine if analog outputs are supported Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 190 Chapter 17 Analog UO The
273. line Each row of the display must be written to individually with separate LCD_PRINT function blocks When all the information is entered clicking ok will cause the function block to be placed in the ladder dia gram project Figure 9 5 is a sample of a complete LCD_PRINT circuit CRZ LCD_PRINT1 Figure 9 5 Writing Variables to the Display In addition to printing static text it is often desirable to be able to print variables to the display This is helpfulin displaying process parameters and menu items To write a variable to the LCD display the same LCD_PRINT function block is still used As in the simple text printing the text is entered into the Text field Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 86 Chapter 9 LCD Display Support In addition to the text control characters may be inserted that represent variables and how to format the variable text For a full listing of what control characters and formatting is supported please see the LCD _ PRINT function block in Chapter 24 Function Reference Figure 9 6 illustrates a sample text dialog with control characters a Led Print Properties Name LCD Pow Description Text Fill PSI d Figure 9 6 When an LCD_PRINT function is inserted to display variables a new variable input is added to the function block automatically for each variable that will be displayed Figure 9 7 represents a sample ladder diagram project using a_LCD_PRINT f
274. list of the supported devices how to install and use them The seconds is using the on board analog inputs if supported l All analog input support whether on board or SPI device based are subject to the actual hardware target Refer to the targets User Manual or Chapter 23 Hardware Targets to determine if analog inputs are supported Analog Input Installation Configuration Some hardware targets require analog inputs to be installed and prior to being available in the EZ LADDER Toolkit ladder diagram project while others automatically configure the analog inputs in the EZ LADDER Toolkit when the target is selected Generally off the shelf controllers that have analog inputs will automatically install in the EZ Q LADDER Toolkit and their variables are created automatically for the analog inputs P Series PLC on a Chip targets and others typically require the analog inputs be installed in the Q Project Settings before they can be used in an ladder diagram project Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 185 Chapter 17 Analog UO Installing Analog Inputs for PLC on a Chip Targets Select the target PLCHIP PXX and click the properties button The Target Properties window will open From the drop down menu DCPN select the model part number of the target If any Analog Inputs are installed they will be listed in the Devices pane under the Internal Analog I O section Click the ADD DEVICE button
275. lkit User Manual 26 Chapter 3 Ladder Diagram Basics Basic Ladder Diagram Symbols In ladder diagram all devices are represented by symbols objects and function blocks Chapter 24 Function Reference provides detailed descriptions for all EZ LADDER Toolkit objects and function blocks This section will give a basic information regarding the most commonly used objects Contacts Contacts represent two types of devices The first is real world digital input devices such as limit switches push button switches and proximity sensors The second is that contacts may represent internal relays also named control relays CRs When acting as a real world input the ladder diagram object will rep resent the current state of the real world input it is assigned When used as an internal control relay the contact will represent the current state of the control relay s coil Contacts are represented in the EZ LADDER Toolkit by two different objects Direct Coil and Negated Con tact Contacts are always shown in their at rest or un powered state Direct Contact Also known as a normally open contact the direct contact may represent real world inputs or internal relay contacts As a real world input when the input is energized TRUE it will be represented by a TRUE condi tion in the ladder diagram causing power to flow through it to any following objects and function blocks As a real world input when the input is de energized FAL
276. ll all be assigned the same 255 Node ID The controller can differentiate between devices that have not been configured using their serial number The serial number is programmed at the factory and is not user changeable Only non controller device Node IDs may be configured using this tool Controller Node IDs are only O changeable in the actual ladder diagram project loaded on the controller Node ID Type Seral Number 4 HEC 1000 Harsh Environment Controller U 240004 255 HEC 1100 Harsh Environment Digital 1 0 07240006 Configure Node JS connected __ Figure 14 14 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 140 Chapter 14 CAN Networking To Configure a Node To configure a node select th e node highlight in the list and click the CONFIGURE NODE button The Node Configuration dialog box will open See Figure 14 15 The following can be viewed from the Node Configu ration dialog Some may be configured while others may not Node ID Type Serial Number Broadcast Interval This is where the node ID number is set This is the description of the device cannot be edited This is the serial number of the device programmed at factory and cannot be edited This is the interval rate at which the registers will be broadcast on the net work EI Node 255 Configuration Node ID 255 Type HEC 1100 Harsh Environment Digital 1 0 Denel Number 07240006 Configure Registers
277. lock can be used to input real or integer variables When connecting a Q variable the type connected will limit all number inputs and outputs to the selected type all integer or all real KEYPAD1 EN Q MI Ebsi Buffer MA KO Figure 10 3 Using the KEYPAD2 Function The Keypad2 function block provides additional features over the Keypad function block These featues al low menus and Discrete key press menu items to be combined allowing for a more powerful and easier to implement menu To read data integer or real from the keypad using the KEYPAD2 function block select the KEYPAD2 func tion block from the drop down menu and place it in the ladder diagram at the desired location The Keypad2 block will be inserted into the ladder diagram Each keypad2 function block has three inputs and six outputs As with all function blocks the EN enable will enable the keypad2 function block or disable it The MI and MA inputs are used to identify Minimum and Maximum allowed entries respectively The Q Output is true when the function is enabled The KB output will maintain the contents of the keypad buffer while KO is the actual value that was entered on the keypad and ENTER pressed The M output is a boolean that is set to true when any number 0 9 or is pressed Pressing the Clear or Enter will reset the M output to false The KP output is a boolean output that is true only for the single scan that a key was pressed The KY output is an i
278. lose the window Be sure to save the ladder dia gram program after making target changes Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 45 Chapter 4 Configuring Targets ad PLCHIP PXX Target Properties DCPN PLCHIP P13 5122x M Figure 4 13 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 46 CHAPTER 5 Creating Ladder Diagram Projects This chapter provides basic information and understanding to create ladder diagram projects using EZ LADDER Toolkit including variables variable types inserting variables inserting objects and functions bit addressable variables drawing links inserting and deleting rungs saving ladder diagram projects and verifying and compiling ladder diagram projects Chapter Contents Creating Ladder Diagram Projects ccccssceecesseeeesseeeeeeeeseeeeeeeeenenenens 48 Understanding Objects amp Variables cccssccsssseeeeseeeeeeeeeseeseeeeseeeneaes 48 Creating and Placing Variables scccccsseeceesseeeesseeseeeneeseeeeeseaeeeseees 50 WANS TEE 51 Variable Attributes eebe 52 Keeping Variable Values on Power LOSS cccsscecseeeneeeeeeeesseeeeeeneeeees 55 Placing Objects and Drawing LINKS cccssseeeeeeeeeeeeeeeseeeeesseeeeeseenenees 55 USING CODY and PAS be wvirisveceaniconessigcsoaencicatanasivcdsuseacewssanceenavunnesagtocvancedsxes 57 Inserting and Deleting RUINS ccccssseeeeeeeseeeeeeeeseeeseeseee
279. m User Bytes is automatically recalculated and updated based on the value you enter for Num Retentive Bytes When the Retentive memory has been configured click ok to close the Ramtron FM24xxx Properties box Click ox to close the Target Properties window and click ok to close the Project Settings Window Be sure to save the ladder diagram project program after making any changes to the Target Settings EEPROM Memory Overview EEPROM memory is a non volatile memory meaning its values are kept in the event of a power loss that may be used to store data from variables The data may be stored and retrieved as needed The EEPROM memory is ideal for storing operational parameters of a program that dont change regularly but need the ability to change l EEPROM memory is not suited for storing values or data that changes rapidly and must be stored at each change EEPROM technology provides a limited number of write cycles to an EEPROM location before it will fail This number of writes before failure is large from hundreds of thousands to Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 14 Chapter 7 Retentive Variables amp EEPROM Memory millions and does not pose any issues for items that change occassionaly however if a process were to try and write once per second the number of writes would exceed the life of the EEPROM much faster Retentive Variables and memory is better suited for rapid and repeated writes Installin
280. me Target Kemel Version ve Une Poor Figure 6 6 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 67 Chapter 6 Downloading amp Running Projects Downloading Ladder Diagram Projects to Targets When connected to a hardware target click the DowNLoap button located on the tool bar A dialog box will temporarily be displayed showing the status of the ladder diagram s download to the target and the Status field will indicate Downloading Upon completion of the download the Status field will update and indicate Running The target has now been programmed with the ladder diagram project A download action causes the project to download for the project to be saved in the target s non volatile memory and then it is given a execute command to begin running on the target The project is now executing on the hardware target The status of contacts coils function blocks variables and power flow may be viewed in real time Disconnecting from the target or changing to Edit Mode does not stop the target from operating as it can only be stopped by removing power or the use of the Stop button in the Monitor Mode O It is important that all ladder diagram projects be archived for safe keeping There is no method to recover a ladder diagram project from the target The actual ladder diagram file must be available for editing and future downloads Real Time Features When connected to a hardware target with an executing
281. mum or high end These variables may be used as outputs from function blocks in the ladder diagram program Figure 15 19 is an example ladder diagram using a variable from the DAC8552 CRI ADD CR2 EN o I SPIO keap ost Spa Increment P2 Figure 15 19 MAX31855 Single Channel Thermocouple Input The MAX31855 is a single channel cold junction compensated thermocouple input integrated circuit with an SPI interface EZ LADDER Toolkit has built in software support for using this device on an SPI port The suffix to the MAX31855 determines the thermocouple type and range of operation Refer to the integrated circuit s datasheet The MAX31855 is a hardware device and requires additional circuitry and knowledge to interface it an EZ LADDER supported target This chapter discusses the basics of using the MAX31855 in the ladder diagram and minor references to hardware when needed l MAX31855 SPI support is based on actual hardware targets Refer to the target s User d Manual or Chapter 23 Hardware Targets to determine if SPI devices are supported Installing the MAX31855 in the Ladder Diagram Project To be able to use the MAX31855 in an EZ LADDER Toolkit ladder diagram project the MAX31855 must first be installed and configured As the PLC on a Chip is the most commonly used target for the MAX31855 it will be used as an example to install and configure the MAX31855 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 176 Chapte
282. n P Series EZ LADDER Toolkit User Manual 289 Chapter 24 Function Reference JMP Description gt Name The JMP function allows sections of ladder to be skipped by jumping to another sec tion ALABEL must first be placed before the JMP is inserted When the condition is true to trigger the jump the program scan jumps to the label skipping any ladder between the jump and label Input Output Connections There are no Input or Output Connections Example Circuit Input s gt gt LabelA Outputl LabelA Output2 Related Functions LABEL Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 290 Chapter 24 Function Reference KEYPAD KEYPAD Description EN Q The KEYPAD function is used to allow users to input data This function requires the Key pad feature be installed on the target s hardware and target settings The keypad may be used in two ways The first is using the KEYPAD function This is Ml KB useful for allowing a user to input numeric data The second is reading individual button presses as a digital input This is useful for menus See Chapter 10 Keypad Support for details on keypad use Using the KEYPAD for Numeric Input Keypad Function Block MA KO When EN is true the function is enabled Data is entered using numeric keypad buttons These numeric buttons are temporarily stored in the keypad buffer KB When Enter is pressed the KB is transferred stored in t
283. n right power rail to complete the circuit Power rails run the entire length of an EZ LADDER Toolkit project Figure 3 3 shows a typical ladder dia gram rung and identifies the power rails Please note the rung is connected to both the right and left power rails PBI Swi Mi TI Left Power Rail Right Power Rail we Figure 3 3 Links As discussed previously a rung must be complete and connected to both power rails for proper operation Links Horizontal and Vertical are used to connect objects and function blocks to other objects and function blocks as well as to power rails Horizontal Links connect devices horizontally or on the same rung Vertical Links connect devices on different rungs Consider each link like an electrical wire that is needed to connect devices in a circuit Figure 3 4 identifies the types of links Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 28 Chapter 3 Ladder Diagram Basics CRI CR3 CR NS Horizontal Link Vertical Link Figure 3 4 Connection Types As seen in previous sections the use of power rails horizontal and vertical links creates a wide variety of ways to draw ladder diagram circuits Below are some typical connection types They are created by using horizontal and vertical links Simple Series Connection CR LH Figure 3 5 Multiple Device Series Connection CRI CH2 CH4 CAS HH H Figure 3 6 Parallel Connection CR LH LH Figure 3 7 Dive
284. n Tool To access this feature in the Divelbiss OptiCAN Configuration Tool window use the Reports Menu and select Node List The Node List Report window will open Place the cursor under the Note Heading next to the node of choice Simply type in the notes for that node See Figure 14 18 The node list and notes may be saved and printed for future reference Node List Report Node ID Serial Number Type Hotes 4 OF 240004 HEC 1000 Harsh Environment Controller This is where can type a note for n 5 07240006 HEC 1100 Harsh Environment Digital lO This is where can type a note for Cancel Cave Pririt Figure 14 18 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 143 Chapter 14 CAN Networking J1939 Networking NMEA 2000 J1939 is a standard maintained by the Society of Automotive Engineers SAE that defines how information is transferred across a network to allow devices such as engine ECUs to communicate information such as engine speed engine RPM etc to other ECUs or devices J1939 is essentially a software specification protocol that operates on a CAN network NMEA 2000 is based on J1939 with additional special message requirements As NMEA 2000 is based on J1939 many of the menus and configuration items are generally the same and interchangeable except for noted differences J1939 uses CAN 2 0B as its structure It is typically used on commercial vehicles such as tractor trailers and construction e
285. n the Project Settings it is simple to control the actual PWM channels in the ladder diagram project Enabling a PWM Channel To control a PWM output specifically when it is enabled disabled and it s duty cycle the PWM function block is used This function block has two inputs EN for Enable and DC for Duty Cycle and also has one output Q When the PWM function block is enabled the EN input is true the PWM channel is active and operating at the frequency defined in the project settings and the Duty Cycle variable connected to DC of the PWM function block When the EN input is false the PWM channel output is disabled Figure 8 4 illus trates the PWM function block in a sample circuit When placing the PWM function block a new dialog is opened to select the PWM channel and the polarity of the PWM Channel Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 81 Chapter 8 Pulse Width Modulation Duty DC Figure 8 4 Controlling the PWM Channel Duty Cycle The PWM output s duty cycle is controlled the PWM function block for that channel Changing the value of the variable connected to the DC input of the PWM function block immediately changes the duty cycle accordingly This gives a PWM output the ability to change duty cycle in real time in response to control parameter changes Changing the PWM Frequency In addition to an adjustable duty cycle the PWM clock frequencies CLK A CLK B can be changed in the la
286. name Target Kemel Version Figure 4 8 The Target Options dialog has three tabs Ethernet Options USB Options and SD Card Options These items are additional configurations that are required if using any of these features on your target See Fig ure 4 9 For details on the Ethernet settings and port use see Chapter 19 Ethernet This dialog displays informa tion regarding the Ethernet configuration including MAC Address etc and provides user configuration items such as Host Name and DCHP settings For details on the USB Options settings and use see Chapter 27 USB Support For details on the SD Card Options settings and use see Chapter 20 SD Card Support When all the configurations required have been completed click ox to close the Target Options dialog This will save these options Click the RESTART TARGET button to restart the target and close the Bootloader dialog Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 41 Chapter 4 Configuring Targets Selectable Tabs VAS a Target Optio e LUS Ethemet Options USB Options SD Card Options MAC 00 50 C E2 00 8F Ethemet Enabled DHCP Enabled Host Name P5orota IP v Auto Config Figure 4 9 Installing Target Devices Features For greater flexibility some target features and devices are not automatically installed on the actual hard ware target when the target is selected as previously shown Devices Features automatically installe
287. nctions and objects Figure 5 2 illustrates a simple ladder diagram project that contains objects that are variables and inserted variables linked to function blocks EZ EZ Ladder Standard EZ Ladder als rm sell ot stuns a SECH EZ File Edit View Project Reports Window Help ox Coke ts Be B amp F e E E E K C MON Abc ak dt Vi CTU CTD CTUD TP TON TOF Direct Contact is Insert Function TON x actual variable Start Set RunTmr MotorStart named MotorStart MotorStart j H H MotorStart TONI RunTmr ElapTime is actual variable inserted and linked to the function block TON1 Figure 5 2 Figure 5 2 identifies the two typical ways variables are used in an EZ LADDER Toolkit ladder diagram proj ect As shown the On Delay timer function block identified as TON1 uses two unique variables one for the set point PT and one for the elapsed time ET All contacts and coils are actually variables themselves and as they are created they must be either assigned to an existing variable or a new variable created must be created declared for them Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 49 Chapter 5 Creating Ladder Diagram Projects Creating and Placing Variables Placing and creating variables can be done several ways Inserting some objects automatically require the selection or creation of a new variable when being inserted an automatic dialog box
288. nd Support Select SPIx and click ox The SPI Properties dialog will open See Figure 15 2 All SPI Devices require Chip Select pins but they are typically selected identified when the actual SPI device is installed This dialog al lows for reserving Chip Select pins specifically when using structured text only Each SPI Device requires the use of a Chip Select pin GPIO from the P Series PLC on a Chip As chip select pins are reserved they should not cannot be used in a program as digital I O Designs must identify all chip select pins while mapping the digital I O Each device on an SPI bus required its own individual chip select pin While each device requires a single chip select pin Multiiple devices may be connected to an SPI port provided that SPI device is compatible and supported o SPI Properties Reserved Chip Select Pins For Structured Text Figure 15 2 If using structured text Click the app button The SPI CS dialog will open Using the provided drop down CS Output menu select the GPIO to reserve as a chip select pin for the SPI bus for structured text only Repeat this step until all the required chip selects have been installed and are listed in the Reserved Chip Select Pins pane of th SPI Properties dialog See Figure 15 3 If not using structured text click ox to close and exit the SPI Properties dialog and return to the Target Properties window a SPI Properties Reserved Chip Select Pins Figure
289. nd easier to implement menu Using the KEYPAD for Numeric Input Keypad2 Function Block When EN is true the function is enabled Data is entered using numeric keypad buttons These numeric buttons are temporarily stored in the keypad buffer KB When ENTER is pressed the KB is transferred stored in the variable connected to the output KO The output Q is true for the ladder diagram scan in which the ENTER was pressed Pressing the clear button on the keypad erases the buffer KB The MI input specifies the minimum value allowed to be entered on the keypad while the MA input specifies the maximum value allow to be entered on the keypad The M output is a boolean that is set to true when any number 0 9 or is pressed Pressing the ENTER Or CLEAR will reset the M output to false The KP output is a boolean out put that is true only for the single scan that a key was pressed The KY output is an integer output of the actual ASCII value of the key that was pressed Input Output Connections POPs ere D The KEYPADZ2 function block placement requires connections of three input pins EN MI MA and six out put pins Q KB KO M KY KP WO Pin Type irage Real Boolean Timer Active State Other Detals ren mom x Aavete fo S Cm mot x Tx O a wa ot x x i vmov e foul x x T e Ko ou x fx S ea Tw Pout x Tre when 0 8 ror Pressed Tarte Ouputotasc value Pressed _ xP ou x eeg
290. nd target configurations Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 32 Chapter 4 Configuring Targets EZ Project Settings PLCHIF PXX PLC ON A CHIP Solves T VB 1000 d Figure 4 1 Target Tab Settings 1 Project Setting Tabs 2 Serial Settings 3 Target List 4 Edit Passwords Divelbiss Corporation PCS Divelbiss Corporation PC HIR DS Divelbiss Corporation HI ON A HIH Select the appropriate tab to configure target settings Figure 4 1 represents the TARGET tab Figure 4 2 represents the VERSION tab and Figure 4 3 represents the OPTIONS tab Clicking on a tab selects the tab for viewing Select the serial port on the computer that will be used to communicate to the target These settings are used to connect download and monitor ladder diagram programs running in EZ LADDER s program run and monitor mode The baud rate for all hardware targets is automatically set in EZ LADDER and cannot be changed This is a list of all targets supported by your version of EZ LADDER Toolkit Click on the target name to select When selecting some targets an additional dialog may open depending on the hardware target selected This button opens Password Setup Dialog box This box is used to configure a Master Password for the project and additional user passwords and permissions for others to view edit etc Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 33 Chapter 4 Con
291. ne input pin CLK and one output pin Q ege Type Integer Real Boolean Timer Active State Other Details os not x Smee o Out lt O OO eow Example Circuit CRI F_TRIG1 INTEGER Timing Diagram Il ff N Program Scan Time 7 Related Functions R_TRIG Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 211 Chapter 24 Function Reference GETDATE GETDATE Description EN Q The GETDATE function reads the current date from the hardware real time clock The values of the date are stored into the integer variables on the output pins The enable EN must be true for the GETDATE function to be enabled The Q output is true when the function is enabled The MN output returns the month 1 12 the DY output returns the MN day of the month 1 31 the YR output returns the current year last two digits and the WD returns the day of the week 1 7 1 Sunday The MN DY YR and WD outputs must be connected to Integer variables Input Output Connections Ur The GETDATE function block placement requires connections of one input pin EN and five output pins Q MN DY YR WD ene Type Integer Real Boolean Timer Active State ren trot X ave Tue vA af owe x Tw our x E ow owe x ve owe x wo wo owe x Example Circuit CRI GETDATE EN Q MN j Month DY YR WD ma eekday Related Functions GETTIM
292. nel a boolean variable to be used as a contact is automatically created ADRUM_ SEQ always starts in step 1 Each false to true transition on the ST input will cause the step to increment to the next The DRUM_ SEQ will wrap to step 1 after the last step Atrue on RST will reset the DRUM_ SEQ to step 1 RST is domi ST nant and will not allow the DRUM _SEQ to step when true Each step stores a unique setting for each channel This setting can be set as on or off true false As a contact is created to represent each channel when a DRUM_SEQ chang es steps each channel is automatically set to the state the channel in that step Input Output Connections The DRUM_SEQ function block placement requires connections of two input pins RST ST and one output pin Q In addition a boolean variable to be used as a contact is created for each channel A maximum of 32 channels is permitted per DRUM SEQ The matrix table is completed when the function is placed eme Type Integer Real Boolean Timer Active State Other Datas OST mt BE BEE E 2 Lan TI x e T S Configuring the number of channels setting channel states and adding steps is handled using the DRUM Sequencer Properties dialog box This box is displayed when placing a DRUM_SEQ function block Use the buttons provided to add insert delete and edit steps The order of steps may also be changed ad Drum Sequencer Properties Name DRUM_SEQ1 Divelbiss Corporation
293. nes 212 Variable Definitions Report ccccccceceseeeeeseeeseeseeceeeeseneesenessenessaeeeeens 212 Cross References Report eesp egeeusb pbtskuksgiriersuuez kebdesp sgebeiekek SeSseEERSeeER 213 Divelbiss Corporation EZ LADDER Toolkit User Manual 211 Chapter 21 EZ LADDER Toolkit Reports EZ LADDER Toolkit Reports EZ LADDER Toolkit includes reporting features to aid in creation troubleshooting and documenting ladder diagram projects Each report when generated is viewable and printable There are two basic reports that can be generated Variable Definitions and Cross References Variable Definitions Report The variable definitions report provides a summary of all of the variables in the ladder diagram project These variables are sorted by type for easy reference For each variable the report shows Name Type I O Number Default Value and its Description To generate and view this report using the Reports Menu select Variable Definitions A report window will open displaying the generated report Controls are available to change pages and print Figure 20 1 is an example of the report that is seen or printed Variable Definitions Date 10 26 2012 3 46 PM Filename T Sales Products EZ LADDER Manuals For P Series crossrefernce did Target PLCHIP P13 5122X Divelbiss Corporation PLCHIP PXX Version 0 0 0 0 Build Number 0 BOOLEAN Name LO Number Default Value Description INPUT AIQ INPUT All INPU
294. nesseesessnaneeses 81 Chapter 9 LCD Display GH DEEN eege eege gegen 83 LCD Display Functionality EE 84 Configuring the LCD Display in the Project Settings c cccecsesseeeeeseeeseeeeeeeeseeseeneeeeesneeeeeneeseeneenes 84 Displaying Messages on the LCD Display c sceccesseeeeeeeeeeeeseeeeeseeeeesneeeeeneeseeseeseaaeesenaneseeaneesoanees 85 Chapter 10 Keypad Support cccccccccsceeeeceeeeneeeeseneeeeseneceesensenesonsoneseneaneseneaes 89 POY BAC UMC e ANE EE 90 Configuring the Keypad in the Project Settings cccccssseeeseseeeeeeeeeeeeeeeseeseesseseeseeneeesaneeseeneesneneeses 90 Getting Data from the eerste eebe ebe 91 Chapter 11 UARTS and Serial Ports ccccccccceeeeeeeeeeeeneeeeeeneeenseneseneenenenees 95 PRS Ge Sea PONS carat uate ia nececaice onan E segdudeedsieauesatevenaoncnectedeadeeveuednecs 96 Sal EEGENEN eebe 98 Installing Configuring the Serial Print D VICC ccccccseseeeeeeneeeeeeeeeeeeneeseeneeseaseeseeeeesenenesseaneesoanees 98 Printing Data to a Serial Device using a Serial Port ccccccsssseecesseeeeeeeeeeeeneeeeeseeeeeeeeseeenenseaneeseanees 101 Chapter 12 Real Time CloOCK sw csesscsicinscsccncessecsseacecvinccvesewssnpenceineamsanesiveneianeeneeeesenes 103 installing the Real Time CIOCK EE 104 Using the Real Time ei Le Te 105 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 3 Table of Contents Chapter 13 Modbus Networkin
295. ney fees incurred by Divelbiss arising or resulting from or related to i Licensee s use modification or adaptation of the Licensed Software including to create any application or any Resulting Product ii the operation or performance or Licensee s or any third party s use of any Resulting Product iii any breach by Licensee of any representation or warranty made by Licensee related to the Licensed Software or any Resulting Product or iv any breach by Licensee of any of its obligations under this Agreement In the event that any claim of infringement under Section 8 a above is or in Divelbiss s sole judgment is likely to be substantiated Divelbiss may at its sole discretion use commercially reasonable efforts to i obtain a license from the third party for Licensee to continue using the allegedly infringing feature or aspect of the EZ LADDER Toolkit ii replace or modify the allegedly infringing feature or aspect of the EZ LADDER Toolkit to avoid such infringement or ili terminate this Agreement and the license hereunder and refund a prorated portion of the initial license fee paid by Licensee for the allegedly infringing feature or aspect of the EZ LADDER Toolkit 9 Modification of Licensed Software a Divelbiss may from time to time at its sole discretion and without further notice to Licensee make and at its further discretion distribute to Licensee modifications to the Licensed Software In the event that Licensee fa
296. ng Modbus TCP and is optional for changing the slave ID for Modbus Slave using serial UARTS For additional details and information see Chapter 13 Modbus Networking When the EN is true the slave ID at input P is set for modbus functionality The Q output is true when EN is true The ERR output will identify if a error occurred if other than zero Input Output Connections The MODBUS_SET PROPERTY function block placement requires connec tions of two input pins EN P and two output pins Q ERR When placing the MODBUS_ SET PROPERTY function an automatic dialog will appear that is used to set paramters such as the type of interface and the Property to be set At this time only the Slave ID is supported for the property ad ModbusSetPropertyForm Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 310 Chapter 24 Function Reference MULT MULT Description _ The MULT function multiplies all of the Px inputs together The number of inputs is speci fied when the object is placed The output O provides the result of the multiplication The enable EN must be true for the MULT function to be enabled P1 A Input Output Connections The MULT function block placement requires connections of at least 3 input pins EN P1 P2 and two output pins Q O The EN is always considered an input in the total number of inputs therefore always add one to the number of Px inputs that need to be used p en ype
297. ng on the target is different than the program currently opened in EZ LADDER Toolkit Could not connect to target Monitor Mode EZ LADDER Toolkit was not able to connect to a hardware target Could not get target version Please connect first Monitor Mode EZ LADDER Toolkit was unable to retrieve the target version when using the target information feature or button Could not open COMX Monitor Mode When connecting to a target the selected Com Port does not exist or is in use This is typically caused when another application is using and locked the serial port as a resource Close the other application to correct this Error downloading file Monitor Mode An unknown error occurred while downloading the program to target Try downloading the program again ERROR downloading user program invalid address Monitor Mode An invalid address was detected in a communications packet while EZ LADDER Toolkit was connected to a target ERROR downloading user program invalid record Monitor Mode An invalid record was detected in a communications packet while EZ LADDER Toolkit was connected to a target ERROR downloading user program checksum error Monitor Mode An invalid checksum was detected in a communications packet while EZ LADDER Toolkit was connected to a target ERROR downloading user program record to long Monitor Mode An invalid record length was detected in a communications packet while EZ LADDER Toolkit was connected to
298. nits called nodes on the network This is called a Global Broadcast While all controllers may broadcast and listen ideally one should be identified as a controlling agent l for the network This agent controller should be responsible for the network commands that start stop and reset the OptiCAN network communications Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 126 Chapter 14 CAN Networking Hardware Requirements amp Recommendations For optimal functionality performance and noise immunity all the hardware recommendations must be followed A failure to follow recommended hardware requirements could result in decreased reliability of the OptiCAN Network Please adhere to the following requirements and recommendations 1 The OptiCAN network cable should be of a twisted pair with shield variety and cannot exceed 40 meters in total length Additional length or incorrect cable type may limit functionality or cause the network to fail Please adhere to the following specifications for cable requirements for all OptiCAN networks Twisted Pair Shielded Cable Specifications Symbol Minimum Nominal Maximum Unit Comments impedance LZ 2 A 1200 ohm resistor load is required at each end of the network Please adhere to the following specifications for terminating resistor requirements for all OptiCAN networks Terminating Resistor Specifications Symbol Minimum Nominal Maximum Unit Comment
299. nnnnnnnennnnrrnnans 308 MODBUS_SET_PROPERTY s cscssssecessessesecsessesessessesessesatsessesesesseeateess 310 RE A AEA 311 MUX ue ceccessecsecessesscsessesucsessecuesessesucsesaesssesaesussesaesesstsaesessesesessesesesateeeteaees 312 NOT E 313 NOT EQUAL TOiss 314 OPTICAN NODESTATUS aannnnaenennoennenoennennennenennennnnnnnnnnrnnnnnrensnnrrnnane 315 OPTICAN TXNETMSG 316 Op 317 PID Een oe en er a te eee 318 DW 320 PWM_FREQ ccccessessecessessesecsessesessessesucsesuesssesatsesstssesessesssnsatsaesesateaeeess 321 RANDOM saaansnaansnsennensenneoeneeonenrensnnrensnnrennnnrennnnennannronannennnneonannennnnrennans 322 RE 323 OL Cen ene ne 324 ROL 325 BER 326 Beete 327 SEED tee SEI SEL 329 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 236 Chapter 24 Function Reference SERIAL PRINT EE 330 e VE 333 SET OME p 334 o g E E E E E E 335 Ee 336 SIN BE 337 SARE a 338 ee 339 ST e 340 SI FUNG BLK E 341 OE sacar E E A A A E E A E 342 TAN WE 343 UI 344 UR OI An EE 345 e 346 TON sce toes E EEE E EEE EE 347 LE 348 VARIT SET_PROPER IY E 349 UNLATCH COU E 350 Eege 351 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 231 Chapter 24 Function Reference Object and Function Block Basics This chapter provides information on using each of the EZ LADDER Toolkit function blocks and objects For each object or function the symbol diagram information on the inputs and outputs and a d
300. nnnnnnnnnnnnn nnmnnn mennenm 353 Chapter 26 Structured Teens 357 Structured Text OvervieW sssssssnsssensnennnnrnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn ennn nnnn mennan ennnen 358 Structured Text Technical Support ssassnnsnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nenna ennnen nenna 358 Structured Zeene Hee geen 358 SEPUCLUTeEd TEXT Eet 359 Structured Text Language iere 361 Structured Text Function BIOCKS asssanssnnnsnennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn ennan ennnen mnene 367 Target Specie SI FUNCOMS ve csccsscceuvaadevecancosasseersscadesnarecassspsengeaseadanceanurcconeauesnuocsssvesnmedeaucasanaasancsmstoeiud 369 EZ LADDER Structured Text Edito geet 373 User Defined Functions amp Function BIOCKS ccccsceccesseeeeeeeeseneseseeeseeeeeeneeenenenseaeeeseeseesenenessnenessoanees 375 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 5 CHAPTER 1 Getting Started This chapter provides detailed information for getting started using the P Series EZ LAD DER Toolkit Included in this section are installation instructions activating EZ LADDER Toolkit and instructions on how information in this manual is presented Chapter Contents What s New or Changed in V1 1 1 0 cccsccceessseeeseeeeeeeeeeeeeeeeeseeneeseeneenes 7 How to Use this Manual ek nese eee eeeeeeeeeeeeeeeeseeeaaseeaeeeaeaeeeseeenenees 8 Installing the EZ LAD
301. nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nenne 77 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual Chapter 7 Retentive Variables amp EEPROM Memory What is a Retentive Variable A Retentive variable is a variable that s value is automatically stored in non volatile memory in the event of a power interruption on the hardware target When power is restored retentive variable values are automati cally read from the non volatile memory and re loaded into their original variable Retentive variables are used often to recover from a power interruption and continue the process that is be ing controlled without initializing the process or wasting materials The hardware target must support Retentive Variables for this feature to work Adding retentive variables to a ladder diagram project alone does not guarantee retentive functionality How to Make a Variable Retentive For a variable to be retentive it must be identified as retentive To identify a variable as retentive in the Edit Mode click the Edit Vars button located on the tool bar Select the variable that is to be retentive Click the EDIT button The Edit Variable dialog will appear as in Figure 7 1 a Edit Variable Var VO Number Default Value Check box to make variable retentive Figure 7 1 To make the variable retentive click the Retentive check box and click ox The variable is now retentive and will be stored in the event of a power inter
302. nput or Output Supported Variable Data Types The variable types listed in Figure 26 4 are supported in EZ LADDER Toolkit Structured Text Some limita tions apply depending upon the type of function or function block and the type of variable declaration Keyword Data Type Bit Size Internal Data Type Input Output Data Type EE a E S onm powem III r a E T UST ons neasnonmegr 3 x o ooo ARRAY OF Figure 26 4 Supported Data Types lt X lt X lt X lt X lt G BE E ECH BE E a ee e a BE E ECH BE E CH BE S ECH BE E ECH BE E RECH E EE eee Structured Text Language Structured Text ST language is uses a combination of assignments expressions construct statements variables and comments to form function or function blocks Assignments are used in ST to assign values to tags variables Assignments use the operator colon and equal signs Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 361 Chapter 26 Structured Text In Structured Text to set a Variable named Pi to 3 14 see Figure 26 5 FunctionBlock1 F FUNCTION BLOCK FunctionBlockl a VAR INPUT Enable bool END VAR VAR Pi real END VAR VAR OUTPUT Q bool END VAR Oo Enable Pi 3 14 END FUNCTION BLOCK d Figure 26 5 Expressions may be part of an assignment or construct statement An expression evalutes to a number nu merical expression INT REAL or to a true or false condition BOOL An
303. nput pins EN P1 P2 and two output pins Q O UO Pin Active State Other Details PAaivetue Output A Output Example Circuit Related Functions DIV Remainder gt CEG EC a ot E ES Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 307 Chapter 24 Function Reference MODBUS_ MASTER MODBUS_MASTER Description EN Q The MODBUS_MASTER function is used to communicate to slave devices on a Modbus Network When the MODBUS_MASTER function is placed additional information is pro vided that is required for communications including the interface UART to use and Func tion Code Type of communication For additional details and information see Chapter ID ER 13 Modbus Networking Input Output Connections The MOD function block placement requires connections of three input pins EN P1 P2 and two output pins Q O vo Pin Type Integer Real Ten imo x D maf x f It ER A JI o S o ST Sx Y Active State Other Details awer ID Number of Slave Communication Status Error Number EN ER a omu MASTER Properties ad Modbus Master Properties Name MODBUS MASTER2 The Modbus Master Properties Box shown left is Description automatically displayed when the MODBUS _ MASTER function is placed in the ladder diagram Select the UART from the Interface Drop down Box Interface Select the Function Code from the Drop down Box to Function Code
304. nteger output of the actual ASCII value of the key that was pressed Figure 10 4 shows the ASCII output for the key press detected Figure 10 5 represents a typical keypad2 function in a ladder diagram project Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 92 Chapter 10 Keypad Support Figure 10 4 CD KP_Output Figure 10 5 Reading Discrete Key Presses using Contacts Before being able to read any key presses using the Discrete key method the ladder diagram must O have at least one Keypad or Keypad2 Function Block installed and in use Any discrete keys will not operate unless one Keypad or Keypad2 Function Block is installed in the ladder diagram project Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 93 Chapter 10 Keypad Support In addition to reading complete values from the keypad it is possible to read individual keys to determine if they are pressed Each key has a predefined address that can be used as an input boolean type variable that is classified as an input Create a contact as a new variable and in the Var I O Number field enter the address of the specific key desired When the key is pressed the contact will be true The following addresses are used to read discrete keypad buttons I O Assignment KB 0 KB 1 KB 2 KB 3 KB 4 KB 5 KB 6 KB 7 KB 8 KB 9 Button Description Numeric 0 Numeric 1 Numeric 2 Numeric 3 Numeric 4 Numeric 5 Numeric 6 Numeri
305. nter Cor ow fi id o o rener or Ca owe O i dS treater Coa ow x __ GurentvatueEreoder Postion _ xf ow xf Yara fox Courter ef owe fx Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 204 Chapter 24 Function Reference Example Circuit DH D QE CRI Direction CRZ IndexYal Related Functions CNTR_PXX_QEI_CMP CNTR_PXX QEI VEL Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 259 Chapter 24 Function Reference CNTR_PXX_QEI_ CMP CNTR PXX QEI CMP Description EN Q The CNTR_PXX_QEI_CMP function block is used to load values into compare reg isters 3 available for Position Counter and 3 avaliable for Index Counter For more details on how the quadrature counter inputs and function blocks operate together PI see Chapter 18 Counters amp Timers When the function block is placed a dialog box is automatically displayed See next page The Compare drop down menu is used to select the type of compare to use load and monitor Di The enable EN input must be true for the CNTR_PXX QEI CMP functionblockto i ast tS operate The Q Output is based on the type of compare and the actual count value The quadrature encoder must be installed in the Project Settings before this function block may be Q placed Other parameter configurations must be completed during this installation Refer to Chapter 18 Counters amp Timers Three hardware compare register
306. number of sample clocks that the input signal must remain in a new state high low for the new state to be seen as a valid state The sample clock is 120MHz 8 33333ns Click ox to close the PLCHIP_Pxx_qei Properites window The PLCHIP_Pxx_qei should now be listed in the Devices pane under Internal Click ox to close the Target Properties window Click ox to close the Project Settings window Be sure to save the ladder diagram project The quadrature counter inputs are now installed and ready to be used Using the Quadrature Counter Inputs With the quadrature counter inputs installed they may be used in a ladder diagram Three function blocks are provided that access the quadrature inputs CNTR_PXX_QEI CNTR _PXX_QEI CMP and CNTR_PXX__ OE VEL Using combinations of these function blocks provide maximum versatility in the ladder diagram to handle a multitude of applications Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 199 Chapter 18 Timers amp Counters The CNTR_PXX_QEI function block is used to read the current count position counter direction of travel status and index count with optional reset control for the position counter and index counter The CNTR_PXX_QEI CMP function block is used to set internal compare registers and then monitor the compare status of these registers The position counter and index counter each have three 3 internal hardware compare registers that this function uses to compare val
307. o its real world status Since all I O status is re evaluated each scan the contacts and coils are updated and will override variable changes Actual real world inputs cannot be changed at all wish to be kept must be manually changed in the project in the Edit Mode Additionally any variable V Changing any variable value in real time does not change the ladder diagram project Changes that changes on the target are lost if the target is stopped started or power is reset to it Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 70 CHAPTER 7 Retentive Variables amp EEPROM Memory This chapter provides basic information to understand what Retentive variables are when to use and how to use them including their limitations EEPROM installation and use is also provided Chapter Contents What is a Retentive Variable ccccsssesseseeceseeceeeeseneeeeneeseeeseseseeeeeeees 72 How to Make a Variable Retentive ccccsseeesseeeseeeeseeeneesenseseeeeeeeees 72 Retentive Variable Memory Limitations ccccccsseeeeseseeeeeseeeseeneeees 73 Configuring Retentive Memory in the Project Settings 0 73 EEPROM Memory OVE rView cccccssseecssseeesseeeeesneseeeseseeaseeseesneesnenenses 74 Installing EEPROM Fucctionallity ccccssssseesesseeeeeseeeseeeeeseseeeseeneeseees 75 Using EEPROM Metteg EEGENEN 76 FRAM used as EEPROM ssssanssnnnunnnnunnnnnnnnnnnnnn
308. ock P GT eps type Integer Real Boolean Timer Active Stato Other Detais e f me x Actes ri me x x A ES EC ES SES Co f ow o e a Ee e TTT er o x S Although the output type for the LT EQ and GT outputs is boolean coils must be connected to the them A boolean variable may be connected and it will compile but it will not function on the target Example Circuit CRI CHP CRe Related Functions LIMIT HYSTER Divelbiss Corporation P Series EZ LADDER Toolkit User Manual ZOU Chapter 24 Function Reference CNTR_LS7366R CNTR_LS7366R Description The CNTR_LS7366R function block is used to read and write to the LS7366R counter inte grated circuit The LS7366R is an integrated circuit that operates as a high speed counter that supports counting up down and also quadrature In addition to this function block the LS7366R must be configured for the application It is configured in the Project Settings A description of the configuration will follow later in this function block explanation The LS7366R operates using internal registers There are three registers in the LS7366R OTR DTR and Actual Count Per the design of the LS7366R the actual count register can never be directly read or written to therefore the other registers must be used to read and write to the actual count As an example when the function block Read Count RC input is true the actual count is copied to the
309. odbus Networking l All Modbus registers are accessed as variables and must begin with MB_ to identify a modbus e Slave register Assigning and Setting Slave Registers To use Modbus Slave registers registers must be assigned to variables For more information regarding variables refer to Chapter 5 Creating Ladder Diagram Projects Modbus registers can be assigned by editing an existing variable when new variables are created Coils and Discrete Input registers are to be used with Boolean variable types while Holding and Input Registers are typically used with Integer variables To assign a Modbus register to a variable using the Add Variable or Edit Variable dialog click the Epit button next to the Address Register field See Figure 13 15 ad Add Variable Name ois Description Vanable Type Input Var VO Number Output Default Value Ce Internal Address Register Edit Retentive SH Get _ Figure 13 15 The Edit Address Register dialog box will open See Figure 13 16 Using the drop down menu select MB_ Modbus From the now visible Register Type drop down box select the type of register to use of the four supported types In the Register Index box type the address number of the modbus register 0 65535 This number depends on the type of register and it s range of allowed register numbers As the register type is selected and the number entered the Address Register displayed w
310. ode Counter will wrap in either direction if maximum or minimum value is reached Single cycle Counter will count until maximum value is reached and then stop counting Used with CY Flag Counter must be reset to continue counting Range limit Counter will only count between zero and the value loaded in the DTR register Modulo n Actual count will equal number of pulses divided by value of the DTR register 1 Index Mode Disable Index Index input is disabled and will not cause any action on the actual count register Load CNTR When the index input is active the actual count register is loaded with the value of the DTR register The DTR register is loaded using PD and LD on the function block Reset CNTR When the Index input is active the actual count register is reset to zero Load OTR When the index input is active the OTR register is loaded with the actual count register value The OTR register is used to read the current count Asynchronous Index In quadrature mode if index is active it is applied acted on regardless of its phase relationship to inputs A and B Synchronous Index In quadrature mode If index is active it must meed the phase relationship of inputs A and B before it can be applied acted on Clock Filter Div by 1 Filter Frequency divided by 1 This is based on the input frequency of A and B inputs Div by 2 Filter Frequency divided by 2 This is based on the input frequency of A and B inputs LFLAG D
311. ogic vs Ladder Diagram c ccccccssenseeeeeeeeseeeeeeeseenseeeeeneeseeseeeeneeeeseseeneeeeneesenesseneeeenessnasensnenenaes 26 Basic Ladder Diagram Symbols E 27 POWER Ra apd WU lut 28 EES Et MEN 29 Understanding Ladder Diagram Functionallity cccccceeseeeseseeeneseeneeeeneeseneeseneeseeeeseeaeeeeneneenenennenenes 30 Chapter 4 Configuring Targets ccccccsscssseesseceeeceeeeeeeceeseneseneseeesenesenesenenegs 31 Understanding attert 32 The Project Settings ne EE 32 Selecting the Hardware Target eggukeebgeugbe gege EENEG HEEN 35 Viewing Target Information ME 36 Updating Installing Target Kernels issssiciicsixissiciecisstecetengenccesiccdnencsvananwcteusiedueiedantoudcueveedselseVeanductseicedontd 37 RECOVERING COMMUNICATIONS este ccesiecexceneenesspeese suas csencnnccdvcenctinesaeewemacsasecmuieeasaumeisanaisdeatenescisied Aa a a aaa 38 Carder GUNIC S reper twice ei tearm cece OE naval co aun ues E ET 40 Bootloader Target Options amp Configurations ccceeseeeeeeeeeeeeseeeeeseeeseeneeseenenseaseeseaeeessnenesseaneesoanees 41 Installing Target Devices Features ccccsceccesseeeeeeeeeeeseeeeeeseeeseeeeeeeeneessaneeseeaneeseaneeseeneessanaeesenneesonges 42 Chapter 5 Creating Ladder Diagram Projects ccccsscssseeeeseeeeeeeseeeseeeeens 47 Creating Ladder Diagram Projets sccstvscescetenssccnocsvvncesiancmmstewacenvanecuenteniinescanuscteanscesswencatewsdsiiecbsaxesennenss 48 Understandin
312. ommunication to each individual item on the network There are specific requirements for the hardware see the OptiCAN section of this chapter CAN networking refers to the hardware There are multiple CAN protocols for communicating between devices on a CAN network As with all networking and protocols protocols have advantages and disadvan tages Some common protocols are SAE J1939 CANopen etc At this time the P Series based targets only support the proprietary OptiCAN protocol Installing CAN Network Ports Prior to installing and configuring any type of CAN protocol the actual CAN port must installed in the P Series target l CAN Networking Port availability is based on actual hardware targets Refer to the target s User d Manual or Chapter 23 Hardware Targets to determine if CAN Network Ports are supported Using the Project Menu choose Settings The Project Settings window will open as previously covered in Chapter 4 Configuring Targets Select the target and click the properties button The Target Properties window will open From the drop down menu DCPN select the model part number of the target If any CAN port were installed it would be listed in the Devices pane under the Bus CAN section Click the app bEvice button The Targets Devices window will open All the available devices and features for the target are shown in the Devices section Scroll down and find the CAN ports CANO CANT etc Figure 14 1 shows the T
313. ompilation process must be corrected before the compilation will suc cessfully complete and provide operational compiled code See Chapter 22 Troubleshooting for common error messages Figure 5 9 illustrates two Output Window messages for the same ladder diagram project The first identifies errors during the compile process while the second illustrates a successful compile EZ EZ Ladder Standard Ladder Diagram Project Name did Lelek EZ File o lini rts Window Help alx x ECH a mS 0 wm me Starting verify Sires ee ee LINK ERROR Yertical link not found at 5 3 1 Errors found Coils Labels 1 Errors found starting compile RAM bytes used bb RAM bytes left 4030 ROM bytes used 215 ROM bytes left 65321 Retentive EEPROM bytes used 0 bytes left 100 End compile Figure 5 9 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 59 Chapter 5 Creating Ladder Diagram Projects Bit Addressable Variables As covered earlier in this chapter variables are an important part of an EZ LADDER Toolkit project While most projects will use variables as described earlier the EZ LADDER Toolkit also provides a feature to use integer variables and then actually control the individual bits that make up the entire integer variable num ber total of 32 bits per integer This feature is called Bit Addressable Variables Any inte
314. ompiling Ladder Diagrams After a ladder diagram has been created it must be verified and compiled prior to downloading it to an ac tual hardware target This process checks the ladder diagram for adherence to all EZ LADDER Toolkit and target rules and then creates a file that will be downloaded to the hardware target This file while main taining the functionality of the ladder diagram actually has no graphical representation and is generally not recognizable or viewable To Verify a Project The verification process will check the ladder diagram for completeness and common rules verifying there are not broken links etc To verify the ladder diagram project on the tool bar click the Verify button In the Output Window at the bottom a message will be displayed with the status and results of the verification process To Compile a Project The compilation process involves two actions The first is an automatic verification is done and if no prob lems are detected the ladder diagram is then compiled converted into machine language code for down loading to the hardware target To compile a ladder diagram project on the tool bar click the Compile button l All EZ LADDER Toolkit Projects must be compiled prior to downloading them to a hardware target Once a program has been compiled it does not need to be compiled again unless the actual ladder diagram project has changed since it was last compiled Any errors encountered during the c
315. on EZ LADDER Toolkit User Manual 205 Chapter 19 Ethernet Ethernet Modbus Port The Ethernet port may also be used as a Modbus communications port Modbus Master or Slave When using the Ethernet port as a Modbus communications port addtional configuration is required As this manual is a generic EZ LADDER Toolkit manual for P Series PLC on a Chip target programming Ethernet connectivity is covered To determine if the actual hardware target model supports ethernet refer to Chapter 23 Hardware Targets Prior to using the Ethernet port for Modbus communications the Ethernet port must be installed in the EZ LADDER project this is different than previously installed using the Bootloader It is installed using the Proj ects Settings Menu Select the target PLCHIP PXX and click the properties button The Target Properties window will open From the drop down menu DCPN select the model part number of the target If Ethernet Port is installed they will be listed in the Devices pane under the Internal Ethernet section Click the app Device button The Target s Devices window will open All the available devices and features for the target are shown in the Devices section Scroll down and find Ethernet Figure 19 7 shows the Target s Devices window a PLCHIP PXX Devices Devices Name Description Analog 1 0 Intemal Analog 1 0 CANO CAN 0 CAN1 CAN 1 Ethemet Ethemet F FM24XXX Ramtron FM24XXX FRAM 12C
316. on 5 p NL EEPROM ADDRESS LOCATION Variabel amp Type 4 of 1 2 B 4 5 6 7 8 eee Variable 1 Boolean Variable 2 intege RIIT Variable 3 Gooean 1 Refer to Chapter 24 Function Reference for details on using the EEPROM READ and EEPROM WRITE function blocks FRAM used as EEPROM When configuring Retentive Memory see earlier this Chapter the NumUser Bytes are automatically cal culated based on the number of retentive bytes configured The NumUser Bytes are memory locations in FRAM that may be used to store data just as in the EEPROM using the EERPROM_WRITE and EEPROM READ function blocks write cycle limitations FRAM locations will not fail after repeated write cycles therefore they are appropriate to use in any situation Q The FRAM memory locations as they are not based on EEPROM technology do not have the When using the EEPROM_READ or EEPROM_WRITE function block ensure you select the Q correct device from the drop down menu the menu is available when placing the function blocks in the ladder diagram The FMXXX devices are FRAM devices while the PLCHIP_Pxx_eeprom is the actual PLC on a Chip EEPROM Divelbiss Corporation P Series EZ LADDER Toolkit User Manual if CHAPTER 8 Pulse Width Modulation This chapter provides basic information to understand what Pulse Width Modulation is and how it is used as feature in the EZ LADDER Toolkit and hardware target Chapter Contents
317. operties can Pos Node ID 5 Broadcast Rate 500 ms Send Heartbeat Common Broadcast Registers Register Name Broadcast Trigger Node Status Specified Interval amp Change of State CAN Tx Erors CAN Rx Errors Figure 14 4 In addition to the parameters listed above that are required the following additional configuration points are optional based on the requirements of the controller program and network configuration Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 131 Chapter 14 CAN Networking 1 Send Heartbeat Check this box configure this controller to send a network heartbeat signal message for the network to function properly Although it is possible to have multiple controllers on one network sending heartbeats it is recommended only one controller broadcast a heartbeat per network One node on the OptiCAN network MUST broadcast the heartbeat 2 191 Node Status This setting identifies when to broadcast the status of this controller node The broadcast trigger may be selected by clicking in the table The selections are Specified Interval Change of State and Specified Interval and Change of State 3 CAN Tx Errors This setting identifies when to broadcast the CAN Transmit errors identified by this controller node The broadcast trigger may be selected by clicking in the table The selections are Specified Interval Change of State and Specified Interval and Change of State d CAN Rx Errors _
318. or installing and using SD Card features for P Series PLC ona Chip targets The SD Card may be used to install and update EZ LADDER target kernels and or ladder diagram programs Future expansion will include the ability to log data to the SD Card As this manual is a generic EZ LADDER Toolkit manual for P Series PLC on a Chip target programming SD Card Support is covered To determine if the actual hardware target model supports the use of SD Cards refer to Chapter 23 Hardware Targets Installing SD Card Support By default SD Card features are not enabled or configured on P Series hardware targets The SD Card Support port must be installed and configured using the Project Bootloader Menu The first step is to open an existing program or create a new program a simple one rung program This program is required to switch EZ LADDER Toolkit from the EDIT mode to the RUN mode which is required for using the Bootloader Menu option Make sure the serial port is configured correctly in the Project Set tings menu Refer to Chapter 4 Configuring Targets and Chapter 5 Creating Ladder Diagram Proj ects Q The Bootloader Menu option is only available when EZ LADDER Tookit is in the RUN mode Open or create the ladder diagram project and configure the serial port using the Project Settings menu Click the monitor MON button located on the toolbar EZ LADDER will switch from the EDIT mode to the RUN mode The toolbars will change
319. or line Parethesis should be used to control order of Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 363 Chapter 26 Structured Text operation To Operator Example Moone moo xmm SSS S Figure 26 9 The arithmetic functions in Figure 26 10 are supported by EZ LADDER Toolkit s Structured Text Function Description Syntax COS Cosine of a numeric expression COS numeric_expression XPT EXPT num_expt E SORT SQRT umeric_expression Figure 26 10 Relational Operators Relational operator compare two values strings or numerical expressions and provide a true or false result based on the comparison The result of a relational operator is always a true or false BOOL 0 or 1 Figure 26 11 lists the supported relational operators for EZ LADDER Toolkits Structured Text Operator Description Example Equal to IF X 1 THEN IF X lt 25 THEN Less Than or Equal to IF X lt 15 THEN Greater Than IF X gt 5 THEN Greater Than or Equal to IF X gt 100 THEN Not Equal to IF X lt gt 6 THEN Figure 26 11 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 364 Chapter 26 Structured Text Logical Operators Logical operators are used to compare if multiple conditions are true or false The result of a logical opera tor is always a true or false BOOL O or 1 These operators are helpful in determining a status of multiiple items and performing an action bas
320. orporation P Series EZ LADDER Toolkit User Manual 181 Chapter 16 I2C Devices Select I2Cx and click ox The I2Cx bus will be installed The Target s Devices window will close and the I2C bus is now listed in the Target Properties window in the Devices pane Click ox to close the Target Properties window and click ok to close the Project Settings window Be sure to save the ladder diagram project The C bus is now installed and ready to be used and additional IC de vices may be installed and used in the ladder diagram FM24XXX RAMTRON FRAM Storage Devices F24XXX FRAM devices are memory storage devices based on FRAM technology These FRAM devices are the memory used for retentive memory and or used as non volatile EEPROM storage on P Series targets As multiple sizes are available the xxx in the part number represents the model size To install an FM24XXX FRAM device use the Project Menu choose Settings The Project Settings win dow will open as previously covered in Chapter 4 Configuring Targets l An FC bus must be installed for the FM24XXX to install and function If an I2C bus is not installed J see Installing an FC bus in EZ LADDER earlier in this chapter Select the target and click the properties button The Target Properties window will open Click the ADD DE vicE button The Target s Devices window will open All the available devices and features for the target are shown in the Devices section Scroll down and find t
321. oses to modify a register if the type is allowed to be modified then any changes made by the master to the register will immediately change the value of the variable that is assigned to that register and will be used in the ladder diagram project locally Modbus Slave Communication Errors Modbus communications supports the use of error codes to identify and diagnose problems with the network and slaves These errors are reported on master only Typical error codes are 2 Illegal Data Address This identifies that the master attempted to access an invalid register 3 Illegal Data Value This identifies the master attempted to access a register that is valid but not used in the ladder diagram project on the slave unit The largest register number is kept automatically by EZ LADDER Toolkit in the ladder diagram project For more details regarding errors and error codes on a Modbus Network refer to the network Master s documentation Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 120 Chapter 13 Modbus Networking Modbus Slave Supported Master Functions EZ LADDER Toolkit s Modbus Slave supports eight standard Modbus master functions functions the master can use to access and update slave registers While there is no way for the ladder diagram or EZ LADDER to use these functions they are noted for reference Supported Functions include 1 Read Coil Status 2 Read Discrete Input Status 3 Read Hold
322. ost ladder diagrams can be utilized on different hardware targets with only minor changes to the ladder diagram program itself Each hardware target is unique in that each usually have differing number of inputs outputs analog I O and other features Due to the differences in each EZ LADDER Toolkit ladder diagram project the actual target must be identified selected and it s optional features if any installed and configured properly Refer to Chapter 23 Hardware Targets for specific target details for each supported target typically have some features that require additional configuration after the actual hardware target is selected while targets such as the PLC on a Chip require you to install and configure each and every I O point device and feature you intend to use l It is important to understand that using PLC targets such as Harsh Environment Controllers etc Failure to correctly select install or configure a feature in the Project Settings may result in the target not operating as anticipated or features and functions not showing available for the target For a target to be able to use the compiled ladder diagram program created using the EZ LADDER Toolkit it must also have its kernel installed The kernel is the hardware target s basic operating system or bios The kernel is required before any compiled programs can be installed The kernels for targets are automatically installed on your computer when the EZ LADDER Toolkit
323. ot solicit or hire any of Divelbiss s employees 7 Limitation of Liability LICENSEE ACKNOWLEDGES AND AGREES THAT NEITHER DIVELBISS NOR ITS SUPPLIERS EMPLOYEES OR AFFILIATES WILL BE LIABLE FOR ANY LOSS OF PROFITS LOSS OF BUSINESS OR GOODWILL LOSS OF DATA OR USE OF DATA INTERRUPTION OF BUSINESS NOR FOR ANY INDIRECT SPECIAL INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND UNDER ARISING OUT OF OR RELATED TO THE SUBJECT MATTER OF THIS AGREEMENT SPECIFICALLY INCLUDING ANY LOSS TO OR DAMAGES OF LICENSEE S CUSTOMERS OF ANY SORT WHATSOEVER HOWEVER CAUSED WHETHER ANY SUCH CLAIM SOUNDS IN CONTRACT TORT STRICT LIABILITY OR OTHER LEGAL OR EQUITABLE THEORY EVEN IF DIVELBISS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS IN NO EVENT WILL DIVELBISS S LIABILITY UNDER ARISING OUT OF OR RELATED TO THE SUBJECT MATTER OF THIS AGREEMENT EXCEED THE AMOUNT RECEIVED BY DIVELBISS FROM LICENSEE UNDER THIS AGREEMENT DURING THE NINETY 90 DAY PERIOD PRECEDING THE EVENT GIVING RISE TO SUCH LIABILITY OR THE AMOUNT OF A SINGLE USER LICENSE FEE FOR THE EZ LADDER TOOLKIT WHICHEVER IS GREATER 8 Indemnification a Subject to the limitations of Section 7 of this Agreement Divelbiss will indemnify Licensee from and against liability for any judgment finally awarded by a court of competent jurisdiction against Licensee based upon a claim that the EZ LADDER Toolkit infringes any current U S patent or copyright of a third party provided that Divelbi
324. otate Right ROR Reset Set Reset Dominant RS Seed Random SEED Select SEL Serial Print SERIAL_PRINT Set Date SETDATE Set Time SETTIME Shift Left SHL Shift Right SHR Sine SIN Square Root SQRT Set Reset Set Dominant SR Structured Text Function ST_FUNC Structured Text Function Block ST_FUNC_BLKk Subtraction SUB Tangent TAN Convert to Timer TIMER Time Delay Off TOF Time Delay On TON Timer Counter TimerCounter Pulse Timer TP Uart Set Property UART SET PROPERTY Unlatching Coil UNLATCH Bitwise XOR XOR Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 231 Chapter 23 Hardware Targets P Series Bear Bones Controllers Each P Series Bear Bones controller model supports different features and function blocks based differ ences of the on board hardware When any P Series Bear Bones model is selected in the Project Settings some supported functions are automtically installed while others must be manually installed ICM BB P13 30 Features On Board Real Time Clock Retentive Memory FRAM 480 bytes 8 Digital Inputs Sink Source DC 8 On Off Digital Outputs DC SD Card Support Up to 8 Analog Inputs Range Type Field Adjustable Up to 1 Analog Output Range Field Adjustable 1 CAN Port Ethernet Port Supported Function Blocks Less Than lt Less Than Equal To lt Not Equal To lt gt Equal To Greater Than gt Gre
325. ough to allow the completion of the Retentive memory write cycle For Retentive memory the P Series PLC on a Chip requires an external FRAM technology device This device connects to the PLC on a Chip using its 1C ports Please refer to the PLC on a Chip P Series Data Sheet for details on th retentive memory requirements and the FRAM connections O The internal EEPROM memory may not be used for retentive memory storage as the on board EEPROM memory is too slow to allow sufficient time to complete the retentive write cycle The PLC on a Chip EZ LADDER Toolkit supports multiple FRAM devices that in turn provide Q different size memory Connected FRAM device memory is split into Retentive and EEPROM storage The amount of this FRAM specified for Retentive is configured in the hardware target s Project Settings Regardless of the memory size for Retentive the hardware must support a loss of power detection and have sufficient power supply to allow enough time for the Retentive Memory to write successfully Configuring Retentive Memory in the Project Settings To configure the Retentive Memory use the Project Menu and click Settings The Project Settings Window Dialog box will open Click the Properites button See Chapter 4 Configuring Targets for more details on target configuation menus The Target Properties window will open Located in the Devices pane the Low Voltage Sense should be listed under Internal and under the Bus the 1 C P
326. ounts pulses on the quadrature inputs over the time set by the Sample Period in seconds It uses the pulses per revolution the Sample Period and the actual counts to calculate the velocity The actual velocity in engineering units is output on the V output The VC output is the number of pulses counted in the sample period The Q output is true only for the ladder diagram scan when the velocity is calculated and updated on the V output If the Pulses per Revolution is 1 then the V output is equal to the counter frequency If not set to 1 then the V output will be revolutions per second D a R E E S E ve ow x i RR REESEN vow x _ __ veen besiess a ow RSC RRE fr sen wen Voit is updatea Example Circuit 1 Hax OEI Velocity Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 208 Chapter 24 Function Reference Dialog Box oJ PlchipPxxQei Properties Name ENTR_PXX_GEI VEL1 Description Related Functions CNTR_PXX_QEI CNTR PXX_QEI CMP Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 209 Chapter 24 Function Reference COS cos Description EN o The COS function provides a cosine O from the input value P1 The enable EN must be true for the COS function to be enabled The Q output is true when the COS function is enabled DI O Input Output Connections The COS function block placement requires connections of two input pins EN P1 and two output pins Q O
327. oving average When EN is false the output is equal to the P input P 9 The larger the number of samples the more RAM is used and the slower the reaction time of the block output to input changes Size the number of samples to give the best suited reaction time and to use the least amount of RAM needed accomplish to meet the operation specifications Input Output Connections The MAVG function block placement requires connections of two input pins EN P and two output pins Q O Oen m xT e C me x if S of owe x fx _ oee ce owe x Example Circuit Related Functions AVG Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 304 Chapter 24 Function Reference MAX MAX Description EN Q The MAX function compares all the Px input values and outputs the largest of them on the O Output The number of inputs is specified when the object is placed The enable EN must be true for the MAX function to be enabled P1 QO Input Output Connections The MAX function block placement requires connections of at least 3 input pins EN P1 P2 and two output pins Q O The EN is always considered an input in the total number of inputs therefore always add one to the number of Px inputs that need to be used P en Type Integer Real Boolean Timer Active Sate omer Dorais Cen mot fT XT treme Cee ot fx fx __ _Narberofinputsis anemic 2 owt ee 2 owej o d xx
328. p per design guidelines for proper operation Using the Project Menu choose Settings The Project Settings window will open as previously covered in Chapter 4 Configuring Targets Select the target and click the Properties button The Target Properties window will open From the drop down menu DCPN select the model part number of the target If any SPI port were installed it would be listed in the Devices pane under the Bus SPI section Click the app pevice button The Targets Devices win dow will open All the available devices and features for the target are shown in the Devices section Scroll down and find the SPI ports SPIO SPI1 etc Figure 15 1 shows the Target s Devices window al PLCHIP PXX Devices 0 Devices Name Description Low Voltage Sense Low Voltage Sense Active Low LS7366R 32 Bit Quadrature Counter SP MCP3204 Microchip 4 Channel 12Bit A D Converter SPI Modbus Master Modbus Master Modbus Slave Modbus Slave PLCHIP_Pxx_eeprom Intemal PLCHIP PXX 4K EEProm PLCHIP Pe oei Intemal Quadrature Encoder Interface PLCHIP_Prox_ttc intemal PLCHIP PXX Real Time Clock PWM Pulse Width Modulator SD_CARD SD Card Serial Print Serial Print SPIO SPI 0 SPI1 SPI 1 TimerCounter Hardware Timer Counter UART1 UART1 Variable Names Name SSP_MISOO SSP_MOSIO SSP_SCKO Figure 15 1 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 160 Chapter 15 SPI Devices a
329. pening Existing Ladder Diagram Project Files ssssecssseeeeeees 24 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual Chapter 2 Navigating EZ LADDER Toolkit EZ LADDER Toolkit Overview When the EZ LADDER Toolkit is started it will open in the Edit Mode This mode is where ladder diagram projects are created functions are inserted and variables are placed When actually downloading ladder diagram projects to targets or monitoring ladder diagram operation on hardware targets it is referred to as Run Mode The Run Mode is explained in Chapter 6 Downloading and Running Projects Figure 2 1 identifies the components that are part of the Edit Mode E 2 EZ Ladder Standard Ladder Diagram Project Name did ia h sc E xX 2 SCH E File RE E Ee A 21 De see Se S JMP Edit Inst k S Label Vara are ig C MON Abc 4 le i UI CTU CTD CTUD TP TON TOF Insert Function D A NW LJ Coils Contacts Functions 5 Variables Labels 3 3 4 4 iii r 6 5 4 5 NUM Figure 2 1 1 Project Filename The name of the currently viewed project will be displayed in this position 2 Menus Drop down menus for programming features and options 3 Cross Reference Quick Click Cross References for functions objects and variables 4 Tool Bars Tool bars for placing functions objects and drop down function lists 5 Ladd
330. perform substantially in accordance with the accompanying documentation provided by Divelbiss provided that the EZ LADDER Toolkit i has not been modified ii has been maintained according to all applicable maintenance recommendations iii has not been used with hardware or software or installed or operated in a manner inconsistent with any manuals or relevant system requirements provided by Divelbiss and iv has not been subjected to abuse negligence or other improper treatment including without limitation use outside the operating environment or range of applications prescribed in any manuals or relevant system requirements provided by Divelbiss by Divelbiss Provided that Licensee gives prompt written notice to Divelbiss of any alleged breach of the foregoing warranty and that such alleged breach can be reproduced by Divelbiss Divelbiss will use commercially reasonable efforts to repair or replace the EZ LADDER Toolkit so that it performs as warranted or at its sole option refund to Licensee a prorated share of the license fee paid by Licensee for the portion of the EZ LADDER Toolkit which caused the alleged breach of warranty Licensee acknowledges that the foregoing represents Divelbiss s sole obligation and Licensee s sole remedy for any alleged breach of warranty regardingthe EZ LADDER Toolkit Divelbiss expressly disclaims any and all warranties concerning any Resulting Products and any applications developed tested installed or
331. perties window and click ok to close the Project Settings window Be sure to save the ladder diagram project The real time clock is now ready to be used in the ladder diagram Using the Real Time Clock To use the real time clock in a ladder diagram project four function blocks are provided Two blocks GET DATE and GETTIME are used to read the current date and time from the real time clock The remaining two blocks SETDATE and SETTIME are used to actually set the date and time on the real time clock Figure 12 3 represents a ladder diagram program that will read the date and time The real time clock date and time may also be synced to a connected computer using EZ LADDER Q Toolkit See the Target Utilites section in Chapter 4 Configuring Targets The real time clock function blocks use variables as inputs for setting date and time and outputs for reading date and time These integer variables are global and may be used anywhere in the ladder diagram Figure 12 4 represents a ladder diagram to set the date and time Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 105 Chapter 12 Real Time Clock For more details on using the real time clock function blocks or additional function blocks see Chapter 24 Function Reference GETTIME EN Q HR MN SC Figure 12 3 SETDATE1 EN Q Month f MN DY YR DayVeekmey WI Figure 12 4 GETDATE EN Q WD SETTIME1 EN Divelbiss Corporation P Series E
332. placing the function block a new Serial Print Properties dialog box will open See Figure 11 7 The Text field is where the message is typed that will be transmitted a Serial Print Properties Name SERIAL_PRINT1 Description Text will Print this text Serially Figure 11 7 When all the information is entered clicking ok will cause the function block to be placed in the ladder dia gram project Figure 11 8 is a sample of a complete SERIAL_PRINT circuit CRI HAL DIN Enlst Error Figure 11 8 Q The SERIAL PRINT function block supports special control characters See the SERIAL_ PRINT function block in Chapter 24 Function Reference Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 101 Chapter 11 UARTS amp Serial Ports Transmitting Variables Serially In addition to transmitting static text it is often desirable to be able to transmit variables to another device To transmit a variable using the serial port the same SERIAL_PRINT function block is still used As in trans mitting text the text is entered into the Text field In addition to the text control characters may be inserted that represent variables and how to format the variable text For a full listing of what control characters and formatting is supported please see the SERIAL_PRINT function block in Chapter 24 Function Reference Figure 11 9 illustrates a sample text dialog with control characters a Serial Print Properties
333. ported by a target The first step is selecting a hardware target as previously shown To view the target supported features from the View menu click Target Information The Target Information win dow will open as shown in Figure 4 4 This window identifies the Target Name Minimum Target Kernel Version that is needed for this version of EZ LADDER Toolkit Supported Objects and Function Blocks Analog Inputs Digital Inputs and Digital Out puts The Target Information is printable using the PRINT button Target Information l Target HEc P5000 Minimum Target Version 0 0 0 18 Analog Inputs JEScTIOn Less than or equal Not equal Equal Greater Greater of equal Absolute value Arccosine Add Bitwise AND Arcsine Arctangent Average Bit Pack Bit Unpack Figure 4 4 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 36 Chapter 4 Configuring Targets Updating Installing Target Kernels As new targets functions and features are added to the EZ LADDER Toolkit and new versions of EZ LADDER Toolkit are developed and released to take advantage of newer features it will be necessary to update the actual target s kernel with newer version These same steps may be taken to install a kernel in a target that is new as all new targets from the factory do not have kernels installed EZ LADDER Toolkit provides an easy way to update the kernel on the hardware target 1 Obtain the new kernel for the
334. programming manual or tutorial Other Structured Text sources should be used for a total understanding of how Structured Text is used to accomplish actions Structured Text is not an intuitive or easy to use language therefore it should only be used by those with adequate Structured Text knowledge or experience j This manual section provides basics on structured text support including supported O Structured Text Technical Support Structured Text technical support for EZ LADDER Toolkit in regards to help with how to create Q programs functions and function blocks is limited to e mail support only Refer to http www divelbiss com Support supt psupport for details on requirements for submitting a structured text support request via e mail Structured Text Introduction Structured Text is one of the included languages of the IEC 61131 stanard Using Structured Text functions and function blocks may be created to perform actions These functions and function blocks are designed to operate with other programming languages and therefore may call other functions or function blocks and may also be called from the main ladder diagram other function or function block If you are familiar with other high level languages such as C Structured Text ST programming will be similar Each program function and function block begin and end with their respective statements Between the stat ments is where all the variables are declared and
335. properties See Figure 11 5 a Serial Print Properties Figure 11 5 Click the app button The Add Uart dialog will open Select the UART to use from the drop down Uart menu and enter the number of bytes to use for the buffer size for the UART See Figure 11 6 Buffer Size 100 Uat UART1 me Co Figure 11 6 Click ox to close and save the Add Uart Dialog The Uart is now listed in the Uarts Box of the Serial Print Properties window Click ok to close the Serial Print Properties Window The targets Devices window will close and the previous target properties window will now list the Serial Print as an installed device under the Device section Click ox close the Target s properties and click ok again to close the Project Settings window Use the File Menu and Save the ladder diagram project The Serial Print can now be utilized from the ladder diagram project Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 100 Chapter 11 UARTS amp Serial Ports Printing Data to a Serial Device using a Serial Port With the Serial Print configured in the ladder diagram project it is now possible to use the EZ LADDER Tool kits function blocks to serially transmit text and set points To serial print the SERIAL PRINT function block is used Transmitting Text Serially To transmit using the serial port the SERIAL PRINT function block is used Using the SERIAL_PRINT func tion block is a two step process When
336. quipment LADDER Toolkit using the function blocks and additional features available in EZ LADDER for J1939 It is not intended as a complete J1939 reference document As such prior knowledge of J1939 is recommended Q This manual section is provides the basics for installing and configuring J1939 support in EZ EZ LADDER Toolkit support for J1939 allow for receive and transmitting data on the J1939 bus including items such as PGN request BAM global and CM specific destination EZ LADDER also supports J1939 bus address claim J1939 PGN Overview J1939 communication is based on the Parameter Group Number otherwise known as the PGN PGNs are defined based on a compilation of information For example PGN 61444 is identified as Electronic Engine Controller 1 Items transmitted with this PGN designation would be engine speed driver s demand torque etc PGNs are typically transmitted by ECUs and other devices at a set rate By reading appropriate PGNs controllers and targets can use the data as setpoints and values in the ladder diagram program Additionally EZ LADDER Toolkit programs can transmit data using J1939 P Series targets only Most PGNs are eight bytes in length but can be a different length If data isn t available typically if the PGN is not supported the data will return a OxFF If a OxFE is returned this signifies an error J1939 SPN Overview When PGNs are received they typically include multiple data points
337. r ActiveState Other Details en me x Cater N er fot x EES O O S Co foe yx Example Circuit CRI gt CRA EN Q Numi kaf Num kaf Related Functions gt lt lt lt gt Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 281 Chapter 24 Function Reference HYSTER HYSTER Description EN RQ The HYSTER provides hysteresis into a control loop When the actual A is greater than the rise R then output RQ is true and FQ is false When actual A is less than fall F the output FQ is true and RQ is false The enable EN must be true for the HYSTER func tion to be enabled A FQ Input Output Connections The HYSTER function block placement requires connections of four input pins EN A R F and two output pins RQ FQ R F eps type integer Real Boolean Timer Active State Omer Deis en mt X Cater at me x ce we x OFE eee xy ee ee ee eee PO Low PE CH oww J o d x BE Example Circuit CRI HYSTERI LH Related Functions LIMIT Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 282 Chapter 24 Function Reference INTEGER INTEGER Description The INTEGER function converts the input P into an integer output O The enable EN must be true for the INTEGER function to be enabled The Q output is true when the IN TEGER function is enabled In addition to converting a Boolean Timer o
338. r FOR_LIST expression TO expression BY expression WHILE_statement WHILE expression DO statement_list END WHILE REPEAT_ statement REPEAT statement_list UNTIL expression END REPEAT EXIT statement EXIT Figure 26 15 Structured Text Function Blocks EZ LADDER Toolkit provides two types of function blocks that use structured text ST FUNC and ST_FUN _ BLK These two function blocks are similar is some ways but different in others These blocks may be callable referring to the function blocks may be inserted into a ladder diagram project and the ladder diagram call or cause the structured text to operate inside the function block based on the inputs to the block Certain rules must be followed for a function block either ST FUNC or ST_FUNC_ BLK may be used as a callable function block Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 367 Chapter 26 Structured Text ST_FUNC Function Function Block The ST_FUNC function block is used to place a ST User Defined function into a ladder diagram When the ST FUNC function block is placed a drop down menu is used to select the functions from the User Defined Functions created by you in the ST Editor To place a ST_FUNC use the drop down function block menu in the toolbar just as any other ladder function function block Select ST FUNC and click to place it in the ladder where it is required Str
339. r 15 SPI Devices and Support The MAX31855 is configured using the Project Settings Using the Project Menu choose Settings The Project Settings window will open as previously covered in Chapter 4 Configuring Targets Select the target and click the properties button The Target Properties window will open From the drop down menu DCPN select the model part number of the target If an MAX31855 device were installed it would be listed in the Devices pane under the Bus SPI section Click the app pevice button The Target s Devices window will open All the available devices and features for the target are shown in the Devices section Scroll down and find the MAX31855 Figure 15 20 shows the Targets Devices window The SPI port must be installed individually or no SPI ports will show available in later drop down configuration menus di PLCHIP PXX Devices Devices Name Description Low Voltage Sense Low Voltage Sense Active Low LS7366R 32 Bit Quadrature Counter SP MAX31855 Thermocouple SPI MCP3204 Microchip 4 Channel 12Bit A D Converter SP Modbus Master Modbus Master Modbus Slave Modbus Slave OptiCAN Divelbiss OptiCAN PLCHIP_Pxx_eeprom Intemal PLCHIP PXX 4K EEProm PLCHIP_Pxx_qei Intemal Quadrature Encoder Interface PLCHIP Px gc Intemal PLCHIP PXX Real Time Clock PWM Pulse Width Modulator SD_CARD SD Card Serial Print Serial Print SPI1 SPI 1 TimerCounter Hardware Timer Counter Variabl
340. r Real to an integer the INTEGER function block can be used to copy one integer to another Input Output Connections The INTEGER function block placement requires connections of two input pins EN P and two output pins Q O ege Type Integer Real Boolean Timer Active State Other Dorais ren not TT x ae S o o E me x x x fx e f WER ee ee ee ee eee a owt E xx E E Example Circuit CHI INTEGER Related Functions REAL BOOLEAN TIMER Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 283 Chapter 24 Function Reference INVERTED COIL INVERTED COIL Description ell The INVERTED COIL is a representation of an internal boolean variable output coil or an actual hardware real world output Its normal state is true or normally energized An inter nal INVERTED COIL may also be referred to as a control relay CR If there is power flow to the INVERTED COIL then it will be false off If there is no power flow to the INVERTED COIL then it will be true on The INVERTED COIL may only be placed in the last column Example Circuit CHI CH3 Related Functions DIRECT COIL DIRECT CONTACT INVERTED CONTACT Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 284 Chapter 24 Function Reference INVERTED CONTACT INVERTED CONTACT Description The INVERTED CONTACT is a representation of an internal boolean variable input or an actual hardware real wor
341. r more information about structured text see Chapter 26 Structured Text The availbility of UARTs Serial Ports is entirely dependent upon the actual target For more information regarding hardware target support and features see Chapter 23 Hardware Targets Prior to using the UARTs in EZ LADDER Toolkit the UART s must be installed and configured in the target The UARTs are configured using the Project Settings Using the Project Menu choose Settings The Project Settings window will open as previously covered in Chapter 4 Configuring Targets Select the target and click the properties button The Target Properties window will open From the drop down menu DCPN select the model part number of the target If any UARTs were installed they would be listed in the Devices pane under the Bus Uart section Click the app pevice button The Targets Devices window will open All the available devices and features for the target are shown in the Devices section Scroll down and find the UARTS UART1 UART4 Figure 11 1 shows the Targets Devices window a PLCHIP PXX Devices Desain Modbus Slave Divelbiss Op AN PLCHIP_Poc_eeprom Intemal PLCHIP PXX AR EEProm PLICHIP Dy oe Intemal Quadrature Encoder Interface PLCHIP_Pooc_ gc Intemal PLCHIP PX Real Time Clock SI CARD SD Card Serial Print SPI 0 SPI 1 Hardware Timer Counter Name RXD1 TXD1 Figure 11 1 Divelbiss Corporation P Series EZ LADDER Toolkit User Manu
342. ration of a modbus network The Modbus Master feature in EZ LADDER Toolkit supports multiple commands for network control EZ LADDER Toolkit variables are used by the MODBUS_MASTER function block as the data storage for values using in the network communications When values are read from slave s these values are stored in variables that are predefined in each instance of the MODBUS _ MASTER function block When values are to be written to slave s the values to be written are captured from variables that are predefined in each instance of the MODBUS _ MASTER function block Only certain Modbus Master functions commands are supported in EZ LADDER Toolkit See Figure 13 4 Functional Description Function Functional Description Function Read Coils Write Multiple Coils Read Discrete Inputs Write Multiple Registers Read Holding Registers Read Write Multiple Registers Read Input Registers Ai Figure 13 4 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 110 Chapter 13 Modbus Networking When the MODBUS_MASTER is place in the ladder diagram workspace a Modbus Master Properties dia log box is automatically displayed See Figure 13 5 Like most functions a description can be added to the function block Using the Interface drop down selec tion menu select the interface for the Modbus Master network the UART or Ethernet that was installed and configured previously The Function Code drop down selection box
343. rd function Target Specific function or variable in the functions pane will place the item in your user defined function In the User Declaration tab the user defined declarations variables functions and function blocks are sorted by type Expanding the type will list any defined items In Figure 26 19 the Function Block type is expanded showing three user defined function blocks have been created Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 374 Chapter 26 Structured Text Function Pane The function pane is the area that user defined functions and function blocks structured text code is edited When a user defined function is open the window will act as a text editing window The strutured text code is entered and manipulated as in any other text editor Figure 26 20 is a sample of the function pane with an open function block FunctionBlock1 FUNCTION BLOCK FunctionBlockl o VAR INPUT Enable bool Vin dint Input value END VAR VAR OUTPUT bool Vout bool Output value END VAR OD Enable IF Vin 1 OR Vin 3 THEN Look for 1 or 3 input mi Figure 26 20 are colored blue variable types are colored red comments are colored green and standard text is Q The function pane colors text based on what is detected In Figure 26 20 contructs and statements colored black This coloring is automatic After a function has been changed in any way is must be verified
344. re added until the minimum width is reached If 0 and are used together the 0 is ignored If O is specified in an integer format the 0 is ignored width This flag is optional Width is the number of characters that will be printed total recision This flag is optional The precision is the number of digits after the decimal point when using REAL variables Variable Formats Variables are formatted based on the variable type The following are supported variable types and their format Yd Signed Integer X Upper Case Hexadecimal ou Unsigned Integer ot Real or Float Variable YX Lower Case Hexadecimal Yb binary 0 Octal Other Special Characters amp Formats To Print Use To Print Use AW OFF ON O Boolean Oor 1 d FALSE TRUE Sc Examples Format Result Format Result OIL d OIL 25 OIL 04d OIL 0025 LS1 T LS1 TRUE LS1 O LS1 OFF TEMP 6 2f TEMP 234 12 TEMP 3 f TEMP 234 Escape Sequences located on next page Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 331 Chapter 24 Function Reference Special Printing Codes Escape Sequences Escape Sequence a b f n r t ooo xhh uhhhh Represents Bell Alert Backspace Form Feed New Line Carriage Return Horizontal Tab Single Quotation Mark Double Quotation Mark Literal Question Mark BackSlash ASCII character in Octal notation ASCII character in Hexadecimal notation stops on last non
345. re organized to promote a step by step progression of using the EZ LADDER Toolkit from installation to troubleshooting Each chapter contains specific information that is relevant to understanding how to use the EZ LADDER Toolkit EZ LADDER Toolkit is a single program that supports both the M Series and P Series PLC on a Chip based targets While all hardware targets are available this manual s focus is on the P Series based targets and their supported features in relation to programming and EZ LADDER Toolkit For M Series based targets the M Series EZ LADDER Toolkit User Manual should be used Only the correct manual for the hardware based P Series or M Series should be used as there are distinct differences in configuring targets and features and functions supported between the two Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 8 Chapter 1 Getting Started Installing the EZ LADDER Toolkit To install EZ LADDER Toolkit on your computer follow the following steps Once EZ LADDER Toolkit is installed it must be activated before it may be used with actual hardware targets EZ LADDER Toolkit supports Windows XP Vista Vista 64 bit Windows 7 Windows 7 64 bit supported Windows Administrator Rights are required for proper installation The EZ LADDER directory security is dependent on local network security settings and may be set for user Read Execute only To allow the user to be able to write to this di
346. read EEPROM contents ARRAY of USINT offset Offset into the Buffer where to start writing read data DINT len of bytes to read DINT Ee EEE FORNT Writes Data to EEPROM memory DINTvar EZ EEPromWrite FD_x StartAdr Datavar Parameters FD_x File Descriptor StartAdr EEPROM address to start writing to DINT Datavar Variable of data to be written any variable type of bytes written dependent upon type of variable used for Datavar EA LEE Onte ATAY Writes Data array to EEPROM memory DINTvar EZ EEPromWriteArray FD_x StartAdr Buffer offset len Parameters FDE File Descriptor StartAdr EEPROM address to start writing to DINT Buffer Source buffer for write data ARRAY of USINT offset Offset into the Buffer where to start reading write data DINT len of bytes to read DINT Pen Formats a string similar to standard C PrintF also used in LCD Serial Print DINTvar EZ_FormatString Strbuffer string format Parameters Strbuffer Destination of where the formatting string is stored ume format String format to use PrintF additional arguments depends on string format of bytes written to buffer Configures a GPIO pin from structured text as an input pin or an output pin BOOLvar EZ_GPIO_INIT GPIOnum PinSel Mode Parameters GPlOnum Number of GPIO pin to configure UDINT PinSel 16 100 for digital input or 16 200 for digital output UDINT Mode 1 for pull down or 2
347. rectory an Administrator must change the permissions accordingly EZ LADDER Toolkit without Administrator Permissions will cause EZ LADDER Toolkit not install and not operate correctly Z Windows Administrator Rights are required to install register activate EZ LADDER Installing 1 Copy the Serial Number printed on the face of the Standard Edition EZ LADDER Toolkit CD to a piece of paper You will need this serial number during installation gy EZ ADDE R TOOLKIT 2 Insert the EZ LADDER Toolkit CD into your CD drive If you have Active Content Enabled for your CD Drive a Menu will appear Click the INSTALL EZ LADDER STANDARD EDITION V X X X X to run the EZ LADDER Toolkit setup Install EZ LADDER Standard Edition V1 0 4 1 What s New in V1 0 4 1 View Readme Installation Notes View the EZ LADDER Tutorial View Manuals amp Data Sheets See other Divelbiss Products View Application Notes If this screen does not appear Click the start button and choose Run Browse to the CD Drive the ern MEEN ae EZ LADDER directory and then the Vx x x x directory gm ne es e Select Setup exe and click ok and ok to run the installer PLC ona Cp a uadumatk and EZ LADDER Regt EE Welcome to the InstallShield Wizard for EZ Ladder Toolkit The InstallShield Wizard will install EZ Ladder Toolkit on 3 The EZ LADDER Toolkit Installation Wizard will open EE Click NEXT Next gt Cancel Divelbiss Corporation P
348. red in the MAX31855 Properties 2 dialog When the MAX31855 is configured click ox to close the MAX31855 Properties dialog 2 It is now listed in the MAX31855 Properties dialog 1 Click ox to close the MAX31855 Properites dialog 1 Click ox to close the Target Properties window and click ok to close the Project Settings window Be sure to save the ladder diagram project The MAX31855 port is now installed and ready to be used in the ladder diagram This installation is to configure the MAX31855 as a device in EZ LADDER Toolkit and the target The MAX31855 requires additional circuitry to control and filter real world thermocouple signals that are separate from the MAX31855 and EZ LADDER Toolkit Using the MAX31855 in the Ladder Diagram Project The MAX31855 thermocouple input values are always stored and can be accessed in the ladder diagram program by the variable names configured in the MAX31855 Properties 2 dialog Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 178 Chapter 15 SPI Devices and Support During the installation process of the MAX31855 the variable should have been automatically be created as a real As the MAX31855 is a thermcouple input the actual value will be equal to the current sensed temper ature in degrees celsius C The type of thermocouple and range is dependent upon the actual part num ber of the MAX31855 used model determines the thermocouple type and thermouple temperature ran
349. relay logic diagrams are connected on the left and right sides to power rails A comparison of a hard wired relay logic system and a programmable system using EZ LADDER Toolkit as the programming platform will show the similarities which make the programming using EZ LADDER Toolkit quick and easy to apply to any application Figure 3 1 shows a block diagram on the left and the hard wired relay logic control system on the right For easy comparison it is divided into three sections Input Devices Includes devices operated manually e push buttons and devices operated automatically i e limit switches by the process or machine being controlled Relay Control Logic Consists of relays interconnected to energize or de energize output devices in re sponse to status of input devices and in accordance with the logic designed into the control circuit Output Devices Consists of motor starters solenoids etc which would control the machine or process INPUT OUTPUT Eup le MACHINE OR PROCESS BEING CONTROLLED PB1 SW1 M 1 Figure 3 1 In place of hard wired relay logic circuitry EZ LADDER Toolkit applications are programmed using relay type symbology This symbology brings ease and familiarity to the programming while adding flexibility Figure 3 2 is the same circuit as shown in Figure 3 1 as it is programmed using the EZ LADDER Toolkits relay type symbology PBI ove Mi Figure 3 2 Divelbiss Corporation P Series EZ LADDER Too
350. request data on an NMEA 2000 network This area determines the allowed source address of the network to receive data from allowed device ID Data may be received from all addresses or from specific address This area determines the allowed destination addresses in the broadcast packet from which to receive data Optionally the receive function block can receive data that is specifically addressed to this device controller transmitted to any device or transmitted specifically to a device but not this one This allows to receive data that is specifcally transmitted to another device on the network As variables are mapped to SPNs they will be listed in this area 939 AX PGI EN Q Eplst Det SA j SreAdrl DA DestAdrl Related Functions J1939 TX PGN Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 28 Chapter 24 Function Reference J1939 TX _PGN J1939 TX PGN Description EN Q The J1939_ TX_PGN function block is used to transmit broadcast data over the J1939 NMEA 2000 CAN network There are several configurable items for transmitting data refer to Chapter 14 CAN Networking J1939 NMEA 2000 The J1939_ TX _PGN function block transmits data that is stored in variables located in the ladder diagram program These variables are mapped when the J1939_ TX_PGN function block is placed Each function block insertion instance is treated individually in the ladder diagram program Input Output
351. rget s Devices window The FM24XXX is now in stalled and should appear in the Target Properties window in the Devices pane under Bus I2C I2Cx Click ox to close the Target Properties window and click ok to close the Project Settings window Be sure to save the ladder diagram project The FM24XXX device is now installed and ready to be used Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 183 CHAPTER 17 Analog I O This chapter provides basic information on installing and using analog inputs and outputs This chapter covers standard product and P 13 Series PLC on a Chip targets Chapter Contents Analog ue TT 185 Analog Input Installation Configuration c csscceseseeeeeseeeeseeeenees 185 Installing Analog Inputs for PLC on a Chip Targets 00008 186 Using Analog Inputs in the Ladder Diagram Project sss0 187 Averaging Analog Input REadingS ccccccsssseesseeeeeeseeseeeeeeenneeneeeeneas 188 Scaling Analog Input ReadingS cccccseeeseeeeeseeeeeeeeeeeeeeeeeseeeeeseneees 188 Analog Re TEE 190 Installing Analog Inputs for PLC on a Chip Targets 00008 191 Using Analog Outputs in the Ladder Diagram Project 0008 192 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual Chapter 17 Analog UO Analog Inputs As analog inputs are a common requirement in today s control world EZ LADDER Toolkit prov
352. ries EZ LADDER Toolkit User Manual Chapter 9 LCD Display Support LCD Display Functionality EZ LADDER Toolkit provides the ability to display text and variables using it s built in LCD support EZ LADDER Toolkit supports LCD displays that meet the HD44780 interface specification In addition to the specification the displays must have 1 to 4 rows and 8 40 columns gt LCD support is based on actual hardware target specifications PLC on a Chip Integrated Circuits and Modules support LCD display functionality For PLCs and controllers refer to the supported features See Chapter 23 Hardware Targets EZ LADDER Toolkit supports only one LCD display in a ladder diagram project Configuring the LCD Display in the Project Settings To be able to use an LCD display in an EZ LADDER Toolkit ladder diagram project the LCD display must first be installed and configured The LCD display is configured using the Project Settings Using the Project Menu choose Settings The Project Settings window will open as previously covered in Chapter 4 Configuring Targets Select the target and click the PRoPeRTIEs button The Target Properties window will open From the drop down menu DCPN select the actual part number if not already done In the Device section of the De vices Pane if the LCD is installed it will be displayed To install the device click the app pevice button The Target Devices window will open All the available devi
353. ries PLC on a Chip based targets in this version See Chapter 26 e EZ LcdClear Clear LCD display using Structured Text e EZLcdiInit Control LCD Initialization using Structured Text e EZ LcdWrite Write Display data on LCD Display using Structured Text Manual Corrections Listed are some manual corrections for this release e TimerCounter function block Timer Counters now uses a 96Mhz reference clock for measuring frequency or period e Typographical errors Divelbiss Corporation P Series EZ LADDER Toolkit User Manual T Chapter 1 Getting Started How to Use this Manual In this manual the following conventions are used to distinguish elements of text BOLD Italic SMALL CAPS Denotes labeling commands and literal portions of syntax that must appear exactly as shown Used for variables and placeholders that represent the type of text to be entered by the user Used to show key sequences or actual buttons such as OK where the user clicks the OK button In addition the following symbols appear periodically appear in the left margin to call the readers attention to specific details in the text Warns the reader of a potential danger or hazard that is associated with certain actions Appears when the text contains a tip that is especially helpful Indicates that the text contains information to which the reader should pay particularly close attention This manual is divided into Chapters that a
354. rk The master is in control and initiates communication to all the other devices Each device that is not a master must be a slave Multiple slaves may be located on a network Slave devices listen for communica tion from the master and then respond as they are instructed The master always controls the communica tion and can communicate to only one or all of the slaves Slaves can not communicate with each other directly The network device UART or Ethernet must be installed prior to installing and using any Modbus devices in EZ LADDER Toolkit For UART installation see Chapter 11 UARTS and Serial Ports For Ethernet see Chapter 19 Ethernet All modbus networking requires either a serial port UART or Ethernet port for the network traffic Installing the Modbus Master EZ LADDER Toolkit P Series based products supports Modbus Master With Master support any of the P Series targets may be used as a master on a modbus network All Modbus communciation availability is based on actual hardware targets Refer to the target s User l Manual or Chapter 23 Hardware Targets to determine if Modbus and what network hardware is supported Prior to using the Modbus Master in EZ LADDER Toolkit it must be installed and configured in the target The Modbus Master is configured using the Project Settings Using the Project Menu choose Settings The Project Settings window will open as previously covered in Chapter 4 Configuring Targe
355. roceeding If the Verify Passed is shown it is time to save the function function block An unverified function or function block may be saved without verification but it will not be usable until it is verified and will not show in drop down menu to call the function or function block from the ladder diagram To save the user defined function or function block using the ST Editor menu click the File then Save op tion The function or function block is now saved Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 377 DIVELBISS SOFTWARE LICENSE AGREEMENT This Software License Agreement the Agreement sets forth the terms by which Divelbiss Corporation an Ohio corporation hav ing a principal place of business at 9778 Mt Gilead Road Fredericktown Ohio Divelbiss authorizes its bona fide licensees who have paid all applicable fees and accepted the terms of this Agreement each a Licensee to use the Licensed Software as defined below provided herewith Installing using or attempting to install or use such Licensed Software or otherwise expressing assent to the terms herein constitutes acceptance of this Agreement Any installation use or attempted installation or use of such Licensed Software by any party other than a Licensee or otherwise in violation of this Agreement is expressly prohibited Introduction Whereas Divelbiss has developed certain modules of computer software known as PLC ON A CHIP
356. rs are standard Figure 4 3 shows the Options settings dialog box 1 Number of Rungs This is where the maximum number of rungs in the ladder diagram is specified The default number is 100 rungs Inserting or Deleting rungs in an EZ LADDER Toolkit ladder diagram Q project will change this number accordingly This number should be considered a starting number of rungs If the number of rungs is not sufficient for the program size return to this dialog and adjust the number of rungs The number of rungs may be adjusted at any time EZ Project Settings Figure 4 3 Selecting the Hardware Target As discussed in a previous section using the dialogs select the target from the list If required select the actual model number configure any features that you wish to use and click ox Chapter 23 Hardware Targets includes additional information for each supported hardware target To save the target selection you must save the ladder diagram project using the Save or Save As menu items Hardware Target Selections are for the currently open and active EZ LADDER Toolkit ladder diagram project only For each new project you must repeat the hardware target selection and configuration pro cess Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 35 Chapter 4 Configuring Targets Viewing Target Information EZ LADDER Toolkit provides includes a built in quick reference tool to identify what I O Analog and func tions are sup
357. rt By default Ethernet ports are not enabled or configured on P Series hardware targets The Ethernet port must be installed and configured using the Project Bootloader Menu The first step is to open an existing program or create a new program a simple one rung program This program is required to switch EZ LADDER Toolkit from the EDIT mode to the RUN mode which is required for using the Bootloader Menu option Make sure the serial port is configured correctly in the Project Set tings menu Refer to Chapter 4 Configuring Targets and Chapter 5 Creating Ladder Diagram Proj ects Q The Bootloader Menu option is only available when EZ LADDER Tookit is in the RUN mode Open or create the ladder diagram project and configure the serial port using the Project Settings menu Click the monitor MON button located on the toolbar EZ LADDER will switch from the EDIT mode to the RUN mode The toolbars will change appropriately In the RUN mode select the Project menu and the select Bootloader EZ LADDER will now attemp to con nect to the hardware target and initialize it s bootloader During this time you may see a small status window If the Bootloader does not respond or an error is encountered check the serial port settings and cables Q The bootloader is a factory installed utility program on all PLC on a Chip hardware targets This utilility is used for configuring options on the target and to update or install target software k
358. rted functions are automtically installed while others must be manually installed VB 2000 Features Retentive Memory FRAM 480 bytes 12 Digital Inputs Sink Source DC 8 PWM On Off Digital Outputs DC 3 High Speed Counter Timer Inputs NPN PNP SD Card Support 7 Analog Inputs Range Type Field Adjustable 1 Analog Output Range type Field Adjustable 2 Serial Ports RS232 RS485 1 CAN Port Supported Function Blocks Less Than lt Less Than Equal To lt Not Equal To lt gt Equal To Greater Than gt Greater Than Equal To gt Absolute Value ABS Arc Cosine ACOS Addition ADD Arc Sine ASIN Arc Tangent ATAN Bitwise AND AND Average AVG Bit Pack BIT_PACK Bit Unpack BIT _UNPACKk Convert to Boolean BOOLEAN Compare CMP Cosine COS Count Down CTD Count Up CTU Count Up Down CTUD Division DIV Drum Sequencer DRUM_SEQ EEprom Read EEPROM_READ EEprom Write EEPROM_ Write Exponential EXP Power Function EXPT Falling Edge Detect E TRIG Floor FLOOR Hysteresis HYSTER Convert to Integer INTEGER J1939 Receive PGN J1939_RX_PGN J1939 Transmit PGN J1939_ TX_PGN Jump JMP Keypad EEPROM Storage 4000 bytes Modbus Master Slave OptiCAN Networking J1939 NMEA 2000 Networking VBDSP X Display Port Keypad Port Din Rail Mount EXP Plug in Expansion Port Keypad2 Label Latching Coil LATCH LCD Print LCD Clear Limit
359. ruption provided the actual target supports the retentive feature The same check box is present when creating a new variable Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 12 Chapter 7 Retentive Variables amp EEPROM Memory Retentive Variable Memory Limitations While retentive variables and functionality can be a useful tool when creating ladder diagram projects There are limitations to when retentive variable usage As was discussed previously retentive variables are stored in non volatile memory memory that retains data without power and that retentive variable functionality is target dependent The actual target must have non volatile memory capability and the capability to detect a loss of power before power drops below the op erating range for the target In other words the target must be able to sense the loss of power early enough to provide the time needed to write the retentive variables to the non volatile memory while the target s input power is still sufficient for proper operation This functionality is programmed at the factory level and cannot be altered in the ladder diagram project l If designing a P13 Series PLC on a Chip based custom product using the PLC on a Chip H Integrated Circuit or Module this functionality is based on the use of the active low LOW_VOLT_ SENSE pin input Integrated Circuit Pin 130 This pin must be connected to a circuit that can detect the loss of power early en
360. s inductance i 1 Assumes a short of 16V to V CAN_H 3 The cable shield should be grounded near the middle of the network cable run The shield should only be connected to ground and one point on the network Multiple ground points could cause a ground loop decrease noise immunity and adversely affect network performance 4 If wiring as a network bus with stub connections the maximum stub length from bus to node is 1 Meter See Figure 14 2 for a sample connection diagram Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 127 Chapter 14 CAN Networking TWISTED PAIR SHIELDED CABLE TWISTED PAIR SHIELDED CABLE Figure 14 2 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual SHIELD SHOULD BE GROUNDED AT CABLE MIDPOINT OptiCAN Device2 OptiCAN Device 1 OptiCAN Device 3 MAXIMUM LENGTH DEPENDENT ON BUS LOADING amp CABLE 120 OHM RESISTOR MUST BE INSTALLED OptiCAN Device 4 120 OHM 120 OHM CH RESISTOR RESISTOR V O O O EGND EGND OptiCAN Device 1 AT EACH TERMINATING END OF CABLE CABLE MIDPOINT GROUND SHIELD H Ve we EGND EGND OptiCAN OptiCAN Device2 Device 3 OptiCAN Device 4 128 Chapter 14 CAN Networking OptiCAN Specifications Bandwidth 250 KBits Sec Maximum Cable Length Up to 270 Meters Maximum Number of Nodes Up to 254 Nodes Registers per Node 256 Registers Dep
361. s The ADD function block placement requires connections of at least three input pins EN P1 P P2 and two output pins Q O The number of inputs is specified when the function is in serted The EN is always considered an input in the total number of inputs therefore always add one to the number of Px inputs that need to be used Oox ee BR SE Oox E E Caner rr Number of inputs is dynamic Example Circuit Related Functions SUB MULT DIV Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 241 Chapter 24 Function Reference AND AND Description EN Q The AND functions provides a bitwise AND function of the P1 and P2 inputs The enable EN must be true for the AND function to be enabled The Q output is true when the AND function is enabled Input Output Connections P O0 The AND function block placement requires connections of three input pins EN P1 P2 and two output pins Q O P eps type integer Real Boolean Timer ActiveState Other Deras en mt X Cater er mt x o Pz f mwe y xx EE E ee 2 Jowi f o x S e owi j x S S S O Example Circuit CR Related Functions OR NOT XOR Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 242 Chapter 24 Function Reference Description EN The ASIN function provides an Arcsine O from the input value P1 The enable EN must be true for the ASIN function to be enab
362. s in the EZ LADDER Toolkit Chapter Contents Understanding Targets cccccsscsssscessseseeeseeeeeeeseeeeeeseeeeneeseneseseeenseeneenenans 32 The Project Settings WINdOW cccccsceeessseeeesseeeseeneeseesneeeeeneseeeneeseaeees 32 Target Tab EE dl e CC 33 Version Faart 34 Options Tab En dite E 35 Selecting the Hardware TarGet cccssseccssseesssseeseeseeseeeneseeeneeeeseeeseaees 35 Viewing Target Information ccccccsseeeeeeeeeeeeeeeeseneeeeeneeeeasnesseeneeseneeses 36 Updating Installing Target Kernels cccccsesseeesseeeeeeseeeseseeeseeeeenes 37 Recovering COMMUNICATIONS ccccsseceeeeeeeeeeeeeeeneeseeeeenseneeesaeneeseeneenes 38 When Unable to Connect to the Target c sceesesseeeseeseeseeneeneeneenes 38 TAR GC ld 40 When Able to Connect to the Target ccccsssseeeseseeeseeeeeseeneeseeneenes 40 Bootloader Target Options amp Configurations cccceseeeeeeeeeeeeenenees 41 Installing Target Devices Features ccsscccseseeeessseeeseeneeseeseeseeeesenes 42 SCUD GPIO EE 43 Adding Devices E 44 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual Chapter 4 Configuring Targets Understanding Targets A Target is the term used in the EZ LADDER Toolkit to describe the actual electronic hardware controller or Programmable Logic Controller PLC to which the ladder diagram is specifically written to operate on Generally m
363. s Corporation P Series EZ LADDER Toolkit User Manual 349 Chapter 24 Function Reference UNLATCH COIL UNLATCH COIL Description UH The UNLATCH coil is for use with the LATCH coil operates similar to the DIRECT COIL The UNLATCH coil will clear it s latched counterpart LATCH coil with same name This will cause the LATCH coil to de energize LATCH and UNLATCH coils work as pairs Any bool ean variable can be used as a LATCH UNLATCH coil Example Circuit CRe CRI L CRI Related Functions LATCH DIRECT COIL INVERTED COIL Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 350 Chapter 24 Function Reference XOR XOR Description EN Q The XOR functions provides a bitwise exclusive OR function of the P1 and P2 inputs The enable EN must be true for the XOR function to be enabled The Q output is true when the XOR function is enabled P1 0 Input Output Connections The XOR function block placement requires connections of 3 input pins EN P1 P2 and D two output pins Q O UO Pin Active State Other Details Px Aveta S a ES ES SSES ES ES SSES ES ES E ES Example Circuit Related Functions OR AND NOT RSC RS Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 351 CHAPTER 25 Password Protection This chapter provides information on securing ladder diagram projects and targets using EZ LADDER Toolkit native password protection
364. s are provided for the Position Counter compare These are listed as CMPO CMP1 and CMP2 in the drop down menu in the dialog When a CMP x is selected the value con nected to the P1 input is compared to the Position Counter and the Q is true if these values are equal As three compare registers are provided using three different instances of this function block with different CMPXx selected will provide three individual compares that may be made to the Position Counter Three hardware compare registers are provided for the Index Counter compare These are listed as IDXO IDX1 and IDX2 in the drop down menu in the dialog When a IDXx is selected the value connected to the P1 input is compared to the Index Counter and the Q is true if these values are equal As three compare registers are provided using three different instances of this function block with different IDXx selected will provide three individual compares that may be made to the Index Counter Additionally these two features Position Counter Compare and Index Counter Compare may be combined by this function block The combination requires the postion counter and index counter each equal their respective Px inputs to the function block These items are listed as CMP_IDX0 CMP_IDX1 CMP_IDX2 When using the CMP_IDXx item the P1 input is the compare value for the Position Counter and the P2 in put is the compare value for the Index Counter The Q Output is true when both the Position Co
365. s with due authority to settle any such Dispute If such representatives are unable to resolve such Dispute within twenty 20 business days after commencing mediation then each party may pursue whatever further recourse it deems necessary to protect its rights under this Agreement Licensee agrees that any violation of this Agreement related to the Licensed Software or Confidential Information specifically including Divelbiss s proprietary rights therein is likely to result in irreparable injury to Divelbiss Accordingly notwithstanding any other provision of this Agreement to the contrary Licensee agrees that Divelbiss shall be entitled to all appropriate relief from any court of competent jurisdiction whether in the form of injunctive relief and or monetary damages to protect its proprietary rights in the Licensed Software and Confidential Information and Support In consideration of the payment of annual maintenance and support fees by or on behalf of Licensee payable for the first year with the license fee and thereafter annually at least thirty 30 days before the anniversary date of this Agreement Divelbiss will provide maintenance and support of the EZ LADDER Toolkit in the form of i such periodic corrections updates and revisions to the EZ LADDER Toolkit as Divelbiss in its sole discretion may from time to time elect to release and ii responses to inquiries submitted by Licensee by email to Divelbiss at sales divelbiss
366. saeeseneeesaeessanes 367 Structured Text Function Blocks cccscceeseeeeseeeeeeeeeaeeeeeneeeseneeeaneneaaes 367 ST_FUNC Function Function Block c sccccessseeeeeseeeeeneeeeeneeseanees 368 St FUNC BER Function Block icici cccciccesevcusscced evecsceceastevernevstdeuenezasteies 368 Target Specific ST Functions cccccesceeeeeseeeeeeeeeeeeeeseeseeseeeneseneeeeseaeees 369 File DC SCPC eenegen 369 EZ LADDER Structured Text Editor ccccsecsseeeseeseeeeeeseeeaeeeeeeeeeeas 373 PURCTION LISI UE 374 PUG UGE TE 375 KOENEN 375 User Defined Functions amp Function Blocks ccccseeeeeseeeeeeeeeeeeeeees 375 Creating a New User defined Function or Function Block 376 Editing an Existing User defined Function or Function Block 376 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 357 Chapter 26 Structured Text Structured Text Overview Structured Text is a high level textual language which is an IEC61131 3 language Structured Text also called ST is used in EZ LADDER to create custom functions and function blocks Structured Text syntax resembles PASCAL as it is based on it Structured Text is a powerful programming tool to create custom functions and function blocks for items such as serial communication drivers complex mathematical calculations and many more statements commands EZ LADDER specific items and basic syntax and is not a structured text
367. sages are received from the actual node If the Q output is false then the node status is not valid as no messages are received from it When this occurs the VAL output will be set to zero be monitored for a network restart a separate function block is required In addition nodes that are considered critical in overall operation may require multiple uses of the OPTICAN NODESTATUS function block to identify errors and handle them correctly Restarting or stopping based on communication errors is application dependent Keep in mind there will always be some communication errors on any network The amount and type of what is allowable is application dependent l The OPTICAN NODESTATUS function block is node specific meaning that for each node that must ad OptiCAN Node Status Properties Name IOPTICAN_NODESTATUS1 Description Timeout ms 1000 Node ID 5 i Coresi Figure 14 11 Click ox to place the function block in the ladder diagram project Figure 14 12 is a sample of a complete OPTICAN_NODESTATUS circuit The Error variable shown will be equal to the status of the node that was programmed into the function block The error codes are listed earlier in this chapter Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 138 Chapter 14 CAN Networking AN NODEST Node Err Figure 14 12 Using the OptiCAN Configuration Tool Up to this point we have configured controllers on the OptiCAN networ
368. sed on the B input X1 The A and B inputs are used in X1 mode for use with biphase encoders The count value changes once for each biphase cycle X2 The A and B inputs are used in X2 mode for use with biphase encoders The count value changes 2 times X1 mode given the same input signal X4 The A and B inputs are used in X4 mode for use with biphase encoders The count value changes with each input transition 4 times faster than X1 given the same input signal Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 164 Chapter 15 SPI Devices and Support Count Mode Single Cycle Index Mode Free Running When counting pulses the counter will continue to count in either direction and wrap if the count goes larger or smaller than the standard integer 32 bit When counting pulses the counter will stop counting in either direction if the count goes larger or smaller than the standard integer 32 bit A Reset or Load is required to restart counting Range Limit Counting range is limited between zero 0 and the PD DTR input on the CNTR_LS7366R function block The LD function block input must be used to load the DTR one scan cycle Modulo N The counter value will be equal to the value of the input signal divided by the value loaded in DTR plus 1 DTR 1 If DTR is 1 then the count will equal the input signal divided by 2 or will count at 1 2 the rate of the input signal Disable Index T
369. serves as a warning that the two build numbers do not match While this is usually caused by the ladder diagram project being compiled again since it was downloaded it also requires that you must download the new build of the ladder diagram project to view it in real time E Z EZ Ladder Standard junk dld d E x f EZ File Edit View Project Reports Window Help Deh Be ER i ee ea ABDO ine P Status Running Program Name junk Program Version 0 0 0 0 Build Number 2 Scan Time ms lt 1 00 cri Version and Build Number doesn t match crz 3 eos 1 Build Number 2 DIY CR2 Figure 6 5 Connecting for the First Time to a New Target To connect to a target the target must have a kernel installed As hardware targets are shipped from the factory without kernels the kernel must be loaded prior to being able to connect and download projects When trying to connect to a new target for the first time if it is configured correctly and successful the Boot loader Window automatically is displayed From this window the kernel can be selected and installed on the hardware target Figure 6 6 illustrates the Bootloader window Refer to Chapter 4 Configuring Targets for details on installing and upgrading the hardware target kernel Curent Target Settings Target Seen Bootloader Version 1 1 0 6 Kemel Version 0 00 18 Serial Number 10028594 Upload File Filena
370. sion required for this version of EZ LADDER Toolkit Supported Objects and Functions Analog I O and Digital I O The target information may be printed using the provided PRINT button Basic Components The Basic Components menu item will cause the basic components tool bar to be visible or hidden This tool bar includes buttons for the direct contact inverted contact direct coil inverted coil CTU CTD CTUD TP TON and TOF functions Cross References The Cross References menu item will cause the Cross Reference Window to be visible or hidden Edit Tools The Edit Tools menu item will cause the edit tools tool bar to be visible or hidden This tool bar includes buttons for select horizontal link vertical link Edit Vars Inst Vars Verify Compile C MON and text boxes Abc Function List The Function List menu item will cause the drop down function list to be visible or hidden This tool bar is used to select and insert functions into the ladder diagram project Output The Output menu item will cause the Output Window to be visible or hidden This window displays important messages during the Verify and Compile Operations During the Compile process it is important to have this window visible Information including compile status and errors are displayed here Toolbar The Toolbar menu item will cause the standard windows functions toolbar to be visible or hidden This tool bar includes New Open Save Cut Print and more
371. ss B Cast Rate Access SPN Field Settings Gain 04 Offset 0 Request Type NOT_REQUEST w A Request message will be transmitted every lsec if Request Type is choosen Destination Address SPN 161 Rx Data datal Rx Status dtalsts SPN 522 Rx Data data2 Rx Status dta2sts Receive only addressed to this device Receive addressed to any device Specify Dest Address to Receive 255 The SA is the Source Address output It must be connected to an integer variable This variable will store the Source Address of the last receive which address this PGN was received from The DA is the Destination Address output It must be connected to an integer variable This variable will store the Destination Address of the last receive if the PGN had a specific destination in the broadcast packet If the broadcast was a global broadcast then the DA does not apply Figure 14 27 illustrates a complete J1939_ RX_PGN function block inserted in a ladder diagram program Figure 14 27 939 RX PGI EN Q ER SA eh SrcAdr1 DA DestAdrl Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 153 Chapter 14 CAN Networking SPN Status Mapped Variables The mapped status not data variables for the SPNs of the function block have their own error and status reporting The SPN error status reporting is only valid if the SPN is set as STANDARD or STATE in the J1939 Database The SPN status is 0 Valid
372. ss is promptly notified of any such threats claims or proceedings afforded the opportunity to intervene in any such proceeding and given sole control over the defense of such claim including all negotiations of any prospective settlement or compromise and that Licensee gives all cooperation and assistance requested by Divelbiss in connection with same and provided further that the foregoing obligation of Divelbiss does not apply with respect to any Resulting Products or any hardware software including the Licensed Software or components thereof i not supplied by Divelbiss ii made or modified in whole or in part by Licensee or according to Licensee s specifications iii otherwise modified after delivery iv combined with other hardware software products or processes by Licensee including in creating Resulting Products where such claim could have been avoided absent such combination v insofar as Licensee continues allegedly infringing activity after being notified thereof or informed of steps or modifications that would have avoided the alleged infringement or vi used by Licensee in violation of the terms of this Agreement Licensee will defend indemnify and hold Divelbiss harmless from and against any and all losses liabilities judgments damages and claims against Divelbiss obtained or asserted by any third party including any allegation of infringement or violation of proprietary rights and all related costs including attor
373. sssseesseneeesees 67 Downloading Ladder Diagram Projects to Targets ccsssssessseeeees 68 R al Time E 68 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual Chapter 6 Downloading amp Running Projects Switching Modes in EZ LADDER Toolkit EZ LADDER Toolkit is generally has two modes of operation Up to this point most of the time we have been using the Edit Mode The Edit Mode is used to open and close projects configure targets create lad der diagram projects verify and compile them The Monitor Mode is used to connect to hardware targets download ladder diagram projects monitor their power flow in real time and to work with target utilities Typically switching modes is done often during ladder diagram project development Switching to Monitor Mode To switch to monitor mode on the tool bar click the monitor button Refer to Chapter 2 Navigation EZ LADDER Toolkit for tool bar and buttons EZ LADDER Toolkit will switch from the Edit Mode to the Moni tor Mode While the ladder diagram workspace will appear similar some tool bars and buttons will change adding functionality for features only needed in Monitor Mode Figure 6 1 shows EZ LADDER Toolkit in the Monitor Mode S demm Z EZ Ladder Standard Figure 6 1 dld Se x EZ File Edit View Project Reports Window Help i Boo D SW BE S eat A ABD OO re P Status Running Program Name Figure 6 1 Program Version 0 0 0 0 Build Number
374. sum Eror A cnecksum error occured 8 Cient ul Transpo d transport pointer was detected Figure 13 11 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 115 Chapter 13 Modbus Networking Modbus Slave EZ LADDER Toolkit provides the ability to add Modbus slave functionality to a ladder diagram making the device a Modbus Slave Modbus Slave support is based on actual hardware target specifications PLC on a Chip Integrated Circuits and Modules support Modbus Slave as well as do some standard Divelbiss PLCs and Controllers For PLCs and controllers refer to the supported features See Chapter 23 Hardware Targets Configuring for Modbus Slave Prior to using the Modbus Slave in EZ LADDER Toolkit it must be installed and configured in the target The Modbus Slave is configured using the Project Settings Using the Project Menu choose Settings The Project Settings window will open as previously covered in Chapter 4 Configuring Targets Select the target and click the PRoPeRTIEs button The Target Properties window will open From the drop down menu DCPN select the model part number of the target If the Modbus Slave were installed it would be listed in the Devices pane under the Network section Click the app pevice button The Targets Devices window will open All the available devices and features for the target are shown in the Devices section Scroll down and find the Modbus Slave Figure 13
375. t workspace wherever you click Edit ST Functions Opens the EZ LADDER Toolkits Edit SI Functions Structured Text Function Editor This window is used for configuring structured text items For more information on structured text See Chapter 26 Structured Text Ladder Diagram Workspace The ladder diagram workspace is the area of the screen where objects and links are placed to create the ladder diagram program Most objects can be placed at any location in the workspace provided there is ac tual space available The DIRECT coil Negated coil LATCH coil and UNLATCH coil are the only objects that must be placed in a particular location They must be located in the last column next to the right power rail Any attempt to place one of them in another location will cause an error dialog box to be displayed A ladder diagram is created using rungs Arung is a horizontal line of logic EZ LADDER Toolkit allows the maximum number of rungs to be configured when the target is selected in the Project Settings dialog Fig ure 2 4 shows the ladder diagram workspace and rungs of horizontal logic Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 22 Chapter 2 Navigating EZ LADDER Toolkit 8 EZ EZ Ladder Standard EZ Ladder1 a ji 2 9 E EZ File Edit View Project Reports Window Help I IR Ose Ar S p JMP pej Edit Inst 4 k S Caen vara vars ig C MON Abc db ie H CTU C
376. t Basics Pulse Width Modulation PWM Outputs for P Series targets are easy implement and utilize using the EZ LADDER Toolkit PWM channels are 32 bit resolution and up to 12 channels are available based on the actual hardware target PWM functionality supported types and number of channels is always target dependent While EZ LADDER Toolkit provides the basic programmability the hardware target must support PWM and the selected configuration for the PWM outputs to operate correctly PWM output frequency is dependent upon the actual hardware target and the resolution configured Changing the resolution or hardware target may change the acceptable range of the PWM outputs Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 19 Chapter 8 Pulse Width Modulation Configuring PWM in Project Settings As with most EZ LADDER Toolkit hardware supported features the PWM channels and functionality must installed and configured before it may be used in a ladder diagram project The PWM channels are config ured using the Project Settings Using the Project Menu choose Settings The Project Settings window will open as previously covered in Chapter 4 Configuring Targets Select the target and click the properties button The Target Properties window will open If PWM is already listed in the Devices pane you can select it highlight and click the PRoPERTIEs button to make additional configurations to the PWM If the PWM is not liste
377. t MSB oredered Most Significant Bit 32 bit variables will use multiple registers while 16 bit variables use one The type of variable to read write will be entirely application dependent and slave device dependent on supported types Once the variable has been added or selected and the type is set click ox The Add Variable dialog will close and the variable selected added will now be listed in the Registers Variables pane Repeat the steps to add addtional variables as needed for the application and this function block instance As per indicated the provided buttons allow the re ordering of the variables Figure 13 9 illustrates 3 variables loaded two 16 bit and one 32 bit the types and actual registers that will be read written to are displayed in the list with the variables Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 113 Chapter 13 Modbus Networking a Modbus Master Map Data Function Code Read Holding Registers 3 Ww Read Starting Address Registers Variables Register fad Vaal inset aici Figure 13 9 Click ox to close the Modbus Master Map Data window and click ox to close the Modbus Master Properties dialog One instance of the MOSBUS_MASTER function block is now placed in the ladder program For each variable added memory RAM is used Large numbers of registers variables will reduce the overall memory available for general ladder diagram object and program Care should b
378. t any variables that are in the ladder diagram project but are not actually used in the ladder diagram itself created but not used Contact without Coil This will list all contacts that have been created and are used in the ladder diagram but have no coil used in the ladder diagram Coil without Contact This will list all coils that have been created and are used in the ladder diagram but have no contacts used in the ladder diagram Divelbiss Corporation EZ LADDER Toolkit User Manual 213 Chapter 21 EZ LADDER Toolkit Reports Drum Sequencer Tables This will include all drum sequencer matrix tables on the report Retentive Variables This lists all variables all types that are configured to be retentive Network Address Register This lists the variables and network addresses on the report only variables with network addresses are listed For each option selected in the dialog box the report is generated identifying the rung number type and description for each item Click ok to generate the report A report window will open displaying the generated report Controls are provided to change pages and to print Figure 20 3 represents the report that is viewed or printed Cross References Date 10 26 2012 3 51 PM Filename T Sales Products EZ LADDER Manuals For P Series crossrefernce did Target PLCHIP P13 5122X Divelbiss Corporation PLCHIP PXX Version 0 0 0 0 Build Number 0 INPUT GPIO19 GPIO20 INTER
379. t is output on the status register set if counter wraps negative borrow Flag on CY This check box enable the borrow flag bit that is output on the status register set if counter wraps positive carry Using the LS7366R in the Ladder Diagram Project To gain the functionality of the SPI LS7366R counter integrated circuit you must use the CNTR_LS 7366R function block This function block has multiple inputs and outputs These inputs and outputs can function in different modes based on the configuration of the actual LS7366R in the ladder diagram projects It is important to reference the LS7366R data sheet for operation modes and to understand registers A thorough understanding of the LS7366R is required to properly configure and use the device correctly For details on the use of the CNTR_LS 7366 function block refer to Chapter 24 Function Reference Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 166 Chapter 15 SPI Devices and Support CR ITR_LS 7366 HState CRA Direction CR2 CR3 Figure 15 7 MCP3204 4 Channel 12 Bit Analog to Digital Converter The MCP3204 is a 12 bit 4 channel analog to digital converter integrated circuit with an SPI interface EZ LADDER Toolkit has built in software support for using this device on an SPI port The MCP3204 is a hardware device and requires additional circuitry and knowledge to interface it an l EZ LADDER supported target This chapter discusses the basics of
380. target The l MCP3204 requires additional circuitry to amplifiy and or scale real world analog signals that are a separate from the MCP3204 and EZ LADDER Toolkit Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 169 Chapter 15 SPI Devices and Support Using the MCP3204 in the Ladder Diagram Project The MCP3204 analog input analog to digital converter channel values are always stored and can be ac cessed in the ladder diagram program by the variable names configured in the MCP3204 Properties 2 dialog During the installation process of the MCP3204 the variables should automatically be created as Integers As the MCP3204 is a 12 bit analog to digital converter the actual integer value for each channel will range from 0 to 4095 with O being O or the low end and 4095 being the maximum or high end These variables may be used as inputs to function blocks in the ladder diagram program Figure 15 11 is an example ladder diagram using a variable from the MCP3204 CRI gt CR2 Figure 15 11 ADS8341 4 Channel 16 Bit Analog to Digital Converter The ADS8341 is a 16 bit 4 channel analog to digital converter integrated circuit with an SPI interface EZ LADDER Toolkit has built in software support for using this device on an SPI port The ADS8341 is a hardware device and requires additional circuitry and knowledge to interface it an EZ LADDER supported target This chapter discusses the basics of using the ADS8341 in the
381. target provided by Divelbiss via CD e mail or download 2 Start EZ LADDER Toolkit and open any project that uses the target or create a new project with the actual hardware target selected This project must have at least one rung of ladder Compile the program if not already compiled 3 Verify the Serial Port Settings and connect the target to the computer 4 Enter the Monitor Mode 5 From the Project menu select Bootloader 6 EZ LADDER will connect to the target and the Bootloader dialog will open showing the current version of the target s kernel if any It will also display the targets bootloader version See Figure 4 5 a Bootloader Curent Target Settings Target plas tt Bootloader Version 1 1 0 6 Kemel Version 0 0 0 18 Serial Number 10028594 Upload File Filename Target Kemel Version Figure 4 5 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 3 Chapter 4 Configuring Targets 6 Click the ERASE USER PROGRAM button to erase the ladder diagram project on the target if any Q It is highly recommended that the user program be erased before updgrading a kernel 7 Click BRowsE and select the kernel file for the hardware target The dialog will update showing the selected kernel file version in the Upload File section of the Bootloader dialog box 8 To update or install the new kernel click UPDATE TARGET A Status box will appear indicating the status of the kernel installa
382. tate Left ROL Rotate Right ROR Reset Set Reset Dominant RS Seed Random SEED Select SEL Set Date SETDATE Set Time SETTIME Shift Left SHL Shift Right SHR Sine SIN 232 Chapter 23 Hardware Targets Square Root SQRT Set Reset Set Dominant SR Structured Text Function ST_FUNC Structured Text Function Block ST_FUNC_BLKk Subtraction SUB Tangent TAN Convert to Timer TIMER Time Delay Off TOF Time Delay On TON ICM BB P13 40 Features On Board Real Time Clock Retentive Memory FRAM 480 bytes 8 Digital Inputs Sink Source 120VAC 8 On Off Digital Outputs 120VAC SD Card Support Up to 8 Analog Inputs Range Type Field Adjustable Up to 1 Analog Output Range Field Adjustable 1 CAN Port Ethernet Port Supported Function Blocks Less Than lt Less Than Equal To lt Not Equal To lt gt Equal To Greater Than gt Greater Than Equal To gt Absolute Value ABS Arc Cosine ACOS Addition ADD Arc Sine ASIN Arc Tangent ATAN Bitwise AND AND Average AVG Bit Pack BIT PACK Bit Unpack BIT _UNPACK Convert to Boolean BOOLEAN Compare CMP Cosine COS Count Down CTD Count Up CTU Count Up Down CTUD Division DIV Drum Sequencer DRUM_SEQ EEprom Read EEPROM_READ EEprom Write EEPROM_ Write Exponential EXP Power Function EXPT Falling Edge Detect F_TRIG Floor FLOOR Get Date GETDATE
383. ted for a password enter the Master Password The Password Setup window will be used Refer to Figure 25 3 Passwords may be deleted by highlighting the row in the window click on the row and clicking the REMOVE button Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 356 CHAPTER 26 Structured Text This chapter provides information on using Structured Text in EZ LADDER Toolkit Chapter Contents Structured Text Overview ee eeusieeregeen Gees g eegente Eege eseg 358 Structured Text Technical Support ccccsceceseeeeeeeeeeeeeeeeessaeeeeanessaees 358 Structured Text Introduction secccesccsesccctsessecesieeteexceccdtecenenetsiceseceuasteeseevesises 358 Structured Text Variables ccccccceceseeseeeeseeeeseneseaeeeeeseeeaneeeseeeesaneesanes 359 Matbrengen geeeg 360 Supported Variable Data Types cccccccsceesseeeeeeeeeeeeeeeeeeseneseeneeeeeeees 361 Structured Text Language egeb ee Seege gege geeeEC eg nnnm 361 Arithemtic Operators amp FUNCTIONS cccccsseeeeeeeeeeeeeeeeeeeeeeeaeeeeeneeeees 363 Relational Operators izes cocaine eset cesta vests 364 Logical Operator S iiccccsiaviucceinactwisccsdaweuselewsnosnccesteweutedenaweniiossenousenestuuimiis 365 Bitwise OCT AON S viii cences et cordate sencec men ctseeeates neste aon seetce cucsseeeeneceeeeeereees 365 Bled e E 365 Standard FUNCIONS E 365 Constructs amp Statements cee cccecce eee ee eee eeeeeeeeaeeeeee
384. ted with the collection of an overdue balance including costs and fees of collection and attorney s fees shall be paid by Licensee Overdue balances are subject to a monthly finance charge equal to the greater of 1 5 or the maximum interest rate permitted by law times the unpaid balance 4 Reporting a Upon request of Divelbiss Licensee will provide a written report each quarter showing the number of Resulting Products produced distributed or sold by Licensee during the previous calendar quarter the parties identified by name address etc to which they were distributed or sold and the revenue received therefor b Divelbiss shall be entitled to commission or to conduct an audit of Licensee s books and records twice per year in order to verify the accuracy of reports regarding resulting Products made by Licensee to Divelbiss Such audit shall be conducted during regular business hours at Licensee s facilities and Licensee shall cooperate fully with in connection with such audit making all facilities records and personnel available upon request by Divelbiss or its representative 5 Divelbiss Warranties a b Divelbiss represents and warrants that i it is the owner of the Licensed Software and ii this Agreement violates no previous agreement between Divelbiss and any third party Divelbiss further warrants that for a period of 90 days from the date this Agreement is accepted by Licensee the EZ LADDER Toolkit will
385. temal Quadrature Encoder Interface Pulse Width Modulator SD Card Vanable Names Name Figure 13 1 al Add Interface Interface UARTI k Response Timeout ms 1000 Wart Properties RTU ASCII Figure 13 2 Click ok to close the Add Interface dialog and click ok to close the Modbus Master Properties dialog and return to the Target Properties window The Modbus Master is now listed in the Devices pane under the Net work Section See Figure 13 3 The Modbus Master Properties dialog and Add Interface dialogs may also be used to adjust settings and change the actual hardware interface by selecting the Modbus Master in the Devices pane and clicking the Properties button Click ok to close the Target Properties window and click ok to close the Project Settings window Be sure to save the ladder diagram project The Modbus Master is now ready to be used in the ladder diagram Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 109 Chapter 13 Modbus Networking a PLCHIP PXX Target Properties DCPN PLCHIP P13 5122x z L PLCHIP P ge 2 Network S Modbus Master Figure 13 3 Using the Modbus Master The Modbus Master for the P Series initiates communications to modbus slave s by using the MOD BUS_MASTER function block This section is provided as a base for how to use the Modbus Master on the network not as a modbus tutorial Previous knowledge of Modbus would ease the integ
386. ter triggers on a false to true transition on the CU input R Input Output Connections The CTU function block placement requires connections of three input pins CU R PV and two output pins Q CV eps type Integer Real Boolean Timer Active Stato Other Detais ei mt x sing oe Rk mt x if Cw me RSC ES CHECK RR RRE SECHS xf i Example Circuit Timing Diagram GU Kal GV Related Functions CTD CTUD Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 262 Chapter 24 Function Reference CTUD CTUD Description The CTUD function is programmable software up and down counter This counter is a com bination of the CTU and CTD therefore it can count up and down based on the count inputs as well as the Reset and Load inputs With reset R not active a true on input CU will increment the current CV count by one while a true on input CD will cause the current count CV to decrement by one When the CV PV the output QU will be true When the CV 0 the output QD will be true A true on the reset R will cause CV 0 QU to go false and QD to go true A true on the load LD will cause CV PV QU to go true and QD to go false The reset R is dominant and takes priority over all inputs The counter inputs trigger on a false to true transition on CU or CD Input Output Connections The CTUD function block placement requires connections of five
387. th ST_FUNC Declaration Description A general variable declaration Used for internal function block declara VAR tions Keeps variable values from call to call Defines variables that are treated as inputs to the function block These VAR_INPUT values are passed into the function block from an external source Defines variables that are treated as outputs to other functions blocks These values are passed to other external items function etc VAR EXTERNAL Used to access variables from the ladder diagram or variables declared X under the Global user declarations VAR_OUTPUT A general variable declaration Used for internal function block declara VAR_TEMP tions Does not keep variable values from call to call Defines variables that are treated as both inputs and outputs to other VAR_IN_OUT functions blocks These values are received from and passed to other external items function etc Figure 26 2 Variable Declarations as Input Output of Callable Function or Function Block For the variable declarations listed in Figure 26 2 additional restrictions apply depending whether the ST code is a function or a function block Figure 26 3 lists the type of actual variables that may be used in a lad der diagram callable function function block when used with VAR_IN VAR_OUT or VAR_IN_OUT declara tions input outputs to function or function block Internal variable declarations are not limited Use
388. the currently installed devices and features for the target Add new devices are added or devices are removed this pane will update accordingly Setup GPIO The setup cpio button is used to add remove General Purpose I O GPIO also known as digital inputs and digital outputs Any digital I O to be used in the ladder diagram program must be installed in the target s de vices To configure the digital I O GPIO click the setup cpio button The targets GPIO window dialog box will open Refer to Figure 4 11 GPIO does not appear in the Devices pane when installed To install digital inputs select GPIO Pins listed by name and actual PLC on a Chip pin that are Q required and click the app To Inputs button These GPIO pins will move from the GPIO Pins pane to the nputs Pane H Inputs were added incorrectly or need to be removed select them in the Inputs pane and click the REMOVE FROM INPUT s button Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 43 Chapter 4 Configuring Targets To install digital outputs select GP O Pins listed by name and actual PLC on a Chip pin that are Q required and click the app To outputs button These GPIO pins will move from the GPIO Pins pane to the Outputs Pane H Outputs were added incorrectly or need to be removed select them in the Outputs pane and click the REMOVE FROM OuTPUT s button When all the GPIO have been installed click the ox button to save the settings and clos
389. tion During this the new kernel is being installed This may take several minutes When updating or installing a kernel DO NOT REMOVE the CABLE or the POWER If Gi interrupted during this process the target will be corrupted and return to a bootloader mode You must repeat all the above steps again the kernel automatically and will display an error if the wrong kernel is selected and an update is attempted If a wrong kernel is somehow loaded contact Divelbiss Technical Support for help regarding removing incorrect kernels l Only the correct target s kernel may be installed into a target The target is checked against Recovering Communications EZ LADDER Toolkit provides additional target utilities that may be used correct actual target problems and restore communication from EZ LADDER to the target Although rare occasionally targets get corrupted and communications cannot be established using normal methods This can be caused by not erasing a lad der diagram prior to upgrading kernels wrong kernels installed and interruptions during kernel installations The bootloader is installed at the factory and can not be updated outside the factory environment When Unable to Connect to the Target The following steps may be taken if you can verify the connection problems is with the actual hardware tar get unit specifically another unit connects with the same setup and program 1 Start EZ LADDER Toolkit and open any project that uses
390. to digital converter channel values are always stored and can be ac cessed in the ladder diagram program by the variable names configured in the ADS8341 Properties 2 dialog During the installation process of the ADS8341 the variables should automatically be created as Integers As the ADS8341 is a 16 bit analog to digital converter the actual integer value for each channel will range from O to 32767 with 0 being O or the low end and 32767 being the maximum or high end These variables may be used as inputs to function blocks in the ladder diagram program Figure 15 15 is an example ladder diagram using a variable from the ADS8341 Figure 15 15 DAC8552 2 Channel 16 Bit Digital to Analog Converter The DAC8552 is a 16 bit 2 channel digital to analog converter integrated circuit with an SPI interface EZ LADDER Toolkit has built in software support for using this device on an SPI port EZ LADDER supported target This chapter discusses the basics of using the DAC8552 in the The DAC8552 is a hardware device and requires additional circuitry and knowledge to interface it an ladder diagram and minor references to hardware when needed DAC8552 SPI support is based on actual hardware targets Refer to the target s User Manual or Chapter 23 Hardware Targets to determine if SPI devices are supported Installing the DAC8552 in the Ladder Diagram Project To be able to use the DAC8552 in an EZ LADDER Toolkit ladder diagram project the DAC
391. to indent variable declarations and subroutines This allows easier reading and scanning of the line of code for debugging purposes Structured Text Variables Structured Text programming requires named variables to be defined Variable names must begin with a letter with the remaining name being any combinations of letters numbers and some symbols such as _ While variable names are not case sensitive the use of case can be helpful for readability Certain variable names are reserved and cannot be used Names of functions function blocks statements and others items are not allowed as variable names Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 359 Chapter 26 Structured Text Examples of invalid variable names would be IF EXP etc If an incorrect variable name is used an error should occur during the code Verify Variable Declarations The variable declaration statements in figure 26 2 may be used to declare variables and name them in a callable structured text function or function block Certain declarations are limited based on the type of call able ST code if function or function block Callable in this instance refers to if the function or function block will be called from the ladder diagram and only applies to the input output variable declara tions ST functions function blocks called from other ST functions function blocks do not have these limitations Use with ST_FUN_ BLK Use wi
392. transmitted as part of the PGN For example PGN 61444 would be Electronic Engine controller 1 When PGN 61444 is received it contains multiple data points and these points are stored in the data based on byte number In EZ LADDER Toolkit these parameters are accessed by their Suspect Parameter Numbers SPNs Installing J1939 in EZ LADDER Toolkit The information contained in this manual regarding J1939 is specifically for the P Series PLC ona Chip based targets only For M Series based targets refer to the M Series EZ LADDER Toolkit Manual Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 144 Chapter 14 CAN Networking When installing the J1939 support in the project many configuration settings and parameters including optional items must be completed It is recommended that you have a complete picture of how you want to implement J1939 and use it J1939 is installed on a per project program basis Once the J1939 settings are configured they are stored in the actual ladder diagram project Actual menus steps to reach the J1939 configuration may vary based on the actual controller used but the configuration itself is always the same Divelbiss standard controllers based on P Series PLC on a Chip HEC P5000 VB 2000 etc are configured based on the part number For details on specific targets please see Chapter 23 Hardware Targets Using the Project Menu choose Settings The Project Settings window will open as pr
393. trolled is 3 or the placeholder for the number 8 in integer form and the variable that is controlling the bit is named Bit3 Therefore if Bit3 is true then bit 3 of the variable Limit would be true changing the value of the variable Limit by its placeholder value in this case 8 Bit Controlling Output SZ ES Variable Boolean Name Name B3 tt Description This controls bt 3of Lt Se postion Name of the Bit Addressable TEEPEE variable and bit number to be CS Var VO Number Limit 3 controlled Format is e Output Default Value C Internal Name BitNumber Retentive Variable Type Output Cancel Figure 5 10 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 60 Chapter 5 Creating Ladder Diagram Projects Reading the bit of a Variable To read the bit of an integer variable identify or create the variable In addition to the variable that will be bit addressable the one you just identified additional variables will be required to read to the bits of the origi nal bit addressable variable one for each bit that you intend to use These additional variables will be boolean input variables representing a boolean 0 or 1 for the actual bit In Figure 5 11 the Add Variable dialog box shows the creation of one of the actual bit reading boolean variables These bit reading variables are always set as Input and the Var I O Number is the variable name of the bit addressable var
394. ts Select the target and click the properties button The Target Properties window will open From the drop down menu DCPN select the model part number of the target If the Modbus Master were installed it would be listed in the Devices pane under the Network section Click the app pevice button The Targets Devices window will open All the available devices and features for the target are shown in the Devices section Scroll down and find the Modbus Master Figure 13 1 shows the Target s Devices window Select the Modbus Master and click ox The Modbus Master Properties dialog will open This dialog is used to specify which hardware interface will be used for this Modbus Network UARTx Ethernet Click the app button The Add Interface dialog will open Using the drop down Interfade menu select the actual hard ware interface to use UART or Ethernet must already be installed prior to this step Enter the Response Timeout in milliseconds and if a UART is used select the Uart Properties as RTU or ASCII based on your needs See Figure 13 2 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 108 Chapter 13 Modbus Networking a PLCHIP PXX Devices Name Description L 3 lac KEYPAD Keypad LoD LCD Display Low Voltage Sense Low Voltage Sense Active Low LS7366R 32 Bit Quadrature Counter SFI Microchip 4 Channel 12Bit A D Converter SPI Modbus Master Modbus Slave Divelbiss OptiCAN Intemal PLCHIP PXX 4K EEProm In
395. two input pins EN P and two output pins Q O eps type integer Real Boolean Timer ActiveState Other Details en me X Cater Ce f ma a S e S o of owe x f ooe Te foe yx o Example Circuit Related Functions OR AND XOR Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 313 Chapter 24 Function Reference NOT EQUAL TO lt gt NOT EQUAL TO Description E The NOT EQUAL TO provides an if greater than or less than comparison for the Px inputs The number of inputs is specified when the object is placed The output Q is true if P1 is not equal to P2 and P2 is not equal to P3 and so on The enable EN must be true for the NOT EQUAL TO function to be enabled P1 Input Output Connections The NOT EQUAL TO function block placement requires connections of at least 3 input pins EN P1 P2 and one output pin Q The EN is always considered an input in the total p number of inputs therefore always add one to the number of Px inputs that need to be used ege Type Integer Real Boolean Timer Active State Other Dorais ren mot TT x Cater er fot xf x Pd dC otras nario ea fom x Example Circuit Yaluel Value Related Functions lt gt gt lt Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 314 Chapter 24 Function Reference OPTICAN NODESTATUS Description The OPTICAN NODESTATUS
396. ty or entities or sells or transfers all or substantially all of its assets or iv Following ninety 90 days written notice of termination to Licensee Licensee may terminate this Agreement and all licenses hereunder in the event that Divelbiss fails to cure any material breach of this Agreement within thirty 30 days after receiving notice of such breach Any fees or expenses payable by Licensee to Divelbiss shall not be reduced or otherwise affected by termination of this Agreement In the event of termination of this Agreement for any reason neither party shall be liable to the other on account of loss of prospective profits or anticipated sales or on account of expenditures inventories investments or commitments Upon termination of this Agreement for any reason Licensee will immediately return to Divelbiss or upon instruction from Divelbiss destroy all copies of the Licensed Software including all code documentation manuals etc and all Confidential Information in its possession and will certify in writing to Divelbiss that it has done so All provisions regarding ownership confidentiality proprietary rights payment of fees and royalties indemnification disclaimers of warranty and limitations of liability will survive termination of this Agreement 13 Assignment and Sublicensing This Agreement the license granted hereunder and the Licensed Software may not be assigned sublicensed or otherwise transferred or conveye
397. ual 112 Chapter 13 Modbus Networking Adding Specifying Variables The buttons in the pane are used to Add Insert Delete Edit and change the order of the variables for the MODBUS_SLAVE function block Add Variable Used to add a new variable to the Registers Variables list Always adds the variable to the end of the currently listed variables Insert Variable When a variable is highlight in the list this button will insert a variable above the current selection Delete Variable Deletes the hightlighted variable in the list Properties Shows the highlighted variable s properties and allows it to be changed Up Moves the hightlighted variable up in the list by one 1 Down Moves the hightlighted variable down in the list by one 1 Click the ADD VARIABLE button to add a new variable to the list The Add Variable dialog will open Click the BROWSE button See Figure 13 8 The Variables window will open Variables can be added or selected here just as was shown in Chapter 5 Creating Ladder Diagrams a Add Variable Varable Name 9 16 Bit 32 Bt LSB Figure 13 8 Add a new variable or select a variable from thelist of variables in the Variables window and click ox This new or selected variable will be transferred to the Add Variable Dialog and the Variables window will close In the Add Variable dialog select the type of variable to write or read 16 bit 32 Bit LSB ordered Least Signifi cant Bit or 32 Bi
398. uctured text user defined functions differ from functionblocks When a function s instance is called it executes and internal variables are used only for that instance and call Variable values are not kept from one execution or scan to another while functionblocks pass their variables from one execution scan to another making them ideal when variables would need to be passed from scan to scan such as a count For a user defined function to be usable as a callable function inserted in the ladder diagram it must mee the following criteria e Return Type must be a BOOL e May only contain input output variable declarations VAR_INPUT VAR_OUTPUT e Variable Input Output types may only be BOOL DINT or REAL Internal variables may be any sup porte type ST FUNC BLK Function Block The ST_FUNC_BLK function block is used to place a ST User Defined functionblock into a ladder diagram When the ST_FUNC_ BLK function block is placed a drop down menu is used to select the functionsblock from the User Defined Functionsblocks created by you in the ST Editor To place a ST FUNC BLK use the drop down function block menu in the toolbar just as any other ladder function function block Select ST FUNC BLK and click to place it in the ladder where it is required Structured text user defined functions differ from functionblocks When a function s instance is called l it executes and internal variables are used only for that instance and cal
399. ues input to the function block as compare values to the actual counts of the position counter and index counter The CNTR_PXX_QEI VEL function block is used to calculate a velocity based on the quadrature counter inputs See Chapter 24 Function Reference for details on specific function blocks Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 200 CHAPTER 19 Ethernet This chapter provides basic information on installing and using Ethernet features Chapter Contents Ethernet between Eeer 202 Installing Ethernet Support cc cceeeeeeeeeeeeeeeeeeeeeeseeeeeeeeaeeeeeeeseaneesaaes 202 Rive PC OTT ATOM DEE 203 Static IP Configuration ssssnnnsennnunnnnnennunnnnnnnnnunnnnnennnnnnnnennnnnnnnnnnnnn nne 204 Ethernet as the Programming Poft cccccscsssseeseeeeeeeseeseeeeseeneeeneeeenees 205 Ethernet Modbus tte 206 Divelbiss Corporation EZ LADDER Toolkit User Manual 201 Chapter 19 Ethernet Ethernet Overview P Series PLC on a Chip targes may support Ethernet connectivity This Ethernet port may be used in two ways as the programming port using EZ LADDER Toolkit and as a communication port using Modbus As this manual is a generic EZ LADDER Toolkit manual for P Series PLC on a Chip target programming Ethernet connectivity is covered To determine if the actual hardware target model supports ethernet refer to Chapter 23 Hardware Targets Installing Ethernet Suppo
400. ues may be stored into this bank The EEPROM bank is organized by per byte and each variable type has a specific number of bytes that it will require Boolean variables fill two bytes while all other variable types fill four bytes of EEPROM The address provides the location where to store the variable or from where to read the data into a vari able from The actual address is the first byte location of the EEPROM memory Each EEPROM address is absolute and is one byte in size To correctly store and read variables of the same or different type they must be mapped based on the starting byte location address and the number of bytes to store or read for the variable type When writing a boolean to address 0O the actual variable will use addresses 0 one byte Should you write an integer variable into address 0 then it would use addresses 0 3 4 bytes A memory map should be created and used to assign variable types and addresses prior to coding to ensure that variable size and types are accounted for You must use the same address for writing and reading a variable for correct operation If the addresses are not the same and or you have overwritten some bytes of where a value is stored the data read will be corrupted Chapter 7 Retentive Variables amp EEPROM Memory Variable 1 Address Boolean 1 Variable 2 Address Integer 4 Variable 3 Address Boolean 1 byte uses location 0 bytes uses location 1 2 3 and 4 byte uses locati
401. unction block with a variable input that will be displayed CR2 LCD_PRINT1 Figure 9 7 The LCD_PRINT function block is rising edge sensitive Therefore it will only display one time as Gi the ENable input goes high The text will appear normally but the variable will not appear to update or change as the ladder diagram is executing To overcome the rising edge issue when displaying variable create TON timer circuit as shown in Q Figure 9 8 and use the timer contact to act as a refresh for the ENable input on the LCD_PRINT function block The refresh timer should be adjusted to your display preferences in Figure 9 8 CR1 will toggle on and off based on the Timer function TON giving the result of the LCD_PRINT seeing a rising edge at that timing rate Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 87 Chapter 9 LCD Display Support CRI TON CRI LCD_PRINTI Figure 9 8 For more detail on all EZ LADDER Toolkit Function Blocks and objects refer to Chapter 24 Function Reference Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 88 CHAPTER 10 Keypad Support This chapter provides basic information to understand how to install configure and use the Keypad feature in the EZ LADDER Toolkit Chapter Contents Keypad Functionally scpiecniecacennccnsnacaunccaenmonansnsnentesmmentennecnpunnssaencsbeawecseteans 90 Configuring the Keypad in the Project SettingS c cccc
402. und on the EZ LADDER Toolkit s CD Case located on back side Click the REGISTER amp GET KEY button The Activation key and other information will be confirmed and if valid a Counter Key Username and Password will be displayed Save the Username and Password as they can be used to download updates to EZ LADDER Toolkit If the information is not valid the registration will fail Activation can fail due to an incorrect Serial Number incorrect CID Code copying the Activation or Counter key incorrectly or if this serial number has been registered more times than allowed per the license agreement typically 2 times Check this information If you are still unable to activate EZ LADDER Toolkit Contact Divelbiss Customer Support 6 Copy Paste or type the Counter Key into the Activation Sele Counter Key form box in the EZ LADDER Toolkit a i i i i Visit hiig Aww diwelbizs com products sothware E Ladderacty ate asp Activation Window Click PROCEED a el e E o aeee epaia Provide the Actvation Kep printed below and your user information and you will be a provided with a Counter Rey Type or copy amp paste the provided Counter 7 A Dialog box will appear verifying that EZ LADDER Ada Der cles ies has successfully been activated Activation Key Counter Rey Cancel Proceed Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 12 Chapter 1 Getting Started Installing Additional Copies of EZ
403. unter equals the P1 input and the Index Counter equals the P2 input As three compare registers are provided using three different instances of this function block with different CMP_IDXx selected will provide three individual compares that may be made to the both the Position and Index Counters ach EELER Compare Vatu tor naer Counter True when Compare values are vue Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 206 F a E a WE x Chapter 24 Function Reference Example Circuit Dialog Box Wl PichipPrxQei Properties Se Name CNTR_PXX_GEI_CMP1 Related Functions CNTR_PXX_QEI CNTR Pax OEI VEL Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 20 Chapter 24 Function Reference CNTR_PXX_QEl VEL CNTR_PXX_QEI VEL Description EN Q The CNTR_PXX_QEI VEL function block is used to convert quadrature input counts into a velocity based on engineering units When the function block is placed a dialog box is automatically displayed See next page The Sample Period in seconds and the Pulses per Revolution is set using the YC dialog box The quadrature encoder must be installed in the Project Settings before this function block may be placed Other parameter configurations must be Y completed during this installation Refer to Chapter 18 Counters amp Timers The enable EN input must be true for the CNTR_PXX_QEI_VEL function block to operate The function block c
404. unter input RC will reset the internal position counter when true The reset index counter input RI will reset the internal index counter when true The direction output DR identifies the direction of encoder travel 0 or 1 The status output ST identifies the current status of the encoder The position counter value output CT will be equal to the current encoder position The index counter value output IX will be equal to the current index counter number of time the encoder has passed its maximum position IX is incremented and decremented as needed when the current encoder position either passes Its maximum position or its minimum position block may be placed Other parameter configurations must be completed during this The quadrature encoder must be installed in the Project Settings before this function V installation Refer to Chapter 18 Counters amp Timers Based on the qudarature encoder input configuration in the Project Settings menu as the encoder moves in the forward direction when the position exceeds the maximum value the index counter is incremented and the position is set to zero As the encoder moves in a reverse direction when the position reaches O the index counter is decremented and the position is set to the maximum en ype Integer Real Boolean Timer Active State Other Demis en mo Txt Te rc mt _ _ Aatve Tue Resets Postion Gone GT CR f ma o o O O l eme Resets nex Cou
405. uration items that are required for the device before it can operate Select the appropriate information for these dialog boxes Additional support is given in later chapters that are specifically written for some devices such as Ethernet etc ad PLCHIP PXX Devices Name Description Analog 1 0 Intemal Analog Lo CANT CAN 1 Ramtron EMAS XX FRAM 12C L 0 L 2 Keypad LCD Display Low Voltage Sense Low Voltage Sense Active Low LS7366R 32 Bit Quadrature Counter SP Microchip 4 Channel 126i A D Converter SPI Modbus Master Modbus Master Modbus Slave Modbus Slave OptiCAN Divelbiss OptiC AN PLCHIP_Pxx_eeprom Intemal PLCHIP PXX 4K EEProm Name ETHER_CRS Figure 4 12 Some device may be required to be installed prior other devices For example before Modbus Slave can be installed ether the Ethernet or a Serial Port UART must be installed prevously as when installing the Modbus Slave the port must be selected This is only an example other situations exist similar to this Other examples may be adding the I2C port before a FM24XXX FRAM etc When PWM Pulse Width Modulator is configured the GPIO pins associated with it are not available as GPIO as they are used as PWM GPIO pins can only be used as either Outputs or PWM not both simulatenously in the same program Figure 4 13 is the Target Properties Window with some devices installed When all the devices required have been configured click ok to save the settings and c
406. uration menus di PLCHIP PXX Devices TI 2 Channel 16 Bit D A Converter SP Ethemet Ramtron FM24XXX FRAM 12C LCD L LC 2 Keypad LCD Display Low Voltage Sense Active Low 32 Bit Quadrature Counter SP Thermocouple SP Figure 15 12 Click ox The ADS8341 Properties dialog will open Ths dialog selects the SPI Port and Chip Select to be used for this ADS8341 device See Figure 15 13 SPI Pot CS Output Input Channels Varables Figure 15 13 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 171 Chapter 15 SPI Devices and Support l Multiple ADS8341 devices may be added to an SPI port provided that each device has a unique chip si select output specified Click the app button An additional ADS8341 Properties window will open Select the SPI port from the drop down menu and select the general purpose output pin GPO that will serve as this device s chip select CS See Figure 15 14 Any chip select pins reserved for structured text will not be visible in the drop down menu With the SPI Port and CS Output selected the Channel enable check boxes are now functional Place a checkmark in the channels that are to be used by clicking in the check box next to CHO to CH3 As a chan nel is enabled an automatic Variable name is shown The variable names are automatically created when a channel is enabled The name can be changed by typing the desired variable nam
407. ure 15 17 a DAC8552 Properties SPI Pot CS Output Input Channels Varables Figure 15 17 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 174 Chapter 15 SPI Devices and Support l Multiple DAC8552 devices may be added to an SPI port provided that each device has a unique chip si select output specified Click the app button An additional DAC8552 Properties window will open Select the SPI port from the drop down menu and select the general purpose output pin GPO that will serve as this device s chip select CS See Figure 15 18 Any chip select pins reserved for structured text will not be visible in the drop down menu With the SPI Port and CS Output selected the Channel enable check boxes are now functional Place a checkmark in the channels that are to be used by clicking in the check box next to CHO to CH1 As a chan nel is enabled an automatic Variable name is shown The variable names are automatically created when a channel is enabled The name can be changed by typing the desired variable name in the Variable Name box for each channel ad DAC8552 Properties pE SFI Properties SPI Port SPIO CS Output GPIO9 M Channels CHO Enabled Vanable Name DA SPIO 95 0 CH1 Enabled Vanable Name DA SFIO 9 1 Figure 15 18 l Refer to the DAC8552 integrated circuit data sheet for details on the DAC8552 and its limitations O The DAC8552 analog output digital to analog converter channel
408. using the MCP3204 in the O i i ladder diagram and minor references to hardware when needed l MCP3204 SPI support is based on actual hardware targets Refer to the target s User O Manual or Chapter 23 Hardware Targets to determine if SPI devices are supported Installing the MCP3204 in the Ladder Diagram Project To be able to use the MCP3204 in an EZ LADDER Toolkit ladder diagram project the MCP3204 must first be installed and configured As the PLC on a Chip is the most commonly used target for the MCP3204 it will be used as an example to install and configure the MCP3204 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 167 Chapter 15 SPI Devices and Support The MCP3204 is configured using the Project Settings Using the Project Menu choose Settings The Project Settings window will open as previously covered in Chapter 4 Configuring Targets Select the target and click the properties button The Target Properties window will open From the drop down menu DCPN select the model part number of the target If an MCP3204 device were installed it would be listed in the Devices pane under the Bus SPI section Click the app pevice button The Target s Devices window will open All the available devices and features for the target are shown in the Devices section Scroll down and find the MCP3204 Figure 15 8 shows the Target s Devices window The SPI port must be installed individually or no SPI ports will s
409. ut the Response Timeout will need to be configured ad Add Interface Interface Ehemet Number of TCP Sockets 7 Figure 13 18 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 7 Chapter 13 Modbus Networking Click ox to close the Add Interface dialog and click ox to close the Modbus Slave Properties dialog and return to the Target Properties window The Modbus Slave is now listed in the Devices pane under the Net work Section The Modbus Slave Properties dialog and Add Interface dialogs may also be used to adjust settings Q and change the actual hardware interface by selecting the Modbus Slave in the Devices pane and clicking the Properties button Click ox to close the Target Properties window and click ok to close the Project Settings window Be sure to save the ladder diagram project The Modbus Slave TCP over Ethernet is now ready to be used in the lad der diagram The Slave ID is not set in the Modbus Slave Project Settings when using Modbus TCP over Ethernet The slave ID is set using the MODBUS_SET_PROPERTY function block in the ladder diagram project Modbus using Multiple Ports The structure of the EZ LADDER Toolkit and P Series hardware targets allow for modbus to be implemented using multiple ports that include serial ports and ethernet As an example two serial ports may be configured to be Modbus slaves with unique slave ID numbers or one serial port may be configured as a slave and the
410. values are always stored and can be ac cessed in the ladder diagram program by the variable names configured in the DAC8552 Properties 2 dialog When the DAC8552 is configured click ox to close the DAC8552 Properties dialog 2 It is now listed in the DAC8552 Properties dialog 1 Click ok to close the DAC8552 Properites dialog 1 Click ox to close the Target Properties window and click ox to close the Project Settings window Be sure to save the ladder diagram project The DAC8552 port is now installed and ready to be used in the ladder diagram This installation is to configure the DAC8552 as a device in EZ LADDER Toolkit and the target The l DAC8552 requires additional circuitry to amplifiy and or scale real world analog signals that are separate from the DAC8552 and EZ LADDER Toolkit Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 175 Chapter 15 SPI Devices and Support Using the DAC8552 in the Ladder Diagram Project The DAC8552 analog output digital to analog converter channel values are always stored and can be ac cessed in the ladder diagram program by the variable names configured in the DAC8552 Properties 2 dialog During the installation process of the DAC8552 the variables should automatically be created as Integers As the DAC8552 is a 16 bit digital to analog converter the actual integer value for each channel will range from 0 to 65535 with 0 being O or the low end and 65535 being the maxi
411. vanuubarvendnetead caatniarensonuaddiadusneetesons 160 JE Elle an SPI TT 160 Installing Supported SPI Bus DeVICES cccsecceeeeeeseeeeeeeeeeeeeeeaeeneaes 162 LS7366R 32 Bit Quadrature Counter cccceeeeeeeeeeeeeeeeeeeeeeeesseeneseeees 162 MCP3204 4 Channel 12 Bit Analog to Digital Converter 167 ADS8341 4 Channel 16 Bit Analog to Digital Converter 170 DAC8552 2 Channel 16 Bit Digital to Analog Converter 173 MAX31855 Single Channel Thermocouple Input cceeseeeee 176 Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 159 Chapter 15 SPI Devices and Support SPI Bus Devices EZ LADDER Toolkit provides built in support for the use of several SPI devices These supported devices are easily integrated with PLC on a Chip and used via EZ LADDER Toolkit variables and function blocks Generally these devices are installed and configured using the Project Settings and are not supported on all targets These devices may be factory implemented on other hardware targets Installing an SPI Bus Before any of the above listed supported SPI devices may be installed in EZ LADDER Toolkit an SPI bus must be installed SPI Port availability is based on actual hardware targets Refer to the target s User Manual or Chapter 23 Hardware Targets to determine if SPI Ports are supported SPI devices must be connected to the P Series PLC on a Chi
412. variable connected to the PD input When using LC and LD LC has a higher priority and will execute first before LD Load Counter input Boolean When true the value of PC is loaded into the DTR register and then the DTR register is copied to the actual count When using LC and LD LC has a higher priority and will execute first before LD Value Integer to be loaded into DIR when LD input is true Value Integer to be loaded into DTR and then actual count when LC is true Function Block Outputs CE DR ST CT Output Boolean is true when the function block is enabled and no errors are present Direction output Boolean Identifies the current count direction 0 or 1 Status output Integer The output provides a numeric represtation of the status of the LS7366R current function Consult factory if more information is required Current Count Integer Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 203 Chapter 24 Function Reference CNTR_PXX_QEl CNTR _PXX_ QEI Description The CNTR_PXX_QEI function block is used to read the current position of a quadrature en coder connected to the quadrature encoder inputs For more details on how the quadrature counter inputs and function blocks operate together see Chapter 18 Counters amp Timers The enable EN input must be true for the CNTR_PXX_QEl function block to operate The Q output is true when the function block is enabled The reset position co
413. variable type that writes to the EEPROM location should be used to read the EEPROM location A memory map is recommended for organizing variables stored in EEPROM Writing to EEPROM is a relatively slow operation and this must be considered when cre ating the ladder diagram project as scan time can be affected during a write EEPROM storage area has a limited number of write cycles therefore it shouldn t be used to store data which changes often and must be re written often Writing often to the same location can cause the location to fail Input Output Connections The EEPROM WRITE function block placement requires connections of three input pins EN AD V and one output pin Q w s type Integer Real Boolean Timer ActiveState Other Dotais en ime x Rising ese a mt x ve CdS SCHERER Each EEPROM address is absolute and is one byte in size Boolean variables fill two bytes while all other variable types fill four bytes of EEPROM When writing a boolean to address 0 the actual variable will use addresses 0 and 1 two bytes Should you write an integer variable into address 0 then it would use ad dresses 0 3 Amemory map should be created and used to assign variable types and addresses prior to coding to ensure that variable size and types are accounted for Variable 1 Address Boolean 2 Variable 2 Address Integer 4 Variable 3 Address Boolean 2 bytes uses location 0 and 1 bytes uses lo
414. w the CAN port drop down is a pane with a list of PGNs PGNs in the configured database By selecting a PGN the SPN pane below populates with the supported SPNs for the highlighted PGN As differ ent PGNs are selected highlighted in the PGN pane the PGN settings to the right change as do the SPN pane Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 154 Chapter 14 CAN Networking Select the PGN to transmit data as The SPN pane will update Select the desired SPN in the SPN pane The SPN Field setting will update with information based on the J1939 User database The Destination Address area determines the type of J1939 broadcast If set to 255 then the broadcast is global and will not have a specific destination address If the Destination Address is set to a specific number then the broadcast is sent with a that specific destination address Destination address may not be settable to a specific address Specific address or global is also dependent upon the PGN SPN selected and the database settings The PGN Settings are based on the settings from the J1939 User database These values may be adjusted for this instance of the function block The adjustable values include the Priority and Broadcast Rate Addi tionally checkboxes are provided for NMEA 2000 optional settings PGN Access Priority Access and B Cast Rate Access Refer to the NMEA 2000 specification for details on these configuration items The Priority and
415. will reset to zero and begin again Care should be taken to not allow this to occur in the ladder diagram Divelbiss Corporation P Series EZ LADDER Toolkit User Manual 196 Chapter 18 Timers amp Counters Quadrature Counter Inputs In addition to timer counter capture inputs P Series targets may support quadrature counter inputs These inputs are ideal for connecting encoders for motion control As this manual is a generic EZ LADDER Toolkit manual for P Series PLC on a Chip target programming the Quadrature Counter inputs are covered To determine if the actual hardware target model supports these inputs refer to Chapter 23 Hardware Targets The qudrature counter consists of three inputs QEI_PHA Phase A QEI_PHB Phase B and QEI_IDX Index Pulses on these inputs cause internal hardware counters to count up down or reset The internal hardware counters consist of the Position counter which holds the actual count of the input de vice connected to the A and B inputs and the Index Counter which hold the number of times the counter has passed the maximum allowed position wrapped back to zero Installing Quadrature Counter Inputs Prior to using the quadrature counter function block s the actual quadrature input s must be installed in EZ LADDER Toolkit and configured for the operational mode desired The examples shown are for the P Series PLC on a Chip Other targets will operate and configure similarly Select the
416. x matches the program name already installed on the hardware target the hardware target s installed kernel version is new enough to support the version the ladder program was compiled with and the ladder diagrams version and build numbers are different This allows a program either newer or older to be installed updated from the SD Card if the conditions set here are met Additionally if there is no ladder diagram installed on the target blank and there is only one hex compiled ladder diagram file in the SD card s update directory and the installed target s kernel matches what is expected in the compile ladder diagram file hex and the kernel is new enough to support the ladder diagram file hex then the hex file ladder diagram will in installed on the target Kernel and ladder diagram updates are performed only on power up of the hardware target after the SD Card has been installed To install an update install the pre loaded SD Card into the targets SD Card socket and cycle power If the above conditions are met the file s will be udpated on the target The SD Card may be removed after the update Divelbiss Corporation EZ LADDER Toolkit User Manual 210 CHAPTER 21 EZ LADDER Toolkit Reports This chapter provides basic information to understand how to create and use EZ LADDER Toolkit project reports Chapter Contents EZ LADDER Toolkit Reports ccccccsseeseeeeeeeceeeeeneeeeeeeeseseneeeeeseeneee

Download Pdf Manuals

image

Related Search

Related Contents

Guía rápida de referencia Power Series  Fujitsu PRIMERGY RX300 S2  この「参加のご案内」 - 第5回草加松原太鼓橋ロードレース大会  Comment lire LE TRAIT d`UNION  Acer 3670 Laptop User Manual  INTEX® MANUEL D`UTILISATION BATEAU GONFLABLE  View/Open - Savoirs UdeS Home  Purdy 140900230 Installation Guide  DDL-8700 取扱説明書 (日本語)    

Copyright © All rights reserved.
Failed to retrieve file