Testing an instrument handle

Labview 8.0, TestStand 3.5,
Is it possible to test an instrument handle in Labview to see if it is valid and not generate any kind of error if it isnt?
I want to close an instrument handle if it exists. This will generate a run-time error if the handle does not exist.

Hello tadk,
You can run VISA Find Resources and look at the resulting list of interfaces.  You can use this list to verify of an interface is valid.  If I specific error is being generated, you can create a sub-vi to clear that error, and thus ignore that particular error.
I am not sure what your end goal is, but there is another discussion forum that discusses getting a Session ID by using a Call Library Function Node.  You might want to check this forum out.
I hope this helps!
Regards,
Angela
Applications Engineer

Similar Messages

  • What is the best way to open close and pass instrument handles from labview in teststand parallel model?

    I have a number of test systems that use a parallel model with labview. We have a good number of instruments(PXI).
    What is the prefered method for open,closing and passing instrument handles in teststand using labview? 
    Solved!
    Go to Solution.

    Hi,
    No, Below is a bit from the Session Manager Help
    Currently, Session Manager supports the following instrument session types:
    IVI Sessions—Use an IVI session to obtain the C-based instance handle for an IVI logical or virtual instrument name. NI Session Manager does not support IVI-COM drivers at this time. When IVI-COM drivers are available, you can use an IVI session to obtain an ActiveX interface reference to an IVI-COM driver.
    VXIplug&play Sessions—Use a VXIplug&play session to obtain a C-based instance handle for a VXIplug&play logical or virtual instrument name. Configure VXIplug&play names in the <VXIplug&play directory>\<Platform directory>\NISessionMgr.ini file.
    VISA Sessions—Use a VISA instrument session to obtain a C-based viSession handle to a VISA resource or logical name. Configure VISA logical names in the <VXIplug&play directory>\<Platform directory>\NISessionMgr.ini file.
    Custom Sessions—Use a custom session to create a data container object that shares ActiveX objects you create or other data between software components you write. Use the Attach and Get methods to attach data to and retrieve data from a session. A custom session does not initialize, close, or own an instrument handle. The data you share with a custom session does not have to be instrumentation related. You can create a custom session with any name you request.
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • Save in a variable an instrument handle out

    Hello,
    I wanna create a sequence in teststand using labview step. the problem is the VI of my labview step has a function with instrument handle in and instrument handle out. How can I store those instrument handle out in a variable to be able to use that variable as the input of an instrument handle in in another VI and if it's possible wich kind of variable should i use in both labView and teststand.
    Thanks in advance for your answer
    Christelle

    You can use the Session Manager. There's an example (in 3.1 anyway), in the SessionMgr\Lv\LVDMM.seq.

  • Instrument Handle Out as Global variable

    Hi,
    How do i create "Instrument Handle Out" of an IVI function as a global variable.
    Regards,
    Siddu

    I don't work with IVI, but this should work - Open the globals VI and add an IVI Logical Name control (I/O palette).
    As a more generic solution, right click the output terminal and select Create>>Control. Find the control on the FP, copy it (ctrl+c) and paste it into your globals VI. In either case, it should now be a global variable.
    You should take care when working with globals, because you can cause race conditions - for example, you probably have to open communication to your device and pass the value of the reference into the global before being able to use it. If you don't, you may start having problems, and it will be hard to locate them.
    Try to take over the world!

  • Get ivi instrument handle from NISE Session

    In TestStand I begin my sequence with an niSE Open Session.vi and I then pass this NISE session reference around to other VI which use the niSE Connect and Disconnect VI's to connect/disconnect routes specified in MAX.  This works perfectly for me.  How do I convert this NISE session reference into an instrument handle for specific IVI devices in this NISE Session?  I want to be able to use the "ni Switch Get Relay Position.vi".  I tried using the "ni Get IVI device session.vi" but i get an error that says VI was stopped at IUseDCO.  What does this mean?  Is it possible to do what I'm asking?
    Thanks
    I'm using TestStand 3.5 and Labview 8.2
    Attachments:
    error.JPG ‏25 KB

    Hi Chad,
    The problem with the find route.vi is it just tells me if the path is available or not.  It doesn’t tell me what state the relay is in.  When using SPDT relays this is a problem.
    I’m using a 2570 card set for SPDT operation.  So if I do a find route after a reset on “Com->NO” and “Com->NC” both return path available.  I understand this because I have not made a connection call to either one.  If I make a call to connect “Com->NC” the relay changes states.   The connection then returns a path exists.  My problem comes when it comes time to disconnect.  Since it is a SPDT I have to first disconnect “Com->NC” then make a call to connect “Com->NO” (which is very annoying).  If someone just calls disconnect and I try to read the path availability both return path available again and the relay has changed state.  How do I know for sure which pole the common is connected to?
    If I open Switch Soft Front Panel it shows exactly what position the relay is in.  How do I get this info to labview?  This is why I was trying to get the instrument handle to the underlying IVI session so that I can look at individual relays instead of paths between endpoints.
    I hope this makes sense.  I know I can’t be the first one to have this problem, so if anyone has another solution I would appreciate any help.
    Thanks    

  • C++ instrument Handle type

    hi, ALL
       I want to use some instrument driver(DLL) to create a sequence.and step type base on C++,When initialized instrument with hp34970a_init("GPIB0::5::INSTR", False, True, Locals.SW) ,the prototype is
    ViStatus _VI_FUNC hp34970a_init(
            ViRsrc resourceName,
            ViBoolean IDQuery,
            ViBoolean resetDevice,
            ViPSession instrumentHandle)
       it works fine,So i want to more operations for intrument,Such as :write,read....
       the arg4 (Locals.SW)is defined as "pointer/handle" -->"by reference &" in the module pane.And Locals.SW is defined as a object reference in Variable pane.After the initialized function is executed,The Locals.SW will be evaluated "Pointer: 0x1fa4f908".So in the next step,I want to use this instrument handle to execute other functions(invoke some functions in the DLL).Example:hp34970a_reset(Locals.SW),the prototype is
    ViStatus _VI_FUNC hp34970a_reset(
            ViSession instrumentHandle)
       it seems not to work.
       How to fix it? Thanks a lot.
    BR
    Johnny

    Using object references (i.e. pointers) is more future proof for 64-bit compatibility. This idea is that on a 64-bit version of TestStand (which does not yet exist) with a 64-bit version of your instrument drivers, the pointers/handles would automatically be treated as 64-bit values, which is what they will have to be if they are addresses in a 64-bit process. This feature of pointers/handles was added in TestStand 2010 for this purpose.
    That said some instrument drivers might continue to use 32-bit values even in a 64-bit process, but if the handles are really addresses they would have to create some sort of map internally to map to the 32-bit value to the correct 64-bit address. You might be able to tell what the driver developer intends by looking at the typedef for the handle type. If it is really a void* or some other sort of pointer then it is very likely that the 64-bit version will require 64-bit handles and thus you should use object references. If it is just a typedef of int, then they might not.
    For Windows SDK APIs handles definitely become 64-bit in a 64-bit process (and are 32-bit in a 32-bit process), so for Windows SDK calls with handles, object reference variables are definitely better than numbers for handles.
    So it really depends on how instrument driver developers end up supporting 64-bit processes.
    Hope this helps explain things,
    -Doug

  • IVI instrument handle data type and palette?

    Hi Folks,
      I'm programming a LabVIEW VI that uses the NI-Scope VIs to talk to a USB-5133. Everything seems to work well, but after calling NI-SCOPE Initialize, I have an 'insturment handle' that needs to be routed to all other NI-SCOPE calls. I'd like to bundle the 'instrument handle' into a cluster to reduce the number of shift registers in the VI, rather than route the handle through its own shift register and as a separate wire everywhere. Can you tell me the data type of 'instrument handle', and where in the palettes to find one, so I can drop it into a cluster?
    Thanks! 

    Hey rogersct,
    The data type for this instrument handle would be an "IVI session of class niScope".  The easiest way to place a constant of this type on your block diagram would be to right-click on the instrument handle output terminal of niScope Initialize.vi and select Create >> Constant.  This should give you a constant of the appropriate data type that you can use to initialize your cluster.
    You can also create a IVI session control from the front panel under I/O >> IVI Logical Name.  You would then need to right-click on the control and select: Select IVI Class >> IviScope >> niScope.  I always use the first method however as it is the quickest.  This should be what you need but if you have any questions please don't hesitate to ask.  Thanks for posting and have a great day!
    -John 
    John Passiak

  • VISA session to an instrument handle

    I tried to aquire data from TEKTDS 220. I use "set condition" to "aqu
    status",
    then "read waveform" subVIs. So there is a problem: I need to connect the
    "VISA
    session" to "instrument handle", but it doesn't work. Could you please tell
    me
    how to connect these two type of wires?
    Thanks a lot!

    It looks like you're trying to mix the tktds2x0 IVI driver with the tktds2xx LabVIEW native driver. The IVI driver has an "instrument handle" which is an IVI session, and the LabVIEW driver has a "VISA session". The two wires are not compatible. You should either use just the IVI driver or just the LabVIEW driver.

  • Siebel Testing. Cookie handling, cookie load balancing and authentication.

    We are delivering a PoC in a big Siebel customer and we are finding some issues.
    Environment information is:
    - Siebel testing, version 8.
    - NTLM Windows authentication.
         When we create a Siebel Load script, recording works fine. Replaying the script, after adding the Authentication function, does not work
         When we create a Web Load Script with the same structure and business process, after adding the Authentication function, it works.
         Looking at the difference between Web and Siebel scripts, only difference are a couple of cookies that Web script considers and Siebel does not. This two cookies are added in the second call of the NTLM handshake requests (two requests with 401 http code and a final with a 200 http code). The application, in the first NTLM handshake request, ask the browser to add a couple of cookies that the browser (and OLT in a web load script) add. Siebel load script does not add/handle this cookies.
         Accordingly, the script works with web module but does not work with Siebel module.
    Right now we only have two options to make Siebel work:
    - Change the DNS address to point to a single node for the application, instead of pointing to the load balancing service. This way, cookies are not needed and the script does not fail.
    - Add the cookies by hand. This way, cookie content is "hardcoded" and, so, it will not be useful for load balancing purposes, which lead us to previous bullet. Load testing using Siebel will not work load balanced.
    I added a web script (works fine with no tweaking) and a Siebel script executed with normal configuration (does not work) and workaround (avoiding the load balancing cookies- it works).
    Many thanks for the help,
    Iván.
    IM_Siebel_Second_Test.zip
    Siebel web test.zip
    Edited by: user9982485 on 03-Aug-2010 09:18

    Álex,
    Thank you a lot, I will call you related to other issue also. Thanks for the kind help!.
    IMHO, it works or not depending on cookies added for load balancing. Siebel module does not specifically add these cookies, while web module does. If you delete the cookies from the web module, it stops working, so I guess the cookies are making/breaking the script.
    I will send you the scripts, so you can have a look.
    Thanks,
    Iván.

  • Multi DUT test with shared instrument​s

    Hello,
    I have a 6 DUT Testand application, using parallel model. All the measurement equipment in shared by each test instance.
    I'm using VISA functions, to initialize and perform measurements.
    For a single DUT application with sequential model, I would perform instrument initialization in PreUUT section. Following initialization I would get an instrument handle, that I'll use in subsequent operations with that instrument.
    Using parallel model, I have a PreUUT section for each test socket, so the instrument initialization is done for each socket - 6 times in my case. For each test socket I will get one instrument handle, so in all I have 6 instruments handles referring to same instrument.
    One problem that I have is that one instrument takes about 30 seconds to initialize, so initializing 6 times will take 3 minutes wait just to get the complete front panel.
    My question is if there is another way of doing instrument initialization - so instrument would be intialized only once, and than share the instrument handle between al 6 test instances ? Instrument access is controled by lock, unlock functions.
    Any advice would be highly appreciated,
    Best Regards

    The simplest way would be to create a sequence file global with the handle.  All of the testsocket executions will be able to access the file globals.
    I tested this out and you do have to set one thing on your sequence file to get all testsocket and you process setup callback to share the same file global...  Follow this:
    http://digital.ni.com/public.nsf/allkb/21368C716B0​6780A86256A5C007075DB
    Another option is the queue step type of the synchronization steps will allow you to pass data between executions.  You could also create a queue in the process setup with the handle, get the handle from the queue without dequeing it where ever you need it, and then close the queue in the process cleanup callback.
    Message Edited by paulmw on 08-10-2007 09:40 AM

  • TEST IN PROGRESS! THE ZEN VS IPOD SO

    My wife just brought an 4th gen 20gb Ipod ( I have the zen touch) and we will preform a taste test if you will on the both of them. We will download 4 genes of songs( r/b , house, rock, celtic) at the same bit rate(same songs) and will play them at the mid -high volume rang at different eq setting for each person blindly and we'll find out just which is better in sound tonight , or if there is really no difference to be heard. I'll Post the results before 0:30pm tonight. So keep watch.

    Ok people we used 4 songs...()Enya's Carribean Blue(celtic vocal settings on "Acoustic" for the zen and "Acoustic" for the Ipod, both set to 28kdps,44khz volumes set 8 clicks for the highest level. Results in clarity = Zen touch clearly better ..my wife and I both knew which was better within 0 seconds of start up time on complete test cycle. The Ipod has good sound BUT it sounds like it trying to play under a small layer of water that drowns out the sound a LITTLE. I guess this is thanks to the 97 s/n ratio which some people say you can't hear with your human ear. I guess we have super ears then, because we did.
    (2). 2nd test song ...r/b Mariah Carey "Close My Eyes"(using "pop" settings on the zen touch and "R/B"/and 2nd time with "pop" settings trying to be fair)to test the music-to-vocal sound ratio ( seeing if bass or instruments would drown out the vocal beauty ). Again the Clarity of the Zen touch won over again, clearly. It's bass was not as strong as the Ipod's but was clearer. The Ipod bass sounded like it was adding to the drowning sound that I mention above.
    (3). 3rd test was Dieselboy jungle mix w/dj jerome,dj dara, and grooverider. We wanted to test which could handle HARDER bass without distortion. The Ipod was the winner on that test. It seemed the harder the bass demands were for the song, on the eq setting for "disco" for the zen ...the worse it got, basically too much( maybe placed on another setting it would have preformed better but I had to place it on the heaviest bass setting as I did with the Ipod to keep it fair). Where the Ipod was set on "Bass Boost" and still left some clarity in place.
    (4). And Finally Rap. We used David Banner's "See About Ya". Both unit keep there orginall setting, even though we could have changed the Ipod's setting thanks to their many Eq setting. And both came back kinda equal except for the cleaner bass that the Ipod projected under high bass demanding setting and songs.
    ZENT=2
    Ipod=2
    Bottom Line
    ***If you don't have both you wouldn't be disappointed in either one. Both by themselves are good sounding machines. It's only when you put them against each other will you ever notice a difference and that difference equals to clarity sound for Vocals for zen and Bass distortion handling for the Ipod(or basically higher volume handling). Hope this helps clear up any questions on the two units.

  • Initialize visa to use for all tests

    Does anyone know how to initialize VISA to use for all tests then close it at the end of the last test?
    Example:
    The test sequence starts with initialize instruments then testing starts until the last test is to close all instrument handles.
    Thanks in advance.

    Is this a LabVIEW question or a TestStand question?  It actually does make a difference in my answer.
    If you are strictly only in LabVIEW, then you just pass your reference wires around where they are needed.
    What I like to do for TestStand is make an Action Engine to control my reference to an instrument session.  This method also works well with strictly LabVIEW as well.  But is overkill for somewhat simple applications.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Unit Testing

    Hi All,
    I would like to inform to all, can any one explain to me the concept of Unit testing in FICO and how it should be drawn? If possible send any dcoumentation for this focus to my mail id: [email protected]
    Thanks with regards,
    Bala

    Hi
    refer below reward if helps
    Unit testing is done in bit and pieces. Like e.g. in SD standard order cycle; we do have 1-create order, then 2-delivery, then 3-transfer order, then 4-PGI and then 5-Invoice.  So we will be testing 1,2,3,4 and 5 seperately alone one by one using test cases and test data. We will not be looking and checking/testing any integration between order and delivery; delivery and TO; TO and PGI and then invoice.
    Whrereas System testing you will be testing the full cycle with it's integration, and you will be testing using test cases which give a full cyclic test from order to invoice.
    Security testing you will be testing different roles and functionalities and will check and signoff.
    Performance testing is refered to as how much time / second will take to perform some actions, like e.g. PGI.  If BPP defination says 5 seconds for PGI then it should be 5 and not 6 second.  Usually it is done using software.
    Regression testing is reffered to a test which verfies that some new configuration doesnot adversly impact existing functionality.  This will be done on each phase of testing.
    User Acceptance Testing:  Refers to Customer testing. The UAT will be performed through the execution of predefined business scenarios, which combine various business processes. The user test model is comprised of a sub-set of system integration test cases.
    We use different software during testing. Most commonly use are
    Test Director:  which is used to record requirement, preparing test plan and then recording the progress.  We will be incorporating defects that are coming during these testings using different test cases.
    Mercury Load Runner:  is used for performance testing.  This is an automatic tool.
    What does the following terms means :
    - Technical Unit Testing
    - Functional Unit Testing
    - IntegrationTesting
    - Volume Testing
    - Parallel Testing?
    Technical Unit Testing= Test of some technical development such as a user exit, custom program, or interface. the test usually consists of a test data set that is processed according to the new program.  A successful test only proves the developed code works and that it performed the process as as designed.
    Functional Unit Testing= Test of configuration, system settings or a custom development (it may follow the technical unit testing) These usually use actual data or data that is masked but essentially the same as a real data set. A successful test shows that the development or configuration works as designed and the data is accurate as a result.
    IntegrationTesting= Testing a process, development or configuration within the context of any other functions that the process, development or functionality will touch or integrate . The test should examine all data involved across all modules and any data indirectly affected. A successful test indicates that the processes work as designed and integrate with other functions without causing any problems in any integrated areas.
    Volume Testing= testing a full data set that is either actual or masked to insure that the entire volume does cause system problems such as network transmission problems, system resources issues, or any systemic problem, A successful test indicates that the processes will not slow or crash the system due to a full data set being utilized.
    Parallel Testing= Testing the new system or processes with a complete data set while running the same processes in the legacy system. A successful test will show identical results when both the legacy system and new system results are compared.
    I would also note that when a new implementation is being done you will want to conduct at least one cut over test from the old system to the new and you should probably do several.
    What kind of testings that are carried out in testing server?
    1. Individual Testing ( Individually which we've created)
    2. Regressive Testing ( Entire Process)
    3. Integration Testing ( Along with other integrated modules)
    The 3 types of testing is as follows:-
    1. Unit testing (where an individual process relevant to a SD or MM etc is tested)
    2. Integration testing (where a process is tested that cuts across all areas of SAP).
    3. Stress testing (where lots of transactions are run to see if the system can handle the data)
    http://www50.sap.com/businessmaps/6D1236712F84462F941FDE131A66126C.htm
    Unit test issues
    The unit tools test all SAP development work that handles business object processing for the connector. Also, the unit test tools enable you to test the interaction of your work with the ABAP components of the connector. The test tools allow you to test your development work as an online user (real-time) only.
    Note:
    It is important to understand the differences between testing the connector as an online user and testing the connector as if operating as a background user.
    The differences between testing the connector as an online user or as a background user are described as follows:
    Memory--When testing a business object, the connector must log into the SAP application.
          The connector runs as a background user, so it processes in a single memory space that is never implicitly refreshed until the connector is stopped and then restarted (therefore it is critical in business object development to clear memory after processing is complete). Since you are an online user, memory is typically refreshed after each transaction you execute.
          For more information, see Developing business objects for the ABAP Extension Module. Any problems that may occur because of this (for example, return codes never being initialized) are not detected using the test tool; only testing with the connector will reveal these issues.
    Screen flow behavior--Screen flow behavior is relevant only when using the Call Transaction API. The precise screen and sequence of screens that a user interacts with is usually determined at runtime by the transaction's code. For example, if a user chooses to extend a material master record to include a sales view by checking the Sales view check box, SAP queries the user for the specific Sales Organization information by presenting an additional input field. In this way, the transaction source code at runtime determines the specific screen and its requirements based on the data input by the user. While the test tool does handle this type of test scenario, there is a related scenario that the test tool cannot handle.
          SAP's transaction code may present different screens to online users versus background users (usually for usability versus performance). The test tool only operates as an online user. The connector only operates as a background user. Despite this difference, unit testing should get through most of the testing situations.

  • I get an error when I use the instrument driver KE230x.

    Good day.  I am using the ke230x instrument driver connected to a Keithley 2306-PJ.  I am using the USB to GPIB to communicate with the instrument
    I load the Getting Started VI and when I hit run I get the following error message
    ====================================================================
    Error - 1074003951 occured at ke230x Initialize With Options.vi
    Possible reason(s):
    Driver Status:  (Hex 0xBFFC0011) Primary Error: (Hex 0xBFFC0011) Identification query failed.
    Elaboration: Failed to Recognize Model
    =====================================================================
    When I place the "id query" switch into the false position, everything appears to be working.  I have left the "reset device" in the true position and I see the instrument resetting.
    I do not understand what is happening?
    Thank you for your time and help.

    Good day.  Dennis - thank you for your response.  My next question is if I leave the ID Query off (false) position, I still cannot get the program to work. 
    My guess is that I am doing something wrong (I am relatively new to LabView).  I use the Getting Started vi and everything looks to be working okay.  I then start the Application Example (I run the Getting Started vi before I run the Application Example to make sure that the Application Example has the correct instrument handle).  When I run the Application Example I get the following error message
    Error -1074130544 occurred at ke230x Configure Current Limit.vi
    Possible reason(s):
    Driver Status:  (Hex 0xBFFA1190) The session handle is not valid.
    Any help or advice would be greatly appreciated.
    Michael

  • Event handling in UWL

    Hi all,
    I'm having problems on calling a function in a workitem.
    The function i'm calling have:
    Export:
    RETURN_CODE     LIKE     SY-SUBRC
    Tables:
    EVENT_CONTAINER     LIKE     SWCONT
    with the column VALUE where is the error description.
    so i looked on <a href="https://media.sdn.sap.com/javadocs/NW04s/SPS8/uw/com/sap/netweaver/bc/uwl/config/doc-files/ActionHandlers.html#FunctionModuleActionHandler">Universal Worklist - Action Handlers</a> where they recomend to use UWL_RETURN_TABLE and UWL_RETURN_TABLE_PARAMETER in case of not having a table MESSAGE_LINES.
    I did that, but seems that is not working, since i force to get an error and none is showed. If i try for example the SAP_WAPI_CREATE_EVENT it works, and i get the errors.
    So what could be wrong on my code?
    Here's my code:
    [code]
    <Action name="Test" groupAction="yes" handler="FunctionModuleActionHandler">
                   <Properties>
                        <Property name="FunctionModule" value="ZWKFRH_PRH_CREATE_EVENT"/>
                        <Property name="WORKITEM" value="${item.externalId}"/>
                       <Property name="EVENTID" value="07"/>
                        <!-- special return parameters -->
                       <Property name="UWL_RETURN_CODE" value="RETURN_CODE"/>
                        <Property name="UWL_RETURN_TABLE" value="EVENT_CONTAINER"/>
                        <Property name="UWL_RETURN_TABLE_PARAMETER" value="VALUE"/>
                   </Properties>
              <Descriptions default="Test"/>
            </Action>
    [/code]
    Thanks in advanced for any answer,
    Luis Cruz

    Restart solved the problem.

Maybe you are looking for

  • I can't sign in to my computer with my apple id....

    Im trying to sign in to my apple ID on my mac book air but i cant and i cant upgrade to os 10.... what shall i do. Going crazy on this ****! Almost regret bying this advanced ****....

  • Can the current line be highlighted using a background color or have the cursor flash?

    I use the split screen and left click in the Design pane to jump to where I want to be in the Code pane in Dreamweaver CS6. The problem is that it can be very hard to tell where the cursor is in the Code pane since the cursor doesn't flash. Is there

  • How to make the border of a linked pciture go away in IE(8)

    picture A links to picture B. A blue border around picture A appears and when I clicked picture A which now links and displays pictures B, but after going back to the page that contains picture A, there is a purple color border appears on picture A i

  • Disk Image/CD-R Confusion

    I'm trying to figure out how to do one simple thing, or at least I hope it's more simple than what I know so far. I want to burn a copy of my Quicken data file to the same CD-R two or three times a month as backup. I've created a disk image of the fo

  • Duplicate Pannning With Mouse Wheel Down + Mouse Move to Pan Vision Image

    I am trying to duplicate an image panning operation using the middle mouse scroll wheel depressed while moving the mouse. Code is pretty simple, but pan occurs in opposite direction of normal pan and opposite to direction of mouse.  I have tried a nu