Using Timer functions in parallel with VISA functions

I have an application using two VISA sessions operating
in parallel controlling a LeCroy oscilloscope and a Pacific
Power Source through GPIB.
In a sub-VI, I setup the scope and put it in single acquistion
mode. Then, in the top level VI, I am reading a global variable
that detects when the scope is armed - when this flag is set, I am
using the second VISA session to control the power to the circuit
under test.
I have a while loop with a small delay (100ms) to poll the
global variable, (I also use the global value to exit the loop.)
This technique does work, although there is a 10 second delay
between the time the scope is armed for acquisition and the time
the command is recieved to turn on th
e power source.
If I take the Wait(mS) function out of the while loop, the command is
sent immediately following when the scope is armed, with no delay,
and even though I don't seem to be missing the trigger, I would prefer
just a small delay, to ensure that the scope is ready every time. Also,
from what I've read, it's not good practice to run loops without even
some small delay.
Is there a better approach to this? I hope I have expained the
problem sufficiently - any help or insight would be appreciated.
thanks,
Mike Selecky

I understand the structure you're talking about, but I don't understand why they have to be in seperate loops. The flag from the scope (actually the error cluster output from the scope command function) is the data that establishes the sequentiality between the two steps. If errors are handled properly in the scope and power supply subVIs all you have to do is string the teo routines together using the error clusters and you're done.
What you want in the subVIs is to create them such that the first time they run they initialize the VISA session and store the reference to it in an uninitialized shift register. Every time after that (or until an error is detected after the command operation) the part of the code that reads or writes the instrum
ent uses the cached reference. To allow the code to stop cleanly, you might also want to include a front panel control that tells the subVI that the system is shutting down and to close the VISA session when it's done with it.
Errors propegated into a subVI containing VISA calls will essentially bypass those calls as long as all the error clusters are connected together. What actually happens is that the low-level functions abort as soon as they see the error input and simply pass the error in to their error output.
Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

Similar Messages

  • How to use Time Capsule via INTERNET WITH WINDOWS 7 SMB Cloud

    how to use Time Capsule via INTERNET WITH WINDOWS 7 SMB Cloud

    Get a vpn router.. I have no idea where you are in the world but you can find reasonable stuff for not too much money or even a general router that takes third party firmware like dd-wrt can run openvpn. 
    Set up the vpn router in place of the TC, as the main router in the network. Simply bridge the TC and place it behind the router. It will be accessible as part of the network via the vpn.
    This is the only safe way to do it via windows.
    http://www.dyncommunity.com/questions/18132/accessing-time-capsule-from-windows- 7-over-the-int.html
    If you google around I have seen posts about how to access TC by port forwarding SMB on the TC.. using a different port.. To me this is going to slow down the hackers by a day or two.. then they will discover the open port and access your network.. not just the TC.. they now have SMB access to everything. Don't do it. There is very little security on SMB.

  • Play sound in specified duration and desired file when reading data with VISA functions ?

    Hi.
    I read data with VISA read function and then I use functions like multiple for showing data on Chart. every thing is OK.
    now I want play a specified sound (like a 3s song in my desired folder) when signal amplitude cross over from specified value. then after desired time, it will be wait for new cross over from specified value and this procedure repeat again until I stop the program. 
    Data comes from MCU and it doesn't stop when system play sound and when system play sound, incoming data for this part (play sound) will be ignore them until specified expired.
    I use this VI for reading data and mentioned part which is sound part is empty and I don't know what I must done ?
    altougth I use another while loop for sound apart because I want save CPU time.
    Thanks.
    Solved!
    Go to Solution.

    I would recommend making the data type of the notifier a cluster that contains a path and a numeric (double).  The path tells the player which file to play.  The numeric is the duration.
    Now for a slightly complicated, but really neat, way to stop your second loop.  Do not use a second notifier.  Instead, send the normal notification but use Not A Path for the path in the cluster.  Your second loop can do a check for the Not A Path and stop when that is recieved.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • I don't use Photoshop - looking for software with similar functionality to Photoshop's Pixelbender / Oil Painting.  Any suggestions?

    I don't use Photoshop, I'm an Aperture guy.
    I'm looking for software with similar functionality to Photoshop's Pixelbender / Oil Painting. 
    I'm especially interested in the bending of the pixels, along the lines of impressionist paintings - think van Gogh.
    Any suggestions?

    If you are interested in computer simulated drawing and painting effects, have a look at the "ToonIt!" plug-in for Aperture. This will do some of the basic work for you, but you will have to do quite a lot of editing afterwards, to turn the image into a piece of art.
    It might be easier, to do most of the drwing and painting yourself in the first place - ArtRage Deluxe is very versatile, if you have a large trackpad and pen.
    For example: Applying a light ToonIt! effect "Impressionist2": The diagonal
    cross-pattern is due to "Demo" mode - I have not yet bought the plug-in - it is rather expensive:
    The original:

  • Function Module Extractor with Delta Functionality

    Hi Friends,
         I have to extract the entire data of CDPOS table in R/3 , as its a cluster table I am unable to build a view, I am planning to go for FM extraction, Could someone help me as how to build it with Delta Functionality.
    I think I need to develop the Datasource, with Extract Structure,( Do I need to create a Structure in SE11)  Please help me out .
    Thanks,
    Krish

    Hi,
    you can either use an existing structure or else create one on your own. (SE11).
    The DeltaHandlig fairly easy.
    When having finished the extractor (FunctionModule, Structur and DatasSource), go to the "generic Delta" button and select the relevant field.
    The Generic Delta and its DeltaPointer is managed within the DeltaQueue (RSA7) and works more or less like a selection. Don't think too hard about it in your function module except taht you need to select by this field in your FM.
    Did that come clear?
    hth
    Cheers
    Sven

  • How do I use time machine back up with airport extreme

    I want to use my airport extreme to back up with time machine, I am not that good with computers, so could some one please explain to me how to do this.
    Thanks
    Ben

    Unfortunately, Apple does not support Time Machine backups to a hard drive at the USB port of the AirPort Extreme due to corruption issues.
    Despite this, some users who have tried this have success with this, some limited success and some no success.
    Our recommendation would be to connect the hard drive directly to your computer and use Time Machine that way.
    To do this, you would need to make sure that the hard drive is formatted in Mac OS Extended (Journaled), or buy a hard drive that has been pre-formatted for Mac. Then connect the drive to the USB port on the Mac.
    After that, you would open System Preferences (gear icon on the dock), then open Time Machine to turn it ON, click Select Disk to select your hard drive and then click Use For Backup. That will get Time Machine backups going.

  • The problem of using timer in long windows with scroll bar

    Hello everybody!
    There is a problem of using timer in windows with scrolling. Lies in the fact that at the moment of the trigger "when-timer-expired", is "jumping" on the active field in the form (where the cursor). If the user scrolls at this moment unscrewed to view another location below, or higher, then it will then "jump" from the viewing area.
    I tried to fix the problem by replacing the timer in Forms, a timer in the JavaBean.
    It did not help. At the moment of the trigger WHEN-CUSTOM-ITEM-EVENT of JavaBean, anyway there is a jump.
    I have not a few forms, but only one form. With one long window.
    I use Oracle Forms 10.1.2.3.
    The forum discussing this problem. But it has not been resolved, I think. It is also proposed to destroy and recreate the timer at the transition between the forms. But the form I have just one!
    Has anyone encountered this problem? What are the solutions?

    CraigB wrote:
    Could you explain the overall affect you are going for? Perhaps if we knew what you were trying to achieve we could offer potential solutions that don't involve using a Timer or perhaps a differnt way to use the Timer.
    Craig...No.
    In different tasks, different purpose of timer. Can I use the timer without jumps?

  • HT4818 Can you use both Bootcamp and Parallels with the same Windows 7 installed

    I have Parallels installed with Windows 7.  Can I use both Bootcamp and Parallels on the same machine depending on whether I just want to work in Windows all day (Bootcamp) or alternate during the same session (Parallels)?

    You can, yes. But there is a complication: once you activate windows it will only be activated for one of the two methods you use. So, let's say you install into boot camp and activate windows. You can then install Parallels and it will find your boot camp installation, but when running in Parallels, Windows will report that it is not activated. Or, you can activate it in Parallels and when running in Boot Camp Windows will report that it is not activated. The reason for this is because Windows thinks it is running on different computers depending on how you boot it. This may not be an issue for you if you run Windows a lot one way and just occasionally the other way, so be sure to activate Windows in whichever method you use more often. Hope this helps!

  • Labview Executable with VISA functions in Run Time Engine

    Hi Everybody
    I designed a gui to communicate using VISA GPIB. I created an executable for the gui. I also installed LabView Run Time Engine on the desired machine. I recieved couple of errors, for which I copied the files visa32.dll, NIVISV32.dll and serpdrv to the folder with the executable.
    I recieved the following error, ' Initialization of NIVISV32.dll failed. The process interminating abnormally.'
    Are there any drivers I should install in addition to the Run Time Engine? If so, where can I find these drivers?
    Thank you
    Jackie

    I installed NI-VISA with similar version as my development installation, and LV runtime engine. Labview still crashed.
    I noticed certain library functions in full labview that is not present in the NI-VISA + LV run time directory, such as _visa.llb etc.
    Do I need to copy these additional library functions too? Will Run Time Engine read these library functions?

  • Parallel  piplelined function not parallelizing with ref cursor

    RDBMS 11.2.0.3
    I have a function with the following signature
    function to_file (
      p_source     in  sys_refcursor
    , p_file_name  in  varchar2
    , p_directory  in  varchar2 default 'DD_DUMP'
    return dd_dump_ntt
    pipelined
    parallel_enable ( partition p_source by any )
    authid current_user;The function works in parallel when I use a cursor expression like this
    begin
      for rec in ( select *
                   from table(dd_dump.to_file( cursor(select /*+ parallel(i 4) */ c1||chr(9)||c2 from mytable i), 'f.out' ))
      loop
        dbms_output.put_line(rec.file_name || chr(9) || rec.num_records );
      end loop;
    end;
    f.out_162     276234
    f.out_213     280399
    f.out_230     286834
    f.out_70     289549But when I use a refcursor, it does not run in parallel
    declare
      rc sys_refcursor;
    begin
      open rc for 'select /*+ parallel(i 4) */ c1||chr(9)||c2 from mytable i';
      for rec in ( select *
                   from table(dd_dump.to_file( rc, 'f.out' ))
      loop
        dbms_output.put_line(rec.file_name || chr(9) || rec.num_records );
      end loop;
    end;
    f.out_914     1133016Is this an expected behavior or am I doing something wrong? How can I use the function when the client returns the SQL statement as a character string
    Edited by: Sanjeev Chauhan on Mar 9, 2012 11:54 AM

    Sanjeev Chauhan wrote:
    I am not performing any DML in the pipelined function. If you read the note carefuly it shows parallel_enable works only when you use:
    table(table_function(<font color=red>CURSOR</font>(select...)))and not when you use
    table(table_function(<font color=red>ref-cursor-name</font>))SY.

  • TABLE  FUNCTION OR CAST WITH TABLE FUNCTION

    Consider following scenario:
    I've a function which returns nested table of employees.
    I am calling this function in some other procedure and building a query dynamically.
    Sample code looks like
    CREATE OR REPLACE  PROCEDURE TEST_PROC( P_EMP_ID   IN   NUMBER,
                                            O_EMP_LIST OUT  SYS_REFCURSOR) IS
    v_tbl_emp_id       tbl_emp_id;
    begin
    v_tbl_emp_id :=  fn_get_usr_list (P_EMP_ID);--fetches employee id  reporting to given emp id
    v_select_clause :=
             'SELECT EMP_NO,EMP_NAME,DEPT_NO';
    v_from_clause := ' FROM EMP';
    v_where_clause1 :=
                ' WHERE emp_no IN (
                          SELECT  COLUMN_VALUE
                                     FROM TABLE
                                             (CAST
                                                 (:v_tbl_emp_id AS tbl_emp_id
    --AND I AM APPENDING AND CLAUSES BASED ON VARIOUS CONDITION
    v_qry :=     v_select_clause  || v_from_clause|| v_where_clause1;
    OPEN O_EMP_LIST FOR v_qry USING v_tbl_emp_id;
    END TEST_PROC;I CAN REWRITE THE SAME CODE AS
    CREATE OR REPLACE  PROCEDURE TEST_PROC( P_EMP_ID   IN   NUMBER,
                                            O_EMP_LIST OUT  SYS_REFCURSOR) IS
    begin
    v_select_clause :=
             'SELECT EMP_NO,EMP_NAME,DEPT_NO';
    v_from_clause := ' FROM EMP';
    v_where_clause1 :=
                ' WHERE emp_no IN (
                          SELECT  COLUMN_VALUE
                                     FROM TABLE(fn_get_usr_list (:P_EMP_ID)))';
    --AND I AM APPENDING AND CLAUSES BASED ON VARIOUS CONDITION
    v_qry :=     v_select_clause  || v_from_clause|| v_where_clause1;
    OPEN O_EMP_LIST FOR v_qry  USING P_EMP_ID;
    END TEST_PROC;Now I would like to know which one performs better
    USING TABLE ALONE OR USING CAST ALONG WITH THE TABLE FUNCTION?
    AND PLEASE HELP ME ON FORMATTING CODE.
    I've added tags still its not formatting!!
    Thanks,
    NM
    Edited by: user10862473 on Apr 11, 2011 12:14 AM
    Edited by: BluShadow on 11-Apr-2011 09:13
    fixed {noformat}{noformat} tags

    To be sure which is better you will have to test them both. You can use either AUTOTRACE or Oracle trace (tkprof) to get run metrics - system resources used when running both versions of the query. AUTOTRACE won't provide CPU information, but if you can find the qieries in (G)V$SQL you can find it there. Oracle trace is more effort but should provide more metrics. I could do it if I have privileges :(..
    All I can do is check the time taken by the both procedures using set timing on, which gives same result for both.
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.07Thanks,
    NM

  • Using Time Capsule's wifi with ATT

    I currently use ATT's 2wire router for my home wifi network.  If I purchase Time Capsule, can I use it's wifi capabilities in conjunction with my 2wire router from ATT?  I don't think I can do away with the 2wire because I use ATT's dsl.

    If I purchase Time Capsule, can I use it's wifi capabilities in conjunction with my 2wire router from ATT?
    The Time Capsule will need to connect to the 2Wire router using an Ethernet connection.
    Once you have that connection established, you could configure the Time Capsule to provide a wireless network and turn off the wireless function on the 2Wire.
    Or, use the Time Capsule for backup only over the 2Wire wireless network and turn off the wireless function on the Time Capsule.
    You would not want to have the wireless function on both the 2Wire and Time Capsule running at the same time because this will likely create interference issues between the two signals. The exception would be if you plan to locate the Time Capsule a few rooms away from the 2Wire.

  • How to creare function to work with EXISTS function

    Hello,
    I would need some help with code in where clause. I have 6 queries which has a same condition:
    AND NOT EXISTS (SELECT 0
    FROM TAB1 T1
    WHERE T1.COL1 = T2.COL1
    AND T1.COL2 = T2.COL2)
    I would like to write some function so I don't have to change a code in every statement:
    AND NOT EXISTS FUNCTION1(T2.COL1, T2.COL2);
    I wonder if that is possible. I was searching forum and documentation but did not find nothing useful. I do not know what type of function must be and how this could work. If someone now please help.
    Regards,
    Igor

    user5528050 wrote:
    Hello,
    I would need some help with code in where clause. I have 6 queries which has a same condition:
    AND NOT EXISTS (SELECT 0
    FROM TAB1 T1
    WHERE T1.COL1 = T2.COL1
    AND T1.COL2 = T2.COL2)
    I would like to write some function so I don't have to change a code in every statement:
    AND NOT EXISTS FUNCTION1(T2.COL1, T2.COL2);
    I wonder if that is possible. I was searching forum and documentation but did not find nothing useful. I do not know what type of function must be and how this could work. If someone now please help.
    Regards,
    IgorHello
    If your 6 queries are hitting the same tables but are applying different where clauses i.e. filters, you might benefit from creating a view to encapsulate the common SQL. That way you only have to implement the core logic once and you can have your 6 queries go to the view... i.e.
    CREATE OR REPLACE VIEW v_myview
    AS
    SELECT
       a,b,c,d....
    FROM
       t2....
    WHERE
        NOT EXISTS (SELECT 0
                           FROM TAB1 T1
                           WHERE T1.COL1 = T2.COL1
                           AND T1.COL2 = T2.COL2)
    select * from v_myview WHERE a = 100
    /HTH
    David

  • Using Time Machine Backup Drive with NEW Macbook Pro

    I just got a new Macbook Pro. I migrated from my old MacBook Pro. Now I want to use my Time Machine Disk with this new machine.
    When I connect the external drive, and select back up now, it says there is not enough space (due to the fact this is a new machine and it wants to backup the entire thing)
    Also, when I go into the TimeMachine, it doesn't show me anything past today. . . all of my backups are not displayed over the past year. . .
    How do I make it so that the external drive displays all my old backups. . . ??
    Thank you for your help.

    Turn off TM or set the backup drive to null. Rename your computer in Sharing preferences to the same computer name of your old computer. Turn TM back on and reselect the backup drive. TM will behave as you expect. Of course if the file dates on the new machine are all changed since the migration, then TM will correctly assume that they require backing up. You will then find that there will not be sufficient space on the drive for the new backups. If this occurs then you should simply erase the backup drive and start your TM backup anew.

  • Windows10 wont connect to Scanner function but works with printing function

    Just completed upgrade to WIN10.  Printing function works fine -- shows the exact product name HPE 18113 (5520 series)but when I try to scan it tries to connect to HP 5520 series (net) and then says not able to connect.   I've checked everywhere I can think of to see if I can change the from that generic 5520 series (net) to HPE 181113 (5520 series) which how it connected before upgrade & how the printer works.My connection between ALL in ONE printer & PC  is wireless so I tried to go under Network Security setting to enable Webscan BUT it goes to HP page that is not available either!   Help!  Is anyone else having this problem?

    I have a All In One 6620, purchased in April 2012 when I bought an entirely new computer system with Windows 8 and my two year old HP printer wouldn't wouldn't work with the new system. I'm having the same problem with the scanner not working now that I have downloaded Windows10. I also can't figure out anything to make it work. It looks like there is no driver available it. That would be my guess as everything I check on the site says everything is up to date and yet, nothing is working. 

Maybe you are looking for