Search the web
Sign In
New User? Sign Up
ultimaserial_group · UltimaSerial Users
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
SetDIODir and DigitalOutput - 1 in, 1out   Message List  
Reply | Forward Message #620 of 794 |
Re: SetDIODir and DigitalOutput - 1 in, 1out

See http://www.ultimaserial.com/standard.html#SetDIODir:

It is plain binary format, bit 0 for DIO0, bit 1 for DIO1....

In case you are not familiar with binary, here is the equation:

diodir = 0
If DIO7isInput Then diodir = diodir + 128
If DIO6isInput Then diodir = diodir + 64
If DIO5isInput Then diodir = diodir + 32
If DIO4isInput Then diodir = diodir + 16
If DIO3isInput Then diodir = diodir + 8
If DIO2isInput Then diodir = diodir + 4
If DIO1isInput Then diodir = diodir + 2
If DIO0isInput Then diodir = diodir + 1

UltimaSerial.SetDIODir diodir

--- In ultimaserial_group@yahoogroups.com, "throrope" <throrope@...>
wrote:
>
> I see posts for setting the direction of all digital IO to in or
> out, but I can't find a post that explains how to set one to out and
> one to in. Also, can that digital output be individually set to
> high?
>
> My application runs within Excel's visual basic editor.
>
> I have the following instructions:
>
> UltimaSerial.SetDIODir 0 turns all DIO to outputs
> UltimaSerial.SetDIODir &HFF turns all DIO to inputs
>
> UltimaSerial.DigitalOutput &HFF turns all available outputs to high
> UltimaSerial.DigitalOutput 0 turns all available outputs to low
>
> For DIO 2, would the &HFF be &H2F for each of the above? Do we set
> all to outputs then set the inputs individually?
>
> ie:
>
> UltimaSerial.SetDIODir 0
> UltimaSerial.SetDIODir &H0F
> UltimaSerial.SetDIODir &H1F
> UltimaSerial.SetDIODir &H3F
> UltimaSerial.DigitalOutput &HFF
>
> I'm thinking the above sets all to out; then 0,1,3 to in; then since
> only 2 is left as out, setting all to high indexes only 2 to high.
> Will UltimaSerial.DigitalOutput &H2F set only 2 to high? Any
> thoughts?
>
> Paul
>





Tue May 15, 2007 7:33 pm

xchen992000
Offline Offline

Forward
Message #620 of 794 |
Expand Messages Author Sort by Date

I see posts for setting the direction of all digital IO to in or out, but I can't find a post that explains how to set one to out and one to in. Also, can...
throrope
Offline Send Email
May 15, 2007
7:01 pm

See http://www.ultimaserial.com/standard.html#SetDIODir: It is plain binary format, bit 0 for DIO0, bit 1 for DIO1.... In case you are not familiar with...
xchen992000
Offline
May 15, 2007
7:39 pm

BTW, you will find a Excel sample in the file section of this group. It has digital I/O control...
xchen992000
Offline
May 15, 2007
8:34 pm

Learn something new every day. Thank you. ... group. ... or ... out and ... to ... high ... set ... since ... high....
throrope
Offline Send Email
May 16, 2007
2:24 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help