isenabled - Determine whether RTDX™ link is enabled for communications

Syntax

isenabled(rx,'channel')
isenabled(rx)

Description

isenabled(rx,'channel') returns ans=1 when the RTDX channel specified by string 'channel' is enabled for read or write communications. When 'channel' has not been enabled, isenabled returns ans=0.

isenabled(rx) returns ans=1 when RTDX has been enabled, independent of any channel. When you have not enabled RTDX you get ans=0 back.

Important Requirements for Using isenabled

On the target side, isenabled depends on RTDX to determine and report the RTDX status. Therefore the you must meet the following requirements to use isenabled.

  1. The target must be running a program when you query the RTDX interface.

  2. You must enable the RTDX interface before you check the status of individual channels or the interface.

  3. Your target program must be polling periodically for isenabled to work.

Examples

With a program loaded on your target, you can determine whether RTDX channels are ready for use. Restart your program to be sure it is running. The target must be running for isenabled to work, as well as for enabled to work. In this example, we created a link cc to begin.

cc.restart
cc.run('run');
cc.rtdx.enable('ichan');
cc.rtdx.isenabled('ichan')

MATLAB® software returns 1 indicating that your channel 'ichan' is enabled for RTDX communications. To determine the mode for the channel, use cc.rtdxto display the properties of object cc.rtdx.

See Also

clear, disable, enable

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS
 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS