LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a GUI to show a picture from LinkSprites JPEG Color Camera.

Hey.

 

I am currently working on a project to send and recieve data from the camera mentioned in the subject, and are running into some problems I am hoping I could get answered here. : )

The camera is sending and recieving over UART and communicating with LabView serial over RS232 and this works fine when using LS-Y201, but when trying this in LabView it wont work.

It looks like LabView are able to send data to the camera, but not recieve anything.

 

I've attached the vi. If someone could have a quick look and see if they can figure out whats wrong, that would be very appriciated.
Ive also copied in the URLs to the camera and its manual.

 

The camera: http://www.sparkfun.com/products/10061

Manual: http://www.sparkfun.com/datasheets/Sensors/Imaging/1274419957.pdf

 

Thanks in advance,

ASibbern.

 

 

0 Kudos
Message 1 of 4
(3,276 Views)

ASibbern,

 

I am planning to do some work with this camera, and when I get it working, I'll post my code.  Thanks for posting; it might help me with some of the protocol information.

 

Looking at your code, it may not be working for LabView coding reasons.  You have two while loops with no synchronization or data sharing between them, which is extremely unorthodox.  You also have a while loop inside a case structure, which is also unorthodox, because whether or not it runs depends on the case selection.  All this could wreak havoc with windows, memory allocation, etc.  You also split your error cluster to a few case structures outside of the loops, so without a single error cluster to enforce program execution, you can't be sure whether they'll run or not.

 

What it looks like you want to do is send an instruction, wait for for the jpg image, look for the end of the jpg image and then do something else.  The best way to do this is with a state machine with states (for example)

 

1. Initialize VISA resource/ Open file

2.  Send Camera Initialization codes

3.  Initiate read

4.  Read byte and store to buffer

5.  Write buffer to file

6.  Close file 

7.  Display image

 

You can read about how to do state machines in this post.

https://decibel.ni.com/content/groups/northeast-oh-labview-users/blog/2009/09/08/state-machines

 

In addition, you are writing the Hexadecimal characters as strings (e.g. 36 32 35 0D 0A 49 6E 69 74 20 65 6E 64 0D 0A), which means that the VISA resource will send the ASCII characters for the string out the serial port rather than the hexadecimal numbers themselves.  The camera then interprets this as gobbledygook and doesn't do anything.  There is probably someway to directly write a byte or word to the VISA resource (please post if you find it), but you may have to resort to looking up the ASCII codes for the hexadecimal numbers and writing those.  Good luck, and please post if you get any further.

 

 

0 Kudos
Message 2 of 4
(3,194 Views)

We are also trying to get this to work for our senior design project. Once we have it working I will post our code.

0 Kudos
Message 3 of 4
(3,137 Views)

Hi, 

Did you finish your VI? could you share it?

Thanks

Ernesto

0 Kudos
Message 4 of 4
(2,857 Views)