How do I create a global signal list or system record

Forgive me but I have been away from LabVIEW for a quite a while. I have been working in the realm of LabWindows (99% of our work) for the last five years with some LabVIEW sprinkled in. I have been tasked with designing a replacement for an existing test stand at another facility in our company with a primary requirement being that LabVIEW is the development environment.
We have two very strong standard 'C' architectures that we try and use as a baseline on the majortiy of our work. I would like to try and implement one of these architectures in LabVIEW but am finding that part, and really a fundamental part, of this architecture is not translating very well. The centerpieces of this achitecture are global signal lookup structure(s) and a global system record. The signal lookup structure is a complete list of signals in the test system with scalar and offset information. The system record stores the current raw value for the of each of these signals. See the examples below:
typedef struct SignalType
    int       globalIndex;
    double voltsPerEngUnit;
    double voltageOffset;
    char    signalName[SIGNAL_NAME_LENGTH];
}SignalType;
struct SignalLookup
    SignalType sigTable[MAX_SIGNALS];
    SignalType *hardwareOutSpare100;
    SignalType *hardwareOutSpare99;
    SignalType *hardwareOutSpare98;
    SignalType *hardwareInSpare100;
    SignalType *hardwareInSpare99;
    SignalType *hardwareInSpare98;
    SignalType *time;
    SignalType *dutyTime;
    SignalType *frameTime;
    SignalType *isrCounter;
    SignalType *softwareOutSpare96;
    SignalType *graphPlot1;
    SignalType *graphPlot2;
    SignalType *graphPlot3;
    SignalType *graphGo;
    SignalType *graphDomainMin;
    SignalType *graphDomainMax;
    SignalType *graphRangeMin;
    SignalType *graphRangeMax;
    SignalType *softwareInSpare91;
} signalLookup;
Initialization Functions:
void SignalTypeInit(SignalType * s, int global, char * name, double scalar, double offset)
    s->globalIndex = global;
    s->voltsPerEngUnit = scalar;
    s->voltageOffset = offset;
    strcpy(s->signalName, name);
void SignalLookupInit()
    //Hardware Output
    signalLookup.hardwareOutSpare100= &signalLookup.sigTable[0];
    SignalTypeInit(signalLookup.hardwareOutSpare100, 0, "hardwareOutSpare100", 1.0000, 0.0000);
    signalLookup.hardwareOutSpare99= &signalLookup.sigTable[1];
    SignalTypeInit(signalLookup.hardwareOutSpare99, 1, "hardwareOutSpare99", 1.0000, 0.0000);
    signalLookup.hardwareOutSpare98= &signalLookup.sigTable[2];
    SignalTypeInit(signalLookup.hardwareOutSpare98, 2, "hardwareOutSpare98", 1.0000, 0.0000);
typedef struct SystemRecord
   double sigTable [MAX_SIGNALS];
}SystemRecord;
How can I translate these structures to LabVIEW when LabVIEW with global structures and arrays being big no-nos in LabVIEW? I am open to all critiques and help I can get.
Regards-
John OC
John O'C
Staff Test Systems Engineer
Woodward, Inc.
Skokie, Illinois, USA
"Life is not a journey to the grave with the intention of arriving safely
in a pretty and well preserved body, but rather to skid in broadside,
thoroughly used up, totally worn out, and loudly proclaiming...
Wow...What a Ride!"
Solved!
Go to Solution.

I didn't look at the C code too closely, but is seems to me that you basically have a bunch of named signal definitions (structs) to which you want to get the data by name.
Personally, I would add all the additional needed data in there (such as the hardware address and the actual current value) and use a class or a library to wrap all of it in an easy to use API.
You can create the core of the functionality by having a lookup table of data value references (DVRs, which are somewhat (only somewhat!) similar to pointers, in that they point to specific data) which will each point to a single cluster (or object). Once you get the DVR to the cluster (or object) you use the in-place element structure to get the data inside the DVR and perform the specific operation you want (such as setting the initial configuration or reading the current calibrated value of the signal) on that data.
For the lookup, I would recommend a simple VI with a variant in a shift register. The shift register makes sure that the data is saved between runs of the VI and you use the variant attribute primitives to keep the DVRs - if an attribute with the current name doesn't exist in the variant, you create a new one and write it to the variant. Each attribute holds a DVR which is what you output.
So, for each VI in your API (Init, Read Current Value, etc.) you give the name as an input and start by calling the lookup VI to get the DVR. Then you use the DVR to operate on that specific signal.
If all that sounds too complicated, you can try going with something like this - http://zone.ni.com/devzone/cda/epd/p/id/5326
Try to take over the world!

Similar Messages

  • How do I create a group contact list for emails?

    I can open an new email contact for a single person, but how do I create a group contact list?

    http://kb.mozillazine.org/Thunderbird_:_FAQs_:_Create_Mailing_List
    In Address Book, File/New/Mailing List, name the list and close it, then add contacts to the list by dragging them from an address book and dropping onto the list icon in the directory (left) pane.

  • How to auto create a global variable with specific variable name in a global vi ?

    how to auto create a global variable with specific variable name in a global vi using lv ? Because i need to add a lot of global variable in this global vi. But you know, if  i manually add them , it will be a much time-costing work. So i want to use someway to auto generate ? Can i ?? Thanks a lot !

    Hi
    what aartjan is saying is the way for you. but you can develop an utility which will actually help you create global variables. To get the details on this just have a look at VI Scripting section on LAVA forum.
    But i would like you to suggest few things
    1. If your programs have so many global variables (Thats why u want utility) then you should take out some time to read about LabVIEW design patterns. I think if programmer follows these practicess he dont need a single global variable.
    2. Their are some other ways to achieve similar functionality as of global variables (Uninitialized Shift Registers, Single Element Qs and so on) but they are much faster than global variables.
    I am Attaching Whatever Resources i am having I will also attach the template of the design pattern i generaly use in short duration
    Message Edited by Tushar Jambhekar on 10-06-2005 07:33 PM
    Message Edited by Tushar Jambhekar on 10-06-2005 07:36 PM
    Tushar Jambhekar
    [email protected]
    Jambhekar Automation Solutions
    LabVIEW Consultancy, LabVIEW Training
    Rent a LabVIEW Developer, My Blog
    Attachments:
    LabVIEWDesignPatterns.zip ‏1505 KB
    Large_Code_Implementation.zip ‏522 KB
    Database Tests.zip ‏868 KB

  • How do I create multiple live USBs of Operating systems to boot from on one flashdrive?

    How do I create multiple live USBs of Operating systems to boot from on one flashdrive?
    I am attempting to create multiple live USBs within one flashdrive so that i can boot various operating systems without having to buy multiple USb sticks. I am using a Mac OS X Snow Leopard 10.6.8 Operating System currently. I am using the Terminal provided by the OS.
    I would like to try Debian, Kali, Precise Puppy, and Sabayon- with one space left empty for whatever Linux OS I would like to try next. I have partitioned an 8GB flashdrive into the following sections:
    name of intended OS,     space allocated for it:
    1)Debian ........................1.32 GB
    2)Kali..............................2.61GB
    3)Precise Puppy..............163.7MB
    4)Sabayon.......................1.77GB
    5)TBD..............................2.14GB
    I have figured out how to change the .iso files of the operating systems into .img files with the following commands:
    hdiutil convert -format UDRW /path/to/input.iso -o /path/to/output.img
    a .img.dmg file is created, this is corrected in the next line of code *please note: I am a a very beginner at programming, and would greatly appreciate any help. Thank you!
    mv /path/to/output/file.img{.dmg,}
    This is where I started to get confused:
    I entered diskutil list to find the location of the partitions on my flashdrive, and this is the relevant section:
    /dev/disk1
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:     FDisk_partition_scheme                        *8.0 GB     disk1
       1:                 DOS_FAT_32 DEBIAN               1.3 GB     disk1s1
       2:                 DOS_FAT_32 KALI                    2.6 GB     disk1s2
       3:                 DOS_FAT_32 PRECISE            163.7 MB   disk1s3
       4:                 DOS_FAT_32 SABAYON           1.8 GB     disk1s5
       5:                 DOS_FAT_32 TBD                     2.1 GB     disk1s6
    This is the code I attempted to use and the subsequent result:
    charles-burtons-mac-mini:~ charlesburton$ sudo dd if=/Users/charlesburton/Desktop/debian-live-7.2-i386-gnome-desktop.img of=/dev/disk1s1 bs=1m
    dd: /dev/disk1s1: Resource busy
    *at this point I went to the Disk Utility GUi and unmounted only the DEBIAN partition, now back to the terminal*
    charles-burtons-mac-mini:~ charlesburton$ sudo dd if=/Users/charlesburton/Desktop/debian-live-7.2-i386-gnome-desktop.img of=/dev/disk1s1 bs=1m
    dd: /dev/disk1s1: end of device
    1259+0 records in
    1258+1 records out
    1320005632 bytes transferred in 1011.966891 secs (1304396 bytes/sec)
    Please may someone help explain why I had a return value of +1 in my records in and how I can make it work properly.

    I would like to know the answer to this as well.  I tried renaming the 3D version by adding 3D after it, but it still not a separate movie in iTunes.
    It's putting them in the same folder.

  • How do I create a drop down list to e-mail a form for signature.

    The desired workflow is for
    1)      Firefighter 1 to complete the top portion of the Agreement
    section, sign in the Firefighter 1 signature field (which locks the top
    portion of the Agreement Section), then select Firefighter 2 from the
    e-mail drop down list and e-mail the PDF form to Firefighter 2;
    2)      Firefighter 2 opens the e-mail and the PDF attachment,
    completes the second portion of the Agreement Section, sign in the
    Firefighter 2 signature field (which locks the bottom portion of the
    Agreement Section), select Lieutenant 1 from the e-mail drop down list
    and e-mail the PDF form to Lieutenant 1;
    3)      Lieutenant 1 opens the e-mail and the PDF attachment, checks
    the approved box, signs the Lieutenant 1 signature field, select
    Lieutenant 2 from the e-mail drop down list and e-mail the PDF form to
    Lieutenant 2;
    4)      Step three continues through Lieutenant 2, Battalion Chief 1
    and Battalion Chief 2
    5)      Battalion Chief 2 sends the fully completed form back to
    Firefighter 1 who copies the completed form to Firefighter 2
    Note: if any of the officers disapprove the agreement the disapproved
    form is immediately sent back to Firefighter 1

    katiesandell wrote:
    how can i create a drop down menu so that when i click on the arrow in the cell i can select from the menu that appears
    Hi Katie,
    Welcome to Apple Discussions and the Numbers '09 forum.
    Numbers vocabulary for this feature is a "Pop-up Menu". It's available as a Cell Format, and is set and edited in the Cell Format Inspector.
    See "Using a Checkbox, Slider, Stepper, or Pop-Up Menu in Table Cells" starting on page 96 of the Numbers '09 User Guide.
    This guide, and the equally useful iWork Formulas and Functions User Guide are available for download through the Help menu in Numbers.
    Regards,
    Barry

  • How can i create a Global Temporary Table inside a Stored Procedure....

    Hi...
    I need to create a Global Temporary Table inside a Stored
    Procedure....
    I have no idea how to do that....
    Please....if u can send me a sample, send to me....
    Thanks a lot

    To create a global temporary table inside a stored procedure,
    the minimal syntax would be:
    CREATE OR REPLACE PROCEDURE procedure_name
    AS
    BEGIN
    EXECUTE IMMEDIATE 'CREATE GLOBAL TEMPORARY TABLE table_name'
    || '(column_name NUMBER)';
    END procedure_name;
    As Todd stated, it would probably be better to create the global
    temporary table outside of the procedure:
    SQL> CREATE GLOBAL TEMPORARY TABLE table_name
    2 (column_name NUMBER);
    Table created.
    You can also specify things like ON COMMIT PRESERVE ROWS or ON
    COMMIT DELETE ROWS.
    It may be that there is something else, like a PL/SQL table of
    records or a cursor, that would suit your needs better. It is
    difficult to guess without knowing what you want to do with it.

  • How can I create an IList Employee list based on my Employee class?

    I'm trying to create an IList<Employee> list based on my Employee class (below).  But this is erroring out.  Is my employee class missing anything?  How could I make this work?
    private void EmployeeList()
    IList<Employee> arL = new IList<Employee>(); //<<<<----errors out here
    arL.Add(new Employee {Name="Mary",Gender="Female", Age=35});
    arL.Add(new Employee { Name = "Bob", Gender = "Male", Age = 40 });
    arL.Add(new Employee { Name = "Tom", Gender = "Male", Age = 50 });
    var qm = from Employee employee in arL
    where employee.Age < 50
    select employee;
    foreach (var m in arL)
    Console.WriteLine(m.ToString());
    class Employee
    private string name;
    private string gender;
    private int age;
    public string Name
    get { return name; }
    set { name = value; }
    public string Gender
    get { return gender; }
    set { gender = value; }
    public int Age
    get {return age;}
    set {age = value;}
    Rich P

    IList is an interface, not a class. This means that it can't be instantiated (can't be "newed").
    List is a class, so it can be instantiated. It implements the IList interface, which means that it must provide the functionality specified in that interface.
    That's what an interface is - a definition of functionality that a class must provide. An interface is often described as a contract that a class must fulfill.
    So in the code in your last post, you are saying that arL is an instance of some class that implements the IList interface, and you are then setting it to an instance of the class List. The List class implements the IList interface, so this assignment is
    legit. It would also be legit to use any other class that implements IList, such as an array.
    Any class that implements IList can have as much extra functionality as whoever wrote it likes, as long as it implements at least the functionality of the interface.
    Sometimes you will come across a method in a library over which you have no control and which returns IList rather than list. In such a case you will be forced to do something like...
    IList list = SomeMethodOrOther();
    So you will have no idea what class list is an instance of, but you will know that it has the functionality of IList. This is about the only circumstance where I would recommend defining a variable as IList rather than List (but it probably won't be long
    before there are some replies to this post that disagree).

  • How does one create a GROUP mailing list from an e-mail message ? ?

    I am having no end of frustration trying to figure out - using the latest versions of Apple Mail and Apple Address book in side-by-side windows, t he following:
    How to select; then 'drag & drop' a list of email addresses from an incoming email message I am reading, so that I can create in my own address book a duplicate "Group" list bearing all the addresses that got the message.
    I am sure I have been able in the past to use simple drag-n-drop technique between the mail window and the newly created "Group" window in Address Book, but it won't work this time .
    Is there a script or a third party app somewhere that will lift addresses out of the "TO" and "c.c." fields in an Apple Mail message and import them into a designated (new) 'Group' list in Address Book.
    Or is there a way to create a CSV file from an email message - if that will do the trick ?

    Mailscript's Add Addresses script should open a window with all the addresses in the email listed. You can select the ones you want to import, you can choose the group or create a new one, and you can pick the label for the email address. It will stay open so that you can add different emails to different groups.
    Your description doesn't sound anything like Mail Scripts.

  • How do i create a group contact list inorder to send out emails to multiple persons?

    how do i create a contact list for emailing from my iphone4?

    I have created a free iphone application to send group emails, as you cannot do it natively.
    http://itunes.apple.com/fr/app/easy-group/id461469079?mt=8
    Rémi
    Note: I may receive some form of compensation, financial or otherwise,from my recommendation or link.

  • How do I create a Group email list from my contacts??

    I can't figure out how to create a Group email list from my contacts on my iPhone??

    I thought that was how I did it before ( a year ago ) but the group is created in my Email software but the group won't synch to my phone?! However it will synch randomly - i.e. singular new emails synch from my phone to my computer, but I am not noticing the computer transferring data to my phone...same with calendar...hmmm, maybe that's the problem - issue synching anything entered into my computer first...anyone hear of this? It seems that this started about a month ago, I had to restore my phone and it would not restore with the most recent backup, so I had to go back a couple of back ups... since it has been glitchy! HELP!

  • How do I share Exchange Global Address List (GAL) across different forests without using federated services

    We have two domains in separate forests, One forest has Exchange 2013 server, how do we get a constantly up to date Global Address list of users
    from the "Other" forest?
    Thanks.
    Babu

    Hi,
    We can configure Global Address List (GAL) Synchronization with Forefront Identity Manager (FIM) 2010:
    https://technet.microsoft.com/en-us/video/configuring-global-address-list-gal-synchronization-with-forefront-identity-manager-fim-2010.aspx
    For more and detailed information about GALSync, please refer to:
    http://social.technet.microsoft.com/wiki/contents/articles/1726.global-address-list-synchronization-galsync-resources.aspx
    Regards,
    Winnie Liang
    TechNet Community Support

  • How do I create group email mailing lists?

    How do I create a group email mailing list?

    Open Contacts - its in the Applications folder.
    In the menu bar click File, and select New Group. In the left column of Contacts there will be a new item called untitled group. (You can change the name.)
    Next click All Contacts on the left, and drag and drop the names you want in the new group.
    To send an email to the group you start a new message and type the group name in the To: field.

  • How do i create a favourites website list (i'm new to mac)

    I have used a PC for the last 8 years and am new to mac.
    How do I create a favourites list of websites I commomnly visit?

    If you are using Safari next to the address bar you will see a + symbol, click that and follow the prompts. Another method is the keyboard shortcut of Command + D and finally using your mouse click the Bookmarks menu, Add Bookmark...
    Because you're new to Macs I'd strongly recommend you bookmark and study the following site. Bookmarking these will be good practice too!
    Switch 101
    Mac 101
    Find Out How Video tutorials

  • How do you create a customized step list?

    I am creating a workbook for some exercises and I want to use a formatted, numbered step list so students can check off the step as they complete it. It might look something like this:
    __ 1. some instructions
    __ 2. more instructions
    __ 3. even more instructions
    The numbering would obviously continue from the previous number.
    How do I create such bullet/number option?
    Thanks

    You can certainly get the underscore as a leading bullet:
    +Inspector > Text (T) > List > Bullets and Numbering > Text Bullet > Type the underscore _ character however many times you want into the bullet field > click away in the page+
    Select the sample of the text and open the Styles drawer:
    +Menu > View > Show Styles Drawer+ or click on the reversed ¶ in the blue dot on the toolbar at the top of the window.
    Select any *List Styles* name and:
    +Right mouse click > Create new List Style from Selection… > Give it a descriptive name+
    This will create:
    __ some instructions
    but without the numbering, which will need to be added manually. To add numbering I think will need some deeper editing of code or xml within the Pages app itself.
    I tried combining the numbered list with a leader tab of underscores but one removes the other.
    Peter

  • How can you create a new category list and attach it to a new incident template

    We intend to create helpdesks for various teams e.g. Facilities, IT, HR etc and allow staff to email separate email addresses via the exchange connector.  So incidents get assigned to separate queues categorised via the support group set in the
    assigned template used by the connector.  I want separate category lists for each template so IT staff don't see Facilities categories etc. This all works apart from having separate Incident classification lists attached to the appropriate template. 
    Thanks
    David

    So I suppose I have to do something similar to the blog post below.  I assume that if I create a new 'facilities incident' class I can create a distinct category list and attach that to a template without showing the default category list?
    Thanks
    David
    http://blogs.technet.com/cfs-filesystemfile.ashx/__key/telligent-evolution-components-attachments/01-6241-00-00-03-47-72-46/SCSM-Creating-a-user-classification-field-using-the-Authoring-Tool.docx

Maybe you are looking for