IO203 - Digital Loopback
The IO203 is a digital I/O module providing a total of 64 TTL channels. The transceivers are TTL and CMOS/TTL compatible (5 V/3.3 V, ±24 mA available for 3.3V usage only) and can also be set to be CMOS compliant by on-board jumper.
Each of the 64 channels can be individually programmed as an input or output. Internally the 64 channels are divided in two groups of 32, and each one is accessed via a single bus access cycle which leads to a simultaneous update of each group with very low latency.
Setup
Prerequisites
You will require the following to run this example:
- Speedgoat real-time target machine with one IO203 I/O module installed
- Connector cable from the I/O module to the terminal board
- 68-pin terminal board with jumper wires
Test Setup
On the terminal board of the TTL digital I/O module, connect the digital output pins to the pins of digital inputs as shown below.
Initialize and Open the Simulink model
modelName = 'sgMdl_IO203_DigitalLoopback';
Model Description
Build, Download, and Run the Example
To run the example, either run the following code section or click the Run on Target button in the REAL-TIME tab in the Simulink model.
% Build the Simulink model
slbuild(modelName); % this will create the real-time application file (.mldatx)
% Create and connect to the Speedgoat real-time target machine
% Download and install the real-time application on the target machine
% Start the real-time application
% Wait a few seconds and then stop the real-time application on the target machine
% Number of signals to be viewed in the SDI
Simulink.sdi.clearAllSubPlots;
runobj = Simulink.sdi.Run.getLatest;
sigsobj = runobj.getAllSignals;
for k = 1:numsignals % Display all signals in the plot
Simulink.sdi.setSubplotLimits(1, 1, "tMin", 0, "tMax", stoptime, "yMin", -0.5, "yMax", 11.5);
Check the Results
The output is then visible in the Simulink Data Inspector (SDI). You should see the square waves, like in the image below:
Additional References