473,385 Members | 1,640 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,385 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 5256
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.