What's wrong with a "regular" global in this case? AND WIl ActiveX objects stored in functional globals remain valid (when used in an executable)?

I've written a plugin layer for a LV executable.  When this layer makes a call to the plugins' initialization functions, I want each plugin library to be able to initialize and maintain its own global memory (where things like VISA resource names or ActiveX objects are stored).  However, I've found that I can't manage to keep my global VIs "alive."  I'm inclined to switch to functional globals, but I suspect that this will be a problem for things like ActiveX objects (that in this particular case reference a CAN interface).  I believe that the functional global will indeed store the object from run to run, it's just that I'm somehow disinclined to think that the object will remain valid.  I think you'll have to re-initialize it.  Can anyone speak for or against this hunch?  (If you can't tell, I'm trying to avoid building a whole little test executable just to debug this problem.)
I suppose the more profound question is "Why don't the globals stay in memory?"  I'm attaching an image of what the application layer that calls the plugins' intializations looks like.  Next I'm attaching an example of an actual initialization routine.  You'll notice that I've even gone so far as to explicitly open the ref to the global VI that I want to keep in memory.  Then I just leave it there dangling - but it still gets dropped!  In my mind I shouldn't even have to do this, since the dynamically-called subVI "MC_CMO Init.vi" actually initializes the globals and runs with AutoDisposeRef = False. 
Lastly, this is my first-ever attempt at writting plugin software.  So if you look at my code and have any criticisms/pointers, I'll greatly appreciate them.
Thanks in advance,
Nick
"You keep using that word. I do not think it means what you think it means." - Inigo Montoya
Attachments:
AppLayer.JPG ‏60 KB
InitPlugin.JPG ‏103 KB

I am not sure if I follow you completely on your work-around.
Everything I have to say on this topic is based on obesrvations and threads I have read on Info-LabVIEW. Therefore it is subject to corecttion by those who know better.
LV is smart enough to know when "something" that had been opened, can be closed. It is not perfect.
If for instance you open a VISA refnum and pass the refnum  to a LV2 AS A REFNUM the refnum in the LV2 stay alive as long as the VI's are running.
If you start another VI that uses the LV2 to fetch the refnum, it should get a valid ref as long as it starts before the first goes idle.
You then be able to work with refnum usign the VI launched second as long as stays active.
I often create action engine that can be invoked where required throughout an application. If the action engines get a ref in one state (like init) and use it another, I will generally write a "tester" that calls the action engine action to test the engine. In this case, my "tester" stays live and it keeps the ref's fresh.
I suspect if you tried to trick LV you could. If you type cast the ref nums to I32 and stored those in a LV2, I could see how LV could loose track of the resource sharing, but that is something I would avoid.
So I encourage you to do some experimenting with keeping track of who's running when to see if your work-around will work.
If you think you understand it better than I explained it, please post.
Trying to help,
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction

Similar Messages

  • I don't know what's wrong with my camara it's all black and the front only works not the back

    I don't know what's wrong with my camara it's all black and the front only works not the back

    Try This...
    Close All Open Apps... Sign Out of your Account... Perform a Reset... Try again...
    Reset  ( No Data will be Lost )
    Press and Hold the Sleep/Wake Button and the Home Button at the Same Time...
    Wait for the Apple logo to Appear...
    Usually takes about 15 - 20 Seconds... ( But can take Longer...)
    Release the Buttons...

  • What's wrong with the regular expression?

    Hi all,
    For the life of me I can not figure out what is wrong with this regular expression
    .*\bA specific phrase\.\b.*
    This is just an example the actual phrase can be an specific phrase. My problem comes when the specific phrase ends in a period. I've escaped the period but it still gives me an error. The only time I don't get an error is when I take off the end boundry character which will not suffice as a solution. I need to be able to capture all the text before and after said phrase. If the phrase doesn't have a period it would look like this...
    .*\bA specific phrase\b.*
    which works fine. So what is it about the \.\b combination that is not matching?
    I've been banging my head on this for a while and I'm getting nowhere.
    The application highlights text that comes from a server. The user builds custom highlights that have some options. Highlight entire line, match partial word, and ignore case. The code that builds my pattern is here
    String strHighlight = _strHighlight;
            strHighlight = strHighlight.replaceAll("\\*", "\\\\*");
            strHighlight = strHighlight.replaceAll("\\.", "\\\\.");
            String strPattern = strHighlight;
            if(_bEntireParagraph)
                if(_bPartialWord)
                    strPattern = ".*" + strHighlight + ".*";
                else               
                    strPattern = ".*\\b" + strHighlight + "\\b.*";           
            else
                if(_bPartialWord)
                    strPattern = strHighlight;
                else               
                    strPattern = "\\b" + strHighlight + "\\b";  
            if(_bIgnoreCase)
                _patHighlight = Pattern.compile(strPattern, Pattern.CASE_INSENSITIVE);
            else
                _patHighlight = Pattern.compile(strPattern);So for example I matching the phrase: The dog ate the cat. And that phrase came over in the following text: Look there's a dog. The dog ate the cat. "Oh my!"
    And my user has the entire line and ignore case options selected then my regex woud look like this: .*\bThe dog ate the cat\b.*
    That should get highlighted, but for some reason it doesn't. Correct me if I'm wrong but doesn't the regex read as follows:
    any characters
    word boundry
    The dog ate the cat[period]
    word boundry
    any characters until newline.
    Any help will be much appreciated

    A word boundary (in the context of regexes) is a position that is either followed by a word character and not preceded by one (start of word) or preceded by a word character and not followed by one (end of word). A word character is defined as a letter, a digit, or an underscore. Since a period is not a word character, the only way the position following it could be a word boundary is if the next character is a letter, digit or underscore. But a sentence-ending period is always followed by whitespace, if anything, so it makes no sense to look for a word boundary there. I think, instead of \b, you should use negative lookarounds, like so:   strPattern = ".*(?<!\\w)" + strHighlight + "(?!\\w).*";

  • I don't know what's wrong with my code. it's about class and object.

    * This is generic type of Person
    package myManagement;
    * @author roadorange
    public class Person {
    private String SS;
    private String firstName;
    private String lastName;
    private String middleName;
    private String phoneNumber;
    private String address;
    private String birthDay;
    public void setSS (String SS) {
    this.SS = SS;
    public String getSS() {
    return SS;
    public void setFirstName (String firstName) {
    this.firstName = firstName;
    public String getFirstName() {
    return firstName;
    public void setLastName (String lastName) {
    this.lastName = lastName;
    public String getLastName() {
    return firstName;
    public void setMiddleName (String middleName) {
    this.middleName = middleName;
    public String getMiddleName() {
    return middleName;
    public void setPhoneNumber (String phoneNumber) {
    this.phoneNumber = phoneNumber;
    public String getPhoneNumber() {
    return phoneNumber;
    public void setAddress (String address) {
    this.address = address;
    public String getAddress() {
    return address;
    public void setBirthDay (String birthDay) {
    this.birthDay = birthDay;
    public String getBirthDay() {
    return birthDay;
    public void Person() {
    SS = "1234567890";
    this.firstName = "abc"; //test the keyword "this"
    this.lastName = "xyz";
    middleName = "na";
    phoneNumber = "123456789";
    address = "11-11 22st dreamcity ny 11111";
    birthDay = "11-11-1980";
    public void print() {
    System.out.println("Display Database\n"
    + "Social Security Number: *********" + "\n"
    + "First Name: " + getFirstName() + "\n"
    + "Middle Name: " + getMiddleName() + "\n"
    + "Last Name: " + getLastName() + "\n"
    + "Phone Number: " + getPhoneNumber() + "\n"
    + "Address: " + getAddress() + "\n"
    + "getBirthDay: " + getBirthDay() );
    package myManagement;
    //this class is used to test other class or test other object
    public class testClass extends Person{
    public static void main(String[] args) {
    Person obj1 = new Person();
    obj1.print();
    System.out.println(obj1.getFirstName()); //test the object
    Result:
    Display Database
    Social Security Number: *********
    First Name: null
    Middle Name: null
    Last Name: null
    Phone Number: null
    Address: null
    getBirthDay: null
    null
    i don't know why it's all null. i assign something in the default constructor. it shouldn't be "null".
    does anyone know why?

    when you create 2 class using netbean editor, person.java and test.java
    i never compile person.java.
    when i finish typing these 2 class and i just right click test.java and run.
    my question is do i need to compile person.java before i run test.java directly??
    does Netbean compile it automatically when i run test.java first time?
    i add another constructor Person constuctor with one parameter in Person.java and create 2nd object to test the 2nd constuctor and run.
    All the codes work, so does the first default constructor. i don't why is that.
    Then i removed what i added and restore back to where it didn't work before and test again. it works.
    @_@. so weird.
    problem solved. thank you
    Edited by: roadorange on Feb 25, 2008 7:43 PM

  • My itunes library is constantly resetting itself. I really don't know what is wrong with it I have ran virus checks and nothing is on my laptop. Anybody got any idea?

    Hi my itunes library is constantly disappearing, I really don't know what is wrong. It keep happening everytime I turn my laptop off, I thought I had solved the problem the other week however it has started back up again. I have a Sony Vaio laptop and have read on the discussions that this can occur but all the solutions I have read haven't seemed to solve it. Anybody else got an idea? I would be really grateful for the help!

    See this post. Seems that AVG is the most likely cause. They are promising a patch tomorrow.
    tt2

  • HT4623 I need to know if anyone knows what is wrong with my iphone?  It is "Magnified" and I cannot figure out how to fix it.

    Help please!  My phone has some kind of issue, besides being old, it has "magnified" I don't know what happened.  I cannot figure out how to get it to go back to normal?  It just happened when I touched a text message to read it.  Does anyone know what I can do to fix this? 

    Double tap with three fingers

  • What's wrong with my MacBook? It's flickering and beeps.

    I bought my MacBook Pro 13" in October 2012. It worked fine and then on December 25 I was using it and a rainbow on vertical stripes started flickering and took over the screen so I had to hold down the power button and shut it down. I took it to the Genius Bar and she did nothing for me. About a month ago the screen started to flicker and was completely distorted. I took it in and they sent it to Austin where they reset the RAM. I got it back and yesterday I pressed the power button and the screen stayed black and it beeped three times then paused, beeped three times, paused, and continued in this pattern. And later last night I tried to turn it on again and it turned on but after about five minutes it flickered and the screen was completely distorted. So I forced shut down. The same thing happened again this morning with it working for about 5 minutes then distorting. This is annoying because I've taken it in twice and it continuously have the same problem. The only thing I have downloaded is Google Chrome. Before they sent it in and reset the RAM and to factory version I had Sims 3 on it but when I got it back Sims 3 wasn't on it because I was reset to factory settings, so Sims couldn't be causing it.

    beeps http://support.apple.com/kb/HT1547
    Bad RAM can be fine for awhile, then not be fine.
    You can run the Apple Hardware Test yourself
    Reboot holding the D key
    http://support.apple.com/kb/ht1509
    Not a definitive test, but will give you more information.
    Genius reservation http://www.apple.com/retail/geniusbar/
    check warranty https://selfsolve.apple.com/agreementWarrantyDynamic.do

  • What's wrong with my laptop? It keeps loading and turning off

    My laptop suddenly shut off while I was using I for almost the whole day (which I usually do every day). It felt hot so I had it turned off for 2 hours. I tried to turn it on again but it loads for a while, and then shuts off. I had it rest for almost 21 hours and tried to turn it on again, but it's doing the same thing. Help! Are all my data lost? What can I do to fix it?

    Katnbguer,
    which model MacBook Pro do you have, and which version of OS X is installed on it?

  • My macbook pro freezes and then displays a blue screen with black stripes... do you know what's wrong with it?

    My macbook pro freezes and then displays a blue screen with black stripes... do you know what's wrong with it?
    I have a two and half year mac book pro... I've had some issues with the screen looking scrambled when I quit certain applications, but now it's turned into something worse.  I'll be working on my computer and the thing will freeze.  When I force restart, the first screen, the apple logo, will be a blue tint and won't boot up normally.  Then I try safe mood and it will then boot just fine.  But there are blue stripes on my screen.  The screen alternates from a blue tint to normal and if the computer freezes again the screen will become completely blue with black stripes.  I haven't tried reinstalling my software because I don't have the startup discs that came with my computer.  If I was sure that would fix it I would purchase them, but if it's a hardware issue I'm afraid that I'm screwed.  I've been able to successfully get the blue off my screen by putting it to sleep and then waking it up, but that's not working well anymore either. 
    Does anyone else have experience with this?  Is it the firmware or what?  I have a MacBook Pro from early 2011 and I'm running Mac OS X 10.6.8.
    Please help... Thanks!

    I just experienced this exact same issue with my early 2011 15" macbook pro. Since like a month after purchasing it I had issues with the screen randomly going dark on me. I sent it in for repair inder waranty they replaced the gpu and logic board but I continued to have the same issues with the screen randomly going black sometimes I would need to reboot it in order to get the screen to go back on but it happened so infrequently and I used the computer for school so disnt find the time to resend it in to apple. Just last night the screen started to display the blue screen with black verticle lines on it. I called apple and explained to them  the issues that had been ongoing since I purchased the laptop but they said because I was now outside of warantee that any repairs at thia point wouldn't be covered. Fml so glad I spent 2200 on this future proof macbook pro what a joke my sister purchased a toshiba laptop for 300 4 years ago and it still running like a champ. I loved my macbook but at the price I paid I expect it to last longer than 2 years before leaving me high and dry. *** apple??

  • What is wrong with my video on Skype?

    what is wrong with my vedio on skype
    This post was transferred from its previous location to create its own new topic here; its subject and/or title has been edited to differentiate the post from other inquiries and to reflect the post's content. A link to this post appears where the post was originally added.

    Hello 087..., and welcome to the Community,
    Thanks for your inquiry.  In order for the Skype Community to help you, some more information would be helpful:
    - Hardware use (laptop/phone/tablet brand and model)
    - Operating system (version and updates installed)
    - Skype version used
    - Internet connection used
    - Any error messages you see; a screen shot would also be helpful (as long as no personal information is shown)
    Thanks in advance.
    - Skype Community Moderation Team
    Was your question answered? Please click on the Accept as a Solution link so everyone can quickly find what works! Like a post or want to say, "Thank You" - ?? Click on the Kudos button!
    Trustworthy information: Brian Krebs: 3 Basic Rules for Online Safety and Consumer Reports: Guide to Internet Security Online Safety Tip: Change your passwords often!

  • What's wrong with iCloud and all that. See below

    What's wrong with iCloud tonight I am
    Sending texts and it is going as a normal text
    Not iMessage it was working earlier. Now
    Gas stopped working all of a sudden. If
    Anyone Is experiencing the same please let
    Me know. Also it is saying when I turn on and log
    In waiting for activation. I've never had this before.

    There is an earlier thread that was answered by an Apple employee that states they are seeing the iMessage and Facetime servers are down. It is unknown when they will return, however it generally is not an extended period of time.

  • What's wrong with my player?!!? PLAYBACK ERR

    Whats wrong with my Zen Touch if my player keeps saying playback error? it plays like 5 seconds of the song before it shows that there is a "playback error" and skips to the next song? i tried fastforwarding past the 5 seconds, and it played fine....what's wrong with it's i had this problem with a couple of my songs...
    this sucks... oh yeah, i also tried restarting it. didnt work either.

    I had the same issue. I used MP3LIBRARY (free program) to analyze and then delete the bad frames out of the files. then they playd fine. just google mp3library and download it...

  • RE: what is wrong with ui4?

    Thanks all for the responses to my question. Using float constants substituted for integer constants in TOOL code works great (no hex constants though - oh well, a little conversion never killed anyone), and the math operations that I am using on ui4s work as I would expect.
    "No worries, mate!"
    Richard Finegan
    -----Original Message-----
    From: Roger Blumer [SMTP:[email protected]]
    Sent: Wednesday, January 14, 1998 6:23 PM
    To: [email protected]; [email protected]
    Cc: SMTP:[email protected]
    Subject: RE: what is wrong with ui4?
    Ui4 works fine. The bug is in the PARSER/TOOL Compiler.
    You cannot use a CONSTANT integer value that is greater than MAXINT.
    If you use FLOAT constants or do arithmetic, you can see that UI4 works.
    The following code:
    uu : ui4 = 2147483655.0;
    task.lgr.puthexline(uu);
    uu = 0xffffffff;
    task.lgr.puthexline(uu);
    produces the following output:
    0x80000007
    0x7FFFFFFF
    Note that putline prints unsigned as signed,
    and using it would give the following output:
    -2147483641
    2147483647
    -roger blumer
    Forte Software
    PS the bug number is 2506.
    PPS The workaround of using LONG might have been for 64-bit machines like alpha.

    Richard,
    Try using the constants 0x80000000U through 0xFFFFFFFFU -- the 'U' and
    the end designates that the value is an unsigned constant.
    I'm not sure if this will fix your Forte problem, but it is needed in C
    and C++.
    -- J.C.
    J.C. Hamlin, Senior Consultant, Forte National Practice
    Born Information Services Group, Wayzata, MN
    Ph: (612) 404-4000 Ph2: (612) 783-8270 FAX: (612) 404-4441
    <[email protected]> <[email protected]> <[email protected]>
    -----Original Message-----
    From: Richard Finegan [SMTP:[email protected]]
    Sent: Wednesday, January 14, 1998 1:20 PM
    To: 'Forte Users Mailing List'
    Subject: what is wrong with ui4?
    Hello-
    I have a potentially dumb question for all of you. I have filtered a
    bug in my program down to what is basically a one line program, which
    assigns to a ui4 the maximum integer constant a ui4 can hold,
    type-casted to a ui4. That is,
    n : ui4;
    n = (ui4)(0xFFFFFFFF);
    Then I output n to a window. But the window's output shows that n
    holds the maximum value for a signed 4-byte integer constant!
    (0x7FFFFFFF or 2147483647)
    I have tried a number of other experiments that have confirmed to me
    that a ui4 is incapable of holding any integer value above 0x7FFFFFFF,
    and that a ui4 in fact behaves exactly like a signed integer, where
    the internal byte patterns 0x80000000 to 0xFFFFFFFF correspond to the
    integer ranges -2147483648 to -1.
    Am I missing something completely obvious here?
    I'm running Forte 3.0.E.0 on a Pentium Pro running Windows NT.
    Thanks for your time.
    Richard Finegan

  • I can't turn my Book Air for the second time since i've bought it. What's wrong with that?

    I can't turn my Book Air for the second time since i've bought it. What's wrong with that?

    Since it's new and in warranty take it in for repair or replacement.

  • What's Wrong with My Computer?

    I have a G5 desktop computer, I believe it's referred to as a "Power Mac." My mom purchased it some years ago, I think in late 2005 shortly after this particular model was on the market.
    Info is:
    Version 10.5.8
    Processor 4 x 2.5 GHz PowerPC G5
    Memory 4.5 GB DDR2 SDRAM
    Hard Drive 240 GB (127 GB unused/available)
    My mother wasn't using this computer for many years, and my 13" Macbook was giving me trouble, so she gave this one to me. It's all been great (she maxed out the memory and hard drive space when she bought it, even though it is outdated and insignificant compared to current models), except for one little thing... Browsing the internet is usually fine when it's only one window, but not always. However, it is almost a guarantee that while trying to operate multiple windows and trying to play a video, Safari will crash. And not just once in awhile. I'm talking about on a daily basis. During regular offline computer use, like Photoshop or iTunes, the computer will sometimes grey over (as if someone put a fairly thick grey film over the entire screen), and tell me I have to restart the computer. So what's wrong with it? I presume it is a physical issue (failing memory, mother board, etc.), but what?

    Your computer is not remotely "maxed out" with RAM.
    You're describing a G5 Quad like mine (though mine was built in June of 2006), and maxed out means having 16 GB of RAM installed, like mine has.
    The Frolick wrote:
    …the computer will sometimes grey over (as if someone put a fairly thick grey film over the entire screen), and tell me I have to restart the computer. So what's wrong with it?…
    That's called a Kernel Panic, and, yes, it is most often caused by hardware problems, such as bad RAM or mismatched RAM.  I can't imagine how you get to 4.5 GB of RAM without exponentially increasing the risk of mismatched RAM.
    RAM has to be installed in matched pairs, starting from the center slots and spreading outward: 4*3*2*1*1*2*3*4
    On the other hand, my own personal experience has led me to conclude that Safari is a piece of cr@p.  It causes problems just being active in the background, causing other applications to fail.
    Check your RAM carefully, starting with just one pair of matched RAM sticks in the two center slots, then adding one pair at a time.  Check your hard disk with Apple's Disk Utility.
    The kernel panics can be caused by a damaged directory too, so if you own Disk Warrior, run it.  If you don't own DiskWarrior, at least Repair Permissions with Apple's Disk Utility and use Verify Disk/Repair Disk with it.
    I'd also recommend downloading and installing Applejack and run it according to the instructions.
    Good luck.
    2.5 GHz Power Mac (PPC) G5-Quad; 16GB RAM; mutant, flashed 550MHz nVidia GeForce 7800GTX 1,700MHz 512MB VRAM; ATTO ExpressPCI UL5D LP SCSI card; Mac OS X Tiger 10.4.11 and Leopard 10.5.8 boot drives; Spotblight, Dashboard and Time Machine permanently disabled; dual 22" CRT monitors; USB wireless 'n' available but connected to the Internet via wired Ethernet; FW flatbed scanner; 2 SCSI scanners (one tabloid-size transparency scanner and a film scanner); various internal & external HDs; FW Epson 2200 and Ethernet Samsung ML-2850ND printers; 2 X Back-UPS RS 1500 XS units.

Maybe you are looking for

  • How to download file to local system when report is run in background?

    Hello all, Can anybody tell me how can we donwload file into local machin when the program is running in background? thanks

  • Free Good scenario for a standalone CRM

    Hello Experts We are on CRM 7.0. I'm trying to configure Free goods determination in CRM sales order TSA. We have done all the relevant customizing under CRM -> Basic Functions -> Free Goods. Free Goods Procedure: 0NA001 Condition Type: 0NA0 Access S

  • FormDataIntegrationService and ALC-DSC-003-000: com.adobe.idp.dsc.DSCInvocationException?

    Hi all! We have Adobe LC ES (version 8.2) over JBoss. We are trying to invoke the FormDataIntegrationService Service, which we see that is accessible on the server and operating (as we see in the management app and the WSDL is accessible). In the sam

  • How to compare the same array?

    Hello, The question not how to compare arrays. I have a method that gives results of an array type int. for(......){ int [] arrayFunc(int [] input) return arrayOut; }I want to compare those arrayOut arrays. I need to find a way to save the first outp

  • EDI 855 (Order Confirmation)

    One of our customers is requiring us to send them an EDI 855 whenver we change a sales order.  They only want the 855 if something is changed.  I thought about using output type BA00 with message type ORDRSP, however the idoc doesn't tell you what ha