Transmission of data Between Computer and UR5e

Hello

I want to know if this is possible, to launch a ur program that takes pictures and passed a msg on the computer when the picture is taken.
Then when the computer finished to analyze the pictures, it communicate a data to the ur5e and depending on the data receive the ur5e choose between action a and action b.

You are probably better off controlling the camera via your PC. You can have the robot execute a remote command to trigger the camera, read and process the data, and then send back a response. One of the ways to do that is via XML-RPC which you can find more information about here:
https://www.universal-robots.com/articles/ur/interface-communication/xml-rpc-communication/

For xml rpc, do you need an urcap to install on the robot ? or this is already installed.

Nope, the example in the link I shared above only uses URScript on the robot side.

Where do i find the rpc_factory, i look into the affectation → variable → expression list but i couldn’t find the rpc_factory ?

Just insert a “script” node (or file) and manually type it.

The Expression editor only has a handful of the available functions listed. For a full list you’ll want to reference the URScript manual here:
https://www.universal-robots.com/download/manuals-e-seriesur20ur30/script/script-manual-e-series-and-ur20ur30-sw-516/

I would also recommend reading through the first couple chapters of that manual as it has important information about how the language works with the robot/controller.