Help with converting serial data to analog data

Hi,
My request is pretty simple.
I have a camera that outputs a rs232 serial data to control the lens.
I have a lens that needs an analog data to move.
I want to translate the data between them and i think i have all the information i need:

camera data
This is the data that comes out from the camera, i need to connect the serial out to my arduino and read the data.

The lens connector
This is the lens connector, i need to send analog data to pins 5+7 to move the iris.

Can any one help me with a code?

Thanks

What? You want people to study the pdf etc and write your code for you? Fat chance.

Make an attempt at it, and ask for help along the way if you need it.
Or offer to pay someone.

This is the data that comes out from the camera, i need to connect the serial out to my arduino and read the data.

You might download the .pdf and then attach it to your post. Not sure what the site you linked to is about. You will probably need a level shifter to convert rs232 to TTL.

his is the lens connector, i need to send analog data to pins 5+7 to move the iris.

Not enough info in the picture to understand how the device works.

You need to post the datasheet for the Lens controller so we can see exactly what sort of data it requires.

It would also be a good idea to post a link to the datasheet for the camera output - so we can see what messages it sends.

...R

JoZee:
so i need to reed this data and in response output an analog data to my old lens, meaning: 3.4v-6.2v according to DATA 1.

I'm guessing that the old lens uses the voltage as a reference and not as power. Is that correct?

The Arduino cannot directly generate a varying voltage. You either need to get a DAC module or, perhaps, it would be sufficient to have the Arduino control a digital potentiometer if the old lens does not need any appreciable current.

I have not read the datasheet carefully but I suspect that the second example in Serial Input Basics would be a good starting point for receiving the data. It should at least let you see what you are receiving.

...R

The Arduino cannot generate a defined DC voltage.

It can generate a PWM signal, which can be smoothed by a resistor and a capacitor, but the average value of that signal will depend on the current consumed by the load.

JoZee:
can you help me with listening to the serial data?

I thought I did in Reply #5.

If you have tried my code and it did not work post YOUR program and describe the symptoms and I will try to help.

...R