Sunday 7 October 2012

TISHITU LM 35 temperature control via RS 232 Protocol By Visual Basic











By Umang Jain 
Team TISHITU 


In 1963, IBM produced computers which were specialized for data acquisition. These include the IBM 7700 Data Acquisition System and its

successor, the IBM 1800 Data Acquisition and Control System. These expensive specialized systems were surpassed in 1974 by general

purpose S-100 computers and data acquisitions cards produced by Tecmar/Scientific Solutions Inc. In 1981 IBM introduced the IBM

Personal Computer and Scientific Solutions introduced the first PC data acquisition products.
Data acquisition is the process of sampling signals that measure real world physical conditions and converting the resulting samples

into digital numeric values that can be manipulated by a computer. Data acquisition systems (abbreviated with the acronym DAS or DAQ)

typically convert analog waveforms into digital values for processing. The components of data acquisition systems include:
Sensors that convert physical parameters to electrical signals.
Signal conditioning circuitry to convert sensor signals into a form that can be converted to digital values.

Analog-to-digital converters, which convert conditioned sensor signals to digital values.
Data acquisition applications are controlled by software programs developed using various general purpose programming languages such as

BASIC, C, Fortran, Java, Lisp, Pascal.
Specialized software tools used for building large-scale data acquisition systems include EPICS. Graphical programming environments

include ladder logic, Visual C++, Visual Basic, and LabVIEW.
ISIS Schematic Capture - a tool for entering designs.
PROSPICE Mixed mode SPICE simulation - industry standard SPICE3F5 simulator combined with a digital simulator.
ARES PCB Layout - PCB design system with automatic component placer, rip-up and retry auto-router and interactive design rule checking.
VSM - Virtual System Modelling lets cosimulate embedded software for popular micro-controllers alongside hardware design.
Data acquisition begins with the physical phenomenon or physical property to be measured. Examples of this include temperature, light

intensity, gas pressure, fluid flow, and force. Regardless of the type of physical property to be measured, the physical state that is

to be measured must first be transformed into a unified form that can be sampled by a data acquisition system. The task of performing

such transformations falls on devices called sensors.
A sensor, which is a type of transducer, is a device that converts a physical property into a corresponding electrical signal (e.g., a

acquisition system to measure differing properties depends on having sensors that are suited to detect the various properties to be

measured. Signal conditioning may be necessary if the signal from the transducer is not suitable for the DAQ hardware being used. The

signal may need to be filtered or amplified in most cases. Various other examples of signal conditioning might be bridge completion,

providing current or voltage excitation to the sensor, isolation, linearization. For transmission purposes, single ended analog

signals, which are more susceptible to noise can be converted to differential signals. Once digitized, the signal can be encoded to

reduce and correct transmission errors.
DAQ (Data acquisition )hardware is what usually interfaces between the signal and a PC[1]. It could be in the form of modules that can

be connected to the computer's ports (parallel, serial, USB, etc.) or cards connected to slots (S-100 bus, AppleBus, ISA, MCA, PCI,

PCI-E, etc.) in the motherboard. Usually the space on the back of a PCI card is too small for all the connections needed, so an

external breakout box is required. The cable between this box and the PC can be expensive due to the many wires, and the required

shielding.
DAQ cards often contain multiple components (multiplexer, ADC, DAC, TTL-IO, high speed timers, RAM). These are accessible via a bus by

a microcontroller, which can run small programs. A controller is more flexible than a hard wired logic, yet cheaper than a CPU so that

it is permissible to block it with simple polling loops. For example: Waiting for a trigger, starting the ADC, looking up the time,

waiting for the ADC to finish, move value to RAM, switch multiplexer, get TTL input, let DAC proceed with voltage ramp.

##############################################################################
CODE 'C"
###########################################################################
#include<reg52.h>
#define ldata P2
#define temp P1
sbit r= P3^3;  // Write pin. It is used to start the conversion. 
sbit d= P3^4;  // Read pin. It is used to extract the data from internal register to the output pins 
void senddata (unsigned char value);
void delay(unsigned int msec )  // The delay function provides delay in msec.
{
int i,j ;
for(i=0;i<msec;i++)
  for(j=0; j<1275; j++);
}

void main()
{  
signed int a,b,c; 
TMOD=0X20;
SCON=0X50;
TH1=0XFD;
TR1=1;    
while(1)
{

d=1;     
r=0;     
delay(1);
r=1;
delay(1);
d=0;
delay (1);
senddata(0x23);
delay (1);
c=temp/100;
senddata(c);
delay (1);
a=(temp/10)-(c*10);
senddata(a);
delay (1);
b=temp%10;
senddata(b);
delay (1);
}
}
void senddata (unsigned char value)
{
value=value+0x30;
SBUF=value;
TI=0;
while(TI==0);
}
###############################################################################

some screen Shots

###############################################################################
##############################################################################
Visual Studio Code
######################################################################
Dim a As Integer
Dim temp As Integer

Private Sub Command2_Click()
MSComm1.PortOpen = False
Command2.Visible = False
Command1.Visible = True
End Sub

Private Sub Form_Load()
a = 10
MSComm1.RThreshold = 1
MSComm1.InputLen = 1
MSComm1.Settings = "9600,N,8,1"
MSComm1.DTREnable = False
End Sub
Private Sub Command1_Click()
MSComm1.CommPort = Text2.Text
MSComm1.PortOpen = True
Command1.Visible = False
Command2.Visible = True

End Sub



Private Sub MSComm1_OnComm()
Dim Data As String
If MSComm1.CommEvent = comEvReceive Then
Data = MSComm1.Input
End If
If Data = Chr$(83) Then
a = 0
End If
Select Case a
Case "1"
 num1.Text = Data
Case "2"
 num2.Text = Data
Case "3"
 num3.Text = Data
 'thermo.Value = num1.Text + num2.Text + num3.Text         ########## You Can Collect all files and data from our Blogs and Sites www.tishitu.org Happy Programming
 pb.Value = num1.Text + num2.Text + num3.Text
End Select
 a = a + 1
'If a = 4 Then
'a = 1
'End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
MSComm1.PortOpen = False
End Sub
#################################################################################

 Screen Shots
##############################################################################



1 comment: