PASSWORD (Creating a program in the PLC and touchscreen) This sample program provides a step by step process on how to create a password to protect a screen. It involves creating a program in the touchscreen and Microsmart PLC. The following items are used in this example: Parts: Keypad, Numerical Input D0 = (Address/Device) Storage for the data entered using the keypad M0 = (Address/ Device) Triggered device when the comparison condition is true 1234 = The password Simply create a Keypad with Numerical Input to enter the password. The password will be stored in a Data Register (D0). The PLC will compare the value entered in D0 with the password and if the password is correct, then a bit (M0) is triggered. The Goto Screen Command allows to switch base screen if the bit assigned (M0) switches state. WindO/I-NV2 Software 1. Select the Keypad and drop it on the base screen. 2. Select Numerical Input and drop it on the base screen. 3. Double click on the Numerical Input to configure the properties: a) The keypad type is: Current (location of the keypad is on the current screen (base screen)). b) Display type: Decimal (Data from the PLC are in Decimal format) c) Data type: Bin16+ (Data range from 0-65535), Digits: 5 d) Destination Device: D 0 (Data entered will be stored in a Data Register, D0) e) Select the Advanced button (located at the bottom) and check the Always Entry Mode (enabled for entry at all times). f) Click on the OK button to close the dialog box. 4. Select the Goto Screen Command (located far right) and drop it on the base screen. 5. Configure the Properties of the Goto Screen Command <by double clicking on the part>. a) Under General tab, the Action Mode is Switch Base Screen b) In Goto Screen No. , the number is 2 (the screen will switch to base screen 2 when the comparison condition is true). c) Select the Trigger Condition tab. For Trigger type select: Rising Edge Device select: M0 Click the OK button to close the properties. Note: When device MO is at Rising Edge, the base screen will switch to base screen #2. 6. Create Base Screen #2 (as per Action mode in General tab of Goto Screen Command) * Make sure you create a Goto Screen button to return to the previous or next base screen. 7. Download the project to the touchscreen by select Online-Download. WindLDR Software (For Idec PLCs) In this program, two rungs of ladder logic will be created. The first rung will execute the Compare instruction. It will compare the value entered in Data Register (D0) using the keypad from the touchscreen and when the value is equal to the password value (i.e. 1234), then a bit (M0) is triggered. The second rung will clear the Data Register to zero so it will clear the condition and stop the coil from turning on. 1. In WindLDR, select Normally Open contact ( ) and label it M8125 (always on). 2. Select Compare Instruction ( ) and choose Compare Equal To (CMP=). a) Source 1 (S1) = D0 ----- > Data from the keypad (touchscreen) are stored in D0. b) Source 2 (S2) = 1234 ----- > password c) Destination (D1) = M0 ----- > When the value in D0 is equal to 1234, then M0 is triggered (Reference from the Goto Screen Command in the touchscreen program) d) Click the OK button to close the dialog box. 3. The complete rung: 4. On the next rung: Once the Compare condition is true, then you’ll need time to clear the condition by moving a value of “0” into the Data Register. The Timer will be added to give a little extra time to react to the true condition, triggering the M0 bit (which will trigger the switch base screen on display) and then moving a value of zero to the Data Register. a) Select Normally Open contact ( ) and label it M0. b) Select a Timer ( ). The Allocation Number is “T0” and Preset value is “2”. The reason for the Timer c) Click on the OK button to continue. d) Lastly, select the MOV instruction ( ). The value in Source 1 (S1) is “0” and Destination 1 is “D0”. Click the OK button to close the dialog box. 5. The complete program: 6. Select Online and then Download Program to the PLC. 7. Make sure the HG and the PLC are connected. Then you may now test the program by entering a password in the touchscreen.
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project