Next month I'm going to start building the desktop application part of my Arduino project: a motion picture film scanner. I'm about 80% of the way there getting all of the individual components working under Arduino control, and then I need to begin writing software to trigger the board to perform these functions on demand.
I'll be writing the application in Xojo (RealBasic), which will allow me to do either serial or TCP-based communication with the board. I'm currently using a Mega 2560, which controls various motors and reads data from a series of sensors in the scanner. So I'd obviously need to get an ethernet shield if I was to go the TCP route - not a problem.
I can envision two ways the system might work, and I plan to test both of them:
1) (Depending on the camera being used, which is TBD), I might be able to do almost everything from the Arduino. In this scenario, there would be minimal communication between software and the microcontroller. I'd issue a command to scan the next X frames and the camera would control the motors, sensors and trigger the camera, which would in turn automatically write the files to the predefined location on the computer. When complete it would send back a response code. Minimal communication, most of the heavy lifting done by the Arduino.
2) The software (desktop application) is more hands on, sequencing the series of events: Advance frame (wait for response), engage pressure plate (wait for response), communicate with camera to scan the image (wait for response), disengage pressure plate (wait for response), repeat.
So obviously there's a lot more back and forth in the second scenario but I feel like it'll provide greater control than doing it on the Arduino. My concern is about performance - I'm not looking to make this scanner realtime - if I get 1-2 frames per second I'll be very happy. The camera probably won't be capable of more than 4-5fps anyway, and in my current testing, I've got the mechanicals running at just between 1 and 2fps.
In the second scenario, would TCP be faster than Serial? Is one inherently easier or harder than the other? What about reliability? Anything I should be thinking about?