EasyManuals Logo

Curtis 1310 User Manual

Curtis 1310
51 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #40 background imageLoading...
Page #40 background image
The previous example “polls” the switch inputs at the the time the statement VCL is run. If there
is a need to read fast inputs, the VCL will need to poll these inputs very often as to not miss a
correct reading. Sometimes it is not possible to run the VCL fast enough. Big programs or push
buttons cause the switch state to be easily missed.
SW_#_UP and SW_#_DOWN variables (where # = 1 though 24) give VCL a better way to catch
fast transients on the inputs. The “up” and “down” terms use the illustration of push button,
which is pushed down to turn something “on”. The 1310 samples the switch states 250 times per
second. Any input that has changed state from “off to “on” will set the corresponding
SW_#_DOWN variable. Any switch that has changed state from “on to “off” will set the
corresponding SW_#_UP variable. It is vital to note that once the bit is set, it is not cleared by the
corresponding variable. An input going off (released) will not clear the SW_#_DOWN bit and
likewise and switch being pushed down (on) will not clear the SW_#_UP bit. It is this feature
that allows the VCL code to run less often and still detect input changes, even after the event
occurs,. Once the VCL code has detected the change, it can clear the bit to allow the next
detection. The example below illustrates a push button interface.
if (SW_1_UP = ON)
{
;put code here to run when switch 1 is OFF (up & released)
SW_1_UP = OFF ; clear the bit so we can detect the button release
}
if (SW_1_DOWN = ON)
{
;put code here to run when switch 1 is ON (down & pressed)
SW_1_DOWN = OFF ; clear the bit so we can detect the next button press
}
Note that these bits are always checked to be ON, even for the switch off state. Think of it not as
the state of the input, but as the transition of the input. In the first line, the VCL checks to see if it
is true that the button went “off” (up). Normally, software is written to clear it (OFF) after
reading it so that the next state can be caught. Also note that it is entirely possible that both the
SW_#_UP and SW_#_DOWN bits are set. This simply means that the input went both on and off
within the time it took for the VCL code to return to these lines of code.
1310 Vehicle Control System Users Manual Release Rev B Page 40 of 51

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Curtis 1310 and is the answer not in the manual?

Curtis 1310 Specifications

General IconGeneral
BrandCurtis
Model1310
CategoryController
LanguageEnglish

Related product manuals