DNA/DNR-429-512/566 ARINC 429 Layer
Chapter 2
20
Programming with the High Level API
Tel: 508-921-4600
www.ueidaq.com
Vers:
4.5
Date: December 2013
DNx-429-Chap2x.fm
© Copyright 2013
United Electronic Industries, Inc.
2.4
Read Data
Reading data from the 429-566 is done using a reader object. Since there is no
multiplexing of data (contrary to what’s being done with AI, DI, or CI sessions),
you need to create one reader object per input port to be able to read from each
port in the port list.
The following sample code shows how to create a reader object tied to port 1
and read up to 10 words from the ARINC bus.
2.5
Write Data
Writing data to the 429-566 is done using a writer object. Since there is no
multiplexing of data (contrary to what’s being done with AO, DO, or CO
sessions), you need to create one writer object per output port to be able to write
to each port in the port list.
The following sample code shows how to create a writer object tied to Port 2 and
send one word to the ARINC bus.
2.6
Programming
the Output
Scheduler
Each output channel is equipped with a hardware Scheduler that you can use to
send sequences of ARINC words at a given rate without intervention of the host
or and/or software.
// Create a reader and link it to the session’s stream, port 1
reader = new CUeiARINCReader(session.GetDataStream(), 1);
// read up to 10 words, numWordsRead contains the
// number of words actually read.
tUeiARINCWord words[10];
reader->Read(10, words, &numWordsRead);
// Create a writer and link it to the session’s stream, port 2
writer = new CUeiARINCWriter(session.GetDataStream(), 2);
// store the one word we want to write out
tUeiARINCWord word;
word.Label = 2; // Set the label
word.Data = 0x123; // Set the payload
word.Sdi = 0
word.Ssm = 0
word.Parity = 0;
// write 1 word, numWordsWritten contains number of words actually sent
writer->Write(1, &word, &numWordsWritten);