Specifications
Reviewing the Signalprog Application
7-6
7.3 Reviewing the Signalprog Application
The source code for the Visual Basic signalprog.exe application is available
in the signalfrm.frm file. Details about this application are provided in the
signalprog.pdf Adobe Acrobat file. In this section, you examine a few of the
routines and functions that are important for this example.
❏
Test_ON
. This routine runs when you click the Test_ON button. It creates
instances of the RTDX exported interface for the input channel (toDSP)
and for the output channel (fromDsp). Then it opens and enables both of
these channels. The channels in the signalprog.exe application are the
same channels declared globally in the hostio.c source code.
This routine also clears the graphs and starts the timer used to call the
Transmit_Signal and Receive_Signal functions.
These global declarations made earlier in the Visual Basic source code
connected the READ_CHANNEL and WRITE_CHANNEL used in the
Test_ON routine to the D2A_channel and A2D_channel used in hostio.c:
' Channel name constants
Const READ_CHANNEL = "D2A_channel"
Const WRITE_CHANNEL = "A2D_channel"
❏
Test_OFF
. This routine disables, closes, and releases the RTDX objects
created by Test_ON. It also disables the timer.
❏
Transmit_Signal
. This function generates a sine wave signal and
displays it in the Transmitted Signal graph. Then, the function attempts to
transmit the signal to the target using the Write method of the toDSP
channel.
❏
Receive_signal
. This function uses the ReadSAI2 method of the
fromDSP channel to read a signal from the target. It displays the signal in
the Received Signal graph.
❏
tmr_MethodDispatch_Timer
. This routine calls the Transmit_Signal and
Receive_Signal functions. This routine is called at 1 millisecond intervals
after the timer object is enabled by the Test_ON routine.