How to adjust a "control array" size

I have a program that creates a digital PWM signal with variable duty cycle. The duty cycle changes every 50 ms, but the overall wave frequency stays at a frequency determined by the user. I have the VI attatched.
My problem is this...I need to be able to control the overall cycle time. This means the size of my array of duty cycles needs to adjust based on the cycle time (i.e. a cycle time of 1 second would require 20 of the 50 ms slots, while a 1.3 second cycle would need 26).
I currently have only 4 slots in my array, meaning the total cycle time is .2 s. I understand how to manually add and remove elements to the array, but I can't figure out how to add a control to it so that the array size changes automatically, allowing much quicker entry of data. As of now I can make it work, it just takes super long to add or delete array elements. The ideal situaton would have a constant control for cycle time divided by 50 that would change the array size.
I can't find any info on this, and I think I even saw a post asking that this kind of feature be added. I'm relatively new to this program.
Thanks
Solved!
Go to Solution.
Attachments:
var_duty_cycle.vi ‏25 KB

Currently, your VI is a one-shot deal. What you need is a state machine that updates the pct duty cycle array control as a function of the frequency while the current I/O code is idle.
I would use an array of clusters, where each cluster contains e.g. a sequence number, a duty cycle, and a string as element label. Show the scrollbar and set the size whenever the relevant inputs change. Do you want to reset the current setting when the number changes or do you want to retain the current settings as much as possible? You could just use the existing values, reshape to the larger or smaller size, and write it back to the control via a local variable. Set all elements  except the percent to disabled so they act as indicators and cannot be changed by the user.
(You also need to program around it if the operator tries to manually add more elements. A better solution would be this idea, so vote for it .)
Some more general comments bout your code:
Why do you use extended precision floating point. All your waits are internally just integers. EXT makes no sense
There is a primitive for 1/x. However, you could just do a 1000/x and eliminate the multiplication afterwards. SInce you are dealing with integers, you can even do the division using quotient&remainder. Depending on the allowed frequency range there are possibly no orange data needed at all.
Make the diagram constant representation match the rest of the code.
The pulses/50ms indicator belongs before the loop. No need to recalculate and refresh it over and over from the same input values.
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • How to adjust shared video memory size - R10/R600 Win7 Prof 32bit

    Hi,
    I use two laptops in business - R600 and R10. Both with Intel 4500 graphic card and shared video memory. Both win Windows 7 Professional 32 bit. In both cases system reserves 1159MB for video memory. As I don't play any games I have no need to waste such a huge memory amount - I would like to free as much as possible for system and programs.
    For trial purposes I installed Win 7 Ultimate 64bit. Surprisingly it reserves only 199MB for video memory - so it looks like OS issue.
    Does anybody know how can I decrease the video memory size in Windows 7 32bit?
    Regards,
    pab 567

    As far as I know this cannot be done manually and shared memory is controlled by system.
    If you dont use it for gaming I dont see any problem there. I dont know what kind of activity you do with your notebook but I cannot imagine there is no enough memory for every day activities.
    Is there not enough power for certain operations or what?

  • How to adjust desk top type size ?

    I connected the MBP to a TV and now desk top displays are over sized.  How do I adjust the so windows are not running off and type is not so big ?

    Yes just liek CMCSk said you need to go change your screen resolution and if you havea fairly large widescreen display you can probally get away with 1920x1080 which is stadard for Hi-Def Screen.
    Good Luck; Hope this Helps -

  • How to adjust the camera overlayview size

    i am making a photography app and need to overlay an image over the camera. i am wondering if there is a way to adjust the size of this image because it's going to full screen by default.
    currently, i'm solely displaying the overlay picture using the code:
    picker.cameraOverlayView = cameraCase;
    where the "cameraCase" is a uiimageview that is being overlayed on top of the camera and "picker" is the uiimagepicker.
    i would also need to add buttons (of custom sizes) on top of the camera view as well - i'm assuming i can adjust the size of these as i would a picture.
    any knowledge you're willing to share would be much appreciated!
    many thanks in advance!

    that that wasn't really the correct answer - anyone got anything?

  • How to adjust the Date picker size

    how to change the size of the Date Picker.
    I am using time inside the data picker and window is too small.
    I cannot see the OK and Cancel buttons.
    Let me know
    thanks

    It is an known APEX 3.1 issue metioned in the "Oracle Application Express 3.1 Known Issues & Limitations" Page([http://www.oracle.com/technology/products/database/application_express/html/3.1_known_issues.html]).
    There is a workaround posted in forum, see Re: Date popup problem in APEX 3.1 and this post was also mentioned in the "Oracle Application Express 3.1 Known Issues & Limitations" Page.
    JT

  • How to adjust the layout column size in WPC?

    Hi All,
    I want increase/decrease the layout size in Web Page Composer?
    After I dragged and dropped the html file, how to reduce the column width or height?
    Thanks
    Sundar

    Hi
    You can create a new layout with width and height as per your requirements and use the layout in WPC.
    For creating new layouts, check the help link below
    http://help.sap.com/saphelp_nw70/helpdata/EN/45/d2970be57f4ebbe10000000a11466f/content.htm
    Regards,
    Yoga

  • How to adjust the blog thumbnail pic?

    In iWeb08 if you drop a picture into a blog entry, it automatically shows up on the main blog page as a thumbnail which is great. The problem is how to adjust that thumbnail (position/size)? There seems to be no way?

    Go to main blog page
    click on photo (this will then expose a photo properties box)
    Hope this helps

  • How to adjust terminal/console frame width

    Hi folks,
    Archlinux 86-64 2007-08-2
    I have 20" wide LCD screen.  How to adjust the window frame size of terminal/console allowing typing to its end rather than after typing a few words the cursor jumps to the beginning overtyping the same line?  TIA
    B.R.
    satimis

    Misfit138 wrote:I'm going to take a guess here, based on what you wrote.. I think what you are describing might be either a problem with your video card/framebuffer driver, or, you may have modified your PS1 prompt incorrectly.
    Did you modify your PS1?
    Hi,
    Yes, PS1 is what I need.  Previously I searched on wrong terms.
    After commenting out "PS1='[\u@\h \W]\$ ' " I added follows;
    BLUE=`tput setf 1`
    GREEN=`tput setf 2`
    CYAN=`tput setf 3`
    RED=`tput setf 4`
    MAGENTA=`tput setf 5`
    YELLOW=`tput setf 6`
    WHITE=`tput setf 7`
    PS1='\[$GREEN\]\u@\h \[$BLUE\]\w/\[$GREEN\] \$\[$WHITE\] '
    That is what I need to display on terminal/console. 
    However I still can't manage to have "black" fore-ground (black characters on typing).  I played around on following variation without result.
    BLUE=`tput setf 1`
    GREEN=`tput setf 2`
    CYAN=`tput setf 3`
    RED=`tput setf 4`
    MAGENTA=`tput setf 5`
    YELLOW=`tput setf 6`
    WHITE=`tput setf 7`
    BLACK=`tput setf 8`
    PS1='\[$GREEN\]\u@\h \[$BLUE\]\w/\[$GREEN\] \$\[$BLACK\] '
    BLACK=`tput setf 1`
    GREEN=`tput setf 2`
    CYAN=`tput setf 3`
    RED=`tput setf 4`
    MAGENTA=`tput setf 5`
    YELLOW=`tput setf 6`
    WHITE=`tput setf 7`
    PS1='\[$GREEN\]\u@\h \[$BLUE\]\w/\[$GREEN\] \$\[$BLACK\] '
    Advice would be appreciated.  TIA
    Besides how to change the colour on "nano"?  The characters are difficult to read on typing.  I need black characters on white background
    satimis

  • How do i send an array of clusters with variable size over TCP/IP?

    Hi,
            I'm trying to send an array of clusters with varible size over TCP/IP,. But I'm facing the following problems:
    1) I need to accept the size of array data from the user and increase the size dynamically.
    I'm doing this using the property node but how do I convey the new size to my TCP read?
    2) I need to wire an input to my 'bytes to read' of the TCP read.
    But the number of bytes to read changes dynamically
    How do I ensure  the correct number of bytes are read and reflected on the client side?
    3) Is there anyway I can use global varibles over a network such that their values are updated just as if they would on one computer?
     Will be a great help if someone posts a solution!
    Thank you...

    twilightfan wrote:
    Altenbach,
     ... xml string. ...number of columns that I'm varying using property node s... I solved these problems by using a local variable as the type input ...o TCP read is creating a problem.... second TCP read gets truncated data because
    its no longer just the first four bytes that specify the length of the data, it could be more as my array of cluster can be pretty huge.
    Instead of writing long and complicated sentences that make little sense, why don't you simply show us your code? 
    What does any of this have to do with xml strings???? I don't see how using a local variable as type input changes anything. The user cannot interact with "property nodes", just with controls. Please clarify. Once the array of clusters is flattened to a string you only have one size that describes the size of the data, no matter how huge it is (as long as it is within the limits of I32). Similarly, you read the string of that same defined length and form the array of clusters from it. How big are the strings? What is your definition of "huge"?
    Here's is my earlier code, but now dealing with an array of clusters. Not much of a change. Since you have columns, you want 2D. Add as many diensions you want, but make sure that the control, diagram constant, and indicator all match.
    The snipped shows for a 1D array, while the attached VI shows the same for a 2D array. Same difference.  
    Message Edited by altenbach on 01-31-2010 01:13 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    FlattenArrayOfClusters.vi ‏12 KB
    ioclusters3MOD.png ‏25 KB

  • How can I control the size of a cell in the GridBagLayout?

    Hi,Swing Gurus
    I am developing a swing-based program using JBulider5 enterprise.
    It seems to me that the GridBagLayout is really a hard nut!
    How can I control the size of a cell in the GridBagLayout?
    It seems that I cann't control the size of a cell directly.
    But how the size of a particular cell is determined when I switch the layout manager from XYLayout to GridBagLayout?
    Thx in advance!
    Regards,
    Justine

    hi,i have not done what you are asking but there are fields like
    COLUMNWIDTH, MINSIZE, MAXGRIDSIZE, PREFEREDSIZE to which you can set the appropriate values and test for your need.hope this helped.bye martian.

  • How can I build an array not knowing final size at startup?

    Hi,
    I need to be able to build an array with a certain number of rows but that number is not known at runtime. Instead it can't exceed 5 in a certain time period. So my question is: every 20 seconds I need to send out the 5 row array but if lets say 10 rows of data come in in 20 seconds I am not sure how to handle the data to have it build 2 arrays and send them out one after another at the elapse of the 20 seconds as opposed to just sending an array with 10 rows and losing half the data on the receiving side. Please any help will be appreciated,
    Alex

    I understand that you have to send a least a message every 20 seconds (could be empty ?), but can you send more messages if you get more data (e.g. 3 message of 5 rows in 20 sec) ?
    If you can, then all you have to do is to trigger the sending of a message each time the array size reaches 5, or if 20s ellapsed since last sent message.
    Here is an example, using shift registers. there is a random data generation so that you can see it working (if you set the time between data long enough, then you will see the data sent after 20 sec. Well not exactly 20 sec, but i guess you can figure this out later by yourself...)
    I hope this will be of any help
    Attachments:
    dynamic_array.vi ‏36 KB

  • How can I control the size of the af:InputText?

    Hi,
    How can I control the size of the 'af:InputText' on the UI, without using columns & rows attributes. Even though I am using width & height attributes, the changes are not getting reflected in the UI.
    Thanks,
    Rajesh.

    Hi,
    It is inside a 'af:PanelBox'. So, the parent container also determines the size of the child? Here I need a create a 'pidgin chat window' kind of an interface with a fixed size top-level container, inside which I willl put all my components. The code looks something like this:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1" partialTriggers="it1">
    <af:messages id="m4"/>
    <af:form id="f1" partialTriggers="it1">
    <af:panelBox text="" id="pb1" background="dark" type="stretch"
    titleHalign="start" ramp="highlight"
    inlineStyle="width:350pt; height:500pt; margin:0.5pt; padding:0.5pt; border-width:0.5pt; "
    partialTriggers="it1">
    <af:spacer height="15pt" id="s1"/>
    <af:inputText id="ot1"
    columns="82" rows="25" wrap="hard"
    partialTriggers="it1"
    value="#{ChatClientBean.chatLog}"
    binding="#{ChatClientBean.outputChatTextBox}"
    visible="false">
    </af:inputText>
    <af:spacer height="27pt"/>
    <af:inputText id="it1" inlineStyle="width:200pt; height:100pt;"
    valueChangeListener="#{sessionScope.ChatClientBean.sendMessage}"
    autoSubmit="true" partialTriggers="it1"
    binding="#{ChatClientBean.inputChatText}"/>
    </af:panelBox>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    Thanks,
    Rajesh.

  • And, in general, how can I control the size of the firefox window?

    The Firefox window has become bigger, even before I clicked "full screen."
    So again, how do I control the size of the window/screen?
    == This happened ==
    Every time Firefox opened

    when opening a link within a window, I want it to open smaller so I can see the window behind it. How can I control that?

  • How to control the size of live data in Coherence?

    How to control the size of live data in Coherence?
    See the following statement:
    Pause times increase as the amount of live data in the heap increases. We recommend not exceeding 70% live data in your heap. This includes primary data, backup data, indexes, and application data.
    --Excerpted from http://coherence.oracle.com/display/COH35UG/Best+Practices                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    In any Java program, it is good practice to make sure your live objects leave some room in the heap for "scratch space." Without this, you will spend too much time in GC, and, in the worst cases, run out of memory. In the general case, you can see how much live data your application requires by looking at the heap used after a full GC's. For Coherence, you should ensure that live data, as you say, is under 70% of the maximum heap size.
    Coherence provides you tools to help enforce this policy. [http://coherence.oracle.com/display/COH35UG/local-scheme] describes how to size limit your cache. By implementing an eviction policy, you can control what happens when a size limit is exceeded.

  • How to control the size of SVG images in epub files?

    There is unfortunately no support for SVG files in InDesign.
    Most of my images in jpg convertes nicely, but the small ones do not.
    Therefore I want to use SVG files which I have created in Illustrator.
    But how do I set the size in the epub file? Right now, whatever I do, they come out too big and I don't know how to control the size.
    Is there a program, like Sigil or other, that can place the image for me - I'm no html wizard you see....

    In any Java program, it is good practice to make sure your live objects leave some room in the heap for "scratch space." Without this, you will spend too much time in GC, and, in the worst cases, run out of memory. In the general case, you can see how much live data your application requires by looking at the heap used after a full GC's. For Coherence, you should ensure that live data, as you say, is under 70% of the maximum heap size.
    Coherence provides you tools to help enforce this policy. [http://coherence.oracle.com/display/COH35UG/local-scheme] describes how to size limit your cache. By implementing an eviction policy, you can control what happens when a size limit is exceeded.

Maybe you are looking for

  • Can PSD files saved back to Lightroom retain their layers?

    When a file is edited in Photoshop. you can choose a TIFF or PSD. It would seem the advantage to PSD would be the ability to retain layers when saved back to Lightroom especially in a file which remains a work in progress. I have not been able to ach

  • Reg: PS and HR.

    Hi BWers,     Can you please forward the documents related to HR customization and how PS linked to HR. Can you please give the table names (or info types) of both PS and HR and also the flow chart which represents the relation between HR and PS tabl

  • Add x days to x date

    Hi! I am quite new at Acrobat and Javascript, which is a common lament on this discussion board from what I have read. But I need a little help! I am creating a form in which the user needs to be able to input the estimated end date in the first fiel

  • Embedding Captivate 4 Movies in PDF

    I created a PDF document using Acrobat 8 that has 3 Captivate 4 movies embedded.  The  movies play just fine on Windows but only play for 5 seconds on macs.   Has anyone else experienced this problem? If so, please let me know what  the solution is. 

  • Need help with clickbios ii terminolgy and values. Z77A-GD65 / 3770k

    Hello All  I recently purchased a Z77A-GD65 board and after searching I've found the differences in terminology between this and my previous Asus board but still have a couple of settings I cant find any info on. System Specs: motherboard: msi z77a-g