01-24-2007 04:07 AM
01-24-2007 05:41 AM
cannot open the attached myproj_2.vi
Try attaching it once more
01-24-2007 11:07 PM
01-24-2007 11:45 PM - edited 01-24-2007 11:45 PM
Message Edited by poll3n on 01-25-2007 12:07 AM
01-25-2007 12:25 AM
The Flaw lies in your implementation
As long as the input to case structure remains 1, the case 1 will get executed and your dialog box, keeps popping up.
To avoid this, here is on one possible solution
Use an event structure as shown in attached vi.
Note: I have moved out your visa read section to another while loop, so that I could demonstrate the use of event structure
Any doubts, do ask
Regards,
Dev
01-25-2007 03:22 AM
hi
thx 4 modifying my program..
but if we modified like dat,wen i typed in '1' in my room no, my boolean doesn't light up n also the pop up menu doesn't activitate also...
bcoz in my original program, if i put '1' in room no, the first boolean lights up, for 2nd row 1st boolean, u just type '21' then e boolean will
lights up.. n i want to open pop up menu to key in some data... thx
01-25-2007 12:04 PM
Hi poll3n,
I'm not clear on what is not working correctly. I opened up devchander's program and it seemed to work correctly for me. I would also reccommend using a 2D array of booleans instead of the 100 separate booleans that you have. Having all of those different cases in your block diagram that essentially do the same thing is not a very good programming practice. For example, if you wanted to change the logic that determines when the booleans light up, you would have to change your 100 or so different cases manually. If you had an array of booleans, you could use a FOR loop to iterate through your booleans for you.
Also, in the future, please try and use fewer abbreviations and internet-isms in your posts because it makes them a little hard to read/understand.
Regards,
Justin D
01-25-2007 01:35 PM - edited 01-25-2007 01:35 PM
Message Edited by altenbach on 01-25-2007 11:39 AM
01-30-2007 08:10 PM
Sorry to bother you again altenbach.
I've tried the attached files 2DArray.vi and 2DArray2.vi..but unfortunately,i couldn't see any result although i tried different numbers
between 00-99 as you said.The LED never lights up and the numbers go back to the default value -1 && 0.What I see is, before i run
your vi,all the LEDs are in dimmed and if I keyed in any number and run the vi, the whole arrays (LEDs) become brighter (green
color) ..Is it because of my software?? How about the result at your side?? Because I want to flash any of the LED one at a time
depending on the numbers that we choose.
thanks in advance.
01-30-2007 11:25 PM - edited 01-30-2007 11:25 PM
No, you're using it wrong. You need to run the VI first (and keep it running), then enter the desired number (s). The loop will only spin if the selector changes so it won't use any significant amount of CPU.
If you look at my code, you see that I reset the selector to a value that does not show any active LEDs using a signaling property node. This ensures that the initial state executes once and that the selector and LED display agree. Without that, somebody could enable a few LEDs in edit mode and select an unrelated selector value and the display would be wrong until the first time the selector is changed.
There are many ways to do thigs differently, you just need to decide how it should react. 🙂
If you want the LEDs to update according to the value you selected in edit mode, you could read the selector using a local variable and feed it to the signaling property of same before entering the main loop to trigger an update of the LED display upon first run.
All clear? 🙂
Message Edited by altenbach on 01-30-2007 09:29 PM