November 23, 2024, 04:06:22 AM

News:

Be sure to checkout our Vixen interfaces in the Library forum -- if you want PC automation at near zero cost, EFX-TEK and Vixen is a great combination of tools.


Initialization

Started by machtoo, June 13, 2012, 11:32:31 AM

Previous topic - Next topic

machtoo

In the Initialization section, what does this statement need to look like to set OUT0 to a high state initially,

PINS = %00000000     

I'm not sure which byte controls which OUT and needs to be set to 1.

Thanks

JonnyMac

I'm guessing this is related to your other question; before we address that, the bit order is

76543210

For example, if you wanted to make P1 and P0 high a the start of a program you would do this:

  PINS = %00000011
  DIRS = %00111111


In this particular case, the IO assignments are:

P7 = input
P6 = input
P5 = output low
P4 = output low
P3 = output low
P2 = output low
P1 = output high
P0 = output high

Note, though, that if you're using the OUTx terminals instead of the Px.W pins, things change. The OUTx terminals are open-collector outputs.  When the corresponding Px.W pin is an input or low, the OUTx connection is "open" (just like an open switch). When the corresponding Px.W pin is HIGH, the OUTx terminal acts like a closed switch to ground (GND terminal).

Jon McPhalen
EFX-TEK Hollywood Office

machtoo

It is the OUTX terminal that I need to make high.  I need the relay with the primary light to be on normally.  I assume in the Initilization section I could use a HIGH Relay1 statement and accomplish this?

JonnyMac

June 13, 2012, 11:59:29 AM #3 Last Edit: June 13, 2012, 12:02:00 PM by JonnyMac
QuoteIt is the OUTX terminal that I need to make high.

OUTx terminals only go to ground (low); when off they act like an open switch. When connecting a relay or other device to the OUTx terminals the second wire goes to V+.


Of course you can use the HIGH command in your start-up code or you can preset the relay (connected between OUTx and V+) by knowing its pin.  Let's say the relay you want to be on at start-up and reset is on OUT4.  Assuming all other outputs start-up low you can do this at the top of the program:

  PINS = %00010000
  DIRS = %00111111


By having 1s in PINS and DIRS in the P4 position that output will be made a high on start-up.  This strategy takes a little thinking but once you get the hang of it, it's easy -- and replaces this:

  INPUT 7
  INPUT 6
  LOW 5
  HIGH 4
  LOW 3
  LOW 2
  LOW 1
  LOW 0


The Prop-1 has a small memory; anything we can do to save code space is worthwhile.  I prefer typing two lines instead of eight.
Jon McPhalen
EFX-TEK Hollywood Office