This program simulates the way a process computer works.
The main window of this programme is a picture representing
the most
important parts of the process computer: main board and
8 I/O cards.
Each card can be used as:
- analogic input card(AI-124) 24 inputs
- digital input card (DI-124) 24 inputs
- count card- to count impulses (FI-116)- 16 count
units
- digital output card (DO-124) (24 outputs)
- analogic output card(AO-106) (6 outputs)
The programme simulates the way each one of this cards
works .
For instance: every time an AI-124 card gets some data
a light turns on and the
data is displayed. This programme is a variant of a real
application that runs on a 386/40 MHz
process computer designed by ICE Felix SA Bucharest.
This computer has a QNX 4.2 operating
system and the application's interface is built to "work
with" Photon 1.0. The only one
difference between the real application and this programme
is the way data is received:
the first one gets data directly from the 8 cards already
mentioned and the second
generates data at random.
When initialising the application a 'setup' function
is called. This function enables the user to specify
a type for every attached card. The simulator does not
provide a setup sequence - the configuration
is static:
- 2 AI cards
- 2 DO cards
- 2 AO cards
- 1 F1 card
- 1 DI card.
Each card is served by a special process (depending on
card's type) as it follows(these processes are
launched when setup is completed):
- proc_ai works with the AI-124 card
- proc_di works with the DI-124 card
- proc_fi works with the FI-116 card
- proc_ao works with the AO-106 card
- proc_do works with the DO-124 card
Processes running with the real application communicate
with card drivers. For instance proc_di
is blocked waiting for one input to change state. Every
time a change of state occurs, the proc_di
process is awakened.
In our case,these processes generate input data at random
. Data is sent to the 'usp' process by
means of QNX message passing procedure. Every time 'usp'
receives a message, it calls the 'handler'
function that displays data and also turns on a light
to specify which card is active.
- The DO-124 marks the state of each
output by turning a light on (light on means 1 logical);
- The same works with the DI-124
card for each input.
- The AI-124 displays 4 values (in
V) - one value corresponding to a certain input channel.
- One can switch the 4 displayed
channels by "clicking" the button related to this card.
- The FI-116 displays the number
of impulses received by this card - displayed channels can be
- switched the same way as for the
AI-124.
Each one of the AI , DI , FI , DO and AO cards has "on
top" a button labelled 'AI_124','DO_124' ,
'AO-124' and so on . When clicking this button a new
window is displayed on the screen.This window
shows some more information on data received from the
related card:
The AI-124 and DI-124 windows displays 6 graphs - one
graph shows data received from one of the 24 input channels.
To switch between graphs you have to click the "NEXT"
button.
The DO-124 window displays 24 ON/OFF buttons - each
one shows the state of one output.
Clicking the "AUTO" button stops the 'proc_do'
from generating data.This way one can control the DO-124
card by means of these 24 buttons (in this case data
is sent from 'usp' process to 'proc_do' process) .
The AO-124 has 6 related sliders.Clicking the "AUTO"
button one can control the outputs by means of these
sliders (in this case data is sent from 'usp' process
to 'proc_ao' process) .