November 23, 2024, 12:57:31 AM

News:

Got VSA?  Want to use your Prop-SX?  Now you can!  See the VSA section of the Library forum for Prop-SX code that works with VSA.


Can you use Vixen to control the Prop-2 during a show?

Started by KISTech, October 14, 2010, 12:16:29 PM

Previous topic - Next topic

KISTech

I've been playing around with Vixen now for about a day, and I can see how it's easy to set up triggers and events in the software, and then have it generate the code to upload to the Prop-2, which then takes over as a stand-alone, which is great. It simplifies setup tremendously.

What I'd like to do is use Vixen to communicate directly with the Prop-2 during the show and run the show from Vixen.

Is that possible?


JonnyMac

Yes.  A long time ago we created a demo driver that would run eight servos (P0..P7) and eight digital outputs (OUT8..OUT15) on a Prop-2.  In Vixen you would use this driver:

EFX-TEK Prop-2 8+8

Here's the source code for the Prop-2 that holds pertinent details:

' =========================================================================
'
'   File...... Vixen.BS2
'   Purpose... Simple Vixen interface for Prop-2_8s8d.DLL driver
'   Author.... Jon Williams, EFX-TEK
'              Copyright (c) 2007 EFX-TEK
'   E-mail.... jwilliams@efx-tek.com
'   Started...
'   Updated... 14 MAY 2007
'
'   {$STAMP BS2}
'   {$PBASIC 2.5}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------
'
' This program serves as a slave interface to Vixen (www.vixenlights.com),
' when using the Prop-2_8s8d.DLL driver.
'
' Connect to PC using the Prop-2 programming port.
'
' Note: Set the Vixen Prop-2 driver baud rate to 9600 (this is the fastest
' practical baud for using the WAIT modifier of SERIN which is required
' to maintain sync with Vixen packets).
'
' Note: The best Vixen Event Period (Tools\Preferences\EventPeriod) is
' 40 ms; periods shorter will cause some packets to be missed by the Prop-2
' while periods longer may result in "rough" servo movement.
'
' Remove the SETUP jumpers from P12..P15.


' -----[ Revision History ]------------------------------------------------


' -----[ I/O Definitions ]-------------------------------------------------

RX              CON     16                      ' use programming port

DigOuts         VAR     OUTH                    ' use P8..P15
Servos          VAR     OUTL                    ' use P0..P7

Servo8          CON     7
Servo7          CON     6
Servo6          CON     5
Servo5          CON     4
Servo4          CON     3
Servo3          CON     2
Servo2          CON     1
Servo1          CON     0


' -----[ Constants ]-------------------------------------------------------

T2400           CON     396
T9600           CON     84                      ' recommended baud rate
T19K2           CON     32
T38K4           CON     6


SevenBit        CON     $2000
Inverted        CON     $4000
Open            CON     $8000

Baud            CON     T9600                   ' use 9600!


' -----[ Variables ]-------------------------------------------------------

idx             VAR     Byte                    ' servo index

pos1            VAR     Byte                    ' servo position values
pos2            VAR     Byte
pos3            VAR     Byte
pos4            VAR     Byte
pos5            VAR     Byte
pos6            VAR     Byte
pos7            VAR     Byte
pos8            VAR     Byte


' -----[ Initialization ]--------------------------------------------------

Reset:
  OUTS = $0000                                  ' clear all pins
  DIRS = $FFFF                                  ' all outputs

  FOR idx = 0 TO 7                              ' center servos to start
    pos1(idx) = 150
  NEXT
  GOTO Refresh_Servos


' -----[ Program Code ]----------------------------------------------------

Main:
  SERIN RX, Baud, 40, Refresh_Servos,
    [WAIT ("VXN"), DigOuts, pos1, pos2, pos3, pos4, pos5, pos6, pos7, pos8]

Refresh_Servos:
  PULSOUT Servo1, (pos1 * 5)
  PULSOUT Servo2, (pos2 * 5)
  PULSOUT Servo3, (pos3 * 5)
  PULSOUT Servo4, (pos4 * 5)
  PULSOUT Servo5, (pos5 * 5)
  PULSOUT Servo6, (pos6 * 5)
  PULSOUT Servo7, (pos7 * 5)
  PULSOUT Servo8, (pos8 * 5)

  GOTO Main
Jon McPhalen
EFX-TEK Hollywood Office

KISTech

October 14, 2010, 12:59:16 PM #2 Last Edit: October 14, 2010, 02:52:18 PM by KISTech
Ok, I had seen that earlier, and it's closer to what I'm after.

What I want is 2 way communication, where the Prop-2 will tell Vixen when a sensor has been triggered, and then Vixen can kick off the appropriate event. Sending on and off commands for the various outputs.

Would that be possible with the current set of Vixen plugins?

[edit]
It looks like what is missing is the ability for an Input Addin to Vixen. Without that you can't capture anything from the serial port, you can only send.
Back to writing my own program. :)