VXi VT1529A/B 사용자 설명서

다운로드
페이지 529
Creating and Running Algorithms   189
Example Scan
Verification Algorithms
Following are some simple examples demonstrating the use of scan 
verification in an algorithm. 
By using S1xx in an algorithm, various results for control or data acquisition 
applications can be achieved. Assuming that one is interested in monitoring 
the scan state of an RSCU at VT1422A channel 25, the following can be 
done:
1. In the VT1422A algorithm: 
if( S125 != 0) {
/* User application specific algorithm code for shutting down critical hardware or 
reporting. Such as:
*/
O156 = 5.0 ;  
/* send 5.0 volts to output chan, then open relay */
         writecvt(S125, cvt_loc);  
/* for reporting */
         interrupt();          
      
/* force a VXI bus interrupt. */
}
2. In the application:
S1xx states can also be achieved by using various Plug&Play functions or 
SCPI commands, such as: 
alg:scal? 'algn','S125'
Timing Impact
One of the tradeoffs for runtime scan verification is an impact on the overall 
scan rate. The total time spent in scan verification depends on the number of 
unique S1xx locations that are referenced in the algorithms. The total time 
in scan verification can be determined by the following formula:
Total Time in scan verification:
= 0 when no S1xx locations are referenced. 
= 230
μ
s + 40
μ
s*(number of unique S1xx identifiers referenced in 
algorithms).
max time = 870 
μ
s, if all sixteen S1xx locations are referenced.
Thus, the flexibility to make tradeoffs between maximum scan rate and scan 
status checking is achieved.
The impact of using scan verification on the overall scan rate depends on 
both the number of channels in the analog input scan list and the number of 
channels in status list. In a system which uses the maximum number of 
512 analog input channels and the maximum sixteen status channels, the 
total timing overhead will be 870/(512*40) = 4.24%.
Also, if the status information is used to make decisions within an algorithm, 
additional time will also be required. The timing impact in an algorithm will 
depend on its complexity.