SlideShare una empresa de Scribd logo
1 de 18
The concept of Write-once-run-anywhere
(known as the Platform independent) is one of
the important key feature of java language that
makes java as the most powerful language. Not
even a single language is idle to this feature
but java is more closer to this feature. The
programs written on one platform can run on
any platform provided the platform must have
the JVM.
There are various features that makes the java as a
simple language. Programs are easy to write and
debug because java does not use the pointers
explicitly. It is much harder to write the java programs
that can crash the system but we can not say about
the other programming languages. Java provides the
bug free system due to the strong memory
management. It also has the automatic memory
allocation and deallocation system.
Java has the strong memory allocation and automatic
garbage collection mechanism. It provides the
powerful exception handling and type checking
mechanism as compare to other programming
languages. Compiler checks the program whether
there any error and interpreter checks any run time
error and makes the system secure from crash. All of
the above features makes the java language robust.
To be an Object Oriented language, any language must follow at least the four characteristics.
•Inheritance : It is the process of creating the new classes and using the behavior of the
existing classes by extending them just to reuse the existing code and adding the additional
features as needed.
•Encapsulation: It is the mechanism of combining the information and providing the
abstraction.
•Polymorphism: As the name suggest one name multiple form, Polymorphism is the way of
providing the different functionality by the functions having the same name based on the
signatures of the methods.
•Dynamic binding :Sometimes we don't have the knowledge of objects about their specific
types while writing our code. It is the way of providing the maximum functionality to a
program about the specific type at runtime.
As the languages like Objective C, C++ fulfills the above four characteristics yet they are not
fully object oriented languages because they are structured as well as object oriented
languages. But in case of java, it is a fully Object Oriented language because object is at the
outer most level of data structure in java. No stand alone methods, constants, and variables
are there in java. Everything in java is object even the primitive data types can also be
converted into object by using the wrapper class.
Distributed
The widely used protocols like HTTP and FTP are developed in java. Internet programmers can
call functions on these protocols and can get access the files from any remote machine on the
internet rather than writing codes on their local system.
Portable
The feature Write-once-run-anywhere makes the java language portable provided that the
system must have interpreter for the JVM. Java also have the standard data size irrespective of
operating system or the processor. These features makes the java as a portable language.
Dynamic
While executing the java program the user can get the required files dynamically from a local
drive or from a computer thousands of miles away from the user just by connecting with the
Internet.
Secure
Java does not use memory pointers explicitly. All the programs in java are run under an area
known as the sand box. Security manager determines the accessibility options of a class like reading
and writing a file to the local disk. Java uses the public key encryption system to allow the java
applications to transmit over the internet in the secure encrypted form. The bytecode Verifier
checks the classes after loading.
Performance
Java uses native code usage, and lightweight process called threads. In the beginning
interpretation of bytecode resulted the performance slow but the advance version of JVM uses the
adaptive and just in time compilation technique that improves the performance.
The term architectural neutral seems to be weird, but yes Java is an
architectural neutral language as well. The growing popularity of networks
makes developers think distributed. In the world of network it is essential that
the applications must be able to migrate easily to different computer systems.
Not only to computer systems but to a wide variety of hardware architecture
and Operating system architectures as well. The Java compiler does this by
generating byte code instructions, to be easily interpreted on any machine and
to be easily translated into native machine code on the fly. The compiler
generates an architecture-neutral object file format to enable a Java application
to execute anywhere on the network and then the compiled code is executed
on many processors, given the presence of the Java runtime system. Hence Java
was designed to support applications on network. This feature of Java has
thrived the programming language.
Windows XP / Vista.
JDK 6 or higher.
Eclipse IDE.
Bookstores Giovynet Driver
Two serial ports.
Hyperterminal.
1. Download handling libraries port.
2. Create java project.
3. Attach library for handling serial ports.
4. Create class to write code.
5. Write and execute code for free ports.
6. Write and execute code to transmit data between ports available.
Follow these steps:
1. Open the folder GiovynetDriver /
2. Copy the files NativeLibraries /
libSerialPort.dll, NativeLibraries
/libSOSerialPort.so, and SerialPort.jar.
3. In Eclipse, click on Window.
4. Click on Show View.
5. Click on Navigator.
6. Right-click the project node (RS232).
7. Click on Paste.
8. Right click on src.
9. Click on Build Path.
10. Click on Configure Build Path.
11. Click on Libraries.
12. Click on Add Jars.
13. Click SerialPort.jar.
14. Click Ok.
15. Click Ok.
public class App{
public static void main(String[ ] args)throws Exception{
SerialPort serialPort = new SerialPort();
List<String> portsFree = serialPort.getFreeSerialPort();
for (String free : portsFree) {
System.out.println(free);
}
}
}
import java.util.List;
import app.Com;
import app.Parameters;
import core.SerialPort;
public class App {
public static void main(String[] args)throws Exception{
// looks for free serial ports
SerialPort free = new SerialPort();
List<String> portList = free.getFreeSerialPort();
for (String string : portList) {
System.out.println(string);
}
// Settings parameters COM1.
Parameters settings = new Parameters();
settings.setPort("COM1");
settings.setBaudRate("9600");
//Instance COM1.
Com com1 = new Com(settings);
// Settings parameters COM·.
settings.setPort("COM3");
settings.setBaudRate("9600");
//Instance COM3.
Com com3 = new Com(settings);
//Write COM1.
for (int i = 0; i < 4; i++) {
System.out.println(">>Send G");
com1.sendSingleData('G');
}
//Read COM3
for (int i = 0; i < 4; i++) {
System.out.println("<<Receive "+com3.receiveSingleString());
}
}
}

Más contenido relacionado

La actualidad más candente (20)

Java features
Java featuresJava features
Java features
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
Java part1
Java part1Java part1
Java part1
 
Presentation on java (8)
Presentation on java (8)Presentation on java (8)
Presentation on java (8)
 
Java unit 1
Java unit 1Java unit 1
Java unit 1
 
Java presentation
Java presentationJava presentation
Java presentation
 
Features of java unit 1
Features of java unit 1Features of java unit 1
Features of java unit 1
 
Features of java
Features of javaFeatures of java
Features of java
 
Java introduction with JVM architecture
Java introduction with JVM architectureJava introduction with JVM architecture
Java introduction with JVM architecture
 
Java Intro
Java IntroJava Intro
Java Intro
 
Features of java
Features of javaFeatures of java
Features of java
 
Java
JavaJava
Java
 
Java Development Kit (jdk)
Java Development Kit (jdk)Java Development Kit (jdk)
Java Development Kit (jdk)
 
JAVA ENVIRONMENT
JAVA  ENVIRONMENTJAVA  ENVIRONMENT
JAVA ENVIRONMENT
 
JRE , JDK and platform independent nature of JAVA
JRE , JDK and platform independent nature of JAVAJRE , JDK and platform independent nature of JAVA
JRE , JDK and platform independent nature of JAVA
 
Features of java 02
Features of java 02Features of java 02
Features of java 02
 
INTRODUCTION TO JAVA APPLICATION
INTRODUCTION TO JAVA APPLICATIONINTRODUCTION TO JAVA APPLICATION
INTRODUCTION TO JAVA APPLICATION
 
Jvm
JvmJvm
Jvm
 
Java vs python
Java vs pythonJava vs python
Java vs python
 
core java
core javacore java
core java
 

Destacado

Weekly Real Estate Absorption rate sendingapr25
Weekly Real Estate Absorption rate sendingapr25Weekly Real Estate Absorption rate sendingapr25
Weekly Real Estate Absorption rate sendingapr25gueste85b68
 
Happy Mother’S Day Mommy
Happy Mother’S Day MommyHappy Mother’S Day Mommy
Happy Mother’S Day Mommybritbobz
 
C:\Fakepath\TOP SECRET MISCAREA LEGIONARA
C:\Fakepath\TOP SECRET MISCAREA LEGIONARAC:\Fakepath\TOP SECRET MISCAREA LEGIONARA
C:\Fakepath\TOP SECRET MISCAREA LEGIONARABiblioteca Secreta
 
Trends in digital learning
Trends in digital learningTrends in digital learning
Trends in digital learningSprout Labs
 
Project management and 702010 blended learning programs
Project management and 702010 blended learning programsProject management and 702010 blended learning programs
Project management and 702010 blended learning programsSprout Labs
 
eLearning - Branching Scenorias
eLearning - Branching ScenoriaseLearning - Branching Scenorias
eLearning - Branching ScenoriasSprout Labs
 
How to make social learning work
How to make social learning workHow to make social learning work
How to make social learning workSprout Labs
 
Webinar - Evaluating 70:20:10 learning programs
Webinar - Evaluating 70:20:10 learning programsWebinar - Evaluating 70:20:10 learning programs
Webinar - Evaluating 70:20:10 learning programsSprout Labs
 
Learn how to design a 70-20-10 learning ecosystem
Learn how to design a 70-20-10 learning ecosystemLearn how to design a 70-20-10 learning ecosystem
Learn how to design a 70-20-10 learning ecosystemSprout Labs
 

Destacado (20)

Haicku submission
Haicku submissionHaicku submission
Haicku submission
 
Forbidden Mihai Eminescu
Forbidden Mihai EminescuForbidden Mihai Eminescu
Forbidden Mihai Eminescu
 
Weekly Real Estate Absorption rate sendingapr25
Weekly Real Estate Absorption rate sendingapr25Weekly Real Estate Absorption rate sendingapr25
Weekly Real Estate Absorption rate sendingapr25
 
INTERZIS EMINESCU
INTERZIS EMINESCUINTERZIS EMINESCU
INTERZIS EMINESCU
 
Wiki
WikiWiki
Wiki
 
Scavenger hunt
Scavenger huntScavenger hunt
Scavenger hunt
 
Happy Mother’S Day Mommy
Happy Mother’S Day MommyHappy Mother’S Day Mommy
Happy Mother’S Day Mommy
 
MARESALUL SI GARDA DE FIER
MARESALUL SI GARDA DE FIERMARESALUL SI GARDA DE FIER
MARESALUL SI GARDA DE FIER
 
C:\Fakepath\TOP SECRET MISCAREA LEGIONARA
C:\Fakepath\TOP SECRET MISCAREA LEGIONARAC:\Fakepath\TOP SECRET MISCAREA LEGIONARA
C:\Fakepath\TOP SECRET MISCAREA LEGIONARA
 
Iorga si secretele istoriei
Iorga si secretele istorieiIorga si secretele istoriei
Iorga si secretele istoriei
 
Aservirea Romaniei
Aservirea RomanieiAservirea Romaniei
Aservirea Romaniei
 
Nationalismul legionar
Nationalismul legionarNationalismul legionar
Nationalismul legionar
 
Secret history of Iron Guard
Secret history of Iron GuardSecret history of Iron Guard
Secret history of Iron Guard
 
Trends in digital learning
Trends in digital learningTrends in digital learning
Trends in digital learning
 
Project management and 702010 blended learning programs
Project management and 702010 blended learning programsProject management and 702010 blended learning programs
Project management and 702010 blended learning programs
 
eLearning - Branching Scenorias
eLearning - Branching ScenoriaseLearning - Branching Scenorias
eLearning - Branching Scenorias
 
Top secret miscarea legionara
Top secret miscarea legionaraTop secret miscarea legionara
Top secret miscarea legionara
 
How to make social learning work
How to make social learning workHow to make social learning work
How to make social learning work
 
Webinar - Evaluating 70:20:10 learning programs
Webinar - Evaluating 70:20:10 learning programsWebinar - Evaluating 70:20:10 learning programs
Webinar - Evaluating 70:20:10 learning programs
 
Learn how to design a 70-20-10 learning ecosystem
Learn how to design a 70-20-10 learning ecosystemLearn how to design a 70-20-10 learning ecosystem
Learn how to design a 70-20-10 learning ecosystem
 

Similar a Presentación rs232 java

Similar a Presentación rs232 java (20)

JAVA PROGRAMMING-Unit I - Final PPT.pptx
JAVA PROGRAMMING-Unit I - Final PPT.pptxJAVA PROGRAMMING-Unit I - Final PPT.pptx
JAVA PROGRAMMING-Unit I - Final PPT.pptx
 
Sybsc cs sem 3 core java
Sybsc cs sem 3 core javaSybsc cs sem 3 core java
Sybsc cs sem 3 core java
 
0f0cef_1dac552af56c4338ab0672859199e693.pdf
0f0cef_1dac552af56c4338ab0672859199e693.pdf0f0cef_1dac552af56c4338ab0672859199e693.pdf
0f0cef_1dac552af56c4338ab0672859199e693.pdf
 
Java features
Java  features Java  features
Java features
 
Introduction to Java Programming.pdf
Introduction to Java Programming.pdfIntroduction to Java Programming.pdf
Introduction to Java Programming.pdf
 
Java ms harsha
Java ms harshaJava ms harsha
Java ms harsha
 
Unit1 JAVA.pptx
Unit1 JAVA.pptxUnit1 JAVA.pptx
Unit1 JAVA.pptx
 
Java and its features
Java and its featuresJava and its features
Java and its features
 
Java 3 rd sem. 2012 aug.ASSIGNMENT
Java 3 rd sem. 2012 aug.ASSIGNMENTJava 3 rd sem. 2012 aug.ASSIGNMENT
Java 3 rd sem. 2012 aug.ASSIGNMENT
 
java introduction.docx
java introduction.docxjava introduction.docx
java introduction.docx
 
Java chapter 1
Java   chapter 1Java   chapter 1
Java chapter 1
 
Java1
Java1Java1
Java1
 
Java
Java Java
Java
 
Features of Java.pptx
Features of Java.pptxFeatures of Java.pptx
Features of Java.pptx
 
JAVA ALL 5 MODULE NOTES.pptx
JAVA ALL 5 MODULE NOTES.pptxJAVA ALL 5 MODULE NOTES.pptx
JAVA ALL 5 MODULE NOTES.pptx
 
Getting Started with JAVA
Getting Started with JAVAGetting Started with JAVA
Getting Started with JAVA
 
Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...
 
JAVA FEATURES
JAVA FEATURESJAVA FEATURES
JAVA FEATURES
 
Features of java Part - 3
Features of java Part - 3Features of java Part - 3
Features of java Part - 3
 
2-Lec - History of OOP and Java (1) .ppt
2-Lec - History of OOP and Java  (1) .ppt2-Lec - History of OOP and Java  (1) .ppt
2-Lec - History of OOP and Java (1) .ppt
 

Último

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Último (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Presentación rs232 java

  • 1.
  • 2.
  • 3.
  • 4. The concept of Write-once-run-anywhere (known as the Platform independent) is one of the important key feature of java language that makes java as the most powerful language. Not even a single language is idle to this feature but java is more closer to this feature. The programs written on one platform can run on any platform provided the platform must have the JVM.
  • 5. There are various features that makes the java as a simple language. Programs are easy to write and debug because java does not use the pointers explicitly. It is much harder to write the java programs that can crash the system but we can not say about the other programming languages. Java provides the bug free system due to the strong memory management. It also has the automatic memory allocation and deallocation system.
  • 6. Java has the strong memory allocation and automatic garbage collection mechanism. It provides the powerful exception handling and type checking mechanism as compare to other programming languages. Compiler checks the program whether there any error and interpreter checks any run time error and makes the system secure from crash. All of the above features makes the java language robust.
  • 7. To be an Object Oriented language, any language must follow at least the four characteristics. •Inheritance : It is the process of creating the new classes and using the behavior of the existing classes by extending them just to reuse the existing code and adding the additional features as needed. •Encapsulation: It is the mechanism of combining the information and providing the abstraction. •Polymorphism: As the name suggest one name multiple form, Polymorphism is the way of providing the different functionality by the functions having the same name based on the signatures of the methods. •Dynamic binding :Sometimes we don't have the knowledge of objects about their specific types while writing our code. It is the way of providing the maximum functionality to a program about the specific type at runtime. As the languages like Objective C, C++ fulfills the above four characteristics yet they are not fully object oriented languages because they are structured as well as object oriented languages. But in case of java, it is a fully Object Oriented language because object is at the outer most level of data structure in java. No stand alone methods, constants, and variables are there in java. Everything in java is object even the primitive data types can also be converted into object by using the wrapper class.
  • 8. Distributed The widely used protocols like HTTP and FTP are developed in java. Internet programmers can call functions on these protocols and can get access the files from any remote machine on the internet rather than writing codes on their local system. Portable The feature Write-once-run-anywhere makes the java language portable provided that the system must have interpreter for the JVM. Java also have the standard data size irrespective of operating system or the processor. These features makes the java as a portable language. Dynamic While executing the java program the user can get the required files dynamically from a local drive or from a computer thousands of miles away from the user just by connecting with the Internet. Secure Java does not use memory pointers explicitly. All the programs in java are run under an area known as the sand box. Security manager determines the accessibility options of a class like reading and writing a file to the local disk. Java uses the public key encryption system to allow the java applications to transmit over the internet in the secure encrypted form. The bytecode Verifier checks the classes after loading. Performance Java uses native code usage, and lightweight process called threads. In the beginning interpretation of bytecode resulted the performance slow but the advance version of JVM uses the adaptive and just in time compilation technique that improves the performance.
  • 9. The term architectural neutral seems to be weird, but yes Java is an architectural neutral language as well. The growing popularity of networks makes developers think distributed. In the world of network it is essential that the applications must be able to migrate easily to different computer systems. Not only to computer systems but to a wide variety of hardware architecture and Operating system architectures as well. The Java compiler does this by generating byte code instructions, to be easily interpreted on any machine and to be easily translated into native machine code on the fly. The compiler generates an architecture-neutral object file format to enable a Java application to execute anywhere on the network and then the compiled code is executed on many processors, given the presence of the Java runtime system. Hence Java was designed to support applications on network. This feature of Java has thrived the programming language.
  • 10. Windows XP / Vista. JDK 6 or higher. Eclipse IDE. Bookstores Giovynet Driver Two serial ports. Hyperterminal. 1. Download handling libraries port. 2. Create java project. 3. Attach library for handling serial ports. 4. Create class to write code. 5. Write and execute code for free ports. 6. Write and execute code to transmit data between ports available.
  • 11.
  • 12.
  • 13. Follow these steps: 1. Open the folder GiovynetDriver / 2. Copy the files NativeLibraries / libSerialPort.dll, NativeLibraries /libSOSerialPort.so, and SerialPort.jar. 3. In Eclipse, click on Window. 4. Click on Show View. 5. Click on Navigator. 6. Right-click the project node (RS232). 7. Click on Paste. 8. Right click on src. 9. Click on Build Path. 10. Click on Configure Build Path. 11. Click on Libraries. 12. Click on Add Jars. 13. Click SerialPort.jar. 14. Click Ok. 15. Click Ok.
  • 14.
  • 15.
  • 16.
  • 17. public class App{ public static void main(String[ ] args)throws Exception{ SerialPort serialPort = new SerialPort(); List<String> portsFree = serialPort.getFreeSerialPort(); for (String free : portsFree) { System.out.println(free); } } }
  • 18. import java.util.List; import app.Com; import app.Parameters; import core.SerialPort; public class App { public static void main(String[] args)throws Exception{ // looks for free serial ports SerialPort free = new SerialPort(); List<String> portList = free.getFreeSerialPort(); for (String string : portList) { System.out.println(string); } // Settings parameters COM1. Parameters settings = new Parameters(); settings.setPort("COM1"); settings.setBaudRate("9600"); //Instance COM1. Com com1 = new Com(settings); // Settings parameters COM·. settings.setPort("COM3"); settings.setBaudRate("9600"); //Instance COM3. Com com3 = new Com(settings); //Write COM1. for (int i = 0; i < 4; i++) { System.out.println(">>Send G"); com1.sendSingleData('G'); } //Read COM3 for (int i = 0; i < 4; i++) { System.out.println("<<Receive "+com3.receiveSingleString()); } } }