Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

CV-S3200 serial port set parameters

I have a CV-S3200 camera connected via a serial port to my PC.  I am using LabVIEW v7.1.1.  How do I set the camera parameters (e.g., white balance, shutter speed, gain, backlight, iris level, gamma connection, H.reverse, and sensitive values) from LabVIEW over the serial port? 
0 Kudos
Message 1 of 9
(4,769 Views)
1. Get proper cable
2.
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 2 of 9
(4,759 Views)

Oops:

 

1. Get proper cable

2. Get command set for camera and proper port setting from it's manual or manufacter

3. Test 1 and 2 using HyterTerminal to seet if you have proper camera responses

4. Search LV help for serial examples, write your vi

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 3 of 9
(4,758 Views)
Hi,
 
I've done #1 and #2.  I don't have HyterTerminal so I went directly to #4.  I’m getting a NAK from the camera when I try to set its AGC to 12db. 

(The camera protocol is attached.) 

Here’s the sequence that I’ve used:

1)       sent 05h (ENQ) to the camera

2)       read 06h (ACK) from camera

3)       sent 0220 0202 0100 0000 0000 0000 0000 0000 03EC 6E (set AGC to 12 db) to camera

4)       read 15h (NAK) from camera

Have I calculated the CRC-16 correctly on 20 0202 0100 0000 0000 0000 0000 0000 03 0000 0000? 

0 Kudos
Message 4 of 9
(4,737 Views)
I did not code up the CRC routine, but it looks like you may have added an extra 0000 to your 18 bit data, thus using 20 bytes?
20 0202 0100 0000 0000 0000 0000 0000 03 0000 0000 = 20 bytes, not 18
 
Did you write the CRC in correct order (upper byte then lower byte)?
 
If the above items were done correctly it looks like it should have worked.
 
Have you been able to read back any settings?
 
I know nothing of this camera other than the brief review of the data sheet.
 
Good luck, let us know how it turns out!
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 5 of 9
(4,733 Views)
Oops.  I meant 20 0202 0100 0000 0000 0000 0000 0000 03 0000.  I'd downloaded the CRC-16.vi from one of the discussion threads.  compared to a CRC-16 calculator at http://zorc.breitbandkatze.de/crc.html, I get a different value.  Do I have to worry about big endian or little endian? 
 
I'd tried the example from the protocol to read the EEPROM address, but got a NAK after sending the read command.  I'm going to try the commands using the CRC-16 calculated from the website.
0 Kudos
Message 6 of 9
(4,730 Views)

Funny, the manual doesn't specifically say what NAK is (I presume Not Acknowledged)

Another possible route- use LV Active X automation with JAI's free software at:

http://www.jai.com/camera/software_show.asp/id=83&produktid=222&sprog=uk

Hyperterminal is part of Windows under Accessories/Communications (at least in Win2K)

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 7 of 9
(4,725 Views)
The JAI free camera control software can adjust the camera parameters.  I've tried using Hyperterminal, but got lost.  I tried running the LVserial port example to send the command, and I read NAK from the camera.
 
I like your idea of using Active X.  It's new for me.  I've tried to model the LV Active X Slideshow example.  When I "select active X class" for the "Automation Open"  and browsed to C:program files:JAI A-S:CV-S3200 Control Tool:XJai S3200.ocx, the automation refnum is unchanged, there are no methods for "Invoke Node", and no properites for "Property Node."  Need help with Active X.  Thanks for your patience.
0 Kudos
Message 8 of 9
(4,714 Views)

It worked with ActiveX via the JAI camera tool.  I can set those darn camera parameters to my heart's content. 

Thanks very much for your brilliant suggestion!

0 Kudos
Message 9 of 9
(4,709 Views)