04-13-2009 04:02 PM
This is the kind of thing you should be able to debug on your own by now.
The example programs aren't intended to be the "end all be all" programs you should be using. They are just demonstrations of how you can use the functions that they are trying to demonstrate.
What other VI's do you have working with this besides Advanced Serial Read/Write? In that example, the write button is set up as "Switch action" which means it will continually be true until you actually unpress it yourself. If you only want to write something once, then you should change it to "Latch action".
If you are using other VI's along with this, you'll have to post more information as to how you are using them.
04-13-2009 04:54 PM - edited 04-13-2009 04:56 PM
yeah...
Its true.i was going to post a "NEVERMIND, got it" post, but you are a step ahead of me.
I found the solutions to my problem...
07-28-2009 07:15 PM - edited 07-28-2009 07:17 PM
Hi Guys:
I am able to access the Arduino using the Advanced serial*.vi. My arduino is programmed using bitlash (not arduino sketchbook). I need to query the status of digital i/o pins using bitlash commands. Any ideas how to do this in Labview.
Thanks
V
07-29-2009 01:17 PM
07-30-2009 11:34 AM
I haven't used bitlash with an Arduino before, so I took this opportunity to try it out. First, I downloaded and installed bitlash-1.0rc2 in the Arduino's hardware directory. Then, I compiled bitlash-demo.pde in the Arduino programming Environment and sent it to the Arduino via USB.
Getting comms established with the Arduino from LabVIEW was easy and I got the bitlash splash message right away. However, the Advanced Serial Write and Read.vi is very awkward for this kind of communications. If you don't know how big the message coming from the remote device will be. you have to wait until the read times out. If you didn't get all the message you'll have to go again to get it all. Sequencing the write and read commands manually is a pain.
Everytime you run this example, it reconfigures the port and bitlash restarts. A more versatile VI should initiate the port once, then enter a loop to either write to the port or read the number of bytes at the port and read them in a loop then wait for more bytes until the whole message has been recieved. When you're done, close the port before the IV terminates.
Plus there are a couple of gotchas with bitlash:
* bitlash requires each command to end with a newline command (\n)
* When the serial port is configured, the default for Enable Termination Char is True. Reset this to false.
If you send "print d13 /n", the Arduino will answer back with the current value on the pin. The bitlash docs cover the commands and arguments to set the pins and read them. Sending "while 1:d13=!d13; snooze(100)(\n)" with cause the LED on d13 to flash. Control C will bring control back to the terminal.
At first glance, I think bitlash and LabVIEW together will be a powerful combination. If any one going to NI Week wants to meet to discuss possible apps, let me know here so we can organize something.
07-30-2009 08:06 PM
Hi John
Thanks for the information. I tried this and was mostly successfull, except when I type "print d13 \n" (without quotes) I just get this string back instead of the actual state (a bit value of 0 or 1). I cant seem to pinpoint the error here.
I am attaching the screenshot of my vi bock diagram here, for reference.
Regards
V
07-30-2009 08:25 PM
07-31-2009 02:18 PM
If the Arduino answers back with the exact text sent including the \n, you'll need to change the string display property for your "String to Write" control from Normal Display to "\" Codes Display.
04-30-2010 08:00 PM
Hello !
Recently I did a proyect similar to yours.
Take a look at this.
http://www.youtube.com/watch?v=x1SD_Pag9ig
I don't know how are going your projects, but any questions I will try you to help you
Regards,
09-21-2010 04:25 PM