Open visa sessions for controllin​g external dlls

I need to open a VISA session to pass a session reference into a call library fucntion that calls the vendors instrument functions.  I currently see no way to do this using the call library or visa open function.  Does anybody know how to proceed when you have a non NI instrument that has a dll wiht it that you need to control over USB serially? 

Mike,
First thanks for your help but I have been in both those docs before.  My issue is that I have an instrument vendor that has a dll with functions like this:
ViStatus _VI_FUNC Instr_autoConnectToFirst(ViPSession vi)
  return(Instr_autoConnectToAll(vi,1,NULL));
that is written using some of the variables in the VISA library...
When I go to look up what datatypes these variables are in the VISA specifications so I can hopefully create inpuits on a call library function in Labview,  I get descriptions like this:
Type ViStatus
This is the operational return status. It returns either a completion code or an error code as follows.
Completion Codes
Description
VI_SUCCESS
Attribute value set successfully.
VI_WARN_NSUP_ATTR_STATE
Although the specified attribute state is valid, it is not supported by this implementation.
Error Codes
Description
VI_ERROR_INV_SESSION
VI_ERROR_INV_OBJECT
The given session or object reference is invalid (both are the same value).
VI_ERROR_NSUP_ATTR
The specified attribute is not defined by the referenced session, event, or find list.
VI_ERROR_NSUP_ATTR_STATE
The specified state of the attribute is not valid, or is not supported as defined by the session, event, or find list.
VI_ERROR_ATTR_READONLY
The specified attribute is read-only.
VI_ERROR_RSRC_LOCKED
Specified operation could not be performed because the resource identified by vi has been locked for this kind of access.
 I do not see how I get the IO defined for passing and returning data to these external library calls.
Any ideas???

Similar Messages

  • Open VISA sessions (including duplicates​)

    I would like to obtain a list of open visa sessions. I found this knowledge base article which should work, however when opening duplicate sessions (e.g. "COM6 (1)") the list contains empty entries or multiple COM1 references.
    Please try the attached vi to see the effect; on my system the visa resource name control shows COM1 & COM2 (default system ports), COM6 & COM12 (2 USB-serial converters) and LPT1 (system parallel port) at start up.
    This is shown after opening "COM6" (3x) > opening "COM12" (4x) > opening "COM1" (1x) > closing "COM12" and "COM12 (1)"
    Maybe there is a way to read the contents of the drop down menu of the VISA resource control which contains all the information and is also updated automatically.
    Any help is greatly appreciated, regards W@Work
    Note: I'm using LabVIEW 2009 (32-bit) on Windows XP
    Attachments:
    open visa sessions.vi ‏28 KB

    Thank you very much for your response,
    First I'll explain the duplication: the "VISA open" VI allows for opening a duplicate session (which refers to the same port). I want to use this so I can have a separate session for writing and reading which can be locked and unlocked separately. The example I attached to my original post opens duplicate sessions when you (try to) open the same port ("COM1" for example) multiple times. 
    Could you please try the example again selecting "COM1" as "VISA resource name", then click "Open" two times. Now you should see "COM1" and "COM1 (1)" in both lists. On my system clicking "Close" (while "COM1" is still selected) removes "COM1 (1)" from the "open sessions found" list while it should remove "COM1".
    MAX lists ports 1, 2, 6 & 12 that I mentioned in my original post. When running the example this list does not change (no "COM1 (1)" for example) so I think this is just a list of physical ports, not the open VISA sessions. 
    I think you forgot to attach the image but I guess this is the printscreen you're asking for:

  • Open VISA sessions in LV6 VISA Ref control and LV executables

    I have created a LV executable that opens a TCP/IP socket class VISA
    session. Once the session is opened, it appears below the dividing
    line in the executable's VISA resource control. However, the open
    session does not appear in the resource control of any open,
    uncompiled VI in the development environment, nor in the VISA control
    of other LV executables. However, if I run the VI as an uncompiled
    VI, the opened session appears in all other open uncompiled VI's as an
    available resource that may be selected. It should also be noted that
    VISA sessions opened by executables are not returned by the "Open VISA
    sessions" utility VI running in the development environment.
    My wish is to create a
    separate compiled executable applet that
    creates a TCP/IP connection to a network device and have that resource
    appear in the VISA control of other executables and VI's. It appears
    the executable uses its own memory space to keep track of open VISA
    sessions. Is there any way to change this so that all runtime
    executables and the development environment all work from the same
    list?
    Thanks in advance,
    sm

    jwf wrote in message news:<[email protected]>...
    > If you haven't done so, you should try updating LabVIEW 6.0 to 6.0.2.
    > You can download this update for free by going to www.ni.com and
    > clicking on downloads and then drivers and updates and pick the
    > LabVIEW updater out of a list. I know for a fact that this update
    > fixed some problems using the VISA resouce control in LabVIEW 6
    > executables. Hope this is helpful.
    Thanks for the advice, but I've already updated to 6.0.2.
    sm

  • How to open multiple sessions for one user?

    Sorry for the silly question but I couldn't find it googling or searching through this forum, so I started wondering whether it's possible in SQL Developer to open multiple sessions for one user. I'm fairly new to SQL Developer and databases in general.
    When I open SQL Developer and connect to a schema, a worksheet opens named MYSCHEMA. If I disconnect then connect, another worksheet opens, named MYSCHEMA~1. I assumed these were different sessions, but if I enter into one worksheet:
    select col1 from my_table where row_id = 1
    -- shows result is 1
    update my_table set col1 = 0 where row_id = 1
    select col1 from my_table where row_id = 1
    -- shows result is 0and then enter into the second worksheet:
    select col1 from my_table where row_id = 1
    -- shows result is 0I would have expected the second worksheet to report 1 because the first worksheet did not issue a COMMIT. Thus, I'd guess both worksheets are the same session? Is that right? If so, how do I have two sessions open simultaneously (opened by same user)?
    I'm trying to implement the code at the bottom of this post, for which testing requires at least two sessions:
    Re: Help with Procedure
    Edited by: tem on Apr 18, 2012 6:44 AM

    Thanks Jim,
    Ctrl-Shift-N doesn't do anything for me. I'm on a mac -- by experimenting it looks like command-N does what you're looking for. This appears to be the same as left-clicking on the "New" icon in the top left corner of SQL Developer, or selecting from the pull-down menu, File > New.
    This opens "Create a New" window that appears to be a wizard. What would I select at this point? Options are: Database Connection, Table, View, Package, ...
    I don't see an option for "Worksheet".
    UPDATE:
    OK, I found that if I select "SQL File", a worksheet becomes available. Perhaps this is what you intended. However, when I issue the command
    select col1 from my_table where row_id = 1;it still returns 0 instead of 1. Hmm, maybe my initial assumption was wrong -- if this is a second (e.g. different) session, should I expect the changes made in the first session in SQL Developer (the UPDATE command) WITHOUT a commit, to be observed in this second session? I thought that changes made in one session were not viewable in a different session until these changes are committed in the first session? If so, how to show this in SQL Developer? I must be missing something basic here.
    Or, is SQL Developer issuing some sort of "auto-commit" without my knowledge?
    Edited by: tem on Apr 18, 2012 8:00 AM

  • In private browsing not working in Firefox 3.6.12 If I open yahoomail one session for one account and if I open other session for yahoomail, it automatically opens the earlier mail account.

    In private browsing not working in Firefox 3.6.12 If I open yahoomail one session for one account and if I open other session for yahoomail, it automatically opens the earlier mail account. But if I want to use more than one yahoomail accounts, in private browsing is not working. Please suggest.

    That problem isn't related to Private Browsing specifically, that's how Firefox works with regards to multiple "sessions" with the same server - only one logon is allowed at any time. Try using one of these extensions to be able to run multiple session cookies.
    Multifox: <br />
    http://br.mozdev.org/multifox/ <br />
    Cookie Swap extension: <br />
    https://addons.mozilla.org/firefox/3255/ <br />
    Cookie Pie extension: <br />
    http://www.nektra.com/oss/firefox/extensions/cookiepie/

  • Open VISA Session Monitor.vi

    This is a vi that is located in \vi.lib\Utility\visa.llb. Did anybody ever had it worked? I started 2 VISA sessions on test equipment (a power meter connected to USB and a signal generator connected to a gpib-usb) and the number of open sessions indicated 0 when there was clearly 2 open sessions.
    Ben64

    Vincent90 wrote:
    Hi Ben,
    Can you specify your error ? Did you try to send commands to your instruments when you think that your session is open ?
    BR,
    Vincent
    There is no error generated, the open VISA sessions just doesn't show up and the Open Sessions.vi return an empty array of references. The issue seems to be with this vi but we can't look at the diagram since it is password protected.
    I was running continuous acquisitions and the VISA resource name controls was showing 2 open sessions (the small computers icon beside the resource name).
    Ben64

  • Open VISA Session

    Hi to all,
    I'm newbie with Labview 8.5, I'm viewing some example to connect serial port with VISA blocks. I see that these examples use a VISA Resource Name control to define the resource (example selecting COM1) but after they don't use Visa Open block to open a VISA session with the device, but they use directly the sequence "VISA write - VISA read - VISA Close" blocks. Why don't they use VISA open session to open a session with device?
    I read in help that VISA Resource Name contains some informations on resource and it maintains VISA session also, instead VISA session is a unique identifier, I think that when I create new Visa Resource name Control, Labview automatically open a session with this resource, so it isn't necessary to use VISA Open block to create the session, isn't it?
    best regards

    It's not correct to say that just dropping a resource control itself on the front panel or diagram opens a session. The resource is automatically opened when calling VISA function (i.e. a write or a read), if the resource was not explicitly opened with the VISA Open function. You can see this yourself. Put just a resource control on the block diagram, select the resource and run the VI. Click the arrow on the control and look at the resources. Now, wire a VISA Write to the control, run the VI, and look at the resources. You will now see a little icon next to the resource you selected. This indicates that the resource is open. The automatic opening of a resource was a change made to VISA several years ago and you will still see the VISA Open in instrument drivers. It's not a bad idea to always use the VISA Open function. For serial, you would put it before the VISA Configure Serial Port.
    Attachments:
    Open Resource.PNG ‏4 KB

  • Why Open VISA Session?

    In the driver here, the VISA Open sub-VI states that it "must be called first" when using the device. There is a similar sub-VI for closing the session.
    How true is this?
    I can open and run a different sub-VI (such as Write Single) with no immediately obvious problems, just by specifying the correct device in the VISA Session field. Are errors or performance hits building up in the background?
    My problem is that the KS 3988 will be called on in sub VI's within sub VI's within sub VI's (relative to the main program). I'm not clear on where, exactly, I should be putting that VISA Open panel. This is especially confusing if the "dup VISA session" needs to be wired into every use of the Write Single sub-VI.

    Here is a picture of the VI which actually calls the KS 3988.
    My problem is that this thing is just the sub VI of a VI which is itself the sub VI of a VI that is running in a frame. The top-level VI that contains the frames has four such frames.
    Now, those top three VI's all read out of the black Admin sub VI, and the bottom can both read from it and write to it. Currently, all programs use the same KS 3988 via VISA, but that needs to be something we can change on the fly.
    So, where does the Open sub VI go? Do I need to include, in the frame-containing VI, something like this?
    Message Edited by DJDDA on 07-31-2008 04:10 PM
    Attachments:
    convertfix.jpg ‏17 KB
    convertvi1.jpg ‏26 KB
    convertvicontext.jpg ‏66 KB

  • When firefox launched and kept open, automatically opens multiple sessions for ads and pornography which I have never visited. sessions hide in legitimate ones

    I use firefox exclusively. I open many sessions simultaneously mostly one site per session in a single tab. At times during the day when I keep firefox open, I will return to a previous site/session and before I am able to see it, I am getting browser 'pop-ups' of ads for TJ MAxx (a site I never visit) and hard-core porno (a site i never visit and not part of my browsing demographic). These are completely random and hide behind legitimate browsing sessions and are not listed in history etc. They are not being removed by adware or Norton and they are driving me nuts not to mention the embarassment of trying to launch a legitimate site and getting disgusting porno in your face while working with colleagues. Please help!

    '''Scan for Malware'''
    Sometimes a problem with Firefox may be a result of malware installed on your computer, that you may not be aware of.
    You can try these free programs to scan for malware, which work with your existing antivirus software:
    * [http://www.microsoft.com/security/scanner/default.aspx Microsoft Safety Scanner]
    * [http://www.malwarebytes.org/products/malwarebytes_free/ MalwareBytes' Anti-Malware]
    * [http://support.kaspersky.com/faq/?qid=208283363 TDSSKiller - AntiRootkit Utility]
    [http://windows.microsoft.com/MSE Microsoft Security Essentials] is a good permanent antivirus for Windows 7/Vista/XP if you don't already have one.
    Further information can be found in the [[Troubleshoot Firefox issues caused by malware]] article.
    '''Reset Firefox'''
    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
    Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!

  • Opening multiple visa sessions

    I'm having problems with opening multiple VISA sessions for communicating with 4 HP-34401A multimeters in LabVIEW 6.1. If you have a little bit of time, please take a look at what I have here to see if I'm doing something wrong.
    Thanks
    Attachments:
    HP34401_Test.vi ‏108 KB

    I have made a look at your VI. I don't have the driver for the instrument I couldn't go into the subVIs and its documentation and I could not change it for you.
    1. You initialise only 2 of the 4 meters. Initialize all meters.
    2. In sequence 0 you close the session to the meter. In the next loop iteration it will not measure as you intended. Delete the "VISA Close" function.
    3. The stop button would cause the while loop to exit. But your handling is a little bit complicated. Do following:
    Delete the "not" and case where the stop terminal is connected. Wire the stop terminal directly to the termination terminal of the while loop. With the context menu set it to "stop if True". Wire the VISA sessions to the right border of the while loop and connect t
    hem to the "VISA Close" function.
    Waldemar
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

  • How are VISA sessions managed by executables?

    I have noticed that VISA sessions opened in the development environment (Labview version 6.0.2) do not show up in the VISA I/O reference control of compiled executables and visa versa. I assume that each EXE has its own memory space for open VISA sessions. Is it possible to get separate EXE's and the development environment to use the same VISA memory space so that all applications and uncompiled VI's show the same open VISA sessions?

    This answer, while correct, doesn't address the issue of some VISA classes and how Labview addresses open VISA sessions. It is quite correct concerning the listing of available resources, that is not the nature of my problem. The heart of the matter is the Open VISA sessions and how they are returned by the "Open VISA sessions.vi" vi in the vi.lib utilities. Also, the VISA reference control does, as you say, display currently available resources (for some classes), but it also displays currently open sessions below a dividing line for those resources not usually displayed.
    The best example of this is for the TCP/IP class. Resources of this class are not displayed unless a session for them has been opened.
    I have written and compiled an executable tha
    t opens a VISA session for a TCP/IP resource. After opening it, the session is displayed in the executable's VISA resource control below a dividing line that separates it from the available serial and GPIB resources. If, however, I have an uncompiled VI with a VISA control open in the development environment at the same time, the open session is not displayed in that VI's resource control. If I run the compiled executable as an uncompiled VI in the development environment along with other VI's containing VISA resource controls, the open TCP/IP session is displayed in all VI's. The same holds true for the "Open VI sessions.vi". Sessions opened by compiled VI's are not returned by this subVI when it is run from outside the executable.
    As I stated before, it appears the executable creates its own separate memory space for listing open VISA sessions.
    I would like to create a small executable that logs in to TCP/IP resources and makes those sessions available to other VI's that ar
    e either uncompiled and running in the devel environment, or are running as separate executables.
    Thanks for your comments
    Steve

  • SRQ event not received when multiple process open VISA instrument

    I'm having two different processes opening VISA sessions to the GPIB instruments.
    This first process install SRQ handler on the ressource and just wait for those events to occurs.
    The second process is basically a test program using standard read/write to my instruments.
    Provided my instrument is correctly configured, I've found that my first process won't see any SRQ when the second process generate badly formatted commands.
    However if the first process send badly formatted commands, then it will see those events.
    I've reproduced this easily with the VIC panels and I can't find any explanation for this behavior.
    I've hooked an AT-GPIB+ to the GPIB bus and confirmed that the SRQ occurred has expe
    cted; I've also confirmed that the GPIB controller do the serial pooling to identify the SRQ origin.
    Furthermore this problem is only reproductible with instrument who do not have secondary address :
    GPIB::4::INSTR => SRQ not detected
    GPIB::5::0::INSTR => SRQ detected
    I've tried different instruments without much differences.
    Finally, writting my first process using the GPIB library instead of VISA seems to works correctly (i.e. it always detects SRQs on the GPIB bus); the only difference being that in that case my callback is installed on the GPIB board instead of the instrument.
    Is it a bug in the VISA library ? How do I work around it ?

    Hi,
    I've further investigated the problem.
    I've upgraded to NI-VISA 2.6.1 and NI-IVI 3.3. This gave better results in the event handling mecanisms, but my issue still exist.
    I've tried to narrow the problem further and it seems that the issue isn't related to instruments with secondary addresses; in fact, it seems related to instruments session which already have seen SRQs before I open a second session on the same instrument.
    Let me try to explain :
    Process A start
    open instrument GPIB0::4::INSTR
    open instrument GPIB0::21::INSTR
    acknowledge SRQ on both instruments
    send "*SRE?" then read response
    call viReadSTB()
    install SRQ handler on both instruments
    call viEventHandler()
    call viEnableEvent()
    configur
    e both instruments for SRQ handling
    send "*ESE 52"
    send "*SRE 32"
    send invalid command to instrument at address 21
    send "xxx"
    => SRQ handler called for the correct instrument
    acknowledge SRQ on the instrument at address 21
    send "*SRE?" then read response
    call viReadSTB()
    Process B start
    open instrument GPIB0::4::INSTR
    send invalid command
    => no SRQ handler called !
    install SRQ handler on this instrument
    call viEventHandler()
    call viEnableEvent()
    => SRQ called in process B (not in process A !)
    acknowledge SRQ on this instrument
    send "*SRE?" then read response
    call viReadSTB()
    close instrument
    open instrument GPIB0::21::INSTR
    send invalid command
    => SRQ handler called in process A
    acknowledge SRQ on this instrument
    send "*SRE?" then read response
    call viReadSTB()
    close instrument
    I hope this detailed test sequence will help you to reproduce my problem more easily.
    Sincerely,
    Rémi THEVENI
    N

  • How to open Multiple session

    I am trying to OPEN multiple SESSION for same application and unable to do this using FIREFOX 7.01
    R 12(Oracle E-Business Suite), we are using FIREFOX for several clients to open the applciation. But i cannot open different session of same applcaition. it is ONLY opening singel JAVA form. In IE 8 or 9, i can do - NO MERGE option or File>New Session option. Is there some workaround for this. I am using Windows 7.

    Hi,
    When you run the form in the browser, it opens a new database session. For sharing the same session, you need to open/call/new form within the form itself.
    For using same JVM, you can use the [JVM Pooling|http://download.oracle.com/docs/cd/B14099_19/web.1012/b14032/jvm.htm] feature (assuming you are on forms >= 10.1.2).
    -Arun

  • [Solved] VirtualBox Failed to open a session

    Hi everyone,
    I've installed virtualbox, qt and virtualbox-additions
    I've also added the following to /etc/rc.conf
    MODULES=(vboxdrv vboxguest vboxsf vboxvideo)
    I've also added my username to  vboxusers
    When I start a session in virtualbox i get the following error message-------------
    Failed to open a session for the virtual machine "Linux VM" ---- Linux VM is the name of the Virtual Machine
    VT-x features locked or unavailable in MSR. (VERR_VMX_MSR_LOCKED_OR_DISABLED).
    Result Code: NS_ERROR_FAILURE (0x80004005)
    Component: Console
    Interface: IConsole {1968b7d3-e3bf-4ceb-99e0-cb7c913317bb}
    Any ideas why the VT-x features would be locked or unavailable?
    I've tried 3 different iso images but every time I get the same error.
    Thanks in Advance I'm certain I must have missed a step at https://wiki.archlinux.org/index.php/VirtualBox
    However I've rebuilt several times and started from scratch at least 3 times. each time I get the message above
    Last edited by joe4ska (2011-10-20 03:43:09)

    DSpider solved my problem. I had Enabled VT-x/AMD-V which caused the conflict.
    Once I unchecked the box everything worked perfectly.
    http://dl.dropbox.com/u/28308548/hardwa … zation.png
    hcjl, I'm probably using it as a Guest. I actually don't know the difference between Host and Guest. I'm very new to virtualbox
    Thanks for the help guys.
    Last edited by joe4ska (2011-10-20 03:44:19)

  • Error in using TCPIP/Inst​r class to open a VISA session

    I use the TCPIP/Instr class session to open a VISA session to Agilent 86140B Optical spectrum Analyser and I get an Error - VISA open in Appln.vi.Help me to fix this problem.
    I am able to access the instrument on LAN through a Telnet session.
    Vijayalakshmi.
    Attachments:
    OSA_Close.vi ‏28 KB
    OSA_Reset.vi ‏27 KB
    OSA_Initialize.vi ‏63 KB

    Thanx for the reply.The instrument is VXI-11 compliant.The error I am getting is Instrument timeout -1073807339 (BFFF0015) and I am using LabVIEW on Linux.
    I have another problem.I am able to see the instrument using a Telnet session but not using http//192.168.10.2 on a web browser.It is giving an error that the host may be down and try some time later.

Maybe you are looking for

  • Error filename measurement file

    Hi. In my project, I have used the Read Measurement File function to read .tdms file. When I run the program on another folder or another PC, then select Open file name an error occurred, error window appears. Although it did not do wrong program ope

  • Unable to delete data from a partition

    Hi, Unable to delete data from a partition I am using the command as: ALTER TABLE TEST DROP PARTITION DATE_20090820090000 Its giving 0 rows deleted.Bu there are 200 rows for the Partition. The partition is getting deleted but the data remains. I want

  • CAN'T GET PAST STEP 8 SETUP CD

    I have a WRT54G router. After a couple of months I started having problems accessing the internet. I started all over again, installing the router rom scratch. However, I can't get past step 8 of the installation process. The setup program prompts me

  • "Use ITunes to restore" displayed, but cannot connect

    Hi all, I have an IPod Nano which is locked somehow after last time I connected it to my system. The display shows: "Use ITunes to restore" However when I connect it to my computer, nothing happens. It is not found as a drive, nor listed in ITunes. F

  • Automatic credit release after payment done

    Hey Experts My client wants to automatically release the credit block after posting customer payment. Thus, the user does not need to manually go to VKM1/VKM3 t code and release the order.  Is this possible in standardr SAP?  or do I need help from a