13.07.2015 Views

CAAPE User's Manual - ALSTOM Signaling Inc.

CAAPE User's Manual - ALSTOM Signaling Inc.

CAAPE User's Manual - ALSTOM Signaling Inc.

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Simulator Reference12.3.2. Logic SectionThe statements in a simulation logic file use the same format as those in the input file.The simulator program is more flexible in processing simulation logic than the actualCAA compiler: you can use advanced statement types such as IF or WHILE in Vitalsimulation logic, and there is no restriction on using inputs as equation results.However, subroutines cannot be defined in simulation logic and calls to subroutines inthe main application logic cannot be made from it.A number of special statements are available in simulation logic which are not availablein normal logic. See Predefined Simulator Logic Functions for more details.For example:* This section declares variables not already existing in the applicationSYMBOLS[BOOLEAN[SIM1 SIM2[5]]INTEGER[LOOP_COUNT]]* Start of the simulation logic. No header required.* This equation simulates the response time of a device.* SW1-OUT is an application output* SW1-IN is an application inputTIME DELAY = 10 SECONDSBOOL SW1-IN = SW1-OUT* This equation counts the number of cycles a variable is True. If a maximum count is* reached, the variable is cleared and a user message is logged.* VAR1 is a Boolean variable in the application* LOOP_COUNT is an Integer variable declared in this fileIF( VAR1==TRUE ){LOOP_COUNT = LOOP_COUNT + 1IF( LOOP_COUNT==10 )P2512A, Rev. Oct/09 12–19 Alstom <strong>Signaling</strong> <strong>Inc</strong>.

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

Saved successfully!

Ooh no, something went wrong!