Download Real-Time Workshop User's Guide
Transcript
C Targeting DOS for Real-Time Applications 32-bit counter. This means that the slowest base sample rate your model can have is 6 1 3600 1.193 ×10 ÷ ( 2 32 – 1 ) ≈ ------------- Hz This corresponds to a maximum base step size of approximately one hour. The fastest sample rate you can define is determined by the minimum value from which the counter can count down. This value is 3, hence the fastest sample rate that the 8254 is capable of achieving is 1.193 × 10 6 ÷ 3 ≈ 4 × 10 5 Hz This corresponds to a minimum base step size of 1 ÷ 4 × 10 5 ≈ 2.5 × 10 – 6 sec onds However, note that the above number corresponds to the fastest rate at which the timer can generate interrupts. It does not account for execution time for the model code, which would substantially reduce the fastest sample rate possible for the model to execute in real time. Execution speed is machine dependent and varies with the type of processor and the clock rate of the processor on the target PC. The slowest and fastest rates computed above refer to the base sample times in the model. In a model with more than one sample time, you can define blocks that execute at slower rates as long as the sample times are an integer multiple of the base sample time. Modifying Program Timing If you have access to an alternate timer (e.g., some I/O boards include their own clock devices), you can replace the file drt_time.c with an equivalent file that makes use of the separate clock source. See the comments in drt_time.c to understand how the code works. You can use your version of the timer module by redefining the TIMER_OBJS macros with the build command. For example, in the Real-Time Workshop pane of the Simulation parameters dialog box, changing the build command to make_rtw TIMER_OBJS=my_timer.obj C-8
Related documents
Real-Time Workshop®
MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER User`s guide
Cisco DWDM XFP
Target Language Compiler Reference Guide
Real-Time Workshop
fulltext01 - DiVA Portal
Simulink PLC Coder User`s Guide
Motion Control of Industrial Printers
Target Language Compiler Reference Guide
DSP-2 Library for Simulink
Real-Time Workshop User`s Guide
Real-Time Workshop Release Notes