PDA

View Full Version : Question about interfacing Vixen with a generic plugin



gte
10-31-2011, 08:53 PM
I have my own code written for a uC that I'd like to have Vixen send the syntax serially. Is this possible? Can I have Vixen send a command serial such as "lightChannel1=1" and "lightChannel1=0" ? Or whatever syntax command I would like?

If so, is this done through a plugin dll?

budude
10-31-2011, 08:58 PM
Well - you could emulate the Renard controllers that are used extensively on this site. The data stream is fairly simple and you can use the standard Renard Dimmer plug-in (protocol 1).
See the Wiki here: http://www.doityourselfchristmas.com/wiki/index.php?title=Renard

(http://www.doityourselfchristmas.com/wiki/index.php?title=Renard)

ctmal
10-31-2011, 09:25 PM
There is also a generic serial plugin. I've never used it but it might be along the lines of what you're looking for.

erm213
10-31-2011, 09:34 PM
If you need to implement a custom protocol, you can write a plugin to do that.

Erik

gte
10-31-2011, 09:39 PM
I'm really looking to write my own serial communication protocol and have Vixen send it during even event that I graph visually inside of Vixen. I'm hoping this is possible.

gte
10-31-2011, 09:40 PM
That is excellent to hear Erik!

Where can I find more information on this?



If you need to implement a custom protocol, you can write a plugin to do that.

Erik

dirknerkle
10-31-2011, 09:41 PM
Welcome to DIYC! And Happy Halloween at the same time!

You've already received excellent guidance -- plugins for Vixen are generally written in C# although you're certainly welcome to take a crack at it in other languages if you like... Information about how to do it is in the Wiki as well as in one of the forums... Since you've already written your own code for the uC, sounds like you should be able to manage it just fine.

Lots of schmartt people here -- excepting me -- so feel free to pick their brains. Especially tonite -- an appropriate task indeed!!! BWWWAAAAAAHHHHHHAAAAAHHHAAAAAAA!!!!

Again, welcome!

erm213
10-31-2011, 09:53 PM
That is excellent to hear Erik!

Where can I find more information on this?

http://www.doityourselfchristmas.com/wiki/index.php?title=Vixen_Plugin_Development

There is a start.

Erik

gte
10-31-2011, 10:42 PM
Thank you, I will read up on that



http://www.doityourselfchristmas.com/wiki/index.php?title=Vixen_Plugin_Development

There is a start.

Erik

gte
10-31-2011, 11:15 PM
Where in OutputPlugin:IEventDrivenOutputPlugIn are events fired based on the numerical values inside of the vixen audio mapping gui?

Does vixen reference public void Event(byte[] channelValues) each time it sees a change in the gui values?

gte
11-01-2011, 12:16 AM
It appears this event is called every time a change in intensity for a channel is passed, I just can't yet seem to obtain which channel is being accessed, only the intensity integer?

nuelemma
11-01-2011, 12:35 AM
Hi
I am not an expert on the matter but I will share my understanding of the Event.

ChannelValues is an array of Bytes. As an example, If you have 16 channels on the plug in, each time the event is called you will receive an array of 16 objects, in this case bytes that represent the intensity value. If you want a particular channel you will need to search the array for that particular channel. Channel intensity = ChannelValues[Channel Index] where channel index 0 is channel 1, index 1 is channel 2 and so on. If I am wrong some of the experts will correct me.

Also check first post of this thread; it contains a nice Vixen Plugin video tutorials. http://doityourselfchristmas.com/forums/showthread.php?15190-Vixen-Plugin-Tutorial/



Hope this helps
Emmanuel

erm213
11-01-2011, 07:16 AM
Where in OutputPlugin:IEventDrivenOutputPlugIn are events fired based on the numerical values inside of the vixen audio mapping gui?

Does vixen reference public void Event(byte[] channelValues) each time it sees a change in the gui values?

Yes, the Event(byte[] channelValues) method will get called once for each time duration in the sequence. The byte array passed represents the values of the channels during that time duration. If you have 50 channels for your plugin, the byte array should have 50 values. The byte allows for 256 levels of dimming. 0x00 being 0% and 0xFF being 100%.

Hope that explanation makes sense.

Erik

gte
11-02-2011, 11:07 PM
Is there an event or data that is passed that provides the resolution (Event timing) of Vixen or do I have to parse through the .vix file for " <EventPeriodInMilliseconds>100</EventPeriodInMilliseconds> "?

nuelemma
11-03-2011, 01:12 AM
Is there an event or data that is passed that provides the resolution (Event timing) of Vixen or do I have to parse through the .vix file for " <EventPeriodInMilliseconds>100</EventPeriodInMilliseconds> "?

I believe this should work, but please test it.

You can create a variable definition like:

public int v_EventPeriod;

And then inside the Initialize event, fill the variable.

this.v_EventPeriod = ((EventSequence)executableObject).EventPeriod;


Hope this helps

gte
11-03-2011, 10:06 AM
That did work, thank you very much!




I believe this should work, but please test it.

You can create a variable definition like:

public int v_EventPeriod;

And then inside the Initialize event, fill the variable.

this.v_EventPeriod = ((EventSequence)executableObject).EventPeriod;


Hope this helps