How does this program group and cluster these button values into an array?

In the attached program, there are 6 buttons in a cluster and 1 individual button. These buttons control a bunch of different relays to control power to different components of a single device. Right now the program works in that I can control the 6 buttons, the LED turns on in the board and the power is being transmitted. What I do not understand is how it is doing this.  I ran the program with the highlight execution on and at the start of the read from array component, if say I pressed button 6 and hit ok, it reads #6, where did these get defined and labled? and if i wanted to add another button/relay how do i do this? If someone could explain step by step how this is grouping the relays on the board into an array and then controling them I would really appreciate it. Thanks.
Solved!
Go to Solution.
Attachments:
Cluster to Array.vi ‏85 KB

The #6 your seeing is the number of elements in the array not a value for the array. 
Now for some deeper explainations.   From the code it appears that exactly 1 of 6 valves may be used and an additional valve may be in one of two possible states.
When the program is run the cluster of buttons is initiallized to all False.  and we enter the outer while loop where a sequence structure starts.  In the first frame of the sequence we initiallize a shift register to hold the current value of "Buttons." and this loop runs unthrottled (Add a wait for next ms multiple to this loop to prevent using 100% of the CPU!) 
For each iteration the buttons are read and if a change has occured to any value buttons that were previously True are reset to False to prevent opening more than one valve.
When the user presses OK or stop- the current "Buttons" value is passed to the next frame.  This frame convertsthe 7 boolean values to a integer where each valve is controlled by a seperate bit of the integer (Isolation is bit 6 and bits 0-5 each control a mixing valve)
Now I'd strongly recommend reworking the DAQmx calls- it is pointless to initiallize the task each time you want to use it- Create the task in the initialzation case and wait until the user exits to destroy the task.  And well a sequence structures are frowned on- (there are better ways to do this)
As far as adding a relay- right now the relays are associated to the hardware by their index position in the cluster (element 1 = bit 0 etc....) to add a new valve you would need to decide what bit you would use to drive it and code in that bits' value to write a 0 in that bit.  (hint the 40 constant is realy 0x40 right-click>visable items>show radix )
Let me know if you need further elaboration
Jeff

Similar Messages

  • How does this program work on  a Mac OS-X 10.8.5?

    How does Adobe Photoshop Elements and Adobe Premiere work on a MAC OS-X 10.8.5?  Do I need additional software?

    Hi,
    The drivers for your device are available through Apple Software Update.
    Follow the steps below to install and find out how to use it on your OS:
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c02911238&tmp_task=setupCategory&cc=us&dlc=en&lc...
    Shlomi
    Say thanks by clicking the Kudos thumb up in the post.
    If my post resolve your problem please mark it as an Accepted Solution

  • What is "Arrow" and how does this programs relate to Windows/BootCamp?

    Hi Everyone,
    On the following YouTube video:
    http://www.youtube.com/watch?v=DxMFCksO0Ps
    When he is talking of the official bootcamp support, he mentions Arrow and other programs alike.
    Could someone inform me of these programs and what their roles are?
    Thanks
    Helooooo

    Hi,
    sounds to me like he's talking about the 'Eye Candy' stuff of Windows 7.
    http://www.windows7home.net/how-to-remove-the-arrows-on-the-desktop-shortcut-in- windows-7/
    But then again I might be wrong.
    Regards
    Stefan

  • Email address change--how does this affect laptop and nook?

    I use my Adobe ID only to authorize my laptop and Nook.  I need to change my email address which seems easy on the FAQs, but how do I then reauthorize my laptop and Nook?  And, if I do this, are all my existing library books unreadable since they were downloaded by what the Nook thinks is a different user?  I'm almost sure I won't be able to return any books in ADE on my laptop, but I can live with that if I can still read the books on the Nook.
    Thanks in advance.

    The sync process with iTunes transfers the email account settings (for your chosen accounts via your iPhone sync preferences) from the Mail application on your Mac to the iPhone's email application.
    The iPhone is running OS X and the iPhone's email client can be considered a mobile version of the Mail application.

  • How does this program work???

    My Mac Powerbook G4 has GarageBand 3.0.4, which I have not yet used.
    Now I want to create a file which has one track entered from an aifc file
    (converted from Sibelius 4 with Wire Tap Pro). Once I have this as a GB
    file, I want to overlay a second vocal track. Haven't a clue how to do this.
    Help, help! James Johnson, Plattsburgh NY

    Thanks very much for the nudge, and I'm beginning to get the feel of it.
    One thing I don't quite "get" already: having created a real instrument track,
    why is it necessary to select a sound? I selected basic male vocal of course --
    haven't tried to record anything yet.
    Also: if I have already installed the track which is my completely composed instrumental
    of the song, why should I (or do I?) have to select a tempo and key? I am guessing that
    I don't have to do that.
    If you please, you can reply to me at [email protected] JJ

  • How do you connect your photoshop elements on your computer to your account online? and how do you create a customized url? how does the gallery work and how do you access it? i have trouble signing in on my program from my computer to connect to the onli

    how do you connect your photoshop elements on your computer to your account online? and how do you create a customized url? how does the gallery work and how do you access it? i have trouble signing in on my program from my computer to connect to the online photoshop, and I really want to create my own customized url and post photos to my gallery and share them with the world, family, and friends, but i need help because i can't figure how to do any of this, would really appreciate feedback and assistance, thanks, - claire conlon

    To add to sig's reply, "calibrating" does not calibrate Lithiu-Ion batteries, it calibrates the charge reporting circuitry.  If you look at the effect of deep discharging Lithium-Ion batteries in the data from the independent test group, Battery University, you will see that doing so shortens the life of the battery significantly. It looks like an optimum balance between use and life is at a discharge level of 50%.

  • In Mac Mail on OS 10.5.8 I am receiving bogus emails which claim to be sent by people in my address book, but actually are not.  How does this happen and how can I correct this problem

    n Mac Mail on OS 10.5.8 I am receiving bogus emails which claim to be sent by people in my address book, but actually are not.  How does this happen and how can I correct this problem

    You said:
    I am receiving bogus emails which claim to be sent by people in my address book, but actually are not.
    ...and:
    Are you saying that my address book has not been hacked into?  That others are getting these email addresses from another source?
    This confuses me.  Are you saying that you are receiving bogus e-mails from some of your contacts, or are you saying that they are receiving bogus e-mails from you?
    If the latter, there are a number of reasons that people might be getting e-mail from you.  Malware, though technically possible, is extremely unlikely.  See Someone is sending messages from my e-mail address!
    If the former, that's rather unusual.  The only decent explanation I can think of is that a bunch of your Windows-using contacts got infected with something and their machines are being used to spam everyone in their contact lists, which would include you.

  • My number has been showing up as calling people while in my possession and sometimes off.  How does this happen?  How do I stop it?

    My number has been showing up as calling people while in my possession and sometimes off.  How does this happen?  How do I stop it?
    I've tried to contact facebook support and been trying to get on live chat for hours to no avail.  Please help me stop annoying people.

    A month ago I received a spoofed call at 6A - obviously I was not happy. Came from 000-0000000 as I recall.
    Tonight I had two irate people call me minutes apart saying I called them - I was eating dinner with my wife with my phone turned off in our eye-sight.
    I cannot believe that we allow spoofing software and spoof cards these days, with only a crime if someone asks for money or does some similar fraudulent activity.

  • Expiration of Reward points and status change from elite status how does this happen?

    My rewards point have expired and my elite status has changed. How does this happen?

    Good morning John30csx, and welcome to the Best Buy forum,
    I can understand questioning why your account status may have been downgraded.  To have retained Elite status, you would need to have spent $1500 on eligible BestBuy.com and Best Buy store purchases during the 2013 calendar year.  If you did not spend at least $1500 by 12/31/2013, then your account status would have been downgraded sometime in February.
    From what I can see after looking over your My Best Buy account, you had a $20 certificate that expired in September 2013.  Prior to some program changes that went into effect last year, a certificate would have expired 90 days (180 days for Premier Silver/Elite Plus members) after it was originally issued.  Once a certificate has officially expired, we are unable to issue a new one.
    With that all being said, please feel free to send me a private message if you perhaps have any additional questions about the My Best Buy program or your account.  A private message can be sent by clicking on the blue button located within my signature.
    How to Keep Your Account Active
    Thank you for reaching out to us!
    Derek|Social Media Specialist | Best Buy® Corporate
     Private Message

  • My iPhone was stolen and I have contacted the police who are using the meid number to locate.  How does this work and what are my chances of getting the phone back?

    My iPhone was stolen.  I used Find My iPhone app to lock it and display a message.  The phone has not connected to the internet to locate it.  I contacted the police and they have taken my meid number.  How does this work and what are my chances of getting the phone back?  Are there other ways the theif can use it.  I was told once they put in a new sim card and use it, whatever software the police have, it will show up.

    Honestly? In the US (I can't speak to other countries, though I doubt it works much differently in a lot of the world) The police took your report and filed it either in their computers or, on paper. They will now not think of this again. The only time it will cross anyones mind is if, in the course of entering information into evidence about items recovered or seized at a crime scene, the serial number of an iPhone that was found/seized happens to match yours, in which case you will be contacted.
    The police in the US can and will do nothing to 'blok' the phone and it's not worth their time to try and locate it unless you know for a fact that it was stolen by a big time drug lord, master criminal, or some other such prime target and they can get a court order to track the location of the phone in order to locate this individual for your own purposes.  If they do that, they'll probably keep him under surveilance for a year or so before they act.
    Basically, the police don't care about your phone. If they find it, they will give it back to you. They are not, however, going to go looking for it. They have better things to do.
    I'm sorry, but that's the way it is.

  • TS1425 My co worker has given me his iPod to take home and transfer his music to my laptop, however, I am unable to access his music to download it to my computer.  How does this work?

    My co-worker has given me his iPod to take home and transfer his music to my laptop, however, I am unable to access his music to download it to my computer.  How does this work?

    You need to transfer the iTunes Library from the most recent backup you made before the hard drive was replaced.
    You can't transfer the full iTunes Library from the iPad back to iTunes.
    There are third-party Windows applications that will transfer data from an iOS device, but they don't re-create the iTunes Library exactly as it was before.

  • HT1751 On an old Mac I got this message while trying to burn a CD for the car: "The attempt to burn a disc failed.  The burn failed because of a medium write error."  What does this mean?  And how do I work around it?

    On an older Mac I got this message while trying to burn a CD for the car: "The attempt to burn a disc failed.  The burn failed because of a medium write error."  What does this mean?  And how do I work around it?

    I had been getting this all morning and checked other messages from the community. THe one which worked was trying a different brand of disc.
    I had been using Verbatim which had copied the music fine off the Real Player on my PC at school, but wouldn't work with I Tunes. Tried a Staples and an Office Depot CD-R , both of which did the job.

  • I was using my notes earlier today and now for some reason they are all gone. How does this happen and is there anything I can do to get them back, the new ones also that haven't been synced.

    I was using my notes earlier today and now for some reason they are all gone. How does this happen and is there anything I can do to get them back, the new ones also that haven't been synced.

    See Recover your iTunes library from your iPod or iOS device.
    tt2

  • My MacBookPro has a white screen with a grey file folder in the center of the screen with a white question mark blinking in it. What does this mean?  And how can I get my computer back up and running normal?

    My MacBookPro has a white screen with a grey file folder in the center of the screen with a white question mark blinking in it. What does this mean?  And how can I get my computer back up and running normal?

    Start up in Safe Mode.
    http://support.apple.com/kb/PH14204?viewlocale=en_US
    Repair Disk.
    http://support.apple.com/kb/PH5836
    Reset PRAM.
       http://support.apple.com/kb/PH14222

  • What does this error2 mean and how do I fix it?

    What does this error mean and how do I fix it?  I am trying to reinstall CS4 on my Windows 8.1 machine. 
    Adobe Flash Player 10 ActiveX
    Error:
    Error 2.
    Here is the initial error: http://s29.postimg.org/wqy2ju8iv/Untitled.png
    Here is a screenshot when I click the "More Information" button: http://s27.postimg.org/bugb7rx7n/Untitled2.png
    And here is the screenshot when I click the "Get Support" button: http://s4.postimg.org/c2ynvhmvx/Untitled3.png
    I'm stumped.

    Hi there I've just installed CS4 Pro on Windows 7 64bit and got exactly the same result as you. Did you manage to find anything out, because the thing that bothered me was the limited functionality (what ever that is). Is it just a case of Windows 7 having a newer version of ActiveX already installed?

Maybe you are looking for

  • How to configure the XI  and PLM in discovery box

    How to configure the XI (SLD, Integration repository, Integration Builder ) in  SAP discovery system. And also i want to configure the PLM and xRPM within R/3 of discovery box. Regards, Nilesh Damle

  • I can't close my itunes

    I'm using Lion. My itunes won't stay closed. It's getting really annoying! Help!

  • Installing Transparency Flattener Preset for Indesign Server CS4

    I'm trying to figure out how to install a transparency flattener preset for InDesign Server CS4. I can see how they are installed for the InDesign app.  Edit -> Transparency Flattener Presets... But I'm not sure which directory to install these on fo

  • How do I work whit windows on mac, like a mac or like a pc?

    I installes parallels, and now I`m trying to install windows after write the windows key this asked me how do I want to work windows like a mac or like a pc? Can some one tell me what to do?

  • View Query with DART

    Hi, I m tring to use the DART tool for extract tax data; We extact the tax data from 2 separately system SAP ECC6 (S1 et S2) with DART My question is : It is possible to use a extract file generate by S1 for executing view query in S2 system with the