<< Chapter < Page Chapter >> Page >

Using the tcp/ip interface

This section will describe a Simulink model used to generate code for capturing and displaying video frames from/to the PC target using the TCP/IP protocol You should allocate an IP address to the DM6437 DVDP, as described in the board documentation. .

Capturing and Displaying Video Using the TCP/IP port
  1. Create a new Simulink model
  2. Open the Simulink library browser and add the "C6437EVM" from the "Target Support Package TC6" group of the " C6000 Target Preferences" Blockset (Please refer to Figure 16).
    The "C6437EVM" Block
    We now need to create Simulink dedicated block to execute CCS commands.
  3. Drag in an empty subsystem into the model (Simulink->Ports&Subsystem->Subsystem).
  4. Delete its contents
  5. Format it: Give it a name. In our example we use “Bulid / Reload&Run".
  6. Right click on the Subsystem, choose “Block Properties”. Go to the Callbacks tab, and under OpenFcn* enter: “RW_tcpip_script('RW_pcl_tcpip');”, as shown in the following picture:
    Creating the “Bulid / Reload&Run” Simulink block
  7. Add the "Task" block from the "DSP/BIOS library" group of the "Target Support Package TC6" Blockset.
  8. Add the “Function- Call Subsystem” from the “Ports&Subsystems" group of the "Simulink" Blockset (Please refer to Figure 18).
    The "Function-Call Subsystem" Block
  9. Rename “Function- Call Subsystem” to “R_W Algorithm” and connect it to the “Task” block.
  10. Add the "IP Config" block from "Target Support Package™ TC6->DM6437 EVM Board Support"
  11. Save the model as “RW_dm6437_tcpip.mdl”. Your model should look as follows:
    The " RW_dm6437_tcpip.mdl " Model
  12. Double-click the “Task” block and make the same changes as shown in Figure 20.
    "Task" Configuration
  13. Double-click the “IP Config” block and make the same changes as shown in Figure 21.
    “IP Config” Configuration
  14. Double-click the “R_W Algorithm” block. A new window will be opened.
  15. In the new window, add the "TCP/IP Recive", "TCP/IP Send", "Byte Unpack" and "Byte Pack" from the "C6000 DSP Communication Libary" group of the ""Target Support Package TC6" Blockset as shown in Figure 22.
    The "TCP/IP Receive" and "TCP/IP Send" blocks
  16. Connect the blocks as shown in Figure 23.
    The “R_W Algorithm” block
  17. Double-click the “TCP/IP Receive” block and make the same changes as shown in Figure 24.
    Main Screen
    Data Types
    "TCP/IP Receive" Configuration
    .
  18. Double-click the “TCP/IP Send” block and configure it as shown in Figure 25:
    "TCP/IP Send" Configuration
  19. Double-click the “Byte Unpack” block and configure it as shown in Figure 26.
    " Byte Unpack " Configuration
  20. Double-click the “Byte pack” block and configure it as shown in Figure 27.
    " Byte Pack " Configuration
  21. Open a new m-file, copy the following code and save it as "RW_tcpip_script.m" at the same directory as the model.
  22. Create another new Simulink model. Add the "Byte Pack" from the "C6000 DSP Communication Libary" group of the ""Target Support Package TC6" Blockset as shown before and the "TCP/IP Receive", "TCP/IP Send" from the "Instrument Control Toolbox" blockset.
  23. Configure the " TCP/IP Receive " and " TCP/IP Send " blocks :
    "TCP/IP Receive"
    TCP/IP Send
    "TCP/IP Receive" "TCP/IP Send" Blocks Configuration
  24. Add the "To Video Display" from the "DM6437 EVM Board Support" group of the ""Target Support Package TC6" Blockset , also add the "From Multimedia File" from " Signal Processing Sources" group of the "Signal Processing blockset".
  25. Configure the " From Multimedia File " block
    "TCP/IP Receive"
    TCP/IP Send
    "From Multimedia File" Configuration
  26. Add the “Subsystem” from the “Ports&Subsystems" group of the "Simulink" Blockset as shown before.
  27. Rename “Function- Call Subsystem” to “Display”.Double-click the “Display” block. A new window will be opened. In the new window, add the "Byte Unpack" and " To Video Display " as shown before, add the "Reshape" from the "Math Operations" grope of the "Simulink" blockset. (Configurations are the same as before).
  28. Connect the blocks as follows:
    The "Display" block
  29. Your model should look as follows:
  30. Save it as “RW_pcl_tcpip.mdl”.
  31. Build load and run the project. Double-click the "Build / Reload&Run" block.
  32. Running the script, you will see the video captured and displayed. A single frame is shown in Figure 32.
    The Captured Video
    The Displayed Video
    Capturing and Displaying Video Using TCP/IP
  33. This model can be found here .

Questions & Answers

if three forces F1.f2 .f3 act at a point on a Cartesian plane in the daigram .....so if the question says write down the x and y components ..... I really don't understand
Syamthanda Reply
hey , can you please explain oxidation reaction & redox ?
Boitumelo Reply
hey , can you please explain oxidation reaction and redox ?
Boitumelo
for grade 12 or grade 11?
Sibulele
the value of V1 and V2
Tumelo Reply
advantages of electrons in a circuit
Rethabile Reply
we're do you find electromagnetism past papers
Ntombifuthi
what a normal force
Tholulwazi Reply
it is the force or component of the force that the surface exert on an object incontact with it and which acts perpendicular to the surface
Sihle
what is physics?
Petrus Reply
what is the half reaction of Potassium and chlorine
Anna Reply
how to calculate coefficient of static friction
Lisa Reply
how to calculate static friction
Lisa
How to calculate a current
Tumelo
how to calculate the magnitude of horizontal component of the applied force
Mogano
How to calculate force
Monambi
a structure of a thermocouple used to measure inner temperature
Anna Reply
a fixed gas of a mass is held at standard pressure temperature of 15 degrees Celsius .Calculate the temperature of the gas in Celsius if the pressure is changed to 2×10 to the power 4
Amahle Reply
How is energy being used in bonding?
Raymond Reply
what is acceleration
Syamthanda Reply
a rate of change in velocity of an object whith respect to time
Khuthadzo
how can we find the moment of torque of a circular object
Kidist
Acceleration is a rate of change in velocity.
Justice
t =r×f
Khuthadzo
how to calculate tension by substitution
Precious Reply
hi
Shongi
hi
Leago
use fnet method. how many obects are being calculated ?
Khuthadzo
khuthadzo hii
Hulisani
how to calculate acceleration and tension force
Lungile Reply
you use Fnet equals ma , newtoms second law formula
Masego
please help me with vectors in two dimensions
Mulaudzi Reply
how to calculate normal force
Mulaudzi
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, From matlab and simulink to real-time with ti dsp's. OpenStax CNX. Jun 08, 2009 Download for free at http://cnx.org/content/col10713/1.1
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'From matlab and simulink to real-time with ti dsp's' conversation and receive update notifications?

Ask