Shop OBEX P1 Docs P2 Docs Learn Events
TAOS 230 and LabView 7.0 — Parallax Forums

TAOS 230 and LabView 7.0

J.D.J.D. Posts: 4
edited 2007-07-20 14:30 in BASIC Stamp
I have a TAOS 230 color sensor that I am trying to link up with LabView7.0.· I am using the SEROUT command to send the data from the BS2 STAMP, and it comes out once every 2 seconds.· I have setup the COM port in LabView and it is seeing the data, but the timing is off because sometimes it catches all the numbers and sometimes it does not.· If i have my program running ina DEBUG window, my data comes over as follows:· RGB, XMIT, (XXXX, XXXX, XXXX)······ The X's represent my color values (I am running a 12 bit program) and this is what i want to capture.

With the current configuration in LabView, and with the data string described above; when i hit RUN in Labview it seems to only catch pieces of the data string.· The determining factor in how much of the string i get seems to depend on when i hit RUN in relation to when the STAMP is sending the data over.

Having said that, if someone could help me to get the timing right so i get all the data everytime it would be very helpful.· Thanks a lot!!

JD

Comments

  • Andy McLeodAndy McLeod Posts: 40
    edited 2007-07-17 20:10
    I'm guessing your LabVIEW code is not waiting for the complete string to come in before reading and dumping the buffer. Try putting a Property Node set for "Bytes at Port" just before the "VISA Read". Also, drop a graphic of your serial read vi into your reply, so I can see what you're doing.
  • J.D.J.D. Posts: 4
    edited 2007-07-18 13:26
    Hi Andy,
    Thanks for the quick response! I have attached a jpeg of my port setup and the serial read vi's for you to look at. I think you are correct that LabView is not waiting for the complete string, and i am not sure how to do that. As you can tell, i just started using LabView and there are way too many vi's to know what does what at this point. Any input you can give me would be welcome. Thanks again!
    800 x 600 - 23K
  • Andy McLeodAndy McLeod Posts: 40
    edited 2007-07-18 13:42
    OK. Where you have the constant "12" wired to the "byte count" port of the VISA read vi is the issue. The vi is simply capturing 12 bytes of data and then cycling to the next step in your program. Replace the "12" with a property node found in the VISA - Advanced palette and select the "Number of bytes at port" property. This will force the VISA read to wait for a complete string to come in before it cycles forward.

    If your still having trouble, attach the vi to your next message and I'll modify it accordingly.
  • J.D.J.D. Posts: 4
    edited 2007-07-18 14:38
    I will try this out hopefully today and i will let you know how i make out.· Thank you·very much for your help!!!!!
  • Shawn LoweShawn Lowe Posts: 635
    edited 2007-07-20 12:42
    J.D.-
    Did you have any success?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Shawn Lowe


    My last words shall be - "NOT YET!!!"
  • J.D.J.D. Posts: 4
    edited 2007-07-20 13:15
    I was successful in one way, in that i am able to read the port now.· Where i am struggling now is splitting up the string, and the timing.· If i have the execution highlight option tunred on i get numbers as i would expect.· If it is not turned on, i get an error at the VISA READ vi; saying the timeout occured before the operation could be completed.· I guess when the execution highlight option is on, it slows things down enough to let things happen as they should.· My problem is that i dont know how to slow things down without using this execution option.· Any ideas?

    My other problem is splitting up my string.· The buffer is reading (xxxx,xxxx,xxxx), where xxxx are the 3 numbers i want.· These 3 numbers i plan on inputing into another vi, but i cant figure out how to make them 3 seperate numbers from my string.

    I do realize this is more a LabView problem than a STAMP problem, but i really appreciate all your help.
  • Shawn LoweShawn Lowe Posts: 635
    edited 2007-07-20 14:30
    J.D.-
    Well I am interested in how you will get it working. I think it would be cool to output data from a stamp to labview. Keep us informed!

    As far as the timeout, have you played with the timeout parameter on the VISA serial instrument? I have been playing with my student version, but I can't even figure out the darn VISA read setup! [noparse]:([/noparse]

    If you visit any labview websites, I would be interested in knowing. I wouldn't mind visiting as well.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Shawn Lowe


    My last words shall be - "NOT YET!!!"
Sign In or Register to comment.