Refnum to path

Hi
I need to reload a VI through a front panel control. I want to obtain VI's path using the refnum to path function in order to  reload the VI using Load and Run. There is an error although according to the context window both source and sink are of same type.
P.S already checked detailed explanation
Attachments:
1.jpg ‏28 KB

To explain a bit possible reasons for this constraint:
References are first of all only pointers to some space in memory; that means, they are only numbers where the actual number is the address in memory of the data space the reference is pointing to.
That being said, most references are completly incompatibel to a "path" or a "string". So casting a reference to a path or string makes only sense for references pointing to file-based data spaces, aka "file streams".
VI RefNum is not necessarily a "file stream" as you can acquire a reference to any VI you haven't saved yet, but is in memory. So it must not be compatible to a file-based reference (like a file handle you get from "Open File").
Norbert
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.

Similar Messages

  • Refnum to path problem

    Hi,
    I have many subVI. I am working with binary files and I want to open them only one time. If I make subVi(1) which opens:
    and then subVI(2) which reads the first 4 elements and store them in array:
    Then subVI(3) which uses previous one and reads only 4.element from array
    Then I can't connect the first subVI with last one because they have different types.
    What should I change/do not right?
    Andy
    Solved!
    Go to Solution.

    You need to change the filepath control in the later subVI's to a refnum control.
    Copy and paste the refnum indicator that is the output of the first subVI and drop it into the later subVI's.  Right click, change to control.  Then wire that up to the file functions instead of the filepath control you have now.

  • How can I display the name of my refnum on the front panel?

    I am writing data to a file. To do this, I am using "Open/Create/Replace File" to prompt the user for a filename, which is then output to my VI as a refnum. I then write strings to this file with "Write to Text File".
    How can I display this filename (with the path) on the front panel after the user has input it?
    Michael
    Solved!
    Go to Solution.
    Attachments:
    refnum.JPG ‏45 KB

    Use the Refnum to Path function, in File I/O -> Advanced File Functions palette. You can wire this to a path indicator.

  • Refnum terminal

    Dear
    I have a trouble to connect between refnum terminals.
    For example, there is a output terminal of refnum in Open/Create/Replace File.vi (LV 8.0 version).
    How to convert to the refnum to a file path?
    I can't connect it to the input of refnum to path.vi.
    Thank you in advance.
    메시지가 05-30-2007 02:31 AM에 labmaster에 의해 편집되었음

    I can't reproduce your problem : the output of Open/Create/Replace File.vi can be connected to Refnum to Path.
    Could you post your VI ?
    Message Edité par JB le 05-30-2007 11:11 AM
    Attachments:
    Refnum to Path.jpg ‏17 KB

  • Get associated avi file from avi file reference

    For normal bytestream files, there is a "refum to path" function (under File I/O -> Advanced File Functions) that will give the associated file path for the input file reference.  This does not seem to work when an AVI file reference (opened using IMAQ's AVI functions) is wired ("refnum to path" returns <Not a Path>).  Is there a way to extract the AVI file path from an AVI file reference?

    Thanks for your help.  The design of my program involves streaming video to disk (along with multiple other parallel functions, including DAQ interfacing and collection, playing back AVIs in mediaplayer, etc.).  Because of this, I have multiple "engine" loops running in parallel to the user interface loop.  In the UI loop, the target of the streaming video can be changed or even turned off, so I have a LV2 functional global holding the AVI file reference, which the video streaming engine checks for validity before proceeding through a loop iteration.  However, in the engine, certain decisions about extra data that needs to be saved with the streaming video is made by checking the directory of the file it is instructed to write to.  Therefore, a way to extract that file name from the reference in the LV2 global would be usefull.  The workaround I have to use now is to store the file path as well as the AVI file reference in the LV2 global and pass them around together.  This isn't that bad, but in the intrest of keeping block diagrams uncluttered with data I shouldn't need, I posted the question. 

  • Stream data from a subvi to the main vi - path refnum

    hello everyone
    sorry my english
    http://forums.ni.com/t5/LabVIEW/stream-data-from-a-subvi-to-the-main-vi/m-p/2205150/highlight/true#M...
    - refnum boolean worked
    - refnum graph worked
    - refnum numeric worked
    how to create a  path refnum? stream data from a subvi to the main vi
    where do I start?
    thank
    Solved!
    Go to Solution.

    Bom Dia Saille,
    Eu acredito que o que você tenha hoje seja isso aqui (Desenho bem simplificado):
    Hoje o que você tem é o Aplicativo do Medidor + USB Driver controlando o seu medidor. Basicamente, sua aplciação está dividida em três camadas:
    Aplicação - Onde estão as funcionalidades principais do programa (interface com o usuário, apresentação de dados, geração de arquivos, etc.)
    VISA - Uma arquitetura de Software para controle de instrumentos. Basicamente, ele se comunica com o Driver USB para poder enviar e receber pacotes de dados através do barramento USB.
    Device Driver - Intruções de SW de baixo nível para controlar um periférico através de um barramento.
    No desenho, eu aponto duas camadas onde você pode tentar atuar para automatizar suas medições:
    Aplicação - Você pode usar o VI Server para controlar o Aplicativo do Medidor (Se este aplicativo tiver sido desenvolvido em LabVIEW, o que eu suponho ser verdade). No entanto é necessário saber se o desenvolvedor do produto permitiu isso (Veja Using VI Server to Pass Data Between a VI and a LabVIEW Executable). Outra alternativa é conversar com o fabricante para ver se ele desenvolveu alguma API (Application Programming Interface) para que você consiga controlar o instrumento diretamente.
    VISA - O LabVIEW Fornece uma API chamada NI-VISA para poder enviar e receber informações através de diversos barramentos (Veja Serial Instrument Control Tutorial)
    É possível acessar o Driver diretamente também, mas eu não recomendo. O resultado não compensa o esfroço!
    Espero ter esclarecido suas dúvidas e espero que você tenha sucesso na sua aplicação!!
    Atenciosamente.
    Felipe Flores
    Engenharia de Aplicações
    National Instruments Brasil

  • In LV6.1, can I get the run-time menu refnum of a VI from the VI Path?

    Actually, for any version of LabVIEW, can I get the run-time menu refnum from the VI Path (or the VI reference)?
    Thanks!
    Enrique
    www.vartortech.com

    I just thought of a workaround...you could have a Menu Bar Ref indicator on your main VI front panel.  When your VI runs, you could have the Current VI's Menubar function wire the refnum into that indicator.  Then, in your subVI that has the VI reference, you could use VI Server to read the value of that indicator, then cast the value into a refnum wire, then you'd have access to the menubar reference in the subVI without having to pass it in to a subVI terminal.  Would that work?
    Oh, another simpler idea would be to simply wire the Menubar reference into a global, and read that global in the subVI.
    -D
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • Path to refnum

    How can I convert path to refnum? Currently I am doing it with Get File Size. But it seems an overkill. Any other simpler way?
    Have a very nice day!

    Hi rashid,
    see the attached example.
    Mike
    Attachments:
    Unbenannt 11_LV80.vi ‏9 KB

  • NaN/PathRefnum? function producing useless answers for Path, Refnum

    I have found similar threads to this, but not quite the same, AFAICT.
    I'm trying simply to see if an INI file exists, so I created the following snippet:
    I also created a small file, put it in my C:\ directory, which I have attached here.
    When I run the LV program with C:\test.ini, my indicators come out as NaN/Path?: False, NaN/Refnum?: True
    which I tried to interpret as (1) a valid path (file exists) and (2) a nonexisting refnum (although the refnum came from an LV-supplied subVI).
    I then changed the control (file to find) to C:\test.in (lopped off final "i") and the two indicators gave me the same results. That blew away my first interpretation, and I can't come up with anything else which makes sense.
    So, for paths and refnums, what is going on here, if anything?
    I did see that the second test threw an error from the "Open Config Data" subVI, so I can use that for my test, but I'd like to know if the NaN... function is actually good for anything but numbers. If not, IMHO LV should change its designation on the palette.
    Cameron
    To err is human, but to really foul it up requires a computer.
    The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
    Profanity is the one language all programmers know best.
    An expert is someone who has made all the possible mistakes.
    To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
    LabVIEW Unit 1 - Getting Started
    Learn to Use LabVIEW with MyDAQ
    Solved!
    Go to Solution.
    Attachments:
    test.ini ‏1 KB

    Thanks, Nathand,
    That clears it up a lot (and then digging down into the layers below the "Open Config Data" VI brings back the opacity). That's just one of the things which has confused me about the Config File VIs subpalette, but the explanation and the fact that you have to use a special "Not a Config Data Refnum.vi" with these instead of the normal "NaN/Path/Refnum?" (I never saw it until you pointed it out) answers several of the other questions, too. Like I said at first, in this case I just wanted to see if the file was there, so there are alternatives. But when I need to do more than what the prepackaged VIs do (which I expect I will), then it's just a matter of digging down in with my hip boots on. (Yuck.) But it's all fun, or I wouldn't be doing it in the first place.
    Cameron
    To err is human, but to really foul it up requires a computer.
    The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
    Profanity is the one language all programmers know best.
    An expert is someone who has made all the possible mistakes.
    To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
    LabVIEW Unit 1 - Getting Started
    Learn to Use LabVIEW with MyDAQ

  • Converting path to refnum ?

    I am working with a custom VI that I made that writes a 2D spreadsheet to a file during a measurement. The 2D data may later be appended, or optionally (at the start) the file may be created for this purpose (with a header file).
    However, during a recent measurement, someone tripped over the power cable for the computer and all data (representing about 15 minutes of sensitive measurements) was lost since it was not flushed to disk.
    The flush VI needs a refnum input. I want to place this VI just before the return of the call, so that this does not happen again (say - the computer crashes, or if I need to abort the measurement because some of the parameters went out of range, but do not want to lose the data already acquired).
    So, how do I generate a refnum from a file path. If it matters, I am using Labview 8.6 on a Fedora 10 machine. 
    Message Edited by m-s on 03-26-2010 01:36 PM

    Please post an image of your code so we can help out.
    I suspect you are using an Express VI and it will have to be converted to real code so you can drop the flush inside it. Just opening another ref to the same file and flushing on that ref will not guarrentee the buffers asscosated with the other ref gets flushed.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Create a default path into Automation Refnum

    I'm currently writing an app which should display a nice graph (chart) on
    its front panel. I choose to use Mapinfo Active X.
    To do this, I've placed an Automation Refnum on my front panel, and in the window
    'select object form Type Library', I choose "Mapinfo.tlb" .
    It works quite well, but :
    When I re-open this Vi, I should re-setting the Automation refnum. I try to use Active X container, it doesn't work. Can I create a default path into the Automation Refnum or any other method which can solve this problem.
    Thanks for your help.

    You shouldn't select the type lybrary, in automation refnum, when you want to select te type, available types appear if properly registered in your system, if not, you should register your tlb.
    Hope this helps

  • "Not a Path?" is not working

    Hello,
    i added a simple example vi where i have a path-control and a "Not-a-Number/Path/Refnum?" and as output a boolean.
    The boolean should be false if the path is correct and true if the path is invalid.
    Then i insert as path the value "c:\abc|||def.txt". When i run the vi then the path is valid.
    But this is not a valid name in Windows so why is it displayed as valid? I cant create a file manually in with this name.
    Thanks for any help
    Attachments:
    validpath.vi ‏7 KB

    Not a path is the Tag <Not a path> and can be found under File-I/O -> path constants as a Not A Path Contant.vi
    Several file vis will also return that constant if cancelled (file dialog) or an error occures. 
    Felix 
    www.aescusoft.de
    My latest community nugget on producer/consumer design
    My current blog: A journey through uml

  • File path of open data storage

    Hello all!
    Now I'm using the blocks of open data storage, write data and close data storage for storing and extracting result data. For the file path issue, before I
    set the data path by double clicking the "open data storage" block and inserting the file location in the indicated place, and that worked!
    Now since I made a stand alone application of this program and shall use it in other computers, the file location I inserted in open data storage block isn't
    valid any more in other PCs. So I modified my source code by connecting a "current vi path" to the open data storage block's file path node instead of
    inserting it inside the block, and this doesn't work! During running there shows an error in the write data block saying that the storage refnum isn't valid!
    I'm wondering why I couldn't specify the file path like this. Any way to allow me to specify the file path as the current vi path?
    Thanks!
    Chao
    Solved!
    Go to Solution.

    You need to account for the path changes when built in to an application, have a look at this example.
    https://decibel.ni.com/content/docs/DOC-4212
    Beginner? Try LabVIEW Basics
    Sharing bits of code? Try Snippets or LAVA Code Capture Tool
    Have you tried Quick Drop?, Visit QD Community.

  • Deny Access function with invalid file refnum causes LabVIEW to crash

    Hi folks,
    I have LabVIEW 8.5, and today encountered something interesting that consistently causes LabVIEW to crash.  Essentially, if you find the "Deny Access" function under the advanced file IO palette and wire up an invalid refnum, Windows (XP in my case) reports that LabVIEW has to close.  I checked in task manager, and the LabVIEW process is still active and using a disproportionate amount of the CPU.
    To reproduce the issue, simply drop the function on your block diagram, create a constant from the refnum input terminal, and run the VI.  Has anyone else seen this behavior?
    Thanks,
    Jim

    Hi Carla,
    I'm glad to help, and thanks for looking into it.  The way I ran into the bug was while I was working on an action engine VI to log certain text values (see attached picture).  While logging, I didn't want other programs to access the file.  When a new file had to be generated, I wanted to stop denying access and close the reference.  However, if the value on the shift register was invalid, LabVIEW crashed instead of throwing an error (I guess a crash qualifies as an error).
    If you look at the attached picture, my workaround was to use the "Not A Number/Path/Refnum?" function.  If the reference is bad, I don't try to use the "Deny Access" funtion or close the file.  That worked just fine and seems like a good solution for now.
    Jim
    Attachments:
    Logger.png ‏6 KB

  • Not A Path Comparison not working.

    I ran across this tonight, and it seems a little weird to me. I have a path that shows as "<Not A Path>" in probes and in the control/indicator, but the NaN/Path/Refnum? function returns false. I suspect it has something to do with how this path was created (I used path to string, some string operations, and then string to path on it), but I would still expect the comparison to return True. Any thoughts or insights? I used Flatten to String to look at the path, and it is clearly different from the Not A Path Constant. I can use File/Directory Info instead, and then check for an error, but this is annoying. The vi is saved in LV8.6.
    Chris
    Message Edited by C. Minnella on 02-05-2009 06:39 PM
    Attachments:
    Not a Path Weirdness.vi ‏7 KB
    Not a Path Weirdness.png ‏31 KB

    Darren wrote:
    P.P.S. - Is this worth a nugget?
    Here's an example of the nugget:
    Message Edited by JoeLabView on 02-06-2009 02:58 PM
    Attachments:
    nuggetExample.PNG ‏16 KB

Maybe you are looking for

  • Why do I get 3 sets of photo files when I transfer 3 catalogs.

    Transferred 3 catalogs from old computer, PSE 9, to new computer, PSE 11.  Result is 3 sets of photo files, all different trees.  Did this previously, then put all files in one place, reconnected one catalog and the tags were all messed up.  Wrong ta

  • Dynamic Icon Titles?

    I've got a course I'm developing. Depending on a student's choice at the beginning, certain terms will change. For this example, let's say that if the student says they work at a "Bank" than all references to "Customer" will remain "Customer", and if

  • Reg dynamic action?

    HI freinds I Have to create Dynamic actions when ever employee location has been changed suppose in infotype 0001 if employee location changed i need to update a record in IT0588 Subtype As '0003' and PTXEL = 1. Pls help me with the above requirement

  • File Names in iPhoto 6

    Filenames in iPhoto If I want to use iPhoto to import pictures from my digital camera, I can chose file names with sequential numbering. If I do not want to do this from the beginning I can batch rename the files afterwards. My question now is: How c

  • Make the default search results google, not yahoo.

    So usually, when i type a single word,(like the name of a website) into the url, i get taken to said website(for instance, typing "infomania" would take me too http://current.com/shows/infomania/). Or at least i would be taken to a google search resu