Help - Dip Switches

Started by visioman6014, December 13, 2011, 06:19:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

visioman6014

Hi All,

Newbie here trying smartshapes AND getting very frustrated. I am trying to toggle the 3 dip switches on the circuit board as seen below and attached. I am trying to use "IF" and "OR" to toggle the FlipX field on the individual shapes. HELP! I am ready to dump this program. :-)

Paul Herber

All the shapes in that document have been ungrouped! Assuming you got the DIP switch from this forum then ungrouping the shape will break it. Permanently.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

visioman6014

Try this file... it's all grouped together with custom properties. Thanks.




Paul Herber

but regrouping them doesn't repair them.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

visioman6014

It's my original file. I haven't de-grouped and re-grouped them. It was done on Visio 2003 as well if that makes a difference. I find the developer documentation for Visio to be minimal at best. MS needs their knuckles cracked for this.

I'm trying to use "=IF(OR(Sheet.94!Prop.INPUT="0-20 Ma",Sheet.94!Prop.INPUT="4-20 Ma"),1,0)" and related IF functions to turn on (flip to the right... "TRUE" (1)) position. But it's taking it as being TRUE all the time.

wapperdude

Check out this post:  http://visguy.com/vgforum/index.php?topic=711.0

Go to the bottom of the thread for the latest version which includes 3 different instantiations of the DIP switch: 
    1.  Right click to bring up a menu to select open / closed for each switch
    2.  VisioGuy's adaptation which uses a binary work to set the switches
    3.  Simple mouse to drag control points to set the switch state.

These can be used as is, or, you can examine how they're built to create a custom number of switches.

HTH
Wapperdude
Visio 2019 Pro

visioman6014

I saw those. Thanks.
My question/concern is more akin to the "IF" function coding and if I'm doing it right. I am not an experienced coder at all.

My version uses custom properties (various V/mA input values to drive a variety of dip switch configurations.


.

wapperdude

The comparison in the IF statement might work better if you use the string same function.  Check out this reference:  http://msdn.microsoft.com/en-us/library/aa431851(v=office.12).aspx

Wapperdude
Visio 2019 Pro

visioman6014

No, that doesn't do it at all. My 5 variables are all unique.

wapperdude

Care to post a sample --  more than just the IF statement?
Visio 2019 Pro

wapperdude

#10
Ooops.  Sorry.  Just remembered you did post examples. 

OK.  Try this syntax:  =IF(OR(STRSAME(Sheet.94!Prop.INPUT,"0-20 mA"),STRSAME(Sheet.94!Prop.INPUT,"4-20 mA")),1,0)

Should work.

Wapperdude

Edit:  updated formula to correct capitalization errors on mA in the provided formula.
Visio 2019 Pro

visioman6014

Super. Just need a fix up for the "S1" switch which has 3 conditions. what did I miss here as this doesn't sem to work...

=IF(OR(STRSAME(Sheet.94!Prop.INPUT,"1-5 Vdc"),STRSAME(Sheet.94!Prop.INPUT,"2-10 Vdc"),STRSAME(Sheet.94!Prop.INPUT="4-20 mA")),1,0)

wapperdude

Syntax error:
IS:  Sheet.94!Prop.INPUT="4-20 mA"
S/B:  Sheet.94!Prop.INPUT,"4-20 mA"
Visio 2019 Pro

visioman6014

The Wapperdude saved my bacon. Thanks!


.

wapperdude

Visio 2019 Pro