CAI Networks WebControl PLC User manual - 1 Introduction

Manual is about: Programmable Logic Controller

Summary of WebControl PLC

  • Page 1

    Webcontrol tm programmable logic controller user guide version: 3.2.17f hardware version: 2.2.2 firmware version: 3.02.17f5 firmware datastamp: 10/15/2013 doc last modified: 11/1/2013.

  • Page 2: Table of Contents

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008-2013 cai networks, inc. I table of contents 1 introduction .......................................................................................................... 1 1.1 scope .............................................................

  • Page 3

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008-2013 cai networks, inc. Ii 6.4.3 example 3: push button input control output ..................................... 32 6.4.4 example 4: send email ..................................................................... 32 6.4.5 example 5, ...

  • Page 4: Table of Figures

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008-2013 cai networks, inc. Iii table of figures figure 1.0 webcontrol tm pcb inputs and outputs diagram ........................................ 2 figure 2.0 webcontrol tm sensor connections ...................................................

  • Page 5: 1 Introduction

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2011 cai networks, inc. 1 1 introduction this document provides an overview of the technical aspects of using webcontrol tm plc. It describes the inputs and outputs offered by the plc version of the webcontrol tm hardware and firmware....

  • Page 6: 2 Webcontrol

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2011 cai networks, inc. 2 2 webcontrol tm i/o the current hardware version of webcontrol tm is equipped with a number of inputs and outputs; these are shown in below in figure 1.0. Figure 1.0 webcontrol tm pcb inputs and outputs diagra...

  • Page 7

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2011 cai networks, inc. 3 load. Ttl output current is capable to drive standard solid state relay, but will not be able to drive those coil based relays. Be aware of the current requirements of the circuits/loads attached to these outp...

  • Page 8: 3 Webcontrol

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 5 3 webcontrol tm plc web gui configuration to access webcontrol tm plc, connect webcontrol tm to the local network and power supply. The default ip address will be 192.168.1.15. Be aware that once you enable dh...

  • Page 9

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 6 network in order to configure it correctly. Figure 4.0 shows the network settings webcontrol tm has. Figure 4.0 webcontrol tm plc network configurable 3.1.1 ntp server settings this version changed from previo...

  • Page 10

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 7 access the webcontrol tm board over the network. Please note that if any entry is 0.0.0.0, all ip addresses can access it..

  • Page 11

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 8 3.2 i/o setup webcontrol tm plc allows users to directly from browser control each output, or through the plc logic to control the ttl output. For flexibility, user can decide if the ttl input or out to be inv...

  • Page 12

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 9 counter enable /frequency measurement enable/ttl input enable are radio buttons that you can only select one of them. Those functions sharing the same ttl1 input. Please note the counter is triggered at rising...

  • Page 13

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 10 3.3 x10 rf control figure 6.0 webcontrol tm x10rf control webcontrol uses ttl7 and ttl8 to control x10rf devices. User must already enabled x10rf function in the i/o setup screen. An external rf transmitter m...

  • Page 14

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 11 3.4 output control figure 6.0 webcontrol tm output control when click on each ttl output on or off, the current state of the ttl output will change. However, the display may or may not update depending on the...

  • Page 15

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 12 3.5 notification setup webcontrol tm allows up to 8 different email notifications to be send from the plc program. Please note the port can be any number, but webcontrol current hardware cannot support ssl en...

  • Page 16

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 13 webset url2 var1 please note webset has sending queue of four. If there are webset requests coming more than the queue can hold, the older requests will get lost. In addition, if the remote webcontrol or serv...

  • Page 17

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 14 most email notification problems are either the configuration problem or the smtp host rejected email. In this version plc firmware, user can send a test email to see if the email notification working or not....

  • Page 18

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 15 3.6 general setup when webcontrol tm is connected to the network it will obtain ntp time from internet. User need to set correct time zone on webcontrol tm plc. Figure 8.0 network defaults if the webcontrol c...

  • Page 19

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 16 value. Another way to set their value is to use /api/seturom.Cgi call. Please refer to the faq section for that method. For 1-wire devices on a complex bus configuration, its timing is critical. Time data sam...

  • Page 20: 4 Aux

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 17 4 aux system inputs the system aux inputs of webcontrol tm are used as inputs to the plc engine (see section 5.1). This section describes the connector ladled as j12. Digital and analog inputs come through j1...

  • Page 21

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 18 4.2 analog inputs webcontrol tm has three built-in analog inputs each having an input voltage range of 0 to +10v. When a ds2450 chip is connected to the 1-wire bus, additional analog input aip5,6,7, and 8 are...

  • Page 22

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 19 4.4 honeywell 4000 series relative humidity sensor the webcontrol tm hardware is designed to support one honeywell 4000 series relative humidity sensor. The honeywell sensor output is ‘almost’ linear voltage ...

  • Page 23

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 20 4.6 direct query system inputs and outputs to integrate with other servers, directly query i/o status maybe desirable. Using wget command from other servers or computers, user can directly query each input an...

  • Page 24: 5  Real Time Clock

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 21 5 real time clock webcontrol tm has a build-in clock functions that doing time keeping by using an atomic clock via the simple network timer protocol (sntp). Configuration is required to set the correct time ...

  • Page 25: 6 Webcontrol

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 22 6 webcontrol tm plc programming the webcontrol tm plc firmware can be programmed to execute programmable logic sequences, including comparison and sub routines. This is the major change from the bre(boolean r...

  • Page 26

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 23 the state of the zero bit. Next a branch instruction is used which branches on the state of the zero bit. Tsteq ip1 1 # sets zero bit based on the result of the test instruction bnz label # branches to label ...

  • Page 27

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 24 result. If test evaluates to false then the next instruction is skipped. Tstle a[] b[] (d[]) tests if a is less than or equal to b. Boolean result loaded into optional destination (d). Zero bit updated with r...

  • Page 28

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 25 non-zero. If true then program jumps to label specified in operand b. Bz (a) b same as bnz but tests for zero value. Cnz (a) b same as the branch instruction but calls a subroutine instead of branching. See s...

  • Page 29

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 26.

  • Page 30

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 27 6.3 webcontrol tm plc i/o identifiers the following are the valid i/o identifiers op1 ttl outputs 1...8 valid range 0 - 1 op2 op3 op4 op5 op6 op7 op8 ip1 ttl inputs 1...8 valid range 0 - 1 ip2 when non-blocki...

  • Page 31

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 28 ts5 ts6 ts7 ts8 h1 humidity sensor valid range 0 - 100 em1 email identifiers 1...8 em2 em3 em4 em5 em6 em7 em8 url1 webset these urls 1...8 url2 url3 url4 url5 url6 url7 url8 cd current date mm/dd/yyyy format...

  • Page 32

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 29 ram7 ram8 ram1h 16 bit signed integer general purpose ram 1...8. Delay ram2h operator is not valid on these. Not displayed anywhere ram3h store in the same ram location as ram1-8 higher 16 bits ram4h ram5h ra...

  • Page 33

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 30 ram63 ram73 ram83 ram1b1 1 bit access to purpose ram 1 only. This only availavble ram1b2 for ram1 delay operator is not valid on these. Not displayed … anywhere, store in the same ram1 location ram1b32 urom1 ...

  • Page 34

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 31 end however, this does not work, when temperature reached above 37 degree c, the op1 turned off, instead of reaching to 39 degree c. The problem is the op1 can be set to on or off by the “tsle t3 370 op1” lin...

  • Page 35

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 32 6.4.3 example 3: push button input control output when a push button connected to ttl input 1 being pushed, set the ttl output 3 on. Start tsteq ip1 1 op3 tsteq op3 1 set op3 0 end although this example works...

  • Page 36

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 33 bnz ram2 loop set ram2 1 email em1 goto loop please note in send portion of the code, ram2 is being checked, if it is already 1, it will skip sending email. Only when ram2 == 0, an email will be send. Only wh...

  • Page 37

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 34 ret checkop3: add aip1 aip2 ram1 tstgt ram1 1024 bnz l1 tsteq ip4 1 bnz l2 ret l1: set o3 1 ret l2: set o3 0 ret checkop4: tsteq op1 1 op4 ret please note in this example, we assume the ttl input, analog inpu...

  • Page 38

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 35 and op1 ram1 bz l2 set op2 1 email em1 l3: tsteq op2[1000] 1 bz l3 set op4 1 set op1 0 end please note in this example, we assume the ttl input, analog input and temperature reading are all perfect, no bounci...

  • Page 39

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 36 set op1 1 set op2 0 set op3 0 ret lights_go: set op1 0 set op2 0 set op3 1 ret lights_am: set op1 0 set op2 1 set op3 0 ret stop: callsub lights_am delay 5000 callsub lights_st delay 60000 callsub lights_am s...

  • Page 40

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 37 panel orientation each hour, etc. The “period” subroutine will turn on night light hooked up to op1 after 18:00 hours and turn it off at 5am. The “daily” subroutine will start the water sprinkler at 6:30am fo...

  • Page 41

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 38 ret t2: tstle ch 8 goto 2early set ram4 cmonth tstlt aip3 20 email em2 2early: ret yearly: tsteq cmonth 1 ram2 nop tsteq cday 1 ram3 nop and ram2 ram3 op6 ret watering: bnz ram5 w_done zone1: set op2 1 tstle ...

  • Page 42

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 39 value. In the period subroutine, we constantly compare the time and set the op1 on or off. That is okay for solid state relay or other control relay, since the logic level did not change all the time. However...

  • Page 43

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 40 e1: ret check_b2: bnz ram2 c2 sub aip2 aip1 ram4 tstle ram4 100 ram2 bz e2 c2: sub aip2 aip1 ram4 tstgt ram4 125 bnz e2 set op2 0 set op5 1 e2: ret check_b3: bnz ram3 c3 sub aip3 aip2 ram4 sub ram4 aip1 ram4 ...

  • Page 44

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 41 set op1 0 end chk4low: tsteq ip1 0 set ram1 0 ret set_op1: tsteq ip1 1 ram1 set op1 1 ret lights: tstge ch 19 ram2 nop tstle ch 5 ram3 nop or ram2 ram3 op3 ret in this logic, set_op1 must be subroutine, if “t...

  • Page 45

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 42 or tand 630 var3 the result for sind and cosd is x1000, because we can only have integer on this processor. The result for tand is x100. 6.4.13 example 13, non-blocking delay non-blocking delay is expressed i...

  • Page 46

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 43 #include #include #include int main(void) { char *data, *remote_mac, *remote_host; long m,n; file *fp; char buffer[18] = "\rnew get call\r"; printf("%s%c%c", "content-type:text/plain;charset=iso-8859-1"...

  • Page 47

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 44 printf("to push up to 10 bytes to webcontrol set_wc=-2147483647"); printf("close connection"); fclose(fp); return 0; }.

  • Page 48: Webcontrol

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 45 webcontrol tm plc faq we include some users frequently asked questions here: 6.5 login and configuration 1-1q: can you tell me how to connect with windows explore? I cannot communicate? 1-1a: if you have dhcp...

  • Page 49

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 46 2-2q: how to read temperature or sensor rom code from command line in linux? 2-2a: use wget http://webcontrol-ip/gett1.Cgi to read the temp sensor t1, and use wget http://webcontrol-ip/gett1rc.Cgi to read the...

  • Page 50

    Webcontrol tm plc user guide version 3.02.17f copyright(c) 2008,-2013 cai networks, inc. 47 command line browser wget can be used to do manually control. The above lines maybe need in double quotes to work. 6.8 external analog chip ds2450 4-1q: i have ds2450 on the 1-wire bus, but reading is not sta...