473,394 Members | 1,889 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to send Bits or data to serial port using PHP ??

Hi, iam building a system which will send data from website to serial port using PHP, the problem that i want to send bits to the serial port not only data. i wrote a php code to do so but it still give me errors...any help please ?!?

CODE:
Expand|Select|Wrap|Line Numbers
  1. <?php 
  2.  
  3. require("php_serial.class.php"); 
  4.  
  5. $serial = new phpSerial(); 
  6.  
  7. $serial->deviceSet("COM1"); 
  8. $serial->confBaudRate(9600); 
  9. $serial->confParity("none"); 
  10. $serial->confCharacterLength(8); 
  11. $serial->confStopBits(1); 
  12. $serial->confFlowControl("none");
  13.  
  14. $serial->deviceOpen(); 
  15.  
  16. int ser_writebyte( byte data );
  17. ser_write( 00000001 ); 
  18. $serial->deviceClose(); 
  19.  
  20.  
  21.  
  22. ?>
Apr 27 '11 #1
3 5258
JKing
1,206 Expert 1GB
Hello,
What are the errors you receiving?
Apr 28 '11 #2
thank you for your reply, iam recieving error in line 19 don't know why !!!
Apr 29 '11 #3
JKing
1,206 Expert 1GB
Yes, but what is the error you are receiving?

I looks like you have a closing curly brace on line 20 that has no opening brace. Removing that may solve your problem but without knowing what you error is I cannot be certain.
Apr 29 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Daniel Åberg | last post by:
I can't find how I can, in c#, open a serial port and read and write to it. Anyone that knows if there is any namespace with methods or code example.
1
by: Mike | last post by:
Sorry, don't know if this is the correct board for my question. I'm a novice so I guess I have a valid excuse My question : I'm using Visual C++ and I need to collect data from a serial port. ...
3
by: Hema Malini Rajanthiran | last post by:
to whom may concern...im final year student doing a project using handphone to create wireless communication. im finding difficulties to get the codes to connect to serial port using c#(visual...
4
by: joe bloggs | last post by:
I am writing a mobile application to interface with a legacy system and I am planning to use web services to communicate with this system. The legacy system receives data through a serial port. ...
2
by: hani | last post by:
hi, i'm try to do a program that can read serial port in web page. can anyone give me any opinion to do this? i've download the javacomm and try the examples. i'ts working. but it is in java client....
0
by: mahdy883 | last post by:
Dear all please, I want to know a piece of code that responsible for reading and writing to a serial port. Thanks
2
by: Prasanth MN | last post by:
Hai, I want to write Hex codes in to serial port using visual basic 6. How I can write this program. Please give me a small sample program. thanks
5
by: samifiaz | last post by:
I have to writen application in C# that can read or write data from a serial port. Can you please send any code that can help me for that. Or even material that can help me understanding this. ...
1
by: sbettadpur | last post by:
hello, I have a bulk of text in text file. so i want to send the text to database using perl is it possible? or do we have to convert text file to any other format if it is yes please let me know ...
2
by: yo2osv | last post by:
I want read serial port and show on the screen using C programing
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.