Selasa, 06 Oktober 2015

Measuring The Resistance


             Measuring Resistance is difficalt for same people. But, following six steps will eneble yoou to knew your resistance value. Resistors are electronic components that oppose the flow of electricity and the resistance is measured in ohms. First knowing the value, for larger value kilohms (1,000 ohms) and megohms (1,000,000 ohms) are used. For example 3,300 ohms equals 3.3 kilohms or just 3.3 k and 1,500,000 ohms equals 1.5 megohms or 1.5 meg.Second knowing about function of color, Color "bands" are used to indicate the resistance value with each color signifying a number and these color bands are grouped closer to one end of the resistor than the other.Third, see the first and second Color Codes chart, the first two color bands have values of brown = 1, red = 2, orange = 3 and so on.Next, see the third color band is the multiplier of the first 2 bands. Here, black is 1, brown is 10, red is 100 and so on. Putting this in other words, the value of the third band (the multiplier) is the number 10 raised to the power of the color code. For example, red in the third band is 10² or 100.Fifth, see the 4th band is the resistor's tolerance and shows how precisely the resistor was manufactured. Gold = 5%, silver = 10% and no band whatsoever = 20%.Finally, combine first until 4th color, that’s the value and tolerance resistance of resistor Knowing the value resistance make void the short circuit and more safety.

Selasa, 29 September 2015

Porsea City



Porsea is beautifull and cold place. At map we can see porsea in north sumatra near Toba Lake. At porse is cold and it feel so cold in the night and the morninng. There are so cold because around of porsea is montains and there are so many daily activity  people is farmer, so when you go to porsea and see left and right so many paddy with big area, that’s make porsea is beautifull and cold. the other reason why porsea is beautifull and cold place, location porsea is 400 meter highest from sea surface, and porsea near to intersted place of north sumatra is Toba Lake. Around is montains, many paddy with big area, 400 meter highest from sea surface and near Toba Lake make porsea is beautifull and cold place.

Minggu, 14 Juni 2015

Praktikum -Komunikasi Ethernet menggunakan VB



 Praktikum - Komunikasi Ethernet

 Dasar Teori
 
Komunikasi Ethernet merupakan salah satu jenis komunikasi yang paling sering
ditemui saat ini. Penggunaannya juga beragam, bisa digunakan untuk komunikasi antar
PC, PC dengan mikrokontroller, PC dengan PLC, PLC dengan PLC dan sebagainya.
Komunikasi Ethernet dapat menggunakan media berupa kabel maupun nirkabel.
Media kabel yang digunakan biasanya berupa kabel UTP yang ditiap ujungnya terdapat
konektor RJ45, sedangkan yang nirkabel biasanya memanfaatkan router wireless. Untuk
mengenali tujuan pengiriman data, komunikasi ini menggunakan IP address dan port. IP
Address dianalogikan sebagai kompleks perumahan, dan port dianalogikan sebagai
nomor rumah. Jika IP Address dan port yang digunakan asal-asalan, maka paket data
yang dikirimkan juga tidak akan pernah sampai ke device tujuan.
Pada komunikasi Ethernet terdapat 2 jenis protocol pengiriman data, yaitu TCP dan
UDP. Kedua protocol tersebut memiliki kelebihan dan kekurangan masing-masing. Pada
praktikum kali ini, kita akan membuat sebuah aplikasi chatting teks sederhana
menggunakan protocol UDP.

Pertama kita buka aplikasi visual studio



Lalu kita buat form seperti ini :



ketiga,
Kita tambahkan library dengan ini :

using System.Net;
using System.Net.Sockets;
using System.Threading;


Library tersebut digunakan untuk mengakses thread, socket dan beberapa method
yang dibutuhkan untuk pembuatan aplikasi.

keempat,
Ini adalah codingannya :

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Net;
using System.Net.Sockets;
using System.Threading;

namespace WindowsFormsApplication1
{
    public partial class chatform : Form
    {
        delegate void Addmessage(string message);
        //string username;
        //TcpClient topclient = new TcpClient();
        int port = 11000;
        const string broadcastAddress = "192.168.1.13";
        UdpClient receivingclient = new UdpClient(11000);
        UdpClient sendingclient;
        Thread receivingthread;

        public chatform()
        {
            InitializeComponent();
            this.Load += new EventHandler(chatform_Load);
            btnsend.Click += new EventHandler(btnsend_Click);
            //topclient.Connect("192.168.0.255",11000);
        }
       
        private void chatform_Load(object sender, EventArgs e)
        {
            textBoxtbsend.Focus();
            initializesender();
            initializeReceiver();

        }
        private void initializesender()
        {
            sendingclient = new UdpClient(broadcastAddress, port);
            sendingclient.EnableBroadcast = true;
        }

        private void initializeReceiver()
        {
            ThreadStart start = new ThreadStart (Receiver); //</p>
            receivingthread = new Thread(start); //</p>
            receivingthread .IsBackground  = true ;
            receivingthread.Start();

        }

        private void btnsend_Click(object sender, EventArgs e)
        {
            textBoxtbsend.Text = textBoxtbsend.Text.TrimEnd();
            if (!string.IsNullOrEmpty(textBoxtbsend.Text))
            {
                string tosend = "<" + Environment.MachineName + ">:" + textBoxtbsend.Text;
                byte[] data = Encoding.ASCII.GetBytes(tosend);
                sendingclient.Send(data, data.Length);
                textBoxtbsend.Text = "";

            }
            textBoxtbsend.Focus();

        }
        private void Receiver()
        {
            IPEndPoint endpoint = new IPEndPoint(IPAddress.Any, port);
            Addmessage messagedelegate = messagereceived;
            while (true)
            {
                byte []  data = receivingclient .Receive (ref endpoint);
                string message = Encoding .ASCII .GetString (data);
                Invoke (messagedelegate ,message );
                System.Console.Beep (1500,300);

            }
        }
        private void messagereceived(string message)
        {
            richTextBoxrtbchat.Text += message + "/n";
        }
    }
}

Kelima
Compile dan amati

Keenam
Coba ganti IP addrass dan port yg digunakan

Ketujuh
Kompile dan amati lagi..

Terimakasih semoga bermanfaat J