<< Chapter < Page | Chapter >> Page > |
CosineOnOff
.Public Class Form1
. The code should be:'--------------------------------------------------------------------------
' RTDX Return Status'--------------------------------------------------------------------------
Const Success =&H0 ' Method call is valid
Const Failure =&H80004005 ' Method call failed
Const ENoDataAvailable =&H8003001E ' No data currently available.
Const EEndOfLogFile =&H80030002 ' End of transmission'--------------------------------------------------------------------------
' Variable Declarations'--------------------------------------------------------------------------
Dim rtdx As Object ' Holds the rtdx objectDim bufferstate As Integer ' Holds the number of bytes xmitted
' or pending xmissionDim status As Integer ' RTDX Function call return status
Form:Load
. In this function put the code for initializing the RTDX channel. Name the channel
HtoTchan
for Host to Target channel.Try
rtdx_out = CreateObject("RTDX") status = rtdx.Open("HtoTchan", "W") ' Open channel for writing
Catch ex As Exception 'Exception occured when opening the RTDX object
System.Diagnostics.Debug.WriteLine("Opening of channel HtoTchan failed") rtdx_out = Nothing
End ' Force program terminationEnd Try
Form:FormClosing
function. In this function put the code for cleaning things up.status = rtdx.Close() ' Close rtdx
Set rtdx = Nothing ' Free memory reserved for rtdx obj
Button1:Click
function put the code to be executed when the button is clicked. When the button is clicked it should send a 4 byte integer, the number 1, to the target indicating that button 1 was clicked. The code for doing this is:Dim Data As IntegerData = 1
status = rtdx.WriteI4(Data, bufferstate)If status = Success ThenDebug.Print "Value "&Data&" was sent to the target"
ElseDebug.Print "WriteI4 failed"
End If
Button2:Click
function put the code to be executed when the button is clicked. When the button is clicked it should send a 4 byte integer, the number 0, to the target indicating that button 2 was clicked. The code is the same as above, the data is just 0.DSK6713_audio.c
file as
DSK6713_audio2.c
and use this as the main file in your project.#include<rtdx.h>
HtoTchan
. This code will go in the global variables section.RTDX_CreateInputChannel( HtoTchan );
processing
:int data;
int status;int busystatus=0;/* enable the Host to Target channel */
RTDX_enableInput(&HtoTchan );
while
loop add the code:/* check to see if the channel is busy before the read */
if (busystatus == 0){
/* Print the data if something was actually read */if (RTDX_sizeofInput(&HtoTchan) == sizeof(data))
{// data received here
LOG_printf(&trace,"Value sent = %d",data);
}status = RTDX_readNB(&HtoTchan,&data, sizeof(data) );
}/* get the status of the channel */busystatus = RTDX_channelBusy(&HtoTchan);
HtoTchan
input channel. When a value is received the program will get to the statement
// data received here
and will have the value in the variable
data
.(Int16)(32000.0*y*data);
Notification Switch
Would you like to follow the 'Dsp lab with ti c6x dsp and c6713 dsk' conversation and receive update notifications?