Question: 3. Sampling and Files: Let Voin be a voltage applied to channel 00 on the analog input module. The voltage range = (0.0 - 10.0


3. Sampling and Files: Let Voin be a voltage applied to channel 00 on the analog input module. The voltage range = (0.0 - 10.0 volts). This voltage is sampled every 10 seconds using timer T1. Start this sampling process with the momentary activation of PB2 (NO) Let PB2 also start a timer, T2, that will sample voltage Vlin every 1 second; Vlin is a voltage applied to channel 01 on the analog input module, with the same voltage range as Voin. Six values of Vlin are stored, sample value by sample value in a file, FILEA. After this file is full, the 1 second sampling is stopped, then the maximum value of the entries in FILEA, Vimax, is determined. When T1.DN = 1, the sample value of Voin is compared with Vimax, if Voin > Vimax, Voin is applied to channel 00 on the analog output module (tag = OUT1). Then, FILEA is re-filled with values of Vlin from the 1 second sampling process. If Voin Vimax, Voin is applied to channel 00 on the analog output module (tag = OUT1). Then, FILEA is re-filled with values of Vlin from the 1 second sampling process. If Voin
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
