473,226 Members | 1,309 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,226 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 5242
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: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.