Best way to encode several digital inputs of choice / binary indicators

Hello.

I need some suggestions.

We have several libraries API (to control our material) written in C and distributed as a dll.  For many of them, we have a library of LabVIEW VIs wrapping (using the call library function node).

We have several functions in which the entry (in the original C library) is an unsigned integer, which is supposed to be several flags ORed together (each value one bit).

I've seen more than one title, that this interface has been transferred to the wrapper live

1 digital input.  User must understand and use it exactly like the C programmer

2 try to make more enjoyable - an entry that is a table, which appears on the front panel, as a sort of list box multiple choice of entry (internally in the block diagram that is used to create the correct entry to the C function)

I think there are others, but this is what I remember right now.  When I saw option number 2 (looking at the front) I thought it was much more enjoyable. clearer and more intuitive (the user can select choice named, no, not strange %valeurs hexa%, etc.).  However when I put on a block and tried to wire diagram, I had to provide an array of numbers; I had no idea what the values were supposed to be.  Option 2 seems so much better for a user interface, but for an API, I think it's actually worse.

What do you see, if you were a programmer building my functions into your application?

Thank you.

Batya

Since each value is a bit simple, I would say that the wrapper have Boolean values in the connector pane and convert it internally to the correct bit field. Another option is to use a cluster of Boolean, but which may be less friendly to the user of the API. I suggest you do this only if you have several options.

Tags: NI Software

Similar Questions

  • How to combine several digital inputs for playback?

    Hi comrade Labview users.

    I just started using LabView and I am very new to it. I know him understand how it works and you have something to work, but I need to be more effective.

    I use DIO96H - USB DAQ Measurement Computing, which includes 96 digital inputs. I use the DAQ to acquire the activations of relay and record the number of times the relays flips.

    Basically, I created a digital input read and then copy & pasted 95 times... it works but I know that's not the best way to use LabView.

    How can I change the digital input (Di1/1stPortA/dev0) in multiples so that it iterates through all 96 channels without copying and pasting the same pattern over and over again?

    Leon

    You have the correct polymorphic instance for playback? Once again, for the material OR it would be a NChan Read. There should be a similar choice if I remember correctly.

  • Best way to MouseDrag several objects around a scene.

    So I'm having a little trouble tried to drag the 3 s Box in a scene.

    Originally, I had it in place where everyone was transferred to an x, is translated Z, then assign a DRC. Then I thought that instead of the click of the mouse on the box itself, I'd be at the root. From there, I would look through all the root.getChildren (then) that see if it contained the x, position y.


    So to know who my children root I clicked on I did .setOnDragged of root.getChildren.get (current) to figure out that it was dragged.

    The code itself has worked with the exception of find which box I was.

    The question that I find, is that I only PositionX, getSceneX and getScreenX. SceneX and X produce the same value and ScreenX is useless. I then tried to do event.getX () - root.getLayoutX () contains the function works, but it did not work and would require me to change many things. getLayoutX() a = 0, since I did not indicate the location of the root, only the locations of the box.

    From there on, I was wondering if there was a better way. Then I thought maybe to loop through each element in my root or in an arrayList (which is what I used, but realized the root.getchildren should work like the original) but the problem is he keeps only save one last list, then just shut up and that's it.

    So I want to know, what would be the best way to understand what object am I?

    Initially, I use contains (Swing) but Swing is different, and as we can save mouseEvents to each node, should we not we know now exactly what we we are, while making a loop in each of them? I think it's easier than having to check each contained unique mouse position, especially if I have 10000 points to check?

    Edited by: KonradZuse March 18, 2013 20:05

    KonradZuse wrote:
    Thanks for the help!

    I can now draw a box, so there is no question about it, just that I have several boxes and I need to be able to drag each without knowing the total.

    I have 1000 boxes, or 5, I can't save a mouse to each event

    Why not?

    so I thought I would go, and then I realized after I posted this I could use the function 'Mouse_ENTERED' or 'Mouse_PRESSED' field and then move each individual, but it would still be a loop in each of them and then find who's who.

    I do not see that your example below has a certain meaning.

    I have never seen sphere.addEventHandler (MouseEvent.ANY, new DragShapeHandler()); so thank you for this tip.

    Buy it, you can also do

    DragShapeHandler handler = new DragShapeHandler();
    box.setOnMousePressed(handler);
    box.setOnMouseDragged(handler);
    

    If you prefer the convenience methods. (It is important that convey you the same reference for both).

    >

    It seems that the "DragShapeHandler" will basically get the source node and then move it? If we really do not need to know which.

    OK-ish. It uses event.getSource () to determine the source of the event (i.e., the node on which the event occurred). But you might as well set a field in the DragShapeHandler class with the node that had to be moved:

      class DragShapeHandler implements EventHandler {
    
        private double sceneAnchorX;
        private double sceneAnchorY;
    
        private final Node nodeToMove ;
    
        DragShapeHandler(Node node) {
           this.nodeToMove = node ;
        } 
    
        @Override
        public void handle(MouseEvent event) {
          if (event.getEventType() == MouseEvent.MOUSE_PRESSED) {
            sceneAnchorX = event.getSceneX();
            sceneAnchorY = event.getSceneY();
          } else if (event.getEventType() == MouseEvent.MOUSE_DRAGGED) {
            double x = event.getSceneX();
            double y = event.getSceneY();
            nodeToMove.setTranslateX(node.getTranslateX() + x - sceneAnchorX);
            nodeToMove.setTranslateY(node.getTranslateY() + y - sceneAnchorY);
            sceneAnchorX = x;
            sceneAnchorY = y;
          }
        }
      }
    

    and then:

    ...
    box.addEventHandler(MouseEvent.ANY, new DragShapeHandler(box));
    ...
    sphere.addEventHandler(MouseEvent.ANY, new DragShapeHandler(sphere));
    

    I slightly prefer the getSource(), I think that, like the box.addEventHandler (..., DragShapeHandler (box)) new; is a little unnatural. Without doubt, however, this version is more robust (it's more type-safe because you are forced to specify a node to drag, while the source of the event could theoretically be any object).

    >

    That's a lot of sense that you're making a new node and just dragging it as such. so I can creater add a picture of the area between them and I just needed to understand the point of click, to get the box then he would know to do hmm...

    Should really "to display the box" as stated above. Just register a Manager with any node you want to be able to drag and the Manager he will drag.

  • What is the best way to get several updates fail to install

    I have 32 updates that have failed to install.  How is the best way to go back and get to install them?

    You receive errors related to updates?

    1. Open Windows Update by clicking the Start button, all programs and then click Windows Update.
    2. In the left pane, click view update history.
      http://Windows.Microsoft.com/en-us/Windows-Vista/see-which-Windows-updates-are-installed
    3. Find an update for Windows that has failed to install, and then double-click the update to view more information.
      Updates that have failed to install will display failed under status, next to the name of update.
    4. In the Windows Update dialog box, next to the details of the error, review the error code for the update has failed.
    5. Follow the links in the Windows Update dialog box under more information or help and Support to resolve the problem, then try to reinstall updates by using Windows Update in Control Panel or by mail with the error code and maybe someone may be able to help others.

    Windows update General troubleshooting

    Suggestions:

    How to reset the Windows Update settings?
    http://support.Microsoft.com/kb/971058

    Diagnose and automatically fix common problems with Windows Update
    http://support.Microsoft.com/mats/windows_update/

    Cannot install updates in Windows Vista, Windows 7, Windows Server 2008 and Windows Server 2008 R2
    http://support.Microsoft.com/kb/2509997

    Or try to install the updates in a clean boot state, and run Windows Update: http://support.microsoft.com/kb/929135

  • What is the best way to merge several projects with a project?

    Hi guys,.

    I want to merge 4 my project in a project.

    What is the best way to do it?

    Thank you

    Max

    Import some sequences of other projects via the media browser.

  • Best way to connect several hard disks

    HI - since getting my new Mac Pro, I worked with two hard drives of 12 to promised Pegasus 2 Raid-5.  They have been great.  But my video player started to get crazy and so I bought two backup drives WD - 8 to, one to save the key on each PP2 files.  Unfortunately, it was too late to save the video player, as one of the bays failed.  Because it's Raid-5 and with the amazing and patient Vincent promise eSupport, I replaced the failed drive Bay and am now waiting while he rebuilds (if all goes well, without any loss of data).  Then it will get saved.

    Until it became clear that a bad drive Bay was probably underlying computer freezing, loss of images in video playback, etc., I was wondering if there was some sort of best practices for fixing of external drives.  With Thunderbolt, you can chain; But what to what?  Is there a limit any?  Can I plug two disks promise, then the one closest to you on the computer?  Must the WDs be connected in the same way, each to each, and the other to the computer?  Should there be just a Garland of four disks?   ????   In the old days, you had to look at how much energy was used during the USB and Firewire connection, but the true even for love at first sight?

    Surely you'd be recognizing any indication on how best to connect several hard disks.

    Thank you!

    There are 3 unique bus in the Mac Pro black cylinder. Better reactivity is with your readers spread between three buses, keeping in mind that video display takes nearly half a ThunderBolt Bus itself.

    You can use USB-3 for your backup drives - just keep in mind, it is only a sufficient bandwidth behind the USB to operate a chain of reading and writing of full tilt. If you simultaneously use devices more than that, you can start to see some cuts of your maximum transfer rate.

  • Best way to manage several libraries?

    Before you begin to offer suggestions of third party such as PowerPhotos, please bear with me for a moment.

    Somewhere, I have about 55 000 photos/videos in my library to iCloud. While I would ideally like to keep everything in a library for the sake of not having to deal with faces/places/sites/keywords etc in a library, I find it a little less than ideal since it takes much of the storage space on my iPad/iPhone a lot that slows in things turn especially when you access the photos on iOS app.

    Unless someone knows a way to prevent my iOS Photos storage support (even on the options of 128 GB is too), or a way to create a separate library iCloud while having faces, etc. are available for iCloud library and library Non-iCloud, I'm out of ideas, in addition to having 2 libraries of Photos , which one is for iCloud, one for my older media and must manage the faces and all other metadata for the two.

    I can imagine now... having to build a routine just to move a library b periodically library stuff. What a nightmare. In any case, someone noticed this? Thanks in advance!

    Somewhere, I have about 55 000 photos/videos in my library to iCloud.

    How do you use iCloud photo library?  Are you using more than one Mac and iCloud photo library to keep your Mac in sync?  Or you want to iCloud library to synchronize with your iOS devices?

    I need iCloud library mainly to have the same photo on every Mac library, but 40000 photos is proved be too much for my iPad. This is simply no funny, if all the photos on the iPad are fuzzy because they are optimized and need to download. Because I didn't reduce the iCloud photo library and must synchronize mac manually, I now keep a large library in iCloud, but disabled iCloud photo library on the iPad. Synchronize the albums selected from my great library to the iPad via iTunes, I ignore the blurry photos on the iPhone (it still uses iCloud photo library), but four Macs still have a single library, synchronized with iCloud Photos.

    The albums selected to the iPad with iTunes Photo sync sync's always better than iCloud photo library, at least for my library.  I do most of my organization with smart Albums and iCloud library does not synchronize the smart albums to the iPhone and iPad. So, all my smart albums are missing on the iPhone, also the albums of faces.  iTunes however synchronizes all smart albums and albums of faces, and all photos are stored in full resolution. I can browse the photos immediately, even in offline mode.

    If you do need iCloud photo library only to synchronize your favorite photos on your iPad or iPhone, but not to another Mac, I would indeed create a second library just to iCloud. There is a problem - your photo library system can synchronize with iCloud. If your iCloud photo library must contain all the photos that you want to access from other applications.

    A drastic method of having only a part of your library to download on iCloud library would be to have a joint photo referenced and managed library.  Only photos stored in your library of Photos download to iCloud photo library, not the pictures referenced externally. Referenced photos require more work and are risky, but they are not well supported in Photos.

    It is best to move photos between two libraries, one for iCloud and a local library.

  • Best way to disable several plots on XY-graph?

    Hi all

    I need to hear here. I have an XY Chart with several plots.

    Here's how the VI would work.

    1. start of program, no parcels or scale is shown.

    2. several buttons are available to select who are plotting to TURN (corresponding scale is also ON / OFF).

    What I have now is to transmit the data to the first graph with all plots and invisible scale.

    I did it using the graphics property ActPlot, ActYscl and PlotVisble nodes, but I had to for this

    through each ActPlot/ActYscl. There are therefore several knots of property in all directions as

    in the figure below.

    My questions are the following:

    1. a lot of knots of property would require more memory or CPU resources?

    I do a lot of similar manipulation on the graphics property (cursors, scale, color, etc.). I'm worried

    the end result is a program that really doesn't do much, but a lot of memory/CPU hog resources.

    2. is there a better way to do it? Perhaps a property node that turns off all

    visible at once?

    I read in another post that suggests to use a loop to turn off one by one. I can

    certainly do it, but it would be a better way?

    Any suggestion or the part of the thought is appreciated!

    Thank you

    CC

    Certainly you must change the data that you pass to the chart, especially when working with lots of data. Simple reason: memory usage.

    Visibility of switching does not reduce the amount of data that you pass to the curve (that copy for display) as a result, you'll probably lose a lot of memory.

    But if you want to display all data at once and only give the possibility to hide the small amounts of data, the approach with the 'visible' property node is OK, but...

    hope this helps,

    Norbert

    EDIT: If you want to change multiple properties at the same time, you must include a control panel (Control Panel-property) defer updates.

  • What is the best way to create several hundred copies of a file?

    Hello

    I am trying to create several hundred copies of a file.  The files will be used as other views on a product pages of the site.  Each product has a unique image of the hand and several other unique images (view left view right, etc.).  However, I have about 3 images I want to use as the alternate images for each product.  Here's the 4oo px wide JPEG (registered for the web).  So I would like to have 'altimage1.jpg', 'altimage2.jpg' and 'altimage3.jpg' to have actually several hundred copies.  I can then rename the lot to the bridge or LR.  The final image must have the same name of the product code, with a suffix picture ID.  So after I renamed "altimage1.jpg", it will be "IPID-001-t' the next copy of the same file will be 'IPID-002-t', and the next copy will be ' IPID - 003 - t ' etc, where (IPID-00) is the product code, and (-t) is the identifier which places the work in the right place with the download FTP."

    I wish there was a way to assign the three Images of spares for all products with a few keystrokes, but it is not as simple as that.

    Thank you

    Looks like stocks, layers and layers of comps is the road I'll take.

  • Best way to synchronize several FPGAs

    I have several PXI-7833R FPGA and I need all the AIs to be sampled at the same time (through all FPGA). As I taste all the individual channels to HAVE, I have data (write to the DMA) buffer, scan it and are looking for a trigger defined by the user in a different loop. Once I discovered this in a single channel, I save all FPGA data. Regarding the timing of sampling, I had started, to an FPGA, to send a signal on the PXI trigger line to tell others to try, but I guess that it does not sync. If I founded the ensemble of distinct FPGAS screw off the clock, PXI, how synchronize loops to the sample to the same clock time?

    Thank you

    Hello

    There is a very good example comes with FPGA LV named 'Master-slave of RIO - R Series.lvproj'. Just use the Finder for example to open it.

    It shows how to use the lines of PXI trigger for synchronization of the different measures on multiple FPGAs.

    Hope this helps,

    Christian

  • What is the best way to coordinate several modules loading.

    I have a number of resource modules I want to load before loading my main user interface module.

    I do now, but to make sure that all loaded OK, I need to establish a chain of Event.COMPLETE reminders for each resource module loading.

    In other languages (threads), I set a flag and run a wait on my main loop before loading the user interface module.

    Is it a good compact way wait n modules to load in Flex?

    I don't think that you need a string if the load order is not serious.  Just keep a

    Dictionary of them, then remove them from the dictionary because they charge.  Then

    Run a quick test of the dictionary has all the elements to the left.

  • best way to control a large number of controls and indicators

    IM building a façade with 46 orders and lights, all of type boolean.

    the logic is control > send order series > receive > indicator set. I consider part of my façade (with 2 sets of control and indicator) and my block diagram.

    I have to be able to control programmatically and through the front panel individually the status and indicators, or all at once (for example to reset the both). This should be done from the tab they are and another.

    thought property nodes but still I would have 46 + 46 of them. same for local variables.

    y at - there I way to refer to a control/indicator by its label (string) and change its value?

    wouldn't be easier just to create two Boolean tables which maintain their Boolean value?

    Please advise me on what options I have. I'm new to labview.

    Thanks in advance.


  • Repeated Interface elements-the best way to approach

    What is the best way to repeat several times N interface elements?

    For now, I use an array of bunches, but this does not work very well because the property nodes are all identical for each element in an array. In this case the different scales and beaches restrictions are needed on the various elements. I understand that it is feasible to the behavior of its equivalent of code manually, but it seems a bit of a cludge. Is there a "right way" to do?

    He needs a little more in detail.  N is fixed, you have to show N at the same time.

    Often the best solution is to separate the data from the user interface, which is to store the data as an array of locked but to present data to the user for interaction as a single element or a cluster of clusters of a window fixed populated the table elements.

  • How to count the pulses with digital input on 6351

    Hi all experts in Labview,.

    I just got my USB x series 6351 and it works fine, but I certainly lack of labview skills to use it to its full potential.

    I would like to read digital pulses with several digital inputs and count the number of pulses each T interval in time. All impulses that I entered on any edge of the clock are not synchronized and can occur at random times during the tests. Basically I have an oscillator of square waves can I modulate the frequency. I don't want to use the meter as inputs as I'm limited to only 2 entries (if I use the option 2 input meter for metering of pulses or frequency). The input frequency can range from 0-1 kHz and goes 0 - 3V. So not too fast, and I shouldn't make too many mistakes trying to get the count of pulses and then back out the frequency in accordance with article ni.com on counters.

    I would like to read the 8 digital input channels and get the number of impulses for each channel. I searched high and low for help online but can't find examples that have been useful. Anyone have any ideas on how to go or direct me to a resource? Thank you very much in advance!

    Are you worried about getting the number as a physical operation timed?  It would be nice to acquire a digital waveform and then postprocess on it to detect how many events took place?  I've attached an example that shows how you can accomplish this. It reads a digital waveform and then uses a detection of crete VI to determine how many pulses occurred. Should be a few adjustments to your particular signal.  The VI I use seems to count events twice (probably count each edge), so counting it gives should be reduced by half in order to work.

  • You can synchronize digital input with an analog input on a 6034e?

    Is there a way to synchronize the digital input and analog input on a 6043e?

    I tried the test application "SyncAI_ReadDigChan", but it fails during the humor tick Verify():

    "The requested value is not supported for this property value.

    Property: NationalInstruments.DAQmx.Timing.SampleTimingType

    You asked: NationalInstruments.DAQmx.SampleTimingType.SampleClock

    "You can select: NationalInstruments.DAQmx.SampleTimingType.OnDemand.

    I'm currently collecting analog input data for the duration of a digital input pulse.

    Thanks for any help.

    Joe

    No, you can't.

    The problem with E-Series cards, is that they have just static DIOs, so you cannot have their clock.

    You would need a M-series card for that where you have correlated DIOs.

Maybe you are looking for

  • How to manage data in an array of Boolean

    Hello I have Boolean values inside the table 1 d and I have a numerc control and a text file so that the entrynumber will be compared to the number in the text fileIf the numbers match, the Boolean value of this number goes onThe issue is that when I

  • Can't find installation for HP Photosmart C4680 printer CD

    I bought a new computer and you want to install my printer in there but can't find the installation disk... Now what? My warranty has expired

  • sound of my ms 6000 v2.0 mouse click?

    How can I cut the click of my mouse?

  • T61p died suddenly. So sick of these problems!

    It is the 3rd bad experience with my T61p since I bought it in August 2008. Less than 18 months. 1. the Palm cracked within three months of purchase. After many telephone conversations, he was replaced by Lenovo for free. 2. last month (December 2009

  • Simple question on Folio overlays

    Hello I have a problem of display in a slide show, it does not play automatically when you go to the article. Other slideshows I created work very well. The only difference is that it has the status of all on the page.Attached to the screenshot...Tha