Back to Creating Circuitry
Entering Code
Before we can enter code for the Thread we need to Compile the Circuitry.
Select MyCircuit.cdl in the Solution Explorer Window, click the Right Mouse button to pop-up the options menu. Select Compile. The CDL translator will run and generate the code files and add them to the project. A popup dialog will appear reporting that 'Files have been added to the project. Do you wish to rebuild the solution ?'. Select NO (we havent finished yet).
Expanding the Solution Windows entries Generated Base Source, Generated Base Header, Generated Derived Source and Generated Derived Header, you will see all of the files that have been generated for this circuit.
Base files must not be edited by users. They will be overwritten if the circuit is retranslated.
Derived files will only be overwritten if they have not been modified.
Double Click the Thread (or select Edit Code->Process... in the Right Click menu). The appropriate file will be automatically opened ready for editing.
For this example we simply wish the application to execute in a loop outputting the Text "Hello World..."
MyCircuit_HelloThrdProc.cpp
...
Uns MyCircuit_HelloThrdElem::Process()
{
// TODO: Add custom process code
while ( TRUE )
{
ClpDiag( "Hello World...\n" );
ClpSleep( 1000 );
}
return TRUE;
}