14.08.2013 Views

snap ethernet-based i/o units protocols and programming guide

snap ethernet-based i/o units protocols and programming guide

snap ethernet-based i/o units protocols and programming guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 2: OVERVIEW OF PROGRAMMING<br />

When you configure events <strong>and</strong> reactions, the masks are in hex notation. If you are setting up a<br />

Digital On mask for points 0–7, for example, you might do so as follows:<br />

Point number: 7 6 5 4 3 2 1 0<br />

State: On -- On On -- -- -- On<br />

Binary notation: 1 0 1 1 0 0 0 1<br />

Hex notation: B 1<br />

For more information on mask data format, see page 41.<br />

You can also configure the brain to send a message as a reaction to digital events. See page 34.<br />

How Digital Events Trigger Reactions<br />

Reactions to digital events are level-triggered, not edge-triggered. The brain continually checks<br />

the digital state to see if it matches the event. The brain sends the reaction as soon as the state<br />

matches the event, <strong>and</strong> the brain continues to send the reaction until the state changes. If the<br />

state changes so that it no longer matches the event, the brain does NOT reverse the reaction.<br />

Digital Event/Reaction Example<br />

For example, suppose you have set up an event/reaction to turn on a light when a door is open.<br />

As soon as the event occurs (the door opens), the brain sends the reaction (turn on the light).<br />

Since the reaction is level-triggered, as long as the door remains open, the light will remain on.<br />

When the door is shut, the brain stops turning on the light, but it does NOT turn the light off. To<br />

turn off the light when the door is shut, you need to set up a second event/reaction.<br />

Suppose the input for the door’s status is on point 0, <strong>and</strong> the output for the light is on point 5.<br />

Here are the two event/reactions to turn on the light when the door is open, <strong>and</strong> turn off the light<br />

when the door is shut:<br />

Event #0: IF Point 0 (Door) is OFF (Open)<br />

Reaction #0: THEN Turn Point 5 (Light) ON<br />

Event #1: IF Point 0 (Door) is ON (Closed)<br />

Reaction #1: THEN Turn Point 5 (Light) OFF<br />

Using Alarms <strong>and</strong> Reactions<br />

A reaction can also be set up as a response to an alarm. You can configure alarms for analog<br />

points or digital counters. (See “Alarm Event Settings—Read/Write” on page 134). For example,<br />

you could monitor the pressure in a tank <strong>and</strong> set up an alarm if it rises above a certain level, or<br />

you could trigger an alarm when a specific number of boxes on a conveyor have passed through<br />

a beam sensor. For each alarm, you configure a suitable reaction.<br />

SNAP Ethernet-Based I/O Units Protocols <strong>and</strong> Programming Guide 31

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!