how to send data through serial port using matlab?

i'm interfacing a microcontroller with pc. how to send data through serial port of pc, using matlab?
0
e_rockerz (6)
3/11/2009 10:00:19 AM
comp.soft-sys.matlab 206921 articles. 560 followers. lunamoonmoon (258) is leader. Post Follow

6 Replies
409 Views

Similar Articles

[PageSpeed] 38
"mohan cp" <e_rockerz@yahoo.com> wrote in message 
news:gp823j$quk$1@fred.mathworks.com...
> i'm interfacing a microcontroller with pc. how to send data through serial 
> port of pc, using matlab?

s=serial('com1');
fopen(s);
fwrite(s,'12345');
fclose(s);

http://www.mathworks.com/serial 


0
tjarvi (224)
3/11/2009 3:16:26 PM
"Trent Jarvi" <tjarvi@mathworks.com> wrote in message <gp8kka$ai$1@fred.mathworks.com>...
> 
> "mohan cp" <e_rockerz@yahoo.com> wrote in message 
> news:gp823j$quk$1@fred.mathworks.com...
> > i'm interfacing a microcontroller with pc. how to send data through serial 
> > port of pc, using matlab?
> 
> s=serial('com1');
> fopen(s);
> fwrite(s,'12345');
> fclose(s);
> 
> http://www.mathworks.com/serial 
> 
thank u.......
0
e_rockerz (6)
3/12/2009 4:06:04 AM
"Trent Jarvi" <tjarvi@mathworks.com> wrote in message <gp8kka$ai$1@fred.mathworks.com>...
> 
> "mohan cp" <e_rockerz@yahoo.com> wrote in message 
> news:gp823j$quk$1@fred.mathworks.com...
> > i'm interfacing a microcontroller with pc. how to send data through serial 
> > port of pc, using matlab?
> 
> s=serial('com1');
> fopen(s);
> fwrite(s,'12345');
> fclose(s);
> 
> http://www.mathworks.com/serial 
> 
thank u
0
e_rockerz (6)
3/12/2009 4:06:07 AM
"Trent Jarvi" <tjarvi@mathworks.com> wrote in message <gp8kka$ai$1@fred.mathworks.com>...
> 
> "mohan cp" <e_rockerz@yahoo.com> wrote in message 
> news:gp823j$quk$1@fred.mathworks.com...
> > i'm interfacing a microcontroller with pc. how to send data through serial 
> > port of pc, using matlab?
> 
> s=serial('com1');
> fopen(s);
> fwrite(s,'12345');
> fclose(s);
> 
> http://www.mathworks.com/serial 
> 

Hi,
Concerning this issue, i have two question:

1- Using "INSTRFIND" show me all ports, but all statue are close. How can i open them?
2-I did not get from above-mentioned code, how to send a data (e.g *.txt format)
to com1, would you give me some more helps!

thanks 
0
jeff_dubi (28)
7/3/2009 3:37:01 PM
"karlo gonzales" wrote in message <h2l8is$deu$1@fred.mathworks.com>...
> "Trent Jarvi" <tjarvi@mathworks.com> wrote in message <gp8kka$ai$1@fred.mathworks.com>...
> > 
> > "mohan cp" <e_rockerz@yahoo.com> wrote in message 
> > news:gp823j$quk$1@fred.mathworks.com...
> > > i'm interfacing a microcontroller with pc. how to send data through serial 
> > > port of pc, using matlab?
> > 
> > s=serial('com1');
> > fopen(s);
> > fwrite(s,'12345');
> > fclose(s);
> > 
> > http://www.mathworks.com/serial 
> > 
> 
> Hi,
> Concerning this issue, i have two question:
> 
> 1- Using "INSTRFIND" show me all ports, but all statue are close. How can i open them?
> 2-I did not get from above-mentioned code, how to send a data (e.g *.txt format)
> to com1, would you give me some more helps!
> 
> thanks 


use this commend first 
delete(instrfindall)
0
3/23/2013 4:15:06 PM
On Wednesday, March 11, 2009 8:46:26 PM UTC+5:30, Trent Jarvi wrote:
> "mohan cp" <e_rockerz@yahoo.com> wrote in message 
> news:gp823j$quk$1@fred.mathworks.com...
> > i'm interfacing a microcontroller with pc. how to send data through serial 
> > port of pc, using matlab?
> 
> s=serial('com1');
> fopen(s);
> fwrite(s,'12345');
> fclose(s);
> 
> http://www.mathworks.com/serial

you have given code to send data through serial cable in matlab.
how can i receive the same data in micro controller(Im using ARM 7 micro controller which runs with keil software).
please help me as soon as possible
0
ravitej
4/3/2014 8:31:54 AM
Reply:
Similar Artilces:

IBM Trackpoint Error, How to use Mouse Now?
Group, Thinkpad 760xl gave me a trackpoint error. I unplugged the keyboard connector and reseated to no avail. Then plugged in a serial mouse, and the mouse works during tests, but it will not work when I finally get the machine to boot using F1 on reboot. How do I get this mouse to work in the interim while awaiting a new keyboard? Can a thinkpad be use with no pointing device at all, like enabling the cursor keys or something like that? This may be a dumb question but I need the assistance of the group to either get the mouse going or somehow use without a mouse at all. Thanks Tom ...

US-VA: Alexandria-Oracle Data Analyst
************************************************************** JobCircle.com is the largest regional job board in the Mid-Atlantic region, with tens of thousands of job offerings in PA, NJ, DE, MD, NY, and Washington D.C. To learn more, visit http://www.jobcircle.com?source=ng ************************************************************** Job Title: Oracle Data Analyst Job Location: VA: Alexandria Pay Rate: Open Job Length: full time Start Date: 2009-02-12 Company Name: Grant Thornton LLP Contact: Human Resources Phone: email only please Fax...

Converting to uppercase using Perl5Substitution
Hi, We are using the following piece of code for Perl5Substitution. public String substitute (String regExp, String sub, String input) throws DatafileException { PatternMatcher matcher = new Perl5Matcher(); Pattern pattern = null; PatternCompiler compiler = new Perl5Compiler(); try { pattern = compiler.compile(regExp); } catch(MalformedPatternException e){ String errorMessage = "Bad pattern. " + e; log.error(errorMessage); throw new DatafileErrorException(errorMessage); } // ...

align to left output data
Hello, I need to add a routine to an old F77 code. The routine is supposed to write an ASCII file where each line starts at column 1. The code below does do that for string variables. I was not able to do that for real and integer numbers. When I look at the output file, the values printed for real and integer numbers start at column 2, rather than 1. Any suggestions? Thanks ================== SOURCE CODE =============== CHARACTER*128 TXT,AKO INTEGER I1,I2 REAL*4 F1,F2 DIMENSION TXT(5),AKO(5) OPEN(6,FILE="AKO.TXT") TXT(1)="1234567890" TXT(2)...

Sending out a probe
TCP-IP question: From the manual: " TCP keep alive (TCPKEEPALV) - Help Specifies the amount of time, in minutes, that TCP waits before sending out a probe to the other side of a connection. The probe is sent when the connection is otherwise idle, even when there is no data to be sent. " Because we have frequent disconnects on the Telnet sessions we have had a sniffer running on one of the PC's on which we expected the probe to come in. But we have never seen some kind of bit coming in from the AS400. Do we do something wrong or should we open some po...

problem in randomly fetching data from mssql databse using scrollable resultset
Hi all i have a gui based application which conects a MSSQL-server 2000. I have buttons such as first-previous-next-last buttons to navigate throught the database. I am using scrollable resultset st=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); i want to fetch a particualr row based on the primary key passed. i am incrementing a number whenever user presses next button. I am using rs.absolute(); but its giving invalid cursor state error. Please help me with some code that allows fast and random navigation i am using type 1 driver...

Send a SNMP Trap
hy, I'm using wengsoft snmp implementation to send a snmp trap. But the information sent by the trap isn't as I would expect. My code: static void sendTrap(String contextID, String contextName) throws java.io.IOException { // Create SNMP message object, it may contain one of the following // protocol data unit : GET, SET, TRAP, GET-NEXT. snmpMessage = new SnmpMessage(); // create a Set Protocol Data Unit. trapPdu = new SnmpGetSetPdu(); trapPdu.setMsgType(AsnObject.SNMPV2_TRAP); trapPdu.setReqId(1); snmpMessage.setPdu(trapPdu); snmpMessage.setSnmpVersion(3); ...

send mail in FMP with Exchange Server ?
Hi, For the Send Mail script in FileMaker vers. 9.0 , it works perfectly if my syst�me is win XP with the Outlook Express installed. And when I put this DB in a winXP with an account of Exchange Server, the Send Mail script doesn't work ! Is this normal or do I have to do something ? Thanks for your help Hi Eric, in FM 7 the problem is that there must be the email program be mentioned in the options of Internet Explorer (in our case). So we are working with Lotus Notes and by default the corresponding email program is outlook express. So open e.g. Internet Explorer then Tools /...

Port Royale riddle?
Anyone here playing "Port Royale" by Ascaron? I'm stuck on a particular riddle (in three parts): "The end of the journey is the destination town. On the other side, the treasure can be found." "The Journey starts where the little keys are found." "Travel with the easterly wind for a day, brave all dangers, come what may." ========================================= OK, "the journey starts where the little keys are". I start at the Florida Keys "Travel with the easterly wind for a day". I go east about a day. ...

Problems with send /delete command
I have Kermit running on Linux Release 9 and have the following lines in my script (This first logs me onto a remote server running Linux 7.3 and has Kermit): set host /pty ssh -e none l root xxx.xxx.xx.xxx if fail stop 1 minput 30 "password:" ">" if < \v(minput) 1 stop 1 "MINPUT = \v(minput)" switch \v(minput) { :1, echo PASSWORD INPUT OK lineout xxxxxxxxxx input 30 "#" if fail stop 1 PROMPT INPUT FAILED :2, echo PROMPT INPUT OK lineout "kermit -x" input 20 "KERMIT READY TO SERVE..." rcd...

Is the use of the SORTED BY option really a gain of time?
Dear Newsgroup, I read the SUGI - Paper 147-29 titled: Efficiency Technique for Beginning PROC SQL Users. As a beginner of SAS this was the right thing for me. Here is an excerpt of the paper (page 4): When performing a sort-merge join operation, use the SORTEDBY table option to inform the SQL procedure that the table is already arranged in the desired order. This prevents the larger table from being automatically sorted during the join operation. Example: proc sql; select title, rating, length, actor_leading from sugi.movies (SORTEDBY=title), sugi.actors where movies.title = actors.title; q...

sending eMail Attachment
Hy, does anybody know a simple, easy to use package to send a binary file as an eMail attachemt over the local unix/linux sendmail service. I want to write a procedure like: proc sendFileViaEmail {to subject text fileList} { # build whats neccessey in file ..... write_file file $emailbody #send exec cat file | sendmail -t } tx TAB Tillmann Basien wrote: > Hy, > does anybody know a simple, easy to use package to send a binary file as an > eMail attachemt over the local unix/linux sendmail service. > I want to write a procedure like: > > proc sendFil...

how do I erase old data when using plots?
Hi all, Unlike the plot command, when I use the plots command and then re-use it with new data, the old data remains on the graph. While I am rather fond of the old data, I would like prefer it not be there. There doesn't appear to be an option for plots that will erase the old data first. Is there a simple way of clearing this data? David David Jackson writes: > Unlike the plot command, when I use the plots command and then re-use it > with new data, the old data remains on the graph. While I am rather fond of > the old data, I would like prefer it not be there. There ...

NT 4.0 Hard drive crash, trying to restore data from tape backup, unrecognizable format, unknown backup software
Hello, I have a customer that has lost the hard drive to an NT 4.0 box. They have tape backups but I'm not sure what backup software they were using. (Last guy left no cd's behind) I've tried different ones, Colorado, BackupAssist, backupexec, veritas(version 10, hoping it would be backwards compatible). Still unable to find one to reconize the format. Anyone know of a software that will read several formats, or any other suggestions?? Tape backup is s seagate STT320000A Thanks for any help. Sorry to semi-spam you here, but this sort of thing is pretty much up our ...

using xdata, ydata bounds
Hi all, I have two sets of images, a base set and a target set. I have already performed a 'nonreflective similarity' transformation one of the target images relative to its corresponding base image. I used xdata and ydata handles in order to store the new x, y bounds in the output space as follows; [affed xdata ydata] = imtransform(targim,tform); Does anyone know how I can go about rewriting this target image taking into account the new x and y bounds? I want to be able to display the images simultaneously without having to call the xdata, ydata bounds each time I display the targe...

Send mail
I want to send an email with attachment using mpack.(UNIX/LINUX/AIX). Is there a startup param like "mailx -r" where you can change the senders address? ...

Verizon's 'Free Gift' to Customers: Giving Data to Credit Bureaus
By Bruce Mohl, Globe Staff | May 21, 2006 Verizon Communications Inc. has begun reporting to the nation's three credit bureaus which Massachusetts customers pay their bills on time and which ones don't, a practice a company spokesman described as 'a free gift to the public.' The telecommunications giant says its reports to Equifax, Experian, and TransUnion will help consumers with limited credit histories build a payment record that can be used to secure lower rates on mortgages, credit cards, and car loans. But there's a flip side to this 'free gift...

MATLAB engine, engPutVariable problem
Hi all, I have a problem with the MATLAB engine. I ask a MATLAB engine to evaluate a .m function (engEvalString). When the .m function is running I want to transfer matrix data to the MATLAB engine's workplace using engPutVariable. This is because I receive data during certain events. The .m function can then read the new data and act accordingly. But unfortunately MATLAB does not work in this way. If an .m function is running, MATLAB does not put any new data in the workspace. I receive the matrix data only after the .m function has terminated. Does anybody have a solution to this prob...

how to decrease the size of database after deleting a lot of data
Hello, I am trying to free some space on the server by cleaning up tables that have unused(garbage) data. Here is what I do, but I would like to get the experts opinion, maybe there is something else or something more I can to do to achieve my goal. 1. I delete data I need. 2. I use DBCC UPDATEUSAGE 3. Then I use DBCC SHRINKFILE ('datafile_data', TRUNCATEONLY) 4. Then I use DBCC SHRINKFILE ('datafile_data',[the size I would like to shrink it to]) 5. Then Rebuild Indexes. I have also a question about [the size I would like to shrink it to]. How do I determine the right number?...

error using save function and -v6 switch
Hello, I recently moved to R2006a to test porting my code (currently running fine on R13). As configuration files of my code are created with the save function, I have to use the -v6 switch in R2006a to ensure compatibility ... but I've noticed a strange behavior: In R2006a, type : a=2;st='hello';save('test.dat','a','st','-v6') In R13 : load('test.dat','-mat') a=2 and st='hello' ... fine. In R2006a modify variable a and append it : a=10;save('test.dat','a','-v6','-append') In R13 : ...

Designing a simple PLB master using EDK 6.3i
Hello, I designed a module that issues writes and reads to the PLB bus using IPIF interface from the "Create Peripheral" wizard in EDK's XPS. I have issued requests per the guidelines in the PLB documentation (http://www.xilinx.com/bvdocs/ipcenter/data_sheet/plb_ipif.pdf ) and the README.txt that comes with the "Create Peripheral" wizard. Specifically, I have been using the waveforms on pages 116 and 117 as guidelines. The main difference is that my implementation issues single beat writes and reads. Nonetheless, I'm using the write/read requests in a similar manne...

Sending errors from psql to error file
Hello, I am trying to migrate a client from one database to another. Basically we designed a web application for them using Postgresql but we have made many changes to the design of our application since version 1. Now they want to upgrade. So basically I have to pg_dump their current data and then import it into our new schema. Now, of course I realize that there are going to be errors. But they have a lot and I mean a lot of data. I don't want to have to sit there and watch the import go by, I want to run a command and then look in a file for any errors after the import i...

link to document of Matlab v6.5.1
Hello, There used to be a link on mathworks web site for all the documentation of matlab 6.5.1. But now it is gone. Could someone post it here? It is really handy for me since I didn't install the HTML document in my notebook. Thanks. Alder ...

PS CS camera raw, getting full camera EXIF data from raw file into jpeg
I use camera raw and edit my Canon raw images in CS. When the result is saved as JPG file, the embedded EXIF contains only PhotoShop's meta data, basically software name, and editing date and time. The original camera EXIF data is not included in the resulting JPG file. I have tried setting and unsetting several options but cannot make PhotoShop to include camera's original EXIF data into the resulting JPG file. Which options do you set in CS to include camera's original EXIF data into JPG file when using camera raw? Hitchkas <hitchkas@gmail.com> wrote: > I use came...

directory data structure
Hi I want to write a C program that can read directories (say list them as well). I found out that we could use an API provided by dirent.h header file, but I am not too keen on using the API. I want to access it directly without any API. Any help is welcome. Thank you. sid <kingsiddharth@gmail.com> wrote: > Hi > I want to write a C program that can read directories (say list them > as well). > I found out that we could use an API provided by dirent.h header file, > but I am not too keen on using the API. I want to access it directly > without any API. Any help is welc...