Forum Sains Indonesia




*
Selamat datang, Pengunjung. Silahkan masuk atau mendaftar. Apakah anda lupa aktivasi email?
Mei 26, 2012, 01:12:59 PM

Masuk dengan nama pengguna, kata sandi dan lama sesi

Artikel Sains

Aku Cinta ForSa

  ForSa on FB  ForSa on Twitter

Pranala Luar

ShoutBox!

Last 10 Shouts:

 

fajri

Mei 24, 2012, 09:40:03 PM
numpang liat_liat dulu,, kexnya menarik bnget sama masalah mikon.. ! :D
 

haman11

Mei 24, 2012, 08:11:34 AM
ada yg tauproses daur ulang urin pada cicak gk ? ;)
 

GhostInMachine

Mei 23, 2012, 03:52:17 PM
kk mau tanya cara upload Tulisan dong??
 

army.fice

Mei 23, 2012, 12:22:47 AM
sepi banget sih :(
 

lustforscience

Mei 22, 2012, 08:26:02 PM
amin
 

exile_rstd

Mei 22, 2012, 08:24:55 PM
offline....
good night all  ;)
 

exile_rstd

Mei 22, 2012, 08:23:08 PM
iyaaaa jumat saya mau ujian kenaikan kelas. doain ya om Farabi, semoga ujiannya lancar dan dpt nilai memuaskan  :D
 

Farabi

Mei 22, 2012, 08:20:37 PM
KMana aja non? Sibuk belajar?
 

exile_rstd

Mei 22, 2012, 07:44:23 PM
argh lama ga buka forsa, comment di beberapa thread jd membingungkan saya. apa karena udh lama ga asah ya...
 

N E R R O

Mei 20, 2012, 07:41:57 PM
udah lama gak mampi ke forsa, sdh banyak berubah

Show 50 latest

Penulis Topik: mohon pencerahan para master sains  (Dibaca 858 kali)

0 Anggota dan 1 Pengunjung sedang melihat topik ini.

Offline yulf1

  • Siswa Baru
  • *
  • Tulisan: 2
  • IQ: 2
    • Lihat Profil
mohon pencerahan para master sains
« pada: Juli 09, 2011, 10:45:07 PM »
saya sedang tugas akhir tentang akuisisi data polusi udara berbasi web..
sensor yang digunakan TGS 2600 dan TGS 2201..tcp/ip modulnya pake NM7010A-lf.
saya sudah coba program dari IE pake bascom dan sudah berhasil. nh programnya

'-------------------------------------------------------------------------------
'                       NM7010A Network Module Test
'-------------------------------------------------------------------------------
$regfile = "m8535.dat"                                      ' specify the used micro
'$programmer = 1
$prog , &HA4 , &HD9,
$crystal = 8000000                                          ' used crystal frequency
$baud = 19200                                               ' use baud rate
$hwstack = 32                                               ' default use 32 for the hardware stack
$swstack = 10                                               ' default use 10 for the SW stack
$framesize = 40                                             ' default use 40 for the frame space

'used constants
Const Sock_stream = $01                                     ' Tcp
'Const Sock_dgram = $02                                      ' Udp
'Const Sock_ipl_raw = $03                                    ' Ip Layer Raw Sock
'Const Sock_macl_raw = $04                                   ' Mac Layer Raw Sock
'Const Sel_control = 0                                       ' Confirm Socket Status
'Const Sel_send = 1                                          ' Confirm Tx Free Buffer Size
Const Sel_recv = 2                                          ' Confirm Rx Data Size

'socket status
Const Sock_closed = $00                                     ' Status Of Connection Closed
'Const Sock_arp = $01                                        ' Status Of Arp
'Const Sock_listen = $02                                     ' Status Of Waiting For Tcp Connection Setup
'Const Sock_synsent = $03                                    ' Status Of Setting Up Tcp Connection
'Const Sock_synsent_ack = $04                                ' Status Of Setting Up Tcp Connection
'Const Sock_synrecv = $05                                    ' Status Of Setting Up Tcp Connection
Const Sock_established = $06                                ' Status Of Tcp Connection Established
Const Sock_close_wait = $07                                 ' Status Of Closing Tcp Connection
'Const Sock_last_ack = $08                                   ' Status Of Closing Tcp Connection
'Const Sock_fin_wait1 = $09                                  ' Status Of Closing Tcp Connection
'Const Sock_fin_wait2 = $0a                                  ' Status Of Closing Tcp Connection
'Const Sock_closing = $0b                                    ' Status Of Closing Tcp Connection
'Const Sock_time_wait = $0c                                  ' Status Of Closing Tcp Connection
'Const Sock_reset = $0d                                      ' Status Of Closing Tcp Connection
'Const Sock_init = $0e                                       ' Status Of Socket Initialization
'Const Sock_udp = $0f                                        ' Status Of Udp
'Const Sock_raw = $10                                        ' Status of IP RAW

Config Pind.4 = Output                                      ' Hardware reset NM7010A module
Set Portd.4
Reset Portd.4
Waitms 12
Set Portd.4

Enable Interrupts
' Change the MAC & IP address, SubMask, Gateway to appropriate to your network setting
' From computer connected to the network, type //192.168.1.8/index.htm at the Internet Explorer window
Config Tcpip = Int0 , Mac = 12.128.12.34.56.78 , Ip = 192.168.1.8 , Submask = 255.255.255.0 , Gateway = 192.168.1.1 , Localport = 1000 , Tx = $55 , Rx = $55 , Twi = &HCC , Clock = 300000

'dim used variables
Dim S As String * 200 , Shtml As String * 15 , Sheader As String * 30
Dim Tempw As Word
Dim I As Byte , P1 As Byte , P2 As Byte

Do
   Tempw = Socketstat(0 , 0)                                ' get status
   If Tempw = Sock_established Then
      Tempw = Socketstat(0 , Sel_recv)                      ' get received bytes
      If Tempw > 0 Then                                     ' if there is something received
         Do
            Tempw = Tcpread(0 , S)                          ' read a line
            If Left(s , 3) = "GET" Then
               Gosub Page
            End If
         Loop Until S = ""                                  ' wait until we get an empty line
         Tempw = Tcpwrite(0 , "HTTP/1.0 200 OK{013}{010}")  ' send ok
         Gosub Stuur                                        ' GET or HEAD or POST feedback so send it
         Closesocket 0                                      ' close the connection
      End If
   Elseif Tempw = Sock_close_wait Then
      Closesocket 0                                         ' we need to close
   Elseif Tempw = Sock_closed Then
      I = Getsocket(0 , Sock_stream , 80 , 0)               ' get a new socket
      Socketlisten 0                                        ' listen
   End If
Loop
End

'get html page out of data
Page:
   P1 = Instr(s , " ")                                      ' find first space
   P1 = P1 + 1                                              ' 4
   P2 = Instr(p1 , S , " ")                                 ' find second space
   P2 = P2 - P1
   Shtml = Mid(s , P1 , P2)                                 ' dont use too long page names
   Shtml = Lcase(shtml)                                     ' make lower case
Return

'send data
Stuur:
   Dim Wsize As Word , Ihitcounter As Integer
   Tempw = Tcpwrite(0 , "Content-Type: text/html{013}{010}")
   If Shtml = "/index.htm" Then                             ' data from eeprom
      S = "<html><head><title>Innovative Electronics</title></head><body><p><b>NM7010A test<br></b>by IE team<br><br>Hits : " + Str(ihitcounter) + "</p></body></html>"
      Incr Ihitcounter                                      ' increase hitcounter
      Wsize = Len(s)                                        ' size of body
      Sheader = "Content-Length: " + Str(wsize) + "{013}{010}"
      Tempw = Tcpwritestr(0 , Sheader , 255)                ' add additional CR and LF
      Tempw = Tcpwrite(0 , S , Wsize)                       ' send body
   End If
   Shtml = ""
Return


yang jadi masalah sekarang web yang dihasilkan masih berupa web statis,,
1. gimana supaya bisa jadi lebih dinamis
2. apakah bisa digabungkan dengan PHP atau sejenisnya
3. dan apakah bisa ditmbah aplikasi datasenya..??

mohon bantuannya,
terima kasih.

 

Copyright © 2006-2011 Forum Sains Indonesia