DNx-SL-514 Synchronous Serial Interface Board
Chapter 2
17
Programming with the High-Level API
May 2018
www.ueidaq.com
508.921.4600
© Copyright 2018
United Electronic Industries, Inc.
2.7
Configuring
the Timing
The application must configure the SL-514 to use the “messaging” timing mode.
A message is represented by an array of bytes.
The SL-514 can be programmed to wait for a certain number of bytes to be
received before notifying the session.
It is also possible to program the maximum amount of time to wait for the
specified number of bytes before notifying the session.
The following sample shows how to configure the messaging I/O mode to be
notified when 10 bytes have been received or every second, whichever is less.
(Note that if the serial port receives less than 10 bytes per second, it will return
whatever number of bytes are available every second).
2.8
Configuring
Timestamps
Users can check whether timestamping is enabled and optionally enable it on
each received frame. Timestamping can only be enabled on master ports.
•
Use the
IsTimestampingEnabled()
method to check whether
timestamping is enabled. The method returns a boolean true or false.
•
Set the
EnableTimestamping
property to true to enable
timestamping for input data on one or more master port(s). Set the
property to false to disable timestamping.
The following code enables timestamping on port 0:
NOTE:
When reading data, the timestamp is read directly following the data
word.
// configure timing of serial port
ssiSession.ConfigureTimingForMessagingIO(10, 1.0);
// Enable timestamping on port 0 (channel0) if not already enabled
CUeiSSIMasterPort* master0;
bool TSenabled;
master0 = dynamic_cast<CUeiSSIMasterPort*>(ssiSession.GetChannel(0));
TSenabled = master0->IsTimestampingEnabled();
if(!TSenabled) master0->EnableTimestamping(true);