473,569 Members | 2,536 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

2 New Member
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 5300
JKing
1,206 Recognized Expert Top Contributor
Hello,
What are the errors you receiving?
Apr 28 '11 #2
Mary Mah
2 New Member
thank you for your reply, iam recieving error in line 19 don't know why !!!
Apr 29 '11 #3
JKing
1,206 Recognized Expert Top Contributor
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
1913
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
3633
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. Specifically, I have a piece of equipment that outputs ASCII data to my computer through the serial port. Is there some way I can call the serial port...
3
2720
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 studio .net 2000)...kindly guide me plz... thank, r.hema malini --
4
11174
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. What I would like to do is make the serial port accessible via a web service. The web service and the legacy application would be running on the...
2
5236
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. someone advise me to use javabean. buat i don't quite understand how. thank you.
0
3002
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
1832
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
8155
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. Kindly do guide me through any tutorial,help book or even sugestion to initiate this project. Your kind guidence means alot to me .
1
1625
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 Thanking you.
2
2336
by: yo2osv | last post by:
I want read serial port and show on the screen using C programing
0
7614
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8125
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7974
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3642
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1221
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.