How would this code look in LabVIEW?

Hello,
I am new to LabVIEW and I'm hoping that someone can tell me what the code would look like in LabVIEW if I want to do the following.....
I am using a C dll that has the "acq_get_board_count()" function and so far I am able to get that to work, however I'm having issues with passing the array of clusters from LabVIEW to the C dll
short count , code;
MyStruct_board_info *board_info_list;
count = acq_get_board_count();
if (count){board_info_list = new MyStruct_board_info[count];
code = acq_get_board_info(count, board_info_list);
}else{// no interface card installed}**************************************************​***************************** 
my C structure looks like the following:
struct MyStruct_board_info
char name[32]; 
short type;
char en_first_gain; 
long first_gain_min; 
char computer_ctrl;
char pad[3]; 

One trick I found is to right-click the call library function node and select "create .c file" and examine what it will create.  I used the method that nathand used to generate the cluster using array to cluster to embed the array contents as values.  After you build the array of clusters, I think you will have to pass in element zero.  If you pass in the whole array and look at the c-code, it will still embed a 4-byte size field in the struct and this will whack your dll.
Use adapt to type in your call library function node.  The pictured code generates the following c-code:
/* Call Library source file */#include "extcode.h"/* Typedefs */typedef struct { double Array0;double Array1; double Array2;double Array3; double Array4;double Array5; double Array6;double Array7; double Array8;double Array9; double Array10;double Array11; double Array12;double Array13; double Array14;double Array15; double Array16;double Array17; double Array18;double Array19; double Array20;double Array21; double Array22;double Array23; double Array24;double Array25; double Array26;double Array27; double Array28;double Array29; double Array30;double Array31; } TD2;typedef struct { TD2 Array;
uint32_t Numeric;
} TD1;void CIELChToDE94(TD1 *arg1);
Attachments:
Call dll with cluster.png ‏9 KB

Similar Messages

  • HT204053 My husband and I both have iPhones but we only have one iPad. We use the same apple ID because we also share the same email address. How would this work with iCloud because we don't share the same contacts?  Thanks Elainecontacts

    My husband and I both have an iPhone and we share an iPad. We also share the same email address so how would this work with iCloud because we don't share all the same contacts?
    Thanks

    An icloud account is designed to be used by one user.  That user can have all his/her devices synced with the same Apple data (email, contacts, calendars, notes, reminders, etc.) .  When two people use the same account, then problems usually occur when one user edits data that the other user doesn't want changed on their device.  You can continue sharing the same ID for the itunes account in order to share the purchased music, apps, etc.  itunes accounts and icloud accounts are different.
    It's by far better that each user has his/her own icloud account.

  • How would you code a 3D transform within an mxml?

    How would you code a group of individual text objects, which
    as an associated group, would scroll like the proverbial opening
    Star Wars story description?
    Thanks,
    Pete

    How would you code a group of individual text objects, which
    as an associated group, would scroll like the proverbial opening
    Star Wars story description?
    Thanks,
    Pete

  • How would this monitor work . . .

    I'm looking for the least expensive monitor to work well with the Mac Mini: how would the Acer X171s, 17" LCD work, do you think?

    Okay . . . now I see why I haven't gotten many replies on this one: poorly worded question. Really what I'm wondering is how well a monitor like that would perform. I get the sense that folks are buying monitors that cost from $300 on up--Apple's being almost $600, I think. So, I'm just wondering what kind of performance issues might arise from using a less expensive monitor (this one is about $180) with the Mac Mini. Thanks for the info. about plug-and-play, though . . . that will help, if the monitor itself is worth it.

  • How would I embed NetMeeting in Labview 6i using ActiveX?

    I would like to use my USB Webcam through netmeeting to run in Labview.I initially wanted to use a Java Applet and looked at Webcam 32 but I thought a cheaper option would be to use ActiveX. I would also like to be able to use netmeetings controls. I have been trying to figure out a way for a while but I am easily confused with Labview!

    The original question is from a month ago but hopefully this will be helpful still to you.
    You can definitely control NetMeeting using ActiveX and LabVIEW. All you need is to have NetMeeting and its ActiveX control installed on your machine. Then use the following method to get the NetMeeting controls on your LabVIEW VI Front Panel.
    1. Place an ActiveX Container on the Front Panel (Controls Palette >> ActiveX >> Container)
    2. Right click inside of the container and select Insert ActiveX Object...
    3. Select from the list the ActiveX Control named NetMeeting.
    The container will then have an instance of NetMeeting in the ActiveX container. I followed these exact steps above and created this VI which is just a NetMeeting control i
    n an ActiveX container.
    Hopefully this information is helpful. I created the example in LabVIEW 6i.
    -scraggs99
    Attachments:
    NetMeeting_in_LabVIEW.vi ‏9 KB

  • How is this build looking?

    Planned system, so far:
    http://pcpartpicker.com/user/crhawkeye/saved/1AkA
    System concerns:
    - Any dumb bottlenecks? Anything standout? What should I spend less on, what should I spend more on? Never built before. Still in research mode.
    - Motherboard going to cut it? Originally targeted this as I knew it was workable with a hackintosh setup, which I plan to install. (for this reason want to stick to intel MBs)
    - Still haven't figured out my drive situation. Do plan on having to manually back up on to multiple external HDs for storage.
    - If I want to overclock the 3770k . . . will my current config work?
    - As I understand it... GTX 660 should support thunderbolt (if I go there) with an adapter. Eventually plan on getting a higher res monitor, not sure it will be thunderbolt.
    Uses:
    - Chiefly photo processing (lightroom/CS6), but some HD video work with DLSR files. (figure premiere was more demanding of hardware, so posted here)
    - Will be processing canon 18mp files and Nikon d800 36mp files raw. Will be stacking multiple 36mp raw files, will be stitching multiple 36mp raw files. Figures to be my most demanding photo process.
    Expectations/tolerances:
    I'm coming from an old 2 core amd system that had 6gb ram. Only used cs5/lightroom... no video editing. Did OK with smaller 18mp files, but 36mp seriously stresses it. Needless to say... I'm used to slow. The biggest thing I want to improve is actual responsiveness of interface. It'd be nice to be able to write a file two minutes faster than I used to or whatnot, but that's not as big a deal. (remember, used to slow, not a pro... need adeqaute)
    I don't do this for a living, but am fairly serious abou my hobby. I want something that will last me 3 years or so at least. I don't see myself upgrading past the nikon d800 in that time frame. (or acquiring anything that gives me more challenging video files)
    I was all ready to get a Dell XPS 850 or something... but convinced myself that maybe this would be a better idea. So here I am.
    Thanks

    Ok, updated parts list. Upgraded mobo and gold rated 720 super-sup. (don't know if 720 is overkill or not -- can't hurt)
    http://pcpartpicker.com/user/crhawkeye/saved/1AQc
    Still trying to figure out what to do hard drive wise. Have listed a couple toishiba 7200/2TB as they were seemingly rated as well as other HDs in that class. Was going to use a couple 2TB drives in raid 1, and then a samsung pro 256 SD. At least to start.  Will add from there. Don't know if I'll be able to get away with multiple OS boots from 1 256gb SD drive or not, may be pushing it.
    Think I'll skip worrying about thunderbolt for now, do believe there is an adapter that would get me there if I needed to anyway with this setup.
    Looks like my price point has shifted to the 1500 range with this current config.

  • How would I code a file upload for in flash?

    The title says it all. Anyone know how I would code a file/pic upload form in flash. I have seen examples that you can use php. However I have tried the php/java I designed for my dreamweaver sites. I think It's time I get with the real designers and us flash for my websites.
    Any imput would be great!

    you can use the filereference class to upload a file using actionscript.  to save the file to your server, you'll need to also use server-side scripting like php.

  • How would I code to resize my UILoader in SWF

    Hi All
    I have loaded different SWFs using UI Loader component and I
    have used AS 3.0 for that. All those SWFs are playing video in form
    of Flvs in that. While executing those UI Loaders show video
    efficiently. Is there any way that I can code so that user can also
    resize that UI loader and still maintain the aspect ratio of the
    video. i am using RESIZE property but it is not allowing the user
    to resize the component , it just once resize the component on the
    run time
    I would highly appreciate any help.
    Thanks
    Anuj
    /* Here's the sample code I am putting to refer*/
    var myUILoader:UILoader = new UILoader();
    myUILoader.autoLoad = false;
    myUILoader.maintainAspectRatio=true;
    myUILoader.drawFocus(true);
    //Allowing Resize of the UI Loader
    /*myUILoader.addEventListener(ComponentEvent.RESIZE,
    resizeHandler);
    function resizeHandler(event:ComponentEvent):void
    var uiLdr:UILoader = event.currentTarget as UILoader;
    trace(uiLdr.width, uiLdr.height); // 400 267
    uiLdr.move((stage.stageWidth - uiLdr.width) / 2,
    (stage.stageHeight - uiLdr.height) / 2);
    myUILoader.focusEnabled=true;
    myUILoader.scaleContent = true;
    myUILoader.width=300;
    myUILoader.height=300;
    myUILoader.addEventListener(MouseEvent.MOUSE_DOWN,UI1);
    myUILoader.addEventListener(MouseEvent.MOUSE_UP,UI2);
    function UI1(event:MouseEvent):void
    if((myUILoader.x>-887) && (myUILoader.y>-500)
    &&(myUILoader.y<746))
    myUILoader.startDrag();
    else if(myUILoader.y>746)
    myUILoader.visible=false;
    function UI2(event:MouseEvent):void
    if((myUILoader.x>-887) && (myUILoader.y>-500)
    &&(myUILoader.y<746))
    myUILoader.stopDrag();
    else
    myUILoader.unload();
    myUILoader.source = "/video/pic_1.swf";
    myUILoader.load();
    myUILoader.move(mouseX,mouseY);
    addChild(myUILoader);

    Whenever I try to resize an image by clicking "image size" it only resizes the canvas. Before, I could click on a single photo and drag the corner to resize the image. If I pressed shift while I did it, it would retain the same dimension ratios. If I pressed control while I dragged the corner, it would let you manipulate the shape so that you could kind of make it 3D. If you put your cursor in the right place, it would also let you rotate the image. It won't even do any of that when I type text onto my canvas. It seems like that function is turned off, and I'd like to know how to use it again.
    Maybe I'm saying it wrong. I guess what I really mean is resizing a layer. Like, if I copy and pasted a photo onto a canvas I already have open, I'd want to drag to resize it to fit the canvas.

  • Programming project: does this code look clean enough to turn in?

    Hi, i was just wanting to know people's opinion on the format of my classes below, i haven't done much java programming and I just want to make sure that this program is easily understood. I will not be able to respond, because I have to wake up in 3 hours for school. So thanks in advance, I will be reading this tomorrow, to see your suggestions, thank you.
    here is the scholar class, it is the class that i made to create a scholar(student object) that will be applying for a scholarship and the grades are entered in the ScholarTester class.
    I could've done things differently and easier but the professor strictly called for it to be exactly as he stated. I came up with a better, less tedious way, but i couldn't use it. My way was to create a method to randomly generate grades and values to determine the major, but my prof. saw it and made me implement everything in ScholarTester. Also neither of the students will receive the scholarship, that will be determined in project 2 my professor said.
    package project1;
    import java.util.*;
    * @author Kevin
    public class Scholar implements Comparable {
        // private variables
        private String fullName;
        private double gradePointAverage;
        private int essayScore;
        private int creditHours;
        private boolean scienceMajor;
        private double totalScore;
           // constructor for a Scholar object
            public Scholar(String myFullName, double myGradePointAverage, int myEssayScore,
                           int myCreditHours, boolean isScienceMajor){
                    this.fullName = myFullName;
                    this.gradePointAverage = myGradePointAverage;
                    this.essayScore = myEssayScore;
                    this.creditHours = myCreditHours;
                    this.scienceMajor = isScienceMajor;
            // returns a Scholar object's fullname
            public String getFullName(){
                return fullName;
            // returns a Scholar object's gpa
            public double getGradePointAverage(){
                return gradePointAverage;
            // returns a Scholar object's essay score
            public int getEssayScore(){
                return essayScore;
            /// returns a Scholar object's credit hours
            public int getCreditHours(){
                return creditHours;
            // retruns if a Scholar object is a science major or not
            public boolean getScienceMajor(){
                return scienceMajor;
            // sets a Scholar object's full name
            public String setFullName(String lastName, String firstName){
               fullName = lastName + ", " + firstName;
               return fullName;
            // sets a Scholar object's gpa
            public double setGradePointAverage(double a){
                gradePointAverage = a;
                return gradePointAverage;
            // sets a Scholar object's gpa
            public int setEssayScore(int a){
                essayScore = a;
                return essayScore;
            // sets a Scholar object's credit hours
            public int setCreditHours(int a){
                creditHours = a;
                return creditHours;
            // sets a Scholar's major to a science major or not a science major
            public boolean setScienceMajor(boolean a){
                scienceMajor = a;
                return scienceMajor;
            // calculates a Scholar object's score
            public double getScore(){
                totalScore = (gradePointAverage*5) + essayScore;
                if (scienceMajor == true)
                    totalScore += .5;
                if (creditHours >= 60 && creditHours <90)
                    totalScore += .5;
                else if (creditHours >= 90)
                    totalScore += .75;
                return totalScore;
            // compares two scholar objects.
            public int compareTo(Object obj){
                Scholar otherObj = (Scholar)obj;
                double result = getScore() - otherObj.getScore();
                if (result > 0)
                    return 1;
                else if (result < 0)
                    return -1;
                return 0;
            // returns the highest scoring of two Scholar objects
            public static Scholar max(Scholar s1, Scholar s2){
                if (s1.getScore() > s2.getScore())
                    System.out.println(s1.getFullName() + " scored higher than " +
                                       s2.getFullName() + ".\n");
                else
                   System.out.println(s2.getFullName() + " scored higher than " +
                                       s1.getFullName() + ".\n");
                return null;
            // returns the highest of 3 student objects
            public static Scholar max(Scholar s1, Scholar s2, Scholar s3){
                if (s1.getScore() > s2.getScore() && s1.getScore() > s3.getScore())
                    System.out.println(s1.getFullName() + " scored the highest" +
                            " out of all three students.");
                else if (s2.getScore() > s1.getScore() && s2.getScore() > s3.getScore())
                    System.out.println(s2.getFullName() + " scored the highest" +
                            " out of all three students.");
                else if (s3.getScore() > s2.getScore() && s3.getScore() > s1.getScore())
                    System.out.println(s3.getFullName() + " scored the highest" +
                            " out of the three students.");
                return null;
            // toString method for a Scholar object
            public String toString(){
                return  "Student name: " + fullName + " -" + " Grade Point Average: "
                        + gradePointAverage  + ". " + "Essay Score: " + essayScore + "."
                        + " Credit Hours: " + creditHours + ". "  +  " Science major: "
                        + scienceMajor + ".";
    }here's the ScholarTester class:
    package project1;
    import java.util.*;
    * This program creates Scholar objects that are applying for a scholarship
    * @author Kevin
    public class ScholarTester {
    public static void main(String [] args){
    System.out.println("This program was written by Kevin Brown. \n");
    System.out.println("--------Part 1--------\n");
    // attributes for a scholar object named abraham
    double abrahamGpa;
    int abrahamEssayScore;
    int abrahamCreditHours;
    int scienceMajorValueAbraham;
    boolean abrahamIsScienceMajor;
        // random numbers used for each scholar object.
        Random doubleGpa = new Random();
        Random intGpa = new Random();
        Random essayScore = new Random();
        Random creditHours = new Random();
        Random scienceMajor = new Random();
            // randomly creates abraham's statistics
            abrahamGpa = doubleGpa.nextDouble() + intGpa.nextInt(4);
            abrahamEssayScore = essayScore.nextInt(6);
            abrahamCreditHours = creditHours.nextInt(121);
            scienceMajorValueAbraham = scienceMajor.nextInt(2);
                if (scienceMajorValueAbraham == 0)
                 abrahamIsScienceMajor = true;
                else
                 abrahamIsScienceMajor = false;
    Scholar abraham = new Scholar("Lincoln, Abraham", abrahamGpa,
                                      abrahamEssayScore, abrahamCreditHours,
                                      abrahamIsScienceMajor);
    System.out.println(abraham);
    double georgeGpa;
    int georgeEssayScore;
    int georgeCreditHours;
    int scienceMajorValueGeorge;
    boolean georgeIsScienceMajor;
        // randomly creates george's statistics
        georgeGpa = doubleGpa.nextDouble() + intGpa.nextInt(4);
        georgeEssayScore = essayScore.nextInt(6);
        georgeCreditHours = creditHours.nextInt(131);
        scienceMajorValueGeorge = scienceMajor.nextInt(2);
             if (scienceMajorValueGeorge == 0)
                 georgeIsScienceMajor = true;
             else
                 georgeIsScienceMajor = false;
    // new scholar object is created from the existing attributes
    Scholar george = new Scholar("Bush, George",  georgeGpa, georgeEssayScore,
                                          georgeCreditHours, georgeIsScienceMajor);
    System.out.println(george + "\n");
    System.out.println("--------Part 2--------\n");
    System.out.println(abraham.getFullName() + " scored " + abraham.getScore() + ".");
    System.out.println(george.getFullName() + " scored " + george.getScore() + ".\n");
    System.out.println("--------Part 3--------\n");
    /* comparing george bush and abraham lincoln's scores and printing them out to
             show that the compareTo method is working*/
             System.out.println(abraham.getFullName() + " scored "
                                + abraham.getScore() + ".");
             System.out.println(george.getFullName() + " scored "
                                + george.getScore() + ".\n");
    if(abraham.compareTo(george) == 1)
        System.out.println(abraham.getFullName() + " scored higher than " +
                george.getFullName() + ".\n");
    else
        System.out.println(george.getFullName() + " scored higher than " +
                abraham.getFullName() + ".\n");
    System.out.println("--------Part 4--------\n");
        // prints out scores to show proof that the Scholar.max method is working right.
        System.out.println(abraham.getFullName() + " scored "
                           + abraham.getScore() + ".");
        System.out.println(george.getFullName() + " scored "
                           + george.getScore() + ".\n");
        Scholar.max(abraham, george); // maximum score between abraham and george.
    // variables for a scholar object named thomas.
        double thomasGpa;
        int thomasEssayScore;
        int thomasCreditHours;
        int scienceMajorValueThomas;
        boolean thomasIsScienceMajor;
        // randomly creates thomas' statistics
            thomasGpa = doubleGpa.nextDouble() + intGpa.nextInt(4);
            thomasEssayScore = essayScore.nextInt(6);
            thomasCreditHours = creditHours.nextInt(131);
            scienceMajorValueThomas = scienceMajor.nextInt(2);
                 if (scienceMajorValueThomas == 0)
                     thomasIsScienceMajor = true;
                 else
                 thomasIsScienceMajor = false;
             // new scholar object created from existing attributes
             Scholar thomas = new Scholar("Jefferson, Thomas", thomasGpa, thomasEssayScore,
                                          thomasCreditHours, thomasIsScienceMajor);
             System.out.println("New student added - " + thomas + "\n");
             // returns all 3 students scores to show proof that the Scholar.max method is working right
             System.out.println(thomas.getFullName() + " scored " + thomas.getScore());
             System.out.println(abraham.getFullName() + " scored " + abraham.getScore());
             System.out.println(george.getFullName() + " scored " + george.getScore() + "\n");
             // highest score of all three scholars
             Scholar.max(abraham, george, thomas);
    }Thanks for reading this long and boring project.

    On comments: don't include a comment that just repeats syntax:
    // constructor for a Scholar object
    public Scholar(String myFullName, ...Anyone knowing Java syntax doesn't need that comment and gains nothing
    from its presence, and anyone not knowing Java syntax shouldn't be reading
    a listing.
    On parameter names: a isn't very imaginative or prescriptive. (See next code.)
    On setters returning the argument:
    public int setCreditHours(int creditHours ){
        this.creditHours = creditHours ;
        return creditHours;
    }1. Most people keep it simple and use a void return type.
    2, The next most common convention is to return this:
    public Scholar setCreditHours(int creditHours){
        this.creditHours = creditHours ;
        return this;
    }Then you can chain calls, which is occasionally useful:
    scholar.setCreditHours(4).setEssayScore(2);3. If you insist on returning the argument, note that this is a one-liner:
    public in setCreditHours(int creditHours){
        return this.creditHours = creditHours ;
    }

  • HT4864 How would this process work with an alias?

    I currently use gmail for iCloud? I forward iCloud's messages to gmail and I have the SMTP server setup to send gmails from an iCloud alias from gmail.
    How can I set up this alias on my iPad and iPhone? The server accepts the primary icloud login address, but not the alias
    Thanks,
    Julian

    The actual server for me.com/mac.com is no more. Which means that you can receive emails that are going to those addresses, but sending is done from @icloud.com.

  • How does this PSU look?

    http://www.newegg.com/app/viewProductDesc.asp?description=17-148-009&catalog=23&manufactory=BROWSE
    hard to see but looks like the AMPS are as follows -30 32 35
    right now im running 18a on the 12v rail, too low for me (system is stable but i want more, im upgrading and dont like the idea of running out of power)

    I got  this Power supply(blue version)from Newegg about 3 weeks ago,and it is great addition to my system.The label reads--+3.3V=30A,+5V=32A,+12V=35A.It has 3 fans that are controlled by knob on back,also thermal speed control as load rises.I have knob set in the middle and it has reduced my case temps about 3 degrees.Also it is very quiet,unless you turn it all the way up.My system is very stable.
     Also unlike the photos, all the wires are UV sleeved ,and it comes with thumb screws to mount it.It has a quality look and feel to it.

  • Does this code look right

    <?php
    $name=$_POST['name'];
    $email=$_POST['email'];
    $location=$_POST['location'];
    mysql_connect("your.hostaddress.com", "username", "password") or die(mysql_error());
    mysql_select_db("Database_Name") or die(mysql_error());
    mysql_query("INSERT INTO `data` VALUES ('$name', '$email', '$location')");
    Print "Your information has been successfully added to the database.";
    ?>

    What colors? You mean in code view?
    Actually your last line should be this -
    print ("Your information has been successfully added to the database.");
    Other than that, the code and its coloring are correct as far as I can tell.

  • HT3924 How would this apply if you have a MacBook Pro Retina, 13-inch, Late 2012?

    How could I use my iMac 27" Mid 2010 as an external monitor for my MacBook Pro Retina, 13-inch, Late 2012?
    I have an HDMI to HDMI but nothing happens.

    You use Target Display Mode via Thunderbolt cable.
    Target Display Mode And Thunderbolt
    Target Display Mode 2009 & 2010 iMacs
    Target Display Mode 2011 & Later iMacs
    iMac (Mid 2011)- Target Display Mode does not work with Mini DisplayPort cable

  • How does this code work?

    public class TestDays {
    public enum Days { MON, TUE, WED };
    public static void main(String[] args) {
    for(Days d : Days.values() )
    Days [] d2 = Days.values();
    System.out.println(d2[2]);
    Also explain the for loop declaration please.

    masijade. wrote:
    prometheuzz wrote:
    masijade. wrote:
    Are you sure it works, at all?
    ...Sure, why not?I.E. "works" as in does what it is suppossed to do, not as in compiles and executes.
    He did not tell us what was expected (if anything at all). The classic "define does not work" type question.Ah, I see.

  • Why Would This Code Indicate a Broken Link?

    Ruth_DeKyne_Map.html is listed as broken even though it works - why?

    The answer can be found in a duplicate discussion below:
    http://forums.adobe.com/thread/1362140?tstart=0
    @Genealogy Guy,
    In the future, please don't duplicate your posts.  It makes it harder for people to follow your discussions. 
    If you can't find your first post, log-in to the web forum. 
    Click on Your Stuff > Discussions.
    Thanks,
    ❄  ☃  ❄Nancy O.

Maybe you are looking for