User`s guide

Getting Star ted with RTDX™
Restarting the processor doe s not start the program executing. Y ou use run
to start program execution.
2 Type cc.run('run');
Using
run’fortherun mode tells the processor to continue to execute the
loaded program continuously until it receives a halt directive. In this mode,
control returns to MATLAB software so you can w ork in M ATLAB software
while the program runs. Other options for the mode are
runtohalt start to execute the program and wait to return control to
MATLAB software until the process reaches a breakpoint or execution
terminates.
tohalt change the state of a running processor to runtohalt’and
wait to return until the program halts. Use
tohalt mode to stop the
running processor cleanly.
3 Type the following functions to enable the write channel and verify that the
enable takes effect.
cc.rtdx.enable('ichan');
cc.rtdx.isenabled('ichan')
If MATLAB softw are responds ans = 0 your channel is not enabled and
you cannot proceed with the tutorial. Try to enable the channel again and
verify the status.
4 Writesomedatatotheprocessor. Checkthatyoucanwritetothe
processor, then use
writemsg to send the data. You do not need to enter
the if-test code shown.
if cc.rtdx.iswritable('ichan'), % Used in a script application.
disp('writing to processor...') % Optional to display progress.
indata=1:10
cc.rtdx.writemsg('ichan', int16(indata))
end % Used in scripts for channel testing.
The if statement simulates writing the data from within a MATLAB
software script. The script uses
iswritable to check that the input channel
is functioning. If
iswritable returns 0 thescriptwouldskipthewrite
2-33