发表于:2006-11-22 17:03:00
1楼
#pragma run_unconfigured
This pragma causes the application to run regardless of the device state, as long as the device is not applicationless. This means that even if the device is unconfigured or hard-offline, the application will run. You can use this directive to have an application perform some form of local control prior to or independent of being installed in a network.
Applications that use this pragma and will be run on firmware versions prior to version 12 should not attempt to send messages when hard-offline. The hard-offline state can be detected by calling retrieve_status( ) and checking the status_node_state field for the value CNFG_OFFLINE. The reason for this is that the hard-offline state is used by network tools during configuration modification. Were one to send messages in this state, the message might be sent using invalid configuration and thus potentially go to the wrong location. Note that an application is typically taken soft-offline during modification so the device is only subject to these concerns if it is power-cycled while the modification is in progress. Applications that do not use this pragma will not ever run when hard-offline and thus will not be vulnerable to this condition.