Channels

Top  Previous  Next

Channels are used to connect Diamond tasks together. To see how the IDE handles channels, we need to create a two-task application. We shall use the standard upper-case program that can be found as example-3b in the Diamond installation (usually C:\3L\My Designs\examples\Lyrtech\example-3b\).

 

A two-task application

Create a new project called Dual1 with a single processor called root. Right-click root and select Create Task. Name the task driver and give it one input port and one output port. As we are going to import the source files from elsewhere, remove the tick from Create main source file.

CreateDriver

 

Click Finish to create the task and then repeat the procedure (including ports and inhibiting creating files) to create a task called upc.

Upc+Driver

Right-click driver and select Add existing files. Browse to the example-3b folder mentioned above and select driver.c. Click Open to select the file and insert a copy into the task. Repeat this procedure to copy the file upc.c into the task upc.

 

Finally, we need to include the header files driver.h and upc.h into their respective .c files. Drag upc.h and drop it onto upc.c, then drag driver.h and drop it onto driver.c.; this would have been done automatically had we allowed the IDE to create the source files.