Impossible to go from baseline of connection via functional Global Variable

Hello

I'm working on a project of producer/consumer based, which some parties have access to a MySQL database. After the connection to the database, I want to store the reference to the connection inside of a functional global variable. Then other parts of the project that need to use it can only read in the functional global variable.

For some reason, the reference of the connection is not valid once it has been read functional global variable. It works fine if I have the reference directly from the connection to the request for enforcement VI wiring.

I have attached a few screws that show the problem, but you will not be able to run them unless you have a database to connect to and hack you the query a little so he selects in your tables.

SQL_whole_thing works very well. It connects to the database, returns information he requested by the query, and then disconnects. No problem.

But if I run DB_Connect.vi (which stores the reference to 'DatabaseID_FGV' FGV), follow-up of SQL_Query.vi (which reads to the FGV reference), then I get an error saying that the reference is not valid.

Anyone has an idea why this happens?

Thank you

Christian.

PS: You'll need DBID_FGVActions.ctl and database_connectioninfo.ctl, also attached

Your referance on the SR's "outdated" when implementing this way.  Essentially, this means that data in memory to this referance has changed because the referance was stored.  Just because you have changed the data at this location.  This prevents you from spend a refeance for the "old data" and crashing the calling application since the referance Rassi contains assumptions that are more adequate data.

Consider upgrading this FGV powered Action.  This would be encapulate all the Actions you want to do to the database (connect, disconnect, fecth, writing etc.) and maintain the current referance on the AEs shift register.  Ben establishes a great deal for just this type of functional encapsulation in his famous nugget.  A must read for every programmer

Tags: NI Software

Similar Questions

  • Access a package Via Select Global variable

    Hi all

    I want to access a global variable of the overall package variable IE via a select query. Is it possible or not possible. Please share some entries on this.

    Thank you

    Just to clarify that you can reference the global variable if your SQL is itself in PLSQL. It will be linked to.

    CREATE OR REPLACE PACKAGE p1
    AS
      my_global NUMBER := 1;
      --
      FUNCTION f_get_my_global
      RETURN NUMBER;
      --
      PROCEDURE p_do_something;
      --
    END;
    /
    
    CREATE OR REPLACE PACKAGE BODY p1
    AS
      --
      FUNCTION f_get_my_global
      RETURN NUMBER
      AS
      BEGIN
         RETURN my_global;
      END;
      --
      PROCEDURE p_do_something
      AS
        l1 NUMBER;
      BEGIN
        SELECT /*+ find_me */
               my_global
        INTO   l1
        FROM   DUAL;
      END;
      --
    END;
    /
    
    SQL>  exec p1.p_do_something;
    
    PL/SQL procedure successfully completed.
    
    SQL> select sql_text from v$sql where sql_text like '%find_me%';
    
    SQL_TEXT
    --------------------------------------------------------------------------------
    SELECT /*+ find_me */ :B1 FROM DUAL
    
    SQL>
    
  • stretching from the internet connection via a wired ethernet cable

    Hello

    First time poster. I have a netgear R8000 Nighthawk on my 2nd floor. I intend to use an ethernet cable connected to the R8000 and bring it downstairs in my living room. My question is, is - it possible to be able to connect the ethernet cable in the living room to another router and then connect up to 3 devices (apple computer, smart tv, tv) via ethernet cables? I prefer wired connections. I am aware that I can use as the EX7000 netgear router as access point, but other devices may only be connected wirelessly.

    Any help would be appreciated

    Thank you very much!

  • global variable functional to read and write data from and to the parallel loops

    Hello!

    Here is the following situation: I have 3 parallel while loops. I have the fire at the same time. The first loop reads the data from GPIB instruments. Second readers PID powered analog output card (software waveform static timed, cc. Update 3 seconds interval) with DAQmx features. The third argument stores the data in the case of certain conditions to the PDM file.

    I create a functional global variable (FGV) with write and read options containing the measured data (30 double CC in cluster). So when I get a new reading of the GPIB loop, I put the new values in the FGV.

    In parallel loops, I read the FGV when necessary. I know that, I just create a race condition, because when one of the loops reads or writes data in the FGV, no other loops can access, while they hold their race until the loop of winner completed his reading or writing on it.

    In my case, it is not a problem of losing data measured, and also a few short drapes in some loops are okey. (data measured, including the temperature values, used in the loop of PID and the loop to save file, the system also has constants for a significant period, is not a problem if the PID loop reads sometimes on values previous to the FGV in case if he won the race)

    What is a "barbarian way" to make such a code? (later, I want to give a good GUI to my code, so probably I would have to use some sort of event management,...)

    If you recommend something more elegant, please give me some links where I can learn more.

    I started to read and learn to try to expand my little knowledge in LabView, but to me, it seems I can find examples really pro and documents (http://expressionflow.com/2007/10/01/labview-queued-state-machine-architecture/ , http://forums.ni.com/t5/LabVIEW/Community-Nugget-2009-03-13-An-Event-based-messageing-framework/m-p/... ) and really simple, but not in the "middle range". This forum and other sources of NEITHER are really good, but I want to swim in a huge "info-ocean", without guidance...

    I'm after course 1 Core and Core 2, do you know that some free educational material that is based on these? (to say something 'intermediary'...)

    Thank you very much!

    I would use queues instead of a FGV in this particular case.

    A driving force that would provide a signal saying that the data is ready, you can change your FGV readme...  And maybe have an array of clusters to hold values more waiting to be read, etc...  Things get complicated...

    A queue however will do nicely.  You may have an understanding of producer/consumer.  You will need to do maybe not this 3rd loop.  If install you a state machine, which has (among other States): wait for the data (that is where the queue is read), writing to a file, disk PID.

    Your state of inactivity would be the "waiting for data".

    The PID is dependent on the data?  Otherwise it must operate its own, and Yes, you may have a loop for it.  Should run at a different rate from the loop reading data, you may have a different queue or other means for transmitting data to this loop.

    Another tip would be to define the State of PID as the default state and check for new data at regular intervals, thus reducing to 2 loops (producer / consumer).  The new data would be shared on the wires using a shift register.

    There are many tricks.  However, I would not recommend using a basic FGV as your solution.  An Action Engine, would be okay if it includes a mechanism to flag what data has been read (ie index, etc) or once the data has been read, it is deleted from the AE. 

    There are many ways to implement a solution, you just have to pick the right one that will avoid loosing data.

  • I have a 'C' IDE drive failure I have a SATA drive connected via a PCI-SATA controller card. I want to change from hard disk IDE 'C' on the SATA drive. What are the steps to achieve this?

    Running Windows XP Home, I want to change hard drive as described above.

    As a result, I have a USB hard drive, which I copied the hard drive of the original 'C', before it fails altogether.

    Is it possible to copy this USB drive on my SATA hard drive and have as my primary hard drive?
    Keeping in mind of the SATA hard drive, connected via a PCI-SATA controller card.

    Unless your third sata card supports the option to boot from this map, its not going to work. Not all sata cards are bootable.

  • Unable to connect via the wireless router "problem with wireless adapter or access point" _

    Hello

    I recently replaced my old Toshiba laptop with a new model of Toshiba Satellite L500/033HNX, it installed Windows 7.

    The problem is that I can't connect to my wireless network. I am currently connected via Ethernet cable to my Linksys router.

    I had help from my internet service provider, the installation correctly the problem not because of the connection.

    I had a Linksys online support, the router is a wireless, model - WAG54G ADSL gateway, is not the problem of all the correct settings and other devices can connect via my wireless network. I ran Dr. connectivity several times and it is always impossible to connect, "problem with the wireless adapter or access point.

    OK, you're my next hope to solve the problem can you HELP Please!

    Hi, JoelbX
    I want to thank very you much for your support and effort do to help me solve this problem, but we receive have been, and I don't want to waste any more of your valuable time, so I am the son of closing and deleting of Tring in Microsoft Answers.
    All the best
    Tring

  • If connected via Bluetooth with car. Phone starts to compose himself after updating iOS 10

    After updating iOS 10: connection via Bluetooth for car, then phone (iphone more 6s) began to compose himself. My President iPhone which is not longer work well

    Hi Pharao-nael,

    I understand that after update your iPhone to iOS 10, he begins to call itself when it is connected to Bluetooth. I know it's important for your iPhone to work as expected, so I'm happy to help for this.

    Since this occurs only when it is connected to Bluetooth, the first thing you want to do is cancel the twinning of the car:
    Configure and use third-party Bluetooth - Apple Support Accessories

    Turn off pairing a Bluetooth accessory

    To disable the pairing a Bluetooth accessory, tap Settings > Bluetooth, find the device you want to disable the twinning, tap , and then we forget this device.

    When you forget this device on your iPhone, iPad or iPod touch, this accessory is removed from the list of available Bluetooth devices.

    Make sure that your iPhone does not seek to call itself after it is disconnected, and then you can pair the iPhone and the car again:

    Pair your device with a Bluetooth accessory

    1. On your iOS device, tap on settings > Bluetooth. Stay on the screen until you complete the steps to pair your accessory.
    2. Place your accessory in discovery mode and wait until it appears on your iOS device. If you don't see it, or don't know how to make it discoverable, check the instructions that came with your accessory or contact the manufacturer.
    3. Tap your accessory pair. You will have to perhaps enter the CONFIDENTIAL code or password. If you do not know what your PIN code or word password, see the documentation for your accessory.

    When pairing is completed, you can use the Bluetooth accessory with your device. You can pair several Bluetooth accessories with your iOS device. Just follow the steps above to pair additional accessories.

    Thank you for using communities of Apple Support, cheers!

  • Portege 3480: is it impossible to boot from a key-USB-cd?

    I would like to install win 2000 on my portege 3480. However, I have a lot of difficulty getting to boot from external cd readers. I tried with a Cd Player and a LiteOn DVD drive iomega. None of them works. The two drives are connected via the USB port. I read somewhere that we can start using pcmcia on the 3480 cd players - can that really be true?

    Hope someone can help out me.

    Thank you

    Steffen - Denmark

    Yes, it's true
    Generally it is not possible to boot from the external USB CD/DVD drive.
    You need a compatible PCMCIA reader and supported.

    Please check other messages of the forum in this category:
    http://forums.computers.Toshiba-Europe.com/forums/thread.jspa?threadID=18540
    http://forums.computers.Toshiba-Europe.com/forums/thread.jspa?threadID=18417

  • Satellite C660-1RQ cannot connect via HDMI to the NEC projector

    Hello.

    I have laptop Toshiba C660-1RQ.
    It can not connect via HDMI to the NEC projector.
    I tried many drivers - the 268,57 (taken from the Toshiba site) to the new 331.58

    I thought, that it my problem, but the same lapto (my friend work - we have a few these notebooks in company) works well...

    And my HDMI works with monitors, TV (but sometimes!), etc.

    I don't know what to do...

    > And my HDMI works with monitors, TV (but sometimes!), etc.

    If s computer laptop HDMI port works correctly in relationship with other devices, I think that the problem is related to your laptop.

    What happens exactly when the projector is connected? Can you pass to the external video using the FN + F5 key combination?

    The use of Fn + F5 keys can toggle between internal and external display.

  • DSC-HX90V/B does not connect via Wi - Fi for my MacBook Pro under El Capitan!

    I just had a DSC-HX90V/B and got Wi - Fi to connect to my iPhone 6Plus. However, I can't seem to connect to my MacBook Pro using PlayMemories House. I use the network configuration tool, and even if my camera is connected via USB (and why do I have to do this, I could ask?), it is said that "any camera that supports the network connection is connected.

    I don't understand this.

    Hi pws442,

    When you use a Mac OS computer, you will need to download the software of automatically importing wireless to allow the camera send wireless files. You can download the program here.

    After downloading the software, please follow the steps below on how to configure the wireless connection.

    • Initial setup process:

      1. Make sure you that using a memory card is inserted in the device.

      2. Turn the camera

      3. On the camera, set the mode of USB connection from the camera to the MTP or PTP.

      4. Connect the camera to the USB port on the computer.

      5. On your computer, go to Finder and select Applications.

      6. Select automatically importing wireless.

      7. Set up your computer as a device to import files from your camera wireless.

        NOTE: If the device should be synchronized with another computer, the new computer must be defined as import wireless device.


      8. In the auto import wireless window, select set.

      9. In this computer will be set to the wireless device for your window of the camera import, click OK.

      10. Unplug the USB cable to the camera and the computer.

    • Transfer wireless after the initial setup process

      1. The device, select Menu.

      2. Select Setup.

      3. Select settings of the Access Point.

      4. Select the wireless access point.

      5. Press the play button on the camera

      6. Press the Menu key.

      7. Select send to the computer.

      8. Follow the instructions to save the images on the computer.

    If my post answered your question, please mark it as "accept as a Solution. Thanks_Mitch

  • Problem with sending a message when you're connected via Wi - Fi

    Hello. Still getting used to my Dext (owned it for about 4 days). I noticed this morning that I can't send the mail from the POP3 account, I set up on my Dext when I am connected via Wi - Fi - when I try I get an "authentication failure". When I disable Wi - Fi email sends end. There is no problem with webmail - send although I am connected to the Wi - Fi or 3 G network.

    Anyone know how to send the mail while POP3 on the Wi - Fi network? Thanks in advance...

    Understand the problem - port incorrect settin for mail server outgoing. Changed to 587 according to some messages that I saw during a search - that did the trick!

  • Satellite L350 - unable to connect via a WLAN

    Hello
    New to this lark of thread

    You just bought a L350
    I have managed to connect to the Internet via a cable, but am unable to connect via wifi.
    WiFi is turned on. He finds my BT Home Hub but when I connect, it just says: it's impossible.

    Help, please

    Have you checked the Wifi device in Device Manager? The driver is properly installed?

    Try turning off your firewall, which could block the Wifi connection.

    Also try to press Fn + F9 to toggle wireless devices

  • Connection via Port COM for Nokia 6288

    Hi, I am a newbie.

    I just got the Hama usb bluetooth key small ultra 2 with the toshiba bluetooth stack.
    My cell phone is a nokia 6288 am I have a laptop from another manufacturer

    My software retrieves data from weather stations by modem. I managed to connect the phone as COM5 USB cable.
    The transmission of weatherdata works very well by ATDT [mobile phone number].
    To facilitate the transmission when I'm on the road, I bought the usb bluetooth key.
    I also managed to connect it like COM8 and software can initiate a connection via ATDT [mobile PHONE number];

    But the transmission does not work without the semicolon, the dial the same telephone doesn´t.
    I don't know where the problem is maybe like the works of transmission when it is connected by a USB cable.

    Can anyone help?

    Greetings from sunny South/stuttgart Germany

    Sorry, wrong name,
    the material is called Hama Nano USB - Bluetooth adapter

  • Vibe Shot Marshmallow rarely connect via 4G

    for some reason any
    After the update my sim card will rarly connect via 4G
    It will usually stay on even worse H + or 3G
    I never faced this problem in lollipop

    Note from the admin; subject edited for clarity

    I guess that the reset has been done? 4G is stable with the telcos here and no reports of slow via WLAN or data so after M.

  • How to transfer files from PC to PC via a serial port using labview

    I need to transfer files (.txt, .doc, .xls) from PC to PC via a serial port using LabVIEW. Is it possible to transfer files, if so how to transfer?

    Yes, it is possible to transfer files with the serial port using LabVIEW.  The files are just collections of bytes and the serial port is good enough in the expedition of the bytes from one PC to another.  You must connect the ports series with a null modem cable.

    First, take a look at the example of serial communication.   In LabVIEW, go to the Help menu and select «Find examples...» ».  From there, you can search for "serial" or navigate to hardware input and output > series.  Select «Write series base» and Read.vi  Try this example to gain confidence on the serial communication methods.

    Then it's time to learn how to read and write files.  For this, the examples might be somewhat confusing as they deal with files that are presumed to have data of a specific type in them.  I would recommend just familiarize yourself with the functions in the file e/s palette.  Specifically, familiarize yourself with the following functions.

    1. Open/create/replace file - on the side of your destination, you will need to create the copy of the file you are trying to transfer
    2. Close the file - when you're done reading or writing to a file, you must close it.  It cleans the memory used and finalizes write operations that are still floating in the write buffer.
    3. Read a binary file - is the best way to play a file when you don't really like what type of file it.  In your case, you just want to get these read bytes and sent so they can be written down instead of destination.
    4. Write to a binary file - next to the destination, is what will store the bytes in the file that you created with the number 1.
    5. Size of the file get (under the range of the advanced features of file) - you need to know how big the file is, so you know when you are finished.

    OK, so once you are able to create files byte write and read bytes from existing files, you can move forward.

    I suggest the basic method is to have the user specify a source file on the source PC, and a folder on the destination computer.  Then find the size of the source file using the number 5.  Divide this number of size by the number of bytes that you want to transfer to the times.  The series pads are usually around 32 k (if I remember correctly) in order not to exceed that.  Now start to send data by reading a number of bytes and this string output wiring to the feature of writing VISAS.  On the side of destination, you will want to monitor the serial port for bytes and read when they arrive.  This string of yarn to the writing of the function of binary file to add them to your destination file.

    This is the basic outline of how to do it.  He needs to not to overload him write and read buffers on the serial ports.  Initially, you can use delays on the side sending to make sure that the side reading has enough time to digest.  To make things faster, you can bring in a control of flow.

    If all that sounds a little intimidating, there are there Alliance member companies (such as the automation of PrimeTest) who can write this code for you and even provides a turnkey for you solution.

    Happy wiring,

    Dan press

    Certified LabVIEW Architect

    PrimeTest Automation

Maybe you are looking for