06-03-2009 02:01 PM
Hi, I'm trying to develop my own VI to write and read from an iRobot Create. I based my vi off the Basic Serial Write and Read.vi example I found (on LabView 8.0). When I run my vi I am able to read the beginning information from the Create, but I am unable to read a second time (after writing a command). The second read should be the same as the first (I checked using a different program that is linked to the Create). I am new at using LabVIEW and I was wondering if there is a common mistake made when trying to implement a serial read and write.
Thanks.
Solved! Go to Solution.
06-04-2009 04:15 PM
06-05-2009 08:46 AM
06-05-2009 09:02 AM
Then it sounds like the write is not working. Don't make the assumption that the write is working if you don't get an error. You will seldom get a VISA error with a write. For example, you can be sending garbage to the instrument. The instrument will not process it and as far as VISA is concerned, no error has occured.
Attach your code.
06-05-2009 09:13 AM
06-05-2009 09:27 AM
06-05-2009 12:50 PM
When I first turn on the iRobot, it sends some "welcoming/reset information." I was using the first read to read that info. The write is then supposed to send the reset command, I should then receive the same "welcoming/reset information" as before. I can now do that. I cannot send other commands to the iRobot successfully. I'm thinking this is a problem I'm having with formatting the commands, but I have no idea how it's incorrect.
As for in LabView, is there an easy way to set up a "pause" until a button is pushed? I'm thinking of a while loop that continues until a button is pushed and that will be the loop condition. Is the best way to implement this pause? (I have a large while loop around the write and read and want to send the write command only when I push a button.)
Thanks for all the help.
06-05-2009 12:55 PM
First, debug your commands with a program such as Hyperterminal. If it works there, then it should work in LabVIEW. You may need to send a carriage return and/or line feed (\r\n). Your code is not currently set up to do that.
Only doing something when a button is pressed is basic LabVIEW programming. You can use a simple while loop with a front panel Boolean wired to a case statement. If you have anything other than the base version of LabVIEW, you should be using the event structure. Look at the examples that come with LabVIEW.
06-08-2009 03:00 PM