tailieunhanh - Industrial Control Student Guide Version 1.1 phần 5

Nút P2 đại diện cho một chuyển đổi khoảng cách, mà sẽ cho biết khi nào thích hợp chiều sâu khoan đã được đạt tới. "Khoan" của bạn P2 cách nhấn ngón tay sẽ được tắt, đèn LED màu đỏ chỉ khoan là vô hiệu. | Experiment 4 Continuous Process Control GOSUB Getdata GOSUB Calc Temp GOSUB Control GOSUB Display GOTO Main Getdata LOW CS LOW CLK PULSOUT CLK 10 SHIFTIN Dout CLK MSBPOST Datain 8 HIGH CS RETURN Acquire conversion from 0831 Select the chip Ready the clock line. Send a 10 uS clock pulse to the 0831 Shift in data Stop conversion Calc_Temp Convert di gital value to Temp TempSpan 255 Datain 10 Offset temp based on Span return Offset var iables. Manual heater control Control BUTTON 1 1 255 0 Wkspace1 1 Toggle_it RETURN Toggle_it TOGGLE 8 RETURN Display Plot Temp binary ADC Temp status DEBuG dec Temp CR debug IBIN OUt8 CR debug USRS Temperature dec Temp ADC Data in BIN Datain Decimal dec Datain CR return The StampPlot Lite interface will give you a dynamic representation of temperature changes in your canister. Toggle the heater ON and OFF and watch the response. The screen shot in Figure represents the closed canister heating to 120 degrees and then cooling after the heater is turned off. Play with your system to become more familiar with its response then let s take a little closer look at the subroutines that make up the program. Page 106 Industrial Control Version Experiment 4 Continuous Process Control Figure Screen Shot Using Program 4 The main loop of this program simply executes three subroutines Getdata Calc_Temp and Display. When running the BASIC Stamp jumps back to the Getdata subroutine first. The last line of this routine instructs the processor to RETURN to the main loop and executes the next instruction GOSUB Calc_Temp. The caic_Temp subroutine executes and it ends with a return. The BASIC Stamp returns to GOSUB_Display. After Display executes its RETURN goes back to the instruction of GOTO Main and the process starts over. This is an organized approach to structuring our program. Later when we include evaluation and control in our program we simply add another subroutine such as GOSUB_Control. Let s take a closer look at the two primary .

TỪ KHÓA LIÊN QUAN