Given array control reference, how do I obtain array size programatically

If an array control reference is passed to a sub-vi, how do I obtain the current length of the array within the sub-vi?  I've tried two properties:  "NumRows", which as documented, contains the visible number of rows in the array control.  "IndexVals" contain the indices of the array element in the upper left corner of the array control.  There seem to be no methods for obtaining the current array length.  I tried changing the class of the array reference to cluster then using the "Controls[]" property... but this generated a runtime error.  What am I missing?  Thanks.
Solved!
Go to Solution.

Taki1999 wrote:
There's a lot of casting going on in your subvi.
What is the actual use case?  There might be a way to do this which doesn't require the casting and you could work just with the reference that is passed in.
For your method you need to wire in a strict class specifier into the To More Specific Class conversion.  I'm not sure how to make the strict class specifier.
I can help with that but first...
Working with arrays on unknown data types is no esy task and determining the size is a special challenge and I did just that in this Nugget that talks about using control references. This task is much easier when you know at development time what is in the array. That is where the strict type casting comes into play.
What I would do...
1) Make sure the contents of the array is a type def (to support data strcuture changes in the future).
2) Go to the FP of the VI that has the array in question and drop a generic control ref control.
3) Ctrl-copy and drag the array in question INTO the the generic ref (still working on the FP). You can tell when you find the "sweet spot" in the ref control because it will switch it appearence. See this mini-nugget for an image where the same thing can be done with que refs.
4) Make the now strict ref a type def.
5) Use the type-def'd ref from step #4 in the sub-VI as the proptype used by the "To More Specific...."
After those changes you should be able to work with array in the sub-VI as if it were in the top level.
BTW:
Doing the above on the control in the sub-VI that brings in the ref would allow skipping the "To more Specific..."
Have fun!
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction

Similar Messages

  • 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 .

  • How do get an indicator to appear when using control references

    Hi, can anyone help with the following?
    I've just managed to resolve the problem of getting indicators of a sub VI to appear on the front panel of my main VI and remain active. This was done by using control references. Basically, I created a reference for the control on the front panel of the main VI. I then dragged the reference in the block diagram of the main VI to the front panel of the subVI to obtain a Control Refnum. Then in the block diagram of the subVI I created a property node and linked the indicator and control refnum to it. Then I wired the subVI's connector pane to the control refnums in the subVi front panel. Finally, I copied the subVI icon into the mainVI block diagram
    and wired the references to the relevent renum terminals of the subVI connector pane. However, I'm still having a problem with one of the indicators, which I've called 'time limit reached?'. When the VI has reached the end of the run this indicator in the subVI changes from the word 'No' (surrounded by a red box) to 'Yes' (surrounded by a green box). In the sub VI this was done by using a comparison function and linking the visible property node to the 'time limit reached?' true/false boolean. I would like the same to happen on the front panel of my main VI. In this case where should I put my property node and control refnum? I'm unable to link a control refnum to the current visible property node. When I create a visible property node which can be joined to a control refnum then I don't have the option to link it to the true/false boolean. Any suggestions? I have written a small VI which demonstrates the problem if need be.
    Thanks, Adrian
    [email protected]

    I would suggest to use a customized boolean instead of making it visible/invisible, just take a boolean, change boolean text from TRUE/FALSE to YES/NO and change also diferent cases colors, this way, you don't need to play with property nodes. If this can't be done for any reason, using a local / global variable is the only solution that comes to my mind.
    Hope this helps

  • Re-casting of object from control reference

    I feel like this question is likely answered elsewhere, but after days of searching I couldn't find an answer. Sorry if I'm missing the answer in some obvious place.
    I'm given a reference to a cluster control and told that the elements of the cluster are all children of parent class A. Using the controls[] property I get an array of the elements, and the value property of each of those elements gives a variant that can be turned into class A. At that point, all of the object oriented overriding and private data stuff works as expected.
    So far so good.
    But one method I call on those objects changes the private data, and I need to update the control with the updated object. There I get a runtime error because the control isn't A but some child class of A.
    I think this is where Preserve Runtime Class comes into play, but since I only get a reference to work with, what do I do? This is especially frustrating because debugging probes show that LabVIEW knows the child class on the wire, but I can't see how to tell LabVIEW to cast down to the class that it knows it has.
    For example, is there some way to use the ClassName property of the control to cast the object of class A into the child that the control is expecting?
    Solved!
    Go to Solution.

    nathand wrote:
    So your trying to write to the specific control within the cluster, by reference, as a variant, and you're getting an error? What's the actual text of the error?
    Really you shouldn't ever be using a front panel object this way, especially one where the user never sees the data in it. For passing data around you should use a wire. Neither a wire nor a DVR will get you the ability to pass an arbitrary cluster, though, which it sounds like is what you're trying to do. With a bit more information we might be able to suggest a better approach.
    I don't have the text of the error handy, but it comes from the write value property node and basically says the given variant can't be converted to the type of the control. It happens only when the value is cast to the parent class, which makes sense.
    In other words, given a control of child type,
    control.value ---> variant ---> to parent ---> variant ---> control.value     failes with the error
    control.value ---> variant ---> to child ---> variant ---> control.value       succeeds
    So a solution would be a way to cast to the child instead of to the parent. LabVIEW knows what class the control contains; it is listed in a number of places from the ClassName property through the probe window. The problem is I know of no way to bridge the gap from "LabVIEW knows what class this thing is" to "have LabVIEW cast the variant to that class."
    I completely agree that I shouldn't have to ever be using a front panel control this way, but I don't want to get sidetracked into talking about the shortcomings of LabVIEW that have required such a use. Suffice it to say, that is the assignment.

  • Get All Controls References

    Hi all
    If somebody know how can i get all controls references of VI (including controls that founds in Tabs and Clusters). I need generic method, because i haven't information about VI (reference to VI i get only at run-time).
    Thanks, Nadav

    To include the controls on Tabs, pass the array from my previous answer into a for loop, use auto-indexing. Place a Class Specifier Constant in the loop, right click on it and set it's type to a Tab Control. Place a "To More Specific Class" function below the constant, and wire the constant into the top.
    If the control from the array that you pass in is a Tab Control, "To More Specific Class" will NOT return an error. Use a case statement and use the No Error case to expose the Tab Control properties. Return the "Pages" property (an array) and pass this into a for loop. Connect a property node to the indexed pages, then select Controls On Page to return an array of controls ON EACH PAGE. You need to set up a shift register and use build array to return all of the controls from all of the pages. Make sure you close the Page Reference.  You can concatenate the array of Tab Control Page items with your original FP Controls.
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

  • Control references/refnums: general info

    Please forgive this question, I am a relatively new LV programmer and the help files & manual seem quite poor to me!
    I am after some basic information about control references & refnums as I am sure they would be of help to me.
    1. What are the main advantages in using them? (i.e. what they can achieve)
    2. How are they implemented?
    3. How is a control refnum/reference passed from one VI to another programmatically?
    Huge thanks to anyone who may be able to shed some light on this topic.
    Dan

    > 1. What are the main advantages in using them? (i.e. what they can
    > achieve)
    The references let you access properties and methods of controls on a
    front panel. Previously, the access was limited to the diagram of that
    panel, and each property node accessed a single particular control.
    With control refnums, you can have one property node access an arbitrary
    control with the refnum parameter controlling which one. You can also
    send the refnums to subVIs meaning that the code can be abstracted to
    simpolify your diagram and shared with other panels.
    > 2. How are they implemented?
    I assume you want to know how to use them. You right click on the
    control or its terminal and under the create menu, next to where you can
    create an implicit property node, you can also create a Reference node.
    The datatype of this node is unique to the type of control that you
    created it from, and when wired to a property node, the property node
    will show the same properties as an implicit one. As an example, if you
    have 8 Boolean buttons on your panel that need to be enabled, disabled,
    hidden, colored, labeled, or whatever based upon the state of your
    application. You can right click on the eight buttons creating
    Reference nodes and build an array of the references. You can now loop
    through your array and with one property node, set the properties of the
    buttons based upon whatever logic or table of information that you need.
    You can also do this in a subVI by passing the array of references to
    the subVI.
    It is also possible to get control refnums/references from other
    properties. For example, a slider will give the reference to its
    digital display, a graph will give references to its cursors, etc. It
    is also possible to loop through the references of all objects on the
    panel inspecting names or types rather than using the Create Reference
    popup, but this is more advanced and requires casting the references.
    If you really want to know how they are implemented, it is much like
    file refnums or VISA refnums. I can give more info if you ask a more
    specific question.
    > 3. How is a control refnum/reference passed from one VI to another
    > programmatically?
    >
    In the refnum palette there is a Control/VI refnum control. You drop it
    on your subVI and right click to set the class. Note that there are
    lots of classes arranged from basic to very specific. Class refnums
    will convert to more basic automatically, but will not wire if they are
    incompatible. So, if you are careful, you can select the class from the
    menu and create the control refnum that you can wire to the connector
    pane allowing you to pass refnums into the VI. A shortcut that is a bit
    simpler is to draw the reference from the diagram to the subVI panel.
    It will make the correctly typed control refnum for you, ready to wire
    to the connector pane.
    That is sort of the basic overview. You probably want to look at the
    example -- general/cntrlref.llb/Property Nodes.vi. I also suspect that
    the devzone contains other examples showing how they can be used.

  • Control references vs. global variables

    I guess my question centers on the appropriate application of control references.
    I am writing a complex program that has a state machine at the top level, and, for one frame of the state machine, a while loop containing a couple subVIs, each of which contains many subVIs. The lower-level subVIs are affected by buttons on the top-level VI. Information from the lower-level VIs must be shown on the top-level front panel within the loop. My question is: what is the best way to do this?
    (I have a previous version of the program that I wrote that keeps just about everything on the top level so that I can update the front panel, but this is not at all modular.
    In addition, I considered breaking things up into more than on
    e front panel, but this doesn't seem to be a good option for this section of this program.)
    Last week I read about control references, and decided that this could be the way to deal with this issue. I have not worked with them before, so I want to know: Are control references an appropriate solution for this issue? Is it good programming practice to use them, especially to update data on charts and graphs? How do they compare programming-wise and efficiency-wise to global variables?
    Global variables are another solution, I think, but I would have way too many variables to update. I think the advantage with global variables is that one could just insert a global variable in a subVI and not have to wire it up through the different subVI levels, which one would have to do (I think) with control references.
    Can you offer any advice?
    Thanks!

    Paul,
    The actual implementation of the solution is up to you. This is indeed a complex question.
    I would offer the following advice:
    On globals:
    Try to avoid them. I try to restrict the use of globals to unidirectional. If you have ever dealt with a race condition, you will know why. Mistakes are often made with globals, and they are quite apt to become the biggest source of bugs in a program, especially in one as large and/or complex as your appears to be. If you must use globals, try using a shift register, or LabVIEW 2 style global instead. Basically, you use an unitialized shift register with two (or more) cases: Read and Write. This prevents race conditions, but only if the VI is non reentrant. However, implementation is still difficult.
    Control References:
    I also have read and heard about control references. I have had much use for them, for controlling the appearance of controls and indicators (and decoratiopns too, I guess...). However, I would caution you on using them to pass data around. This violates dataflow in a big way, as you are passing around pointers, instead of data. I believe this is difficult to implement, and even more difficult to keep straight. I personally recommend using them only for attributes of FP components, not for passing data.
    So, what do I believe is the most elegant solution? I think a data server is your best bet. This is close to a LabVIEW 2 style global, but a little more active. Simply write all of your data into a subVI in any manner, a queue, a FIFO, LIFO, etc. Then, retrieve the data as desired. Buffering, queuing, etc are all handled by the data storage and retrieval subVI. It becomes sort of a small active database. The two sides (storage and retrieval) are independent of each other, and the code is all handled in the function. A basic version is a LIFO, Last In First Out, wherein the data is overwritten constantly. The data is then read by the reading VI, the front panel VI in your case, at any time, and the data is always the latest. You can add complexity as you need, such as making it a FIFO. This is done by simply writing the data to an array, then reading back the oldest value (by reversing the array and reading index 0.)
    I believe this is an elegant solution to your problem. It does maintain dataflow, except that time is taken out of the equation, depending on how you look at it. It simplifies your program because you only need to do three things. Write the data handler, then drop in the function into the VI that writes, and the one that reads. It is also flexible in handling the data.
    Good luck, and let us all know how you do.

  • Getting control references which are in tabs

    Hello,
    In a labview vi, we can successfully get all the control references, including references to tab controls.  We would also like to get at the control references of controls which are contained within the tabs.  We've been hunting around the methods/properties of the vi pane references (where we found the controls[]) reference, and can't seem to find how to access the control references within tabs.  Does anyone know the method/property to do this?
    Thanks
    David Jenkinson

    The Pages property will return a 1D array of references to each page. Then you can autoindex this to get the controls for each page reference:

  • How can I obtain a version of Print Studio Pro that works with Photoshop Elements 13 (64 bit)?

    How can I obtain a version of Print Studio Pro that works with Photoshop Elements 13 (64 bit)?  The advertising refers to Print Studio Pro 2 but all I find available to download is version 1.35.

    Thanks - I did notice that the 2 was a superscript on one site but on another (I think the one for the Pro-10 printer) it was definitely a 2 in line with the rest of the text and separated by a space (at least on my browser).  At any rate, I suspected something of the kind and will simply use Photoshop Elements 11 when I want a pattern print until the change is made.
    If you have an inside line to Canon you might also suggest some changes to their Image Garden program, specifically its handling of DVD label projects.  It has several themes and within each theme several layouts.  As far as they go these are fine but they do not give nearly enough flexibility.   The boxes for insertion of images are useful as is the simple procedure for rescaling the image so it is cropped in varying ways while staying within the fixed box.  However, it should be possible (a) to relocate the boxes on the page and (b) to resize and reshape the boxes - probably by a control which would become available by right-clicking on the box.  For example, there are times when the user might want to include a full 16 x 9 frame shot as one of the images, and in general the aspect ratios of the provided boxes do not permit this.
    I have over the years preferred to use Word for this purpose after setting up masks to expose just the printable area of the DVD or Blu-ray disc, setting up the margins so that the center of the disc is in the horizontal center of the page, and finally introducing text and pictures and adjusting the font size of blank lines above the disc to line everything up properly in the vertical direction.  A typical layout might involve one large picture, located so the center hole and the curved outer edge do not block anything important, or two pictures side by side, or four pictures centered vertically (to minimize the effect of the outer edge of the disc) but possibly of different widths (so as to make both close-ups and wide scenes optimal on the same disc label).  The text then goes above and below the pictures.  All of this works perfectly so I probably wouldn't use Image Garden very often for this purpose, but the inability to resize and relocate the boxes must be very limiting for others as well. 
    Some of the layouts have image locations severely reduced by the edge of the disc.
    As I said ... if you have an inside line to Canon .. but if not, please excuse the length of this post!

  • Cluster of control references: want to access the control value

    I want to be able to save and set control values that are saved (XML). I have my controls on about 5 sub vi's. So I thought it'd be a good idea
    to put all the control references in a cluster from the several sub vi's and save and read from one point.
    I can get the cluster values (i.e. the references to the controls), but how to proceed from here? If somebody has a better idea it is very welcome.
    I have also read Ben's nugget here, but it deals with references to controls in a cluster, not references to a reference of a control in a cluster

    Thank you for reading that Nugget!
    I use a GUI Controller in many apps so I can grab refs in sub-VI's.
    Here are some screen shots of them in use.
    The first "GUI Cnt" is a wrapper around the AE and invokes the action "Set Analysis mode" then another call let me get a cluster of the refs so I can choose based on the name.
    This image shows what that action does.
    THis is what happens when going into collection mode.
    That is a small set of what you will find in my image gallery Feel free to browse (yes I know there is a lot of Olivia in there ) and ask if anything catches your interest.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Help!: Control reference seamingly "lost" in run-time execution mode

    Hi!
    The Facts:
    LabView 6.1 PC under NT.
    I've been using "Vi loader" technique since a few month s to distribute a LabView application on severals PCs without having to re-compile it each time. My application uses more than 500 VIs so I can't build it directly. The directories/Vis of the application are simply copied on the target PC and run through the Vi loader technique instead of using the development environnement.
    The problem:
    Since the last release of the my application, differences between the application running in development mode or run-time mode have appeared:
    One VI reading a .ini file does not act the same way if runned in the developpment environnment or
    runned in the run-time environnment. This VI uses control-references from its front-panel and passes them to sub vis. In run-time execution those references seems to be perverted: the sub-vis get them but can't access their properties like Label Name, Values,...
    All works perfectly fine if the VI is runned in the environnment developpment.
    Moreover the same sub-vis called with other control references in other VIs work fine.
    Question:
    Has anyone seen any behavioral difference between run-time execution and development environnement execution?
    Are there any differences in the linkage process between those 2 execution ways?
    Is there any labview Feature that would automaticaly "de-allocate" references at run time and would do so "too early"?
    Is there any know problem with poly-morphique VIS in run-time execution mode.
    That's all, any idea, lead, wellcome!

    Hi Andrew!
    I've allready had a look at the "Problem with VI Loader technique". It only deals with top vis not working (ie broken) when called from loader in Run-Time mode because of ill declared vi.lib path.
    It's "unfortunately" not my problem: My VI is not broken, it's kind'a working, but not as it does in development environment execution mode.
    If NI people are reading this, I would like to send them the VI and it sub-VIs to understand if something has been perverted .
    The problem is seen on all three target PCs.
    Moreover, a new one has appeared: in run-time mode, the standard "file dialog" vi called to prompt the user for a file with a given extension pattern sends back the file name with the extension "double dotted" (exemple: anything..data
    instead of anything.data).
    About the first problem, does any know why a Ctrl Refnum would loose its parent information (name, value...) in run-time execution mode?
    Bye!

  • I no longer have a service provider and my SIM is locked. How do I obtain my PUK?

    I no longer have a service provider and my SIM is locked. How do I obtain my PUK?

    if you don't have a carrier then the sim card and punk code is irrelevant and you will not be able to use it
    the only purpose of the sim card is to tie the phone to the carrier, and the puk code is a security code for the sim card
    trow away the sim card and when you get a new carrier you will be given a new sim card by that carrier

  • Control references; need some help

    Im having a VI with controls, let's say some boolean control. From another running VI I want to be able to adjust the value of that control. How do I do that? I remember something about creating a reference of the control and calling
    the reference in another VI.  If I'm wrong, can somebody clearly explain what they are for?
    Second, is there a way to call a subVi and display the front pabel in a tab of the VI from which i am calling it?
    Thanks!
    Solved!
    Go to Solution.

    1. In your front panel of the local VI go to the Modern -> Refnum
    -> Control Refnum and place it on your panel. Then create a control
    of which refnum you need (in this case a boolean) and drag 'n' drop it
    into the refnum element on the front panel. Now you will have a refnum
    to your boolean control in your block diagram. You can adjust the value
    of that control in another (foreign) VI simply by placing a Property
    Node of your control (in the foreign VI) and wiring the already created
    reference to it. So basically you need to transmit the reference from
    the local VI to the foreign one. The adjusted value can also be
    transmited or, if it is static, it can be placed on the foreign VI.
    Sorry, I could not to edit my previous post. Just thought I could elaborate on the first point a bit more.
    Please ask is something is not clear enough.
    Jeff Bohrer wrote:
    On the Block Diagram select the terminal you want to update Right-Click>Create>Referance.
    Just don't understand how I have managed to forget this one, including the fact that I use this method in most of the cases
    Message Edited by Giedrius.S on 02-13-2010 07:01 PM
    While evaluating my code please have in mind that I am a LV novice. Therefore sometimes my code might violate some coding rules that I have to learn about myself. But how else could I do that...
    Chart zoom with "Mouse Over" effect

  • Accesing controls (references) from several VI's

    Ok I have this small problem:
    I have a large program
    and have put serveral "advanced settings" in a different VI.
    Result
    is that the values entered here need to be passed to controls in
    different other VI's
    The way I use this now is using 1 element
    queues to pass the control
    value. 
    For one VI I can create control
    references, call a sub vi and put here the control that can manipulate
    the value.
    How do I achieve this for multiple VI's? Is
    there a way to make control values from ANY running VI available? Maybe
    using xcontrols? I have no idea how to achieve this though.
    thanks!

    Ben wrote:
    I will typically use a GUI controller in my apps to accomplish that type of thing.
    GUI Controller
    I develop an Action Engine  that will cache a cluster of control references when an Init method is invoked. This put all references in a SR that can be accessed from any place the Ae is used.
    I add methods to the AE to take care of screen settings associated with changes of state ("Set Visability Edit Mode", "Set Visablilty Login", etc).
    I also add a method to return the cluster of refs so I can use them to set-up dynamic event registration in sub-VI etc.
    A side benfit of using a GUI Controller is that you have a single point where you can add a "stack" of screen views so functions like "Back" and "Forward" can be added easily. 
    So...
    trying using a GUI Controller.
    Ben
    This an excellent method for achieving what you want. A variation of it would be to use LVOOP instead of the AE. The two approachs are essentially the same but with some thought on the definition of the classes I imagine you can create a general purpose base class to handle most of the common aspects. Customizations can be achieved using derived classes.
    Further adding to Jeff's comments about the up front hit in the schedule. When done right you will see the benefits of shorter schedules for future projects. The first time is the hardest sell to management. However once you get a couple of successes under your belt future requests will be much easier since you now have a track record of benefits achieved by using reusable code libraries.
    Message Edited by Mark Yedinak on 03-30-2010 08:55 AM
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • How can I obtain the coefficients m, b from MAX scale?

    I use CWAI ActiveX for acquire data. Also, I use MAX to set the virtual channels for CWAI. When I try to use scale option of MAX (for exemple y = 0.5x + 3 to transforn volts in my phisics values) I obtain true data from ScaledData (phisics values), but I can't obtain true data from (BinaryCodes x GetScaleMultiplyer) + GetScaleOffset. How can I obtain true value from binarycodes?
    How can I obtain m and b from ActiveX?

    drg,
    The GetScaleOffset & GetScaleMultiplier refer to the hardware factors used by the driver to transform the binary values produced by the ADC converter to actual Voltage values (not physical units of the Virtual Channel).
    The documentation (NI-DAQ 6.9.3) for the ScaleMultiplier property mentions this:
    "Returns the slope in the linear scaling formula for converting the binary codes of the analog-digital converter to voltages. The CWAI control multiplies the binary code by the ScaleMultiplier and adds the ScaleOffset to convert a binary code to a voltage.
    (BinaryCode * ScaleMultiplier) + ScaleOffset = Voltage"
    If the signal range was, for example +/- 5 V, the multiplier for a 12 bit board would be approximately 0.00244141 so that:
    2047 * 0.002441
    41 = 5V
    NOTE: The 12 bit range (4096 words) is divided into +2047 / -2048
    Unfortuantely there is not a function or method in the CWDAQ API to obtain or set parameters from the Custom Scales used by the Virtual Channels.
    The reason for this is probably due to the fact that once Virtual Channels are created, most users would read in scaled values directly rather than reading binary values, getting the scale constants and applying the custom scale themselves. Since the user specifies the values for the custom scales anyway, the application could as well store the scaling constants as part of its configuration.
    Still, it would be nice to have this functionality so I thank you for pointing this out. I will create a suggestion indicating the need for such functions.
    The ways to achieve the results you desire are:
    1) Use Virtual Channels and read scaled data
    or
    2) Use the ScaleMultiplier and ScaleConstants to transform binary values into actual voltage values. Once
    you obtain the voltage values you can manually apply the same custom linear scale you had created through MAX.
    Regards,
    Alejandro Asenjo
    Applications Engineer
    National Instruments

Maybe you are looking for

  • ORA-01403: no data found error hile inserting into a table

    Hi, I am populating a PL/SQL table(Array) with the data. From that array inserting into a Actual table. Before inserting am checking array count. Array count is greater than 0. But I am getting "ORA-01403: no data found" exception. I am not getting w

  • How to add a normal attachment in my apple mail?

    Apple mail is so slow when I want to add attachment to my message. I think the reason is that when I add eps file or other files, apple mail does not simply add it, but integrating it into my context. But I don't need it to do that. And because the p

  • How to validate password using LDAP using client script JSOM

    Hi All, I have a requirement in my sharepoint 2013 project. I need to force user to signature digitally by reentering his password so that the system will validate his user name and password. If its validated user can access that document. For this,

  • Price difference in inovice(scheduling agreement)

    Hello Gurus, Can anyone please suggest me on the systems unknown behaviour given below. We have scheduling agreement in currency GBP and Local currency EUR, when we post GR, it is getting posted perfectly i.e with proper accounting entries as Invento

  • Bounding Box locks up after editing objects

    I am using Edge Animate CC (2014) on a Mac. After using Edge Animate for a few minutes (making simple edits to objects), the bounding box around the object selected, and the border around the stage box freeze in place. I am able to move the objects a