DLL wrapper

Is it possible to interface to a dll with vvvv if you know what functions and procedures it takes in?
Basically make a patch that handles what it should take in. Any runtime stuff etc.
My idea it to control two canon VC-C4 cameras.
They have a SDK that specifies everything.
But I’m not good with C nor VB.

I am writing a program in Delphi but it goes kinda slow. vvvv would be a lot nicer. At least to test with as I have not gotten it to work yet.

What I want is X, Y, Zoom, Focus, Focus mode, Color, And some less essential stuff.

It interfaces through COM port abd they include the source for the dll as well but it might be a little too much to add it as a device.

One thing I know though is that I can’t do it.

Link to SDK

Wow, nice cam :)

Well, I was looking at the website, and so far I have not yet found the protocol they use, not even in the manual, most devices I controlled with RS232 had a protcol written out somewhere :( (all I read, it works 8BIT, no Parity, woopy…)

Havent tried their software yet, wich claims to contain a manual, in an .exe file…

You could try and send them an email, and ask for it, than I am almost sure we can help you out.

RS232 hacking with vvvv is pure fun.

if you really don’t get information about the necessary commands you may use PortMon to sniff them out.

but better wait until @oschatz reads this thread: he is the unchallenged ruler of the comport.

in general all RS232 devices can communicate with vvvv, but indeed there exist exceptions proving the rule. so there are some rare cases of hardware specs vvvv isn’t capable to manage.

It seems tht the vc-c4 is controllable via Sony’s-Visca-Protocol:(at least some of them)?
"The Canon VC-C4 Camera is a fully controllable Pan, Tilt and 16 x Zoom Camera unit providing both S-Video and Composite video outputs. Units can be controlled by the supplied IR remote or via RS-232 (VISCA) from any PC/MAC. "

Then it should be quite easy going, you can read the visca-specifications, getting the visca commands (hexa) and integrating it in your vvvv-application.
I did sth. similiar with maxmsp before, controlling sony evi d31’s via rs232 and visca protocol. (breathing city)

I managed to dig out the RS232 manual from the SDK

I don’t know what any of it means though. Head overload sort of.

Am I right in my observation that the camera does not support a exact value for pan and tilt but instead works with speed?

We have two cameras running and the control program included does not look that good with live video other then position the camera and then fade between the two.

*edit file seems to be too big.
Manual516_E.pdf in the SDK page linked.
The exe is just a self extracting archive.

Ok, i had a short look at the “Programmers Manual”. Page 9: “This format is to transmit from the Computer to VC-C4” -> you need to send lists in hexadec. (generate them in vvvv) with(always):

  1. a header
  2. the device number
  3. your actual command
  4. parameter
  5. end mark

f.e.FFh30h3Xh00h57hEFh if you want to send th camera to its home position.
and of course you can assign pan/tilt angle (page 45)

-> everything you need is in the manual, and, it’s serial :-)

X is an empty for the cameranr. (use 0 - 9 for cascaded cameras)



Allright. If I send out that (or any other string) at any time the camera should respond?

After thinking about it it doesn’t sound too complicated.
Might be pretty fun actually. And I learn to master theRS232 bus too.

What kind of performance can I expect to get running two cameras on one bus?
Will they collide or just work?

If I run into any problems or get any progress I will put up the patch.

exactly, it might be that there is another string to send first to initialize the connection before you can send “any” control strings, but if that is the case it should be written prominently in the manual.
About 2 cameras at one bus:
After any contol command (TXD) sent to any device, you will get an answer (RXD) from the device. After you recieved that answer (i think approx. sth. between 5 and 30ms delay) you can sent the next control command safe (if you want, you can also recieve the answers into your vvvv-patch) . So it is not possible to send many commands at exactly the same time with just one bus.



I am getting somewhere. Sort of.
I should be able to put up a patch that does what I want in terms of converting usable commands to sendable commands. In other words a HEX string.
Also detecting if there has been a change in the input and then send it.

However I can’s shout a million things at once in the bus. I also want to wait for the camera to respond a small OK when it is done.

And as you know there is two cameras running on one bus. I don’t want them to collide.

How can I cue the data in a buffer so it gets sent when it can?
And how do I limit data in an intelligent way so that Pan and Tilt always get the latest value available and sent out as soon as there is a free spot but still making sure other commands don’t get dropped but cued instead. And still gets sent out in a certain amounts of time. Like Focus and Color.

And how can i compare the sent command to the received answer so I know the right camera answered?
I would also want to detect if it’s an error or not and possibly log it or something. For debugging. (the error that is)

I know I have to limit the use to one active camera to get some sort of fluid motion but I should still be able to call in a point now and then on the other camera to get it to the right position.