PDA

View Full Version : Triggers



DynamoBen
07-29-2007, 11:47 AM
So I've seen a mention of triggers in Vixen but I'm not entirly sure how it is used. Anyone willing to give me a quick tutorial?

BTW it may be time to update a/the wiki to describe the feature list and usage. By doing this KC would have a leg up when the help file gets created. ;)

pete
07-29-2007, 03:28 PM
The triggers work by using the input from an external device like an commerical input card or through a serial, game or parallel port to start a preprogrammed sequence or launch some program (i.e. notepad or calculator for testing purpose).

I've been playing with a game port trigger Kiwichristmas wrote http://www.christmasinshirley.com/forum/viewtopic.php?t=292 which uses a joystick or game pad as a trigger. He has include a schematic someone could work from to make an interface for more remote trigger points.

1. Choose Sequence > new event sequence > vixen standard sequence. set the timing, plugin, channel count, and program each channel like normal. test that it runs like you want.

2. Now choose Sequence > new event sequence > vixen trigger response. A small window will open. on it will be a save icon, play, stop and test buttons. As well as three circles '+' to add a trigger '//' to edit a selected trigger and '-' to remove a selected trigger.

3. click the add to set up your trigger. pop up will open wth 5 fields to fill in. the top row you select the trigger plug in and which input on it you want to use. the second row is a description. the third row you choose the sequence you want to start with the trigger. and the bottom field you select the audio delect you want to send any sound thru. Once you have filled these in and click ok the trigger should list in the trigger seq. window with a red arrow.

Once you have setup each trigger you can click play and the triggers should become active and the arrows should turn green. Now just use the input device to activate the different triggers. If all work as expected click the disk icon and save your setup.

I hope this is helpful and have fun

Pete

DynamoBen
07-29-2007, 04:28 PM
I must have a corrupt install or something because when I try to add a trigger I get an error dialog that says I don't have any trigger plugins.

pete
07-29-2007, 04:57 PM
there is nothing wrong with your install. there are on trigger plug ins included with vixen 2.0 install

DynamoBen
07-29-2007, 05:03 PM
there is nothing wrong with your install. there are on trigger plug ins included with vixen 2.0 install

Based on what I'm seeing trigger plugins need to be written from scratch. True?

If so thats a bit of a bummer, I had hoped there would be some "standard" trigger interfaces. In particular I was hoping to locate a serial trigger interface with a predetermined serial protocol. I was going to take a basic stamp I had lying around and use it to take inputs then pass them to vixen via serial.

kiwichristmas
07-29-2007, 05:36 PM
I posted a blank template for a trigger pluggin, written in C#, to help flowblok get started writting a plugin http://www.christmasinshirley.com/forum/viewtopic.php?p=1534#1534.

you could use this to write a serial pluggin, or flowblok has written a parallel plugin, it depends on what the pic can do.

The one I wrote will uses anything that windows thinks is a joystick.

kiwichristmas

DynamoBen
07-29-2007, 06:18 PM
I posted a blank template for a trigger pluggin, written in C#, to help flowblok get started writting a plugin

While this is helpful I don't write code in C#. In fact I don't code really at all, I'm more of a hardware/firmware type of guy. (Even my firmware isn't in C) So I guess I'm stuck for now.

This kind of loops back to a topic I posted elsewhere. I think we are at a point where there needs to be a few "standard" ways to communicate with Vixen w/o needing to know how write code. A remote control/trigger serial protocol would be one of these "standard" communications methods. Having such an interface allows folks like myself to communicate with Vixen with any type of gadget we come up with; in my case a very simple basic stamp.

KC
07-30-2007, 07:14 PM
...I had hoped there would be some "standard" trigger interfaces.
The absence of this is exactly why there aren't any trigger plugins shipping. When 2.0 goes to release, I'll happily post anyone plugins people have come up with. In the meantime, if you want to come up with some sort of standard protocol, I'm sure there are a few guys on here who'd love to voice an opinion or two. I'm all for standardizing to make things easier for everyone.

DynamoBen
07-30-2007, 09:26 PM
Cool, I'm willing to do my part. ;)

I will need to understand triggers before I can move foward with a protocol. I will try to find established protocols that meet the need we are trying fill and use that as the base.

I need the high level summary of triggers and then the ability to dig into the details. Will one (or several) of the current plugins give me all the capabilities of triggers?

DynamoBen
07-30-2007, 10:58 PM
So I took a look at the Network and Parallel trigger. From what I can tell its pretty straight foward. Basically an outside source provide an input, that input is then assocated with a trigger event. Seems straight foward and making a simple serial protocol should be a snap.

Something I noticed is once the event is triggered, there is no stopping it. Is this just how triggers are or is these something that is determined by the plugin?

Finally can you tell via triggers when a sequence has started or completed? The thinging here would be that Vixen could send a serial command when the sequence starts, and then when its finished.

ErnieHorning
07-31-2007, 12:32 AM
That’s the way I would expect a trigger to work. As long the trigger is true, the event should be also. Typically though, a protocol would only send the true and false conditions when they initially occur.

In some applications, the event would be repeated at certain intervals even though the status had not changed. This is in case of noise or false triggering.

KC
07-31-2007, 06:14 PM
Currently, the triggers are one-way, well, triggers. Their intended use was to tell the application to start execution of a short sequence, such as for a haunted house (the genesis of the triggers). I'm not saying things can't change in future releases, just that that's the current design. Very simple.

DynamoBen
07-31-2007, 07:32 PM
The reason I ask is the serial protocol would be a bit different if there was some type of response or feedback from vixen. It would be nice to know when a sequence is actually started and when it completed, other than that I like the simplicity of triggers.

I think I'm going to take the simple route for the protocol. Basically I'm thinking that the trigger ID will be sent to vixen (via serial) as hex. So a device would send "01 1A" and this would fire trigger 26. Vixen will respond with "01 1A 01". The leading “01” is the message type, in this case triggers. The idea here is future expansion. The trailing "01" in the response indicates that the triggers status, which in this case it has been fired.

If status is ever added to Vixen then you would get these responses.

01 = Triggered
02 = Completed
03 = Currently Playing (a device could poll for status)

There are two things I’m on the fence about:

1. Whether these commands should be ASCII or not. The advantage to making them ASCII is that these commands could be sent via HyperTerminal. The disadvantages are there would need to be a CR (character return) at the end of each sent packet, and the packet would be six bytes long instead of three.

2. Whether there should be a leading digit to indicate message type. The reason I threw it in there was in case you want to add features to the serial-in protocol. For example an “01” would be a “Sequence Trigger”, an “02” would be a “Program Trigger”, or “03” could be channel toggle…

Thoughts? Comments? Suggestions?

FireGod
08-28-2007, 11:50 AM
Deleted

FireGod
08-28-2007, 12:01 PM
The reason I ask is the serial protocol would be a bit different if there was some type of response or feedback from vixen. It would be nice to know when a sequence is actually started and when it completed, other than that I like the simplicity of triggers.

I think I'm going to take the simple route for the protocol. Basically I'm thinking that the trigger ID will be sent to vixen (via serial) as hex. So a device would send "01 1A" and this would fire trigger 26. Vixen will respond with "01 1A 01". The leading “01” is the message type, in this case triggers. The idea here is future expansion. The trailing "01" in the response indicates that the triggers status, which in this case it has been fired.

If status is ever added to Vixen then you would get these responses.

01 = Triggered
02 = Completed
03 = Currently Playing (a device could poll for status)

There are two things I’m on the fence about:

1. Whether these commands should be ASCII or not. The advantage to making them ASCII is that these commands could be sent via HyperTerminal. The disadvantages are there would need to be a CR (character return) at the end of each sent packet, and the packet would be six bytes long instead of three.

2. Whether there should be a leading digit to indicate message type. The reason I threw it in there was in case you want to add features to the serial-in protocol. For example an “01” would be a “Sequence Trigger”, an “02” would be a “Program Trigger”, or “03” could be channel toggle…

Thoughts? Comments? Suggestions?
Anything is OK except 55h (my syc char). My system disregards any packet not starting with 055h (85 dec).

FireGod
08-29-2007, 09:26 AM
Since the Firegod system is bi-directional a serial trigger would be very useful and very easy for me to provide the PIC program for inputs.

It would be cool if multiple sequences could communicate with a single serial port. Now, only one sequence can run on one serial port. Triggers would be much more useful if multiple sequences could run on one serial port.

DynamoBen
08-29-2007, 10:31 AM
I guess I'm not sure what you mean. With serial triggers you would be able to trigger 255 different sequences from one com port.

FireGod
08-29-2007, 10:56 AM
I guess I'm not sure what you mean. With serial triggers you would be able to trigger 255 different sequences from one com port.

Yes, but only one sequence can run on that com port therefore tying up ALL the hardware on that com port until the sequence is finished.

I guess it would be able to trigger a second sequence from the original com port but the second sequence would need to be running on a different com port (or other plugin).

DynamoBen
08-29-2007, 12:01 PM
I understand, the limitation has to do with the output device not the trigger inputs.

In my setup the microcontroller will wait until a sequence is complete prior to triggering a new sequence.

FireGod
08-29-2007, 12:35 PM
I was thinking of the guys out there running a haunted house, each device in the haunted house would need its own set of hardware and com port.

For example, I have an automated coffin system where when I get a motion sensor input, a relay energizes and a recording starts and runs until the input goes away. If I used my 128 channel FGDimmer for this, it would be only device I could connect to it (126 wasted channels) if I wanted it to work at ANY given time.

I could connect other systems to the 128 channel hardware but if the coffin system was running, any of the other systems on that same set of hardware would have to wait their turn until the coffin finished with its sequence.

I am guessing that to modify the Vixen code would be quite a large job to allow mulitple sequences running while communicating with the only one com port.

A Marchini
08-29-2007, 12:36 PM
I guess I'm not sure what you mean. With serial triggers you would be able to trigger 255 different sequences from one com port.

Yes, but only one sequence can run on that com port therefore tying up ALL the hardware on that com port until the sequence is finished.

I guess it would be able to trigger a second sequence from the original com port but the second sequence would need to be running on a different com port (or other plugin).

You need a separate serial trigger server, which could redirect to ,lets say a TCP/IP trigger plugin in Vixen. That way the plugin could link to the server and comunicate with individual trigger devices on the serial link, OR different serial triggers (from one device managing a lot of switch inputs lets say) could be redirected to different vixen programs (and being TCP/IP configured, these would not even have to be on the same machine). The Vixen plugin could have an identifier field so that each program could store their redirect ID... since I/P addresses wouldn't necessarily be fixed or unique.

my 2 cents
Tony

A Marchini
08-29-2007, 12:42 PM
You need a separate serial trigger server, which could redirect to ,lets say a TCP/IP trigger plugin in Vixen.

my 2 cents
Tony

I forget , can multiple instances of vixen run on the same machine??
This is assuming that they manage separate output data streams.
Tony

FireGod
08-29-2007, 01:25 PM
I forget , can multiple instances of vixen run on the same machine??
This is assuming that they manage separate output data streams.
Tony

I can run multiple instances of Vixen as long as the plugin for each instance is configured for a different serial or parallel port.

The sound from the sequences is played simultaneously on the same sound output device.

A Marchini
08-30-2007, 08:00 AM
I forget , can multiple instances of vixen run on the same machine??
This is assuming that they manage separate output data streams.
Tony

I can run multiple instances of Vixen as long as the plugin for each instance is configured for a different serial or parallel port.

The sound from the sequences is played simultaneously on the same sound output device.

A TCP/IP server program, managing the serial port for triggers could be devised that would manage different vixen events. A new trigger plugin would need to be created that connects to a TCP/IP port , comunicates some information about the event number it wishes directed to it and then waits for a signal packet from the server.
The server would sit in a loop, wait for the serial packet to come in, compare it to the list of waiting triggers and send the packet to the one that is waiting.

The server could be python script or something that handles TCP/IP relatively effortlessly (ok, the threads managing the connections wouldn't be "effortless").

I would attempt it but my pluging that manages TCP/IP output to my linux controllers is so behind it makes me want to cry. Just not enough hours in a day.

Wasn't there talk of independant sound output at one time. People were trying to use USB audio devices I thought.

oh well, enough hand waving , someone intellegent can take it from here I suppose.
Tony

lalder
09-26-2007, 03:47 PM
Ok I am a newbie but I don't see how to use triggers. Can I use the same lpt port I'm using to run my Grinch? If so how do I trigger it?

lalder
09-27-2007, 09:08 AM
Ok so my little wire and port3 on the parallel trigger is working

darko
08-23-2008, 04:48 AM
Hey all, I'm new here. I just have to say, this community and its accomplishments is quite awesome. Ive been looking for this kind of stuff for a long time!

This thread looks ancient, but I'll revive it anyways.

I'm a haunt builder myself, and I am personally looking for a solution in which minimal hardware can be used to separately automate distinct zones (groups of channels for specific haunt rooms)

When triggers activate sequences, do they neccessarily monopolize the entire universe of channels? I have no problems running separate computers with specific vixen installs, as I have plenty of old pII boxes lying around, however I would hate to have to build separate dimmer controllers for each zone in my haunt. Indeed it has been said that it would be a waste to throw away hundreds of channels.

How difficult would it be to have vixen understand that trigger_sequence_1 applies to channels 17-25, and overrides the background sequence's control over that subset of channels during the duration of execution?

I guess it would get a little more complicated if some other triggered sequence had shared some of those channels.

Cheers :)

Macrosill
08-23-2008, 08:52 AM
darko,
I have no answer for you as I have not used the triggers function yet. Check with Pete, he seems to have used the triggers functions the most and helped implement them.

Welcome to DIYC!!!

Shades
12-15-2008, 09:30 PM
entry error

djulien
12-19-2008, 01:20 PM
I posted a blank template for a trigger pluggin, written in C#, to help flowblok get started writting a plugin http://www.christmasinshirley.com/forum/viewtopic.php?p=1534#1534.

you could use this to write a serial pluggin, or flowblok has written a parallel plugin, it depends on what the pic can do.


This link is broken - is the sample file available somewhere else?

thanks

don

rlilly
12-19-2008, 01:37 PM
Lot's of information under the tag 'triggers'.

w8one
10-14-2009, 05:48 PM
I know this is a old thread but, one person was disappointed that the trigger would launch 2 seq's at once, not waiting in a que or stopping the 1st one. latter in the thread someone wanted to use in multiple locations with different triggers. if i was doing different zones i would use say channel 1-8 for zone a and set a seq for zone a, say zone b has 16 channels make the seq using those channels and call it name-zone b make your triggers for them if it works on ebay they sell usb sound cards they are size of a pen drive you could set the sound out in the seq's. to each of them. i use multiple sound cards on my machine for my ham radio. if all is setup it should work out fine.