View Single Post
  #4   Spotlight this post!  
Unread 26-01-2007, 19:17
Danny Diaz's Avatar
Danny Diaz Danny Diaz is offline
Smooth Operator
AKA: FrankenMentor
None #0418
Team Role: Alumni
 
Join Date: Apr 2005
Rookie Year: 2003
Location: Manchester, NH
Posts: 545
Danny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond repute
Send a message via AIM to Danny Diaz
Re: Labview and communication with peripheral device help

In LabVIEW we use a single VI for write, and a single VI for read. So, if you want to talk to a device, you would "write" your 2-character string to issue a command to the device, and then you would "read" a 2-character response from the device. The CMUCam2 camera communicates via serial in exactly the same way.

If the response is always known, but you just need to issue the command and wait for it to be executed, I would recommend just using the VI included in the CMUCam2 library called, "query for result from serial port.vi". This function is very nice because you can input what the command is, what you expect back, and you can provide a timeout in case it doesn't give you what you expected in the time specified.

If the response isn't always know, but the byte size is, then just use the primitive read/write functions - write your 2-byte string, then read up to 2 bytes from the serial port. It's fairly straightforward.

If you need examples, give me an example of what you're trying to do (exact communication) and I'll show you how it should look in LabVIEW.

-Danny
__________________
Danny Diaz
Former Lead Technical Mentor, FRC 418
Reply With Quote