VISA port spy

Is there a way to programmatically monitor a serial port (without taking control of the port or otherwise interfering with an existing connection)?
I know I can use third party applications like Portmon, or NI IO Trace to display (VISA) communication in the NI IO Trace application, but I would like to create my own "terminal window" in LabVIEW to display all messages.  NI IO Trace has a LabVIEW API to start and stop IO Trace, but no API to programmatically access the data stream.

Dennis,
True (for TestStand).  Likewise, in LabVIEW I could send a Notification (or some other communication mechanism), but the key is that I would have to modify each VI that does a VISA write or read.  I would like to do essentially what NI I/O Trace does--display what VISA messages are being sent and received without the application doing the sending/receiving having to know that it is being montored.  If NI I/O Trace provided an API to programmatically access what it is seeing, I would be in good shape; but (as far as I can tell) it doesn't.
There are lots of tools out there that spy on serial (and other type of) ports (at a lower level than VISA), but they all seem to be stand-alone programs that are the equivalent to NI I/O Trace--they display and capture the traffic, but don't provide an API.  The next best thing is to figure out how all these tools are using low-level Windows calls, but that seems daunting.

Similar Messages

  • How do I create Labview VISA ports for *individual* GPIB instruments using Prologix USB GPIB controller?

    Hello,
    I'm trying to use a Prologix USB GPIB controller to control GPIB
    instruments, and I would like to have a virtual serial (VISA) port for
    *each instrument*, as is the case with a normal GPIB controller with a
    standard NI driver. However this is not what the Prologix driver
    provides -- it provides a single VISA virtual serial port for the
    entire controller. To address the instrument with GPIB address 11,
    you first send "++addr 11" to the serial port, and then you're talking
    to instrument 11. However, this means I have to change all old
    Labview programs.
    Is it possible to create a "wrapper" function of some kind that will
    define a virtual serial (VISA) port for each *instrument* on the
    controller? For example, to talk to GPIB instrument 11, call it
    ASRL3::11::INSTR, each time it is written to it would have to write to
    the virtual serial port of the controller, say ASRL3::INSTR, first "+
    +addr 11" and then the command that is sent to it.
    A clearer explanation of the difference (i.e. incompatibility), and of
    my objective:
    1) A normal GPIB controller with NI driver: I go to the NI
    Measurement & Instrumentation Panel, under GPIB, and Scan for
    Instruments; all the live instruments show up; subsequently when I
    want to use Labview programs that use VISA ports, the VISA drop boxes
    allow me to choose a different port for each instrument, e.g.
    "GPIB0::11::INSTR", "GPIB0::12::INSTR" would be instruments at
    addresses GPIB 11 and GPIB 12.
    2) The Prologix GPIB controller that plugs into a USB port: In
    Labview you get a *single* VISA virtual serial port, ASRL3::INSTR, for
    the entire GPIB0 controller. Therefore to address GPIB instrument 11,
    you write "++addr 11" to the virtual serial port ASRL3::INSTR, and
    then you are communicating with device 11, so you can write and read
    ASRL3::INSTR to talk to that device. Then to talk to device GPIB 12,
    you write "++addr 12" to the same VISA port, and then you are talking
    to that device. The problem is that this requires recoding all
    Labview code, whereas I would like to be able to use the same program
    either with a normal or with a Prologix GPIB controller. Therefore, I
    would like to create code that scans the controller for all GPIB
    attached devices and creates VISA ports for all. Such ports, when
    written to, would have to first write "++addr DEVICENUM" to
    ASRL3::INSTR (i.e. the port of the GPIB-USB controller) where
    DEVICENUM is the GPIB address of the instrument corresponding to that
    port, and then would have to do a write or read or whatever function
    is being done on that instrument VISA port.
    I haven't figured out if it is possible to do this easily. Help and
    pointers on where to look for hints would be much appreciated. Many
    thanks!
    Milos

    My first impression is that if you don't want to make any changes at all to existing programs is that the wrapper you need is one around VISA. You would need to intercept all of the calls into the NI VISA driver. If you create your own visa32.dll and in there, change the addressing and then call the real VISA driver, you might (repeat, might) get something to work. If this would even work, you still might find that you have to make significant changes anyway. The serial connection is going to be considerably slower, and interface specific functions such as service request handling, bus triggering of multiple instruments, etc., would be difficult to impossible. This would be a lot of work, imho, to just save a couple of hundred dollars over a real GPIB controller. I've seen this Prologix device before and have even used NI's RS-232->GPIB controller. The Prologix intended use to me seems to me more for a hobbyist or very casual user. Of course, I'm used to having multiple GPIB instruments worth 10s/100s of thousands of dollars and the cost of an fully compliant GPIB controller is just lost in the noise.

  • Serial port: Input/output signal errantly combined

    I am currently in the process of using LabView to replace another user interface for a scientific instrument.
    LabView is connected to this instrument through a serial port.  The instrument streams 25 bytes of binary data every second to the computer.  I can read the binary string (VISA Read) and save contiuously to disk using a while loop.  In addition, there are a few instructions I can send to the instrument that will do various functions (start logging, turn LEDs on/off, etc).  I can successfully send these instructions to the instrument using the previous interface, and in a stand-alone vi using VISA Write, but when I place the VISA Write function into the larger interface vi, signals go haywire.  Specifically, there are two separate LEDs that I can toggle with two different commands, but when in the larger interface vi, both commands toggle the same LED.  Also, it appears that the singal I send to the instrument (a single ASCII character) immediately bounces back to the computer into the 25 bytes of streaming binary data.  In other words, after I press the LED "on" key, one column of my streaming data changes when it is not supposed to (ex: after Binary to ASCII conversion, it changes from a single digit to a twenty digit value).
    Initially, I thought the problem was the sequence of VISA Read/Write.  In the current configuration, I read all data, then allow for Write commands.  Both the VISA functions are within the same While loop to continuously monitor the data.  Is it possible the Write signal output is not leaving the while loop and being read as input?  What would make the instrument read two different commands as the same one?  My goal is to run an interface that displays the streaming data as ASCII, and allows for a few different toggle options while the interface is running - is there are more efficient/elegant way than a while loop?
    ~Going Bananas
    Solved!
    Go to Solution.

    New replies now in gray.
    CodeMunkee wrote:
    1.  If you keep giving me good advice like this, I'll be tempted to change the background to Baltimore prison purple.
    I'll ignore this statement.
    2.  The buffer now lives outside the loop.  I understand clearly.  Part of the problem might be my instrument - when I cycle power the 19 digit number that was 'echoed' disappears.  Forget about that display stuff, it works properly - I accidentally removed the time delay when editing the vi.   But you do bring up an interesting point...
    Without the delay, the loop ran much faster.  If the bytes weren't at the port, the read statement would have returned nothing when it read zero bytes, thus blanking out the indicator rather quickly.
    Yes, Hexadecimal display shows 04 to indicate the end of the 25-byte data sample.
    Doing a bytes at port read is not always a good idea.  If not all the bytes had arrived yet when you ask for the read, you won't get all the data.  The remaining data being sent in that stream from the instrument will show up at the front of the buffer on the next read command. 
    While this isn't a common occurence, it does happen.  How can I prevent this from ever happening?
    Since you know each commands ends with a hex 04 (ASCII character for EOT), you could enable the termination character when you configure the serial port.  Set the termination character to be 4.  Then when you execute the VISA read, read a large number of bytes such as 25 or more.  The read will terminate at either the timeout, the requested number of bytes, or when the termination character is read.  With this setup, you could eliminate the wait statement and also not request the number of bytes as the port.  The VISA read will control the pacing of the loop.  Any extra bytes after the termination character are part of the next frame of data and will wait around until the next time you read the VISA port.
      3.  Implementing your ideas for the latch button works better.  I am still encountering issues with these commands however.  Attached is the new vi.  There are two commands I want to send, 't' turns on the LED light (they blink for 30 sec then time out), and the latch works perfectly for that, 'p' turns on the magnetometer light (an additional 'p' is required to turn it off), but I cannot get the command sent to the mag while the loop is running.  It turns on either at the beginning of the vi, or at the end of the vi (after Finish button is pressed).  This leads me to think the command 'p' is stuck inside the loop.  I tried adding another film strip (see attached vi) for the toggles to force the issue, but it didn't work. Additionally, the 'p' command effectively works as a 't' command, and the LED lights begin to blink when I press the 'p' button.  This isn't supposed to happen, and leads me to believe the 'p' command does in fact exit the loop but in the wrong manner.
    The "film strip" is another frame of a flat sequence structure.  It enforces the order of execution.  The next frame can't execute until everything in the prior frame has completed.  It isn't necessary in your case because the Error and VISA wires determine the order of execution with respect to the other VISA statements.  But it shouldn't hurt.
    There is no reason the "p" case structure should behave any differently than the "t" case structure.  Although you should wire the error wire through in the False case of the "p" structure like you did for the "t" structure.  There is no "exiting of the loop" in either case.  The loop runs until the stop button is pressed.  I would check the manual to see that t and p commands do what you think they should do.  Do they need a termination character of their own when they are sent?  Should they be upper case letters rather than lower case?  You can run NI Spy on your serial port and see the operations occurring with it and see the data coming in and what data is going out.  I would be suspicious that the device is not handling the command properly.
    Any ideas?  I think I've tried to put the toggle buttons outside the loop before, but then could only toggle once before the loop took over.  Ideally, these toggles would be available at any time while the data is streaming, so therefore inside the loop?
    The toggle buttons need to be within the loop so that they can be read on every iteration of the loop.  Outside the loop, as you discovered, they are only read once at the very beginning before the loop is started.
    4.  Thank you for the suggestion about the Selection Mode for the Open/Create File option.  It is annoying to create a file first.  I made the change, but I still get error messages when I use a file that does not yet exist.  LabView takes me to the first Open/Create/Replace vi when the error occurs.  Is there something else I must do?
    On the open file VI, there is an input that is Open as default when unwired.  Create a constant there and change to Replace or Create.
    Remember, if you have any questions about the way LabVIEW is handling something with serial ports, close the port within LabVIEW.  Open Hyperterminal and try the commands from there.
    Message Edited by Ravens Fan on 01-13-2009 03:55 PM

  • Visa Read Timeout Occurs with multiple Reentrant VI Calls

    I have written a test application in Labview (6.1) which will be used to test (burn-in) up to 15 serial instruments through a 16 Port USB->RS232 Hub. Here's how it works:
    When the App loads, I am transmitting a Connect command to each of 15 com ports (one-at-a-time) using VISA. If I receive the proper response from the unit on that port, I add the port to an array and continue on to the next system. Once I've found all systems on the hub, I wire my array of active Visa references to a for loop in which I open up to 15 reentrant VIs which will run in the background in parallel. Each of these reentrant VIs (all are idential with the exception of the Visa Resource they use) running in the background are sending commands to the the respective instrument and receiving a response. One Function in particular "Get Unit Status" is important and the response determines whether or not the instrument is functioning correctly. Here's the problem -- In my Main Loop, I am continuously acquiring indicator values from each of the reentrant VIs that are running in the background. After a period of time (not consistent) I will lose communication with a port (the symptom is no response from the unit). I've looked closely at the COMM engine I created and found that the Visa Write function is completing without error, then when I perform a Visa Read I immediately get the "Timeout occured before operation completed" error (please keep in mind that this occurs after 100-5000 successful attempts at writing/reading). Eventually another port will drop out, followed by another. This seems to stop occurring and the remaining systems run to completion without a problem.
    Some background on what how I'm setting up my Visa Sessions...
    When I originally scan for systems (before I load and run the Reentrant VIs)
    - Init Visa Port
    - 19200, 8, N, 1
    - Use Termination = True
    - Timeout = 400mS (I've tried larger values already) 400mS should be plenty
    - Termination Char=13 (/r)
    - Open Visa Session
    - Visa Write "CONN18/r" (the command required to connect to my instrument)
    - Visa Read with 1 for requrested byte count to read 1 byte at-a-time, concatenating the results until /r is received (or 1000mS timeout occurs -- this is not a VISA timeout) I've also tried 16 for requested byte count and just waiting for Visa to timeout -- both methods work.
    Once all 16 ports are scanned I Close ALL of the ports using the Visa Close Function.
    It is important to know at this time that I "AM" using proper wiring flow to ensure open occurs before write, write occurs before read, etc.
    I'm assuming at this time that all of my Visa sessions are closed.
    On to the Reentrant VIs:
    Inside each reentrant VI I first Initialize all of my variables and Init/Open a 'New'? Visa session using the same parameters mentioned above.
    Then I enter the "Run" case structure where all of the communication begins.
    I am using the same Communications Engine to operate the instrument as before (the only difference being that all of the VIs in the comm engine are now reentrant and operate at higher priorities) I have actually saved two different versions of the engine (one for the reentrant calls and one for when I first scan for systems from my Main GUI).
    When I init the reentrant VI, I am placing the Duplicate Visa Resource output of my Visa Open Function on a shift register. When I enter the Run case, it takes the Resource from the register on the left, wires through any Comm Engine Vis then back out to the shift register on the right and keeps going for a 12-hour period or until "Get Unit Status" has returned 60 naughty results.
    On my Main GUI I am continuously (every 500mS) I am Getting certain Indicator Values from each reentrant VI AND I am also setting some control Values on each reentrant VI. There is no VISA interaction between each Reentrant VI, and the Main GUI.
    As I said earlier, up to 15 systems will run for a time, then one will stop responding, followed by another, and another until a few remaining systems will run to completion.
    Any advice as to why I'm encountering the timeouts with the VISA read fucntion as I have metioned would be appreciated. I managed to find one suggestion which uses the Bytes at Port function to ensure there is data at the port before doing a Read otherwise, skip the read and retry the whole operation -- I haven't tried this yet.
    Sorry for the wordiness of my question. If anyone would like some screen shots of portions of my code (I can't submit the actual code because some of it is confidential) I'd be happy to post them.
    Doug.

    Hi Doug,
    The first thing I would recommend is the solution you have already found, to check and see if there is data at the port before attempting a read. I would be interested to see if this will solve the problem. Does there seem to be any trend to which ports have this timeout error? How many ports does it cut down to before operation seems to continue as expected? Does this number vary, or is it always the same number of ports? I think the best thing to do will be to identify constant attributes of how the error is occurring so that we can narrow it down and see what is going on.
    John M

  • How to include NI-SPY in the Deployment system

    Hello,
    I would like to include the NiSpy in the deployment system I'm making. I included all the files in the 'C:\Program Files\National Instruments\NI Spy' directory and the 'nispylog.dll' located in the 'c:\winNT\system32\' directory.
    The program is running when called, however when I select the 'Start Capture' (blue arrow) I get the following error message: 'NI Spy could not enable capturing because no API is selected. Please select at least one API from the Spy menu and try again. If there are no APIs' listed under the Spy menu, reinstall the National instruments driver software to fix this problem''
    Can you advice me how to solve this problem?
    a) Which files are missing?
    b) If I want to install Ni Spy alone, how to do that?
    Thanks
    Rafi

    Rafi -
    NISpy has an installer and I would recommend using it instead of trying to figure out the files to install manually. The DriverCD that comes with TestStand contains the installer and it is typically located on disk2 at \components\visa\ni-spy\NISpy.msi. I suspect that various NI drivers also install support for their APIs, so using their installers would be appropriate.
    Scott Richardson
    National Instruments

  • Running two stepper motors at the same time from one port

    Hello,
    I have to run two motors at the same time - one used to move a linear ball screw and one to turn a grip. I am doing tension and torsion testing on small wires, but tension and torsion have to be done at the same time. I also have to build in the ability for each motor to take multiple steps, ie. have a motor take x number steps at y velocity and then move x number of steps at z velocity. Both motors need to be able to do this. However, I am having problems getting the motors to run at the same time and to take all the steps. The motors are connected to two RMS Technologies R356 controllers. Both of the controllers are then connected to one RS485 to USB converter card, and that card is connected to one of the USB ports in the computer. Currently, I pass an array of commands to two for loops each containing VISA read and writes. I've attached the vi to look at. All of the timing stuff in the code is because a new command cannot be sent to the controller before the motor is done executing the previous command. If commands are sent right after one another, the controller will only execute the first command and then return with an error. 
    Does anyone have a suggestion as to what I am doing wrong?
    Thanks in advance for any help. 
    Solved!
    Go to Solution.
    Attachments:
    Motor Controller (Sub VI 3).vi ‏41 KB

    I'm not too clear on exactly what you are trying to accomplish or some of the details.
    Are there equal number of torsion and tension steps?
    Is there a pairing between a torsion and tension?  For example, you want to tension and torsion simultaneously, but those two together make a complete step?
    Do you want to wait until both the torsion and tension have completed before moving on to the next torsion/tension pair?
    Is there any time delay you want to hold at before moving on to the next step.
    When working with state machines, it is important not only to define the states, but also the logical stepping from one state to the next, or alternatives based on conditions.  It could be flowchard, but sometimes people call them state charts.
    Right now your latest posting has goes to "Write to Motor" event though and will wait there forever because there is nothing in the queue to write out through the VISA port.
    Let's assume your first state would happen to be Enqueue Tension (in order to get something in the queue), you will actually queue up all your tension commands at once with the For loop.  Then i will be 1 less than the size of the array it always will be because for an array size n, i will go from 0 to n-1 on each iteration.  So your false case will run and you will go to "Write to Motor".  Write to Motor will run and dequeue the first command then go to Waiting for Response.  Waiting for response will iterate through the while loop until 66 or 67 comes back.  I assume only 66 will come back for tension since you have yet to write a torsion command.  Once that comes back, it will go to Enqueue Tension again and insert a whole other series of commands.  Then go back to write Motor and will take out the 2nd queue element from the first set of commands your wrote.  It will stay in a Tension mode and the Queue will grow endlessly putting in a whole new series for each element that you dequeue.
    A state machine is the way to go, but I can't really sketch one out for you because I'm not sure exactly how your applications is supposed to work.  If a tension and torsion command are paired together,  perhaps you should just queue them together and write them out at once.   But the key thing is to sketch out on paper your application and flowchart exactly how the program should progress from step to step.
    PS:  One other thing, make sure you wire the queue reference wire through all states.

  • VISA Menu

    Hi,
    I made a project using VISA read&write every thing is okay, but when I build it on PDA device ( I-mate  pocket pc 2003) the menu of VISA (ports) doesn't appear so I should return back then change it to constant and fix the no. of the port used then build it again to PDA , when I already choose the port no. by constant the program is fine. but I can't change the port no. ,  How can I let the VISA menu appear.   On PC Program I put it as Control and I can see it, but when download on PDA it disappears.
    Any help??????

    Hi,
    Are you using the VISA Resource Name Control?  While you can add this to the front panel of a PDA VI, this control is not visible when you deploy the application to the PDA.  This is documented in the VISA Resource Name Controls (PDA Module, Touch Panel Module) in the LabVIEW Help.  You will need to use a string control and use the VISA Find Resource function to get the ports on your PDA.
    Donovan

  • Initializing/configuring DAQ output port

    Attached I have a simple program that I am using to make sure I understand how to interact with the PCI-6025E (Device 1). It works just fine with the test panel, and it works fine after I do some configuration with the test panel. However if I get out of labview and reload this simple program it no longer works till I go into the test panel an configure and actually write to the port. After that, my program will work again. Right after loading labview however, if I try to run this program, it gives me the following error message:
    Error 10008- occurred at DIO Port Write.
    Possible Reasons:
    NI-DAQ LV: The group is invalid.
    I am trying to find the right configuration VI to make this work but I guess I don't un
    derstand the concept of groups vis-à-vis port, lines, and channels. The "Write to Digital Line.vi" does not even mention a group.
    Any idea what I need to do to keep from needing to manually use test panel again every time I reload this vi?
    Thanks,
    Attachments:
    DAQOUTTEST1.vi ‏91 KB

    Dennis -- Thankyou for taking the time to answer me. Your answer didn't help me solve the problem using the "Write to digital line" and the "Write to digital port" functions (vi's) that I had been using, but, rather, led me over to the "DIO Port Config" and "DIO Port Write" functions which solved the problem. The "write to digital port" function would have been handy because of the iteration line which can be tied to the looping index to automatically take care of the first time initialization. The "DIO Port ..." vi's don't have this feature. If there were a way to do it with the other functions, I would be interested to learn how. When using the configuration line on those vi's I seem to be able to write to only one port at a time. The writes to the ot
    her port get ignored or even erase the prior writes to that port.
    Thanks again.
    -Tonboy

  • Does Visa have any buffer/memory or similar?

    Hi, I have a comunication with 2 radiomodems
    via RS232 port, and I get data with VISA in my laptop and have a Visual
    Basic program that controls the frames in the other embbedded PC that
    sends me frames of an electronic compass and a GPS. The thing is that
    in the VB application I can see the correct frame of the compass to be
    sent, but the one that I recive in my laptop is not the correct one, in
    fact is the one that was sent 30 secs ago so I can't allow that happen
    and I have no idea what could be the problem cause radiomodems transmit
    correctly and I made another VI program that only reads the frame and
    the same thing happened, so I have the thinking that it can be the VISA
    command that stores the frame or something similar. By the way, the
    compass samples twice per second, and the radiomodem sends that frame
    every 400ms. At the beggining, the compass sampled 8 times per second
    and I thought it could be the problem but it remains altough I changed
    that. What can be happening?
    Thank you

    Sorry, I wanted to say LF not LP. I tried that and didn't do nothing, the same problem. The good new is that I finally found what was the problem. I have to put a delay of 400ms in my VI application and in the VB application. That did that somewhere, the frames were stored. Now I have changed the delay and put the VISA read inside a while with a condition of 400ms of time so now I recive the frames correctly. The problem I have now is that if I stop the VI application but not the VB one, and let the radiomodem send data, when then I run the program, I have a crazy frame showing that had been storing while the VI was stopped, and if that was for a long time, I get an error in VB because it recives a strange frame from my laptop. So, where could frames be storing while my VI application is sttoped???? Do I have to close the VISA port? I tried to do that, closing the serial port every time I sttopped reading and writing, but I only recive strange characters on frames, so it can't be the solution.
    Thanks.
    Mensaje editado por CarlosSp

  • VISA menu can not see in PDA or Touch Panel Module

    I made a project using VISA read&write , but when I build it on PDA device Or Touch panel 2106( pocket pc 5.0) the menu of VISA (ports) doesn't appear
    I use  Dennis Knutson's Vi ==>VISA Resources to String.vi
    but when I download the above vi into PDA or Touch Menu will pop up a error message
    Any help
    Attachments:
    error.jpg ‏40 KB
    VISA Resources to String.vi ‏17 KB

    http://digital.ni.com/public.nsf/allkb/5482EA4D46EC9EB48625728F005095AC?OpenDocument
    http://forums.ni.com/ni/board/message?board.id=170&message.id=241058&requireLogin=False

  • Serial ports not showing up as COMs

    Hi,
    I currently have the problem where my serial ports don't show up as COMs when I use the VISA resource block. Instead they show up as ASRL1::INSTR for port 1 etc. While this still works ok when I select them manually for running some VI's, some executables where I'm prompted to select a COM port, no com ports show up at all. This is strange because previously I used to be able to see serial ports as COM8 instead of ASRL8::INSTR. Device manager from Windows XP says that the ports are working properly and there are no conflicts. Using Hyperterminal to see information from the serial devices works fine. So i'm not sure what is going on.
    One thing I did notice is that in Measurement and Automation Explorer (MAX), three of the ports have the yellow caution sign next to them. One of them is a serial port which says that "VISA port settings are different from the Windows port settings. Go to the Port Settings Conflict tab to resolve the inconsistency." However when trying to resolve this error I cannot save the changes, an unknown error message will come up (maybe because I don't have admin rights on the comp?). The other two ports with the caution sign are Toshiba bluetooth comms. with the device status: "VISA returned this device when finding resources, and MAX could use VISA to parse the resource name. MAX could not succesfully open a VISA session to the device" with no clues on how to fix.
    Has anyone had any experience with these sort of problems and how to resolve them.
    Thanks,
    William

    Hi
    Thanks for the quick replies. The VISA Aliases from MAX seems to be set up properly, just that when I go to select a com port in LabView, they show up as ASRL1:INSTR etc. This isn't such a big problem as selecting ASRL still works ok, just that some executables and VI's i'm trying to run is written so as to scan for the string "COM" while they search for com ports so when that happens I can't run them since there's nothing to select.  I've attached a couple of screenshots of what I see (note that some of the serials ports, the device status says device is working properly, just the ones I took screenshots off, it seems to have an error).
    Attachments:
    VISA select screenshot.JPG ‏55 KB
    MAX com screenshot.JPG ‏64 KB
    MAX ASRL screenshot.JPG ‏63 KB

  • Visa: lack of privileges under WIN XP, Error: 42, Constant0042, VI_ERROR_INV_CONTEXT, 0xBFFF002A

    Hello,
    do someone know how to work with VISA devices as an
    "normal user" (no administrative rights).
    My software works fine with administrative rights under
    Windows XP. But with "normal rights" the VI "VISA Find Resource"
    finds no (zero - nada - nischt) device.
    The error code is "42", the file "visainfo.ini" (LabView6.0.1),
    tells me, that this is the error flag: VI_ERROR_INV_CONTEXT.
    Do someone know how to set the rights properly, so that a normal
    user can run my application?
    For the people with LabView < v7.0 I publish here a screen shot
    of my code to find the local devices.
    Please can me tell someone how to set the rights for VISA instruments
    like COM-Ports?
    Regards,
    Stefan
    Attachments:
    find_com_resources1.vi ‏82 KB
    find_visa1.jpg ‏102 KB

    Hello Benjamin,
    thank you very much for the link!
    This knowledge base article is not easy to find,
    I failed to find it myself, perhaps you can add
    the error-message, that you receive,
    when you get in trouble with visa-ports
    as normal user.
    I received the error code -1073807346.
    Kind regards,
    Stefan
    Attachments:
    not enough rights.jpg ‏16 KB

  • Serial port snooper

    I frequently have to do Serial or VISA comms with devices.
    I would like to know if anyone has any ideas for creating a VI that runs seperate to an existing VISA session which would "snoop" the (serial/GPIB) VISA port and read traffic going to and from the PC Port, without affecting the operation of the port.
    1) Is this possible to do this in LabVIEW - if the Comms to the device is also running in LabVIEW?
    2) Is it possible without extra hardware?
    3) Am I just being a wishful thinker? (it's the Mech Eng talking here)
    (I don't want to have to use any other propreitory S\W, I just want to see the history of the port commands, see the real time commands and possibly log them to a file)
    Cheers
    James

    I don't see why it could not be implemented in LabVIEW.
    If you have access to the original code that communicates over the serial port and you want to "snoop" into..  Then create an ActionEngine.  Call one copy WRITE-COM.vi and the other READ-COM.vi.  Drop it everywhere in the original code where you write to the port and the other everywhere you read and you can log everything that is "attempted" to write and everything that is read in seperate string buffers.  The ActionEngine would of course have two inputs, the state and the string.  You can do whatever you like within the AE, such as display to string indicator or write to file (or both).
    Now the only limitation is that you cannot see what is going over the physical serial cable.  That would be the same limitation from using any software solution.

  • VISA + Stepper Motor

    Hi .
    I'm trying to control a stepper motor with VISA . I have made one diagram to control it " works.png" and it works perfectly but this diagram sends ONE command for ONE execution .
    Commands I need to send are ( with Carriage Return each time ) :
    1) -\r : sets the sense of rotation .
    2) S2000\r ( for exemple) : sets the position needed .
    3) R\r : Moves to the relative previous position "S" .
    I want to do these 3 commands in this order automatically .
    I have already tried to put only one " VISA configuration " and one " VISA close" for the 3 commands but it doesn't work .
    So I have made the diagram " Doesn't work.png" but I don't understand why it doesn't work like the first one. Do you have some ideas ?
    Thank you .
    Attachments:
    Doesn't work.png ‏44 KB
    Works.png ‏20 KB

    Hi bejard,
    two important notes:
    DON'T open and close the VISA port for each single command. You only need to open it once on start of your program and close it once in the end.
    DON'T close the port immediatly after writing a string to the VISA write buffer. Closing the port may also clear the buffer before your command is even sent…
    More notes:
    - Use error wires. Use them in all the places. You will not need the sequence structure anymore…
    - Read about loops and state machines. They come in handy for such tools like yours…
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • PXI-8433 Transmitting Negative Numbers

    I have a serial device to which I am attempting to send negative commands but I am having difficulties.  The device receives positive commands and processes them in a correct fashion but cannot interpret negative commands.  The protocol consists of 5 bytes - one lead character (one byte), one command character (one byte), two bytes for the command payload (data high followed by data low), and a checksum.  The payload requires two's complement and I have this coded.
    Can anyone think of any reasons off the top of his/her head why I might be having these problems? (e.g. big endianness vs. little endianness?)
    Regards,
    Jordan
    Jordan McBain, PhD
    LabVIEW Controls Engineer
    Revolutionary Engineering
    Solved!
    Go to Solution.

    I am certain at this point that the problem is with LabVIEW/PXI.  I can restate the question as follows: If I write a byte of 254 by itself to the serial port, the correct value is written to the serial line (as indicated by Versa-Tap serial spy device from Stratus Engineering).  If I write a U8 array with a value of 254 (FE) in it, the serial spy device indicates that 126 (7E) has been written to it.
    This irregular behaviour only happens when I write a value over 127 as an element of an array to the VISA port.  I am not sure how I could write one byte at a time to my device and have it accept it but I am looking into it right now.
    BTW: I am using LabVIEW 2009 SP1.
    Jordan McBain, PhD
    LabVIEW Controls Engineer
    Revolutionary Engineering

Maybe you are looking for

  • How can I get my voicemails that I receive as a .wav attachment through email to play?

    My office sends my voicemails to my email as a .wav attachment.  Until a couple of weeks ago, they played just fine, but now, when I tap the attachment, the media player (QuickTime) will open up, then close without playing.  Help is appreciated!! 

  • Excise Tax Codes (Purchase/sales for 2nd stage dealers in trading company

    Hi, I have come across the similar problem mentioned below (the post is from SDN itself from Mr. Sandeep) what i understand is 2. when you purchase a material from dealer Manufacturer to dealer item cost 100 + 20 Excise Dealer to you client 120+20 Ex

  • Selecting only one row from a query

    Hi, I am using database version 10.2.0.4.0 I have 2 tables: artist(artistid, artistname, titleid) trans(transid, datesold, salesprice, titleid, artistid) This is what i used and got the below results. SELECT max(worksold) AS mostworksold FROM ( SELEC

  • Best place in publishServiceProvider to create collection sets on the server?

    I'm developing a LR publishing plugin that talks to a custom-built back-end.  Collections on the server are created as needed within the publishServiceProvider.processRenderedPhotos function, which is working fine. Looking towards supporting collecti

  • Problem when trying to open excel

    Hi , This is my procedure Procedure P_1_Open_Excel is OBJ_HND OLE2.OBJ_TYPE; AppID PLS_INTEGER; ConvID PLS_INTEGER; V_File_Name VarChar2(500) := 'Problem_In_Open_Excel'; Begin      Obj_hnd := OLE2.Create_obj ('Excel.Application'); ConvID := DDE.INITI