<< 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

how to study physic and understand
Ewa Reply
what is conservative force with examples
Moses
what is work
Fredrick Reply
the transfer of energy by a force that causes an object to be displaced; the product of the component of the force in the direction of the displacement and the magnitude of the displacement
AI-Robot
why is it from light to gravity
Esther Reply
difference between model and theory
Esther
Is the ship moving at a constant velocity?
Kamogelo Reply
The full note of modern physics
aluet Reply
introduction to applications of nuclear physics
aluet Reply
the explanation is not in full details
Moses Reply
I need more explanation or all about kinematics
Moses
yes
zephaniah
I need more explanation or all about nuclear physics
aluet
Show that the equal masses particles emarge from collision at right angle by making explicit used of fact that momentum is a vector quantity
Muhammad Reply
yh
Isaac
A wave is described by the function D(x,t)=(1.6cm) sin[(1.2cm^-1(x+6.8cm/st] what are:a.Amplitude b. wavelength c. wave number d. frequency e. period f. velocity of speed.
Majok Reply
what is frontier of physics
Somto Reply
A body is projected upward at an angle 45° 18minutes with the horizontal with an initial speed of 40km per second. In hoe many seconds will the body reach the ground then how far from the point of projection will it strike. At what angle will the horizontal will strike
Gufraan Reply
Suppose hydrogen and oxygen are diffusing through air. A small amount of each is released simultaneously. How much time passes before the hydrogen is 1.00 s ahead of the oxygen? Such differences in arrival times are used as an analytical tool in gas chromatography.
Ezekiel Reply
please explain
Samuel
what's the definition of physics
Mobolaji Reply
what is physics
Nangun Reply
the science concerned with describing the interactions of energy, matter, space, and time; it is especially interested in what fundamental mechanisms underlie every phenomenon
AI-Robot
what is isotopes
Nangun Reply
nuclei having the same Z and different N s
AI-Robot
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