Gpib write or read sometimes hogs cpu

I have written a simple vi to communicate and
control a Stanford Research SR640 programmable filter.  It does a
series of gpib writes and reads to get and set various controls on the
instrument, and it works very well.  The problem comes when I try to
call it from a more complex vi that controls the entire experiment. 
Once the sr640 vi is linked into the big vi, it takes 10-20 seconds for
the sr640 vi to return and it hogs the cpu, making even the mouse
unresponsive, Windows task manager stops updating, etc.  This happens
even when running the simple sr640 vi directly from its front panel
with no other vi's executing.  In "lightbulb" mode, I can see that
occassionally, the gpib write or read icons (from traditional gpib
pallette) take a long time to return, and the cpu goes to 100%.
If
I remove the complex calling vi from memory, the problem goes away, ie
the sr640 vi runs fine.  If I load the big vi back into memory, I
reproducibly get the bad behavior when running the sr640 vi. Note that the big vi does not need to be running to cause trouble, only be loaded in memory.   If I
delete the sr640 vi from the big vi, i.e. it is no longer called from
the big vi, the sr640 vi again runs fine.
Any idea what might be happening and how to go about debugging this?
Thanks,
Bob Shelby

Thanks for the reply. 
Attached is the SR640 vi and a calling vi that works just fine.
Bob 
Attachments:
srs_filter_setparms.vi ‏42 KB
test_sr640.vi ‏17 KB

Similar Messages

  • Windowserver suddenly hogs cpu with Lightroom and Photoshop

    I recently upgraded these software packages to 64bit and upgraded NIK plugins for each to the 64bit versions. Since then I've had problems with PS freezing while making adjustments using a NIK plugin (doesn't appear to be plug-in specific). Looking at the Activity Monitor I see windowserver up to 90+ cpu usage. Sometimes if I just wait it will recover, sometimes I have to shut everything down.
    Anyone seeing this problem while using this software and if so have you found a remedy? This never happened while using the 32bit versions of all these packages.

    My understanding is that windowserver is an OS X application independent of software used. My question is whether others have seen windowserver start hogging CPU time while this specific software was being used and any Mac remedies that solve the issue. It's not an Adobe question.

  • Error 6 in GPIB Write

    Hi
    I have a LabVIEW code acting as a driver for an EG&G 5210 lock-in amplifier. Essentially I am using the GPIB write vi to send a string to the amplifier.
    I have been trying to de-bug my code for a while.
    The problem is, I have split the code into each constituent control and each separate part (e.g. changing phase or filter type etc.) works absolutely fine on its own. Also, when I combine several of these into one string it also works fine, apart from the addition of the very last part. 
    At this point I get error 6 "LabVIEW:  Generic file I/O error. NI-488:  I/O operation aborted."
    I cannot then check any of the others parts work after this point since I only get the same error, even just testing one constiuent part (which had been working well beforehand)
    I am using Labview 2011 with an NI GPIB-USB-HS with the previously mentioned EG&G 5210 amplifier.
    Any help is greatly appreciated.
    Please find attached my LabVIEW if required.
    Jordan B
    Attachments:
    test 3.2.vi ‏28 KB

    My guess is that when you are stringing the commands together, you aren't waiting long enough for at least one command to complete.  I can't see the VI because of the ancient version of LV that I have at work, but if the instrument is SCPI compliant, consider appending ;*OPC? to each command that isn't already a query.  This will turn that command into a query, so you execute a read (of a couple of bytes) and it will wait until the instrument has completed the command.
    Read the instrument manual to make sure that the commands you are going to modify in this fashion are compatible with the *OPC? command.
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • Safari hogging CPU and won't run

    Sorry for posting here, but I couldn't find the Safar for windows section.
    I run WinXP (fully up to date), with 2Gb RAM, (with one 1Gb on my gfx card), 1.8Ghz processor
    Having updated to the latest Safari I'm finding that it hogs CPU so much so that when I select a page from the top sites screen my PC locks up and I have to use the application manager to kill Safari.
    The same thing happens when I try to go to a website just by typing into the address bar.
    Anyone having similar issues, or able to help me out as to how to fix it?
    Thanks

    Try turning off plug-ins, java, javascript
    Empty history, caches, etc or go to where XP would store the application temp files, in Windows Vista/7 that is AppData\Local and \Roaming
    Disable or turn off extensions, 3rd party can break with any Safari update
    make sure you have current Flash etc
    I'd stick to Firefox or something - use NoScript, HTTPS Everywhere, FlashBlock, etc.

  • Mobiledeviceservice.exe hogs CPU

    mobiledeviceservice.exe hogs CPU. It takes 98 to 99 % of resources.  Trying to upgrade the operating system to 5.0 but its been hung up in the back up process for 4 hours.

    I have a single core laptop it won't work eats 99% of cpu, it's the mobile device service. I couldn't update my iPhone 4 to the latest iOS5.
    Also I can't access iTunes to get my contact list or music from iTunes with my new iPhone 4S because I have to update to iTunes 10.5 to do that or buy a quard core laptop.
    I do have two quard core PC's on in shop and one in bits, but my laptop was always my backup, maybe I need a new laptop but can't afford one atm.

  • How to combine both DAQ AI signal, write and read file in single VI

    Hi
     I am the new user of LabVIEW version 7.1 for testing automation application. I have to measure 33 signals ( mostly analog like temp, pressure, etc...) from NI USB 6210 DAQ system and write in master file for future verfication.From real data or from master file back up have to write  one more file if only the signal reaches steady state , which will used for analysis and same signals to be read from this file parallely & make a waveform and/or table display format.
    Pl. help me to shortout this problem 
    note: I have plan to ugrade labVIEW version 2011 shortly, so let me know doing parrel acquistion write and read file for data analysis in same VI in version 7.1...... 

    Parallel operations in LabVIEW are very simple.  Just code it in parallel and it will work.
    Try taking a look at some of the examples in the NI Example Finder (Help > Find Examples).  There you will find example for writing to and reading from files, as well as data acquistion in parallel with other operations.
    You might need a producer/consumer architecture is you are acquiring data very quickly.
    Chris
    Certified LabVIEW Architect
    Certified TestStand Architect

  • My first gen ipod mini does no longer sync with itunes 11.0. It says "cannot write or read". Ist this the end?

    My first gen ipod mini (that I use in my car) does no longer sync with itunes 11.0. It basically says "cannot write or read". Is this the "end of life" of that ipod?

    You mean you can't get to the Summary pane?
    If you  have iTunes 11 turn on the Sidebar. Go to iTunes>View and click on Show Sidebar. You can also do a Crtl+S to show the sidebar. The sidebar is where Devices appears. and Control+B to show the Menu bar

  • Cannot Write or Read to disk Error during iPhone 3g 3.1 sync

    Searched the forum with no luck. Just upgraded to 3.1 on my 3G and I cannot sync without it stopping with the error - Cannot write or read disk. It seems like its almost random on what file it picks to stop on - the file plays fine in iTunes 9. Any suggestions?

    Hi,
    Restore the Touch. There is no easy way to remove files from an iPod as it classes media on the iPod as "read-only" - There are software products that can be used to remove media from an iPod, but it is not an official method and you risk causing more damage.
    If you really need the files on the Touch then use Google to find a program to remove files, there are a few, but do so at your own risk!
    Kind regards,
    Peter.

  • Closing a serial port after executing a for loop of write and reads.

    Hello,
    Labview is opening and then closing each write to the port. I have tried to leave the close outside of the for loop, but labview wont allow it. What do I need to change to make all the writes and reads execute on 1 open and close of the serial port.?
    Thanks.
    Attachments:
    Controller.vi ‏27 KB

    J_es--
         The program that you posted looks to be ok for the most part, you might consider putting an open after your configure (but that's trivial). The other thing that is a minor issue is the loop tunnel coming out of your for loop is currently being auto-indexed.  This function is used to index data for each interation of the loop.  You are using a static address (not an array) and so you don't need this.  If you right-click and remove the auto-index the broken wire will go away. Other than that it should be ok.
         I would suggest looking at one of the shipping examples that come with LabVIEW.  "Basic Serial Read and Write" is essentially the same thing that you are doing and is tested here and might save you a bit of time.  Anyway, take a look if you have a second. Best of luck with your application!
    John H.
    Applications Engineer
    National Instruments
    http://www.ni.com/support

  • How can i write and read the same data

    hi,
             i have attached my program to this mail. i have some problems in this program.
    problems:
    1. I want to select the threshold for the rms,varience and s.d.
    But what i used is not doing that. i want to fix the upper threshold value and lower threshold value.
     when ever the input crosses upper threshold value i want the output and it will remains uptill the value above the lower threshold value.
    Once it come down the lower threshold value the output should be stopped.
    2. I want to write this in to a  file and i want to read this file. is this possible or not. 
                please try to help me i am very new with lab view6i
           REGARDS
    CHAMARTHY KOMAL DILEEP.
       [email protected]
    Attachments:
    dileep.vi ‏93 KB

    The easiest way to perform a certain action (such as file I/O) based on a certain condition (such as whether a value has passed a certain threshold) is to use a comparison VI in combination with a case structure. Then you can specify that if your rms, standard deviation and variance are above a threshold then perform a certain action.
    Also consider using shift registers to keep track of data from the last loop. If I understand you correctly, you want to start logging data when an upper threshold has been passed. Then you want to continue logging data until a lower threshold is passed. I have attached a non-functional but explanatory VI that will help explain how to implement logic to that effect. It also demonstrates that you can indeed write and read from the same file in a loop. The best way to do this is to open the file before the loop, do all the necessary writing and reading in the loop, and then close the file after the loop.
    Hope this helps!
    Jarrod S.
    National Instruments
    Attachments:
    dileep_example.vi ‏61 KB

  • How to Write BUFFER & Read TEXT with Encrypt file ?

    I'm using Windows Phone 8.1 RT.
    I have a issue :
    - I write a BUFFER encrypted to file. After, I read file with TEXT. It's throw exception : No mapping for the Unicode character exists in the target multi-byte code page. (//ERROR 2)
    - I write a TEXT encrypted to file. After, I read file with BUFFER. It's throw exception : The supplied user buffer is not valid for the requested operation. (//ERROR 1)
    Code Write Buffer & Read Text.
    //Write Textstring msg = EncryptText.Text;
    //ERROR 1 - Use 1 or 2
    await WriteTextAsync(this.file, msg);
    //ERROR 1
    //Read Buffer
    string msg;
    //ERROR 1 - Use 1 or 2
    IBuffer buffer = await ReadBufferAsync(this.file);
    StreamReader stream = new StreamReader(buffer.AsStream());
    msg = stream.ReadToEnd();
    //ERROR 1
    Code Encrypt-Decypt.
    public static string EncryptString(string msg)
                var bufferMsg = CryptographicBuffer.ConvertStringToBinary(msg, BinaryStringEncoding.Utf8);
                var bufferMsgEncrypted = Encrypt(bufferMsg);
                var msgEncrypted = CryptographicBuffer.EncodeToBase64String(bufferMsgEncrypted);
                return msgEncrypted;
            }public static IAsyncAction WriteTextAsync(IStorageFile file, string msg)
                return FileIO.WriteTextAsync(file, EncryptString(msg));
    public static IBuffer Decrypt(IBuffer bufferMsg)
                var key = CreateKey(KEY);
                var aes = SymmetricKeyAlgorithmProvider.OpenAlgorithm(SymmetricAlgorithmNames.AesCbcPkcs7);
                var symetricKey = aes.CreateSymmetricKey(key);
                var bufferMsgDecrypted = CryptographicEngine.Decrypt(symetricKey, bufferMsg, null);
                return bufferMsgDecrypted;
            }public static IAsyncOperation<IBuffer> ReadBufferAsync(IStorageFile file)
                var buffer = FileIO.ReadBufferAsync(file);
                Task<IBuffer> result = Task.Run<IBuffer>(async () =>
                    var Buffer = await buffer;
                    return Decrypt(Buffer);
                return result.AsAsyncOperation();
    Link demo code :
    https://drive.google.com/file/d/0B_cS3IYO936_akE0cmI4bExJMjh0RU9qR3RvWDBWWElZWC1z/view?usp=sharing

    Please provide a working app so this can be tested. You can upload to OneDrive and share a link here.
    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
    objects and unknown namespaces.

  • NI 6602 Write and Read Frequency

    Hi all ,
    I Have NI 6602 timing card and i'm trying to use it in order to write and read using the
    DAQmxWriteCtrFreq (taskHandle1, 0, 1, 10.0, DAQmx_Val_GroupByChannel, &freq, &duty, &writtenVal, 0);
    and
    DAQmxReadCounterScalarF64(taskHandle2,10.0,&dataVal,0);
    what i'm trying to do is to write to ctt0 and to read from ctr7 ( they are crossed in the card )
    i'm having a bit problems with that can some one give me a tip on how to do it properly ?
    just write freq to ctr0 and read freq from ctr7.....
    Kobi Kalif
    Software Engineer
    Solved!
    Go to Solution.

    You should have the following sample installed on your PC that may help you in this task: DigPulseTrain-Cont.prj (it could be located in \program files\National Instruments\CVIx\samples\daqmx\counter\generate pulse folder)
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • DAQ vi to perform digital write and read measurements using 32 bits binary data saved in a file

    Hi
    DAQ vi to perform digital write and read measurements using 32 bits binary data saved in a file
    Two main
    sections:
    1)     
    Perform
    write and read operations to and fro different spread sheet files, such that
    each file have a single row of 32bits different binary data (analogous to 1D
    array) where the left most bit is the MSB. I don’t want to manually enter the
    32 bits binary data, I want the data written or read just by opening a file
    name saves with the intended data.
          2)     
    And
    by using test patterns implemented using the digital pattern generator or  build digital data functions or otherwise, I need to
    ensure that the     
                binary data written to a spreadsheet file or any supported file type
    then through the NI-USB 6509 is same as the data read.
    I’m aware I can’t use the simulated
    device to read data written to any port but if the write part of the vi works I
    ‘m sure the read part will work on the physical device which I’ll buy later.
    My Plan
    of action
    I’ve
    created a basic write/read file task and a write/read DAQ task for NI USB 6509
    and both combine in a while loop to form a progress VI which I’m confuse of how
    to proceed with the implementation.
    My
    greatest problem is to link both together with the correct functions or operators
    such that there are no syntax/execution errors and thus achieve my intended
    result.
    This
    project is one of my many assignments for my master thesis, so please i’ll
    appreciate every help as I’m not really efficient with LabVIEW programming but
    I prefer it because is fun and interesting if I get to know it.
    Currently I’m
    practicing with LabVIEW 8.6/NI DAQmx 8.8 Demo versions and NI USB 6509
    simulated device.
    Please see
    the attached file for my novice progress, thanks in
    advance for the support
    Rgds
    Paul
    Attachments:
    DIO_write_read DAQ from file.vi ‏17 KB

    What does your file look like?  The DAQmx write is expecting a single U32 value, not an array of I64. 
    Message Edited by vt92 on 09-16-2009 02:42 PM
    "There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal

  • GPIB write error code 6, how to do proper wait in GPIB comm

    Hi!
    I use a Keithley MUX and a DVM to measure different values in my system, including 4 wire resistance. My project runs for several hours without any problem, but last night I have got an error after approx. 8 hours runtime. My error out in the main vi shows the following error:
    GPIB Write in A_4Wire_resMUX_2!1,2!3,2!5_new.vi Error code 6.
    I have attached this subvi, as you can see, I have put a while loop in the subvi, to give enough time for the 4Wire measurement to be done. But of course maybe another GPIB write function crashes in the subvi, not the one after the while loop.
    I have 2 questions:
    1. what is the best way to do error handling in GPIB comm., so I could see on my final error out what element caused the problem in this certain subvi?
    2. Can someone show me what I could do better in this subvi, to avoid possible GPIB errors?
    Its just guessing, but I think the error comes from that I may not give enough time to the GPIB device to perform an action, so the next GPIB write crashes?
    plus info: WindowsXP, LabView 2010 Full version
    Thanks very much for advice and help!
    Solved!
    Go to Solution.
    Attachments:
    A_4Wire_resMUX_2!1,2!3,2!5_new.vi ‏35 KB

    2001 driver
    7001 driver
    Now that you have a modern version of LabVIEW why are you not taking advantage of the instrument driver network?  VISA is wonderful and the raw 488.2 primitives should be considered "obsolete".
    Since you did not use the specific instrument driver vi's we can't tell which write to what device generates the error you are seeing. 
    So to specifically answer Q1.  Use the Driver's found on the instrument driver network- they are tested and structured in ways that assist in debugging your application and take advantage of powerful features in VISA..
    And 2) (see #1) and change the stacked sequence into a state machine
    Jeff

  • PNA Guided Calibration: GPIB write error in for loop

    Hi,
    I have a LabVIEW program that creates a Guided Power Calibration on a PNA.
    After initializing everything properly, I have a for loop that loops through all the manual steps that the user must go through (ex: Connect Channel A of Power meter to Port 1" "Connect male Short to port 1" etc).
    The problem is, the program displays an error at the first command: sens:corr:coll:guid:acq STAN1
    I says there is an error with the GPIB Write function.
    Here are the commands I send:
    SYSTRES
    DISPlay:WINDow2TATE ON
    CALCulate2ARameterEFine:EXT 'MyMeas',S21
    DISPlay:WINDow2:TRACe1:FEED 'MyMeas'
    CALC1AREL 'CH1_S11_1'
    SENS:FREQTAR 2e9
    SENS:FREQTOP 4e9
    SENSWEOINTS 3
    SENS:CORR:COLL:GUID:CONNORT1 'APC 2.4 male'
    SENS:CORR:COLL:GUID:CONNORT2 'APC 2.4 male'
    SENS:CORR:COLL:GUID:CKITORT1 '85056D'
    SENS:CORR:COLL:GUID:CKITORT2 '85056D' 
    SENSe:CORRection:COLLect:GUIDedSENsor1 ON
    SYSTem:COMMunicateSENsor gpib, "13"   
    SENSe:CORRection:COLLect:GUIDedSENsor1OWer:LEVel -20
    sens:corr:coll:guid:init
    sens:corr:coll:guid:steps?
    //for loop from 1 to total_number_of_steps
    sens:corr:coll:guid:desc? <step#>
    sens:corr:coll:guid:acq STAN<step#>
    The program quits right at the first step, when I send "sens:corr:coll:guid:acq STAN1", although the command is executed.
    Also, the VBScript with the same commands works fine.
    Can anybody help me? I've been stuck for a while now.
    I attached the block diagram of the for loop.
    Thanks in advance,
    Nicolas
    Attachments:
    Guided cal for loop.vi ‏27 KB

    Sending SENS:corr:coll:guid:acq STAN1 \n gives me a different error: -101 "Invalid Character".
    From my different attempts at figuring this out, I thought the problem would come from LabVIEW, since the vbscript with the same commands works on the PNA.
    I also modified the for loop because I thought each iteration should be linked to the previous one with the error wire (see attached).
    I still have the same issue, only the first iteration is executed, then the program quits.
    Attachments:
    Guided cal for loop.vi ‏28 KB

Maybe you are looking for

  • AntiXSS removed from GAC?

    I have code that MSOCAF required us to use the AntiXSS library. It was added and the package was updated to deploy the AntiXSS.dll to the GAC. Once the DLL is in the GAC, I remove the original reference and update the reference to the AntiXSS to the

  • ITunes 9.0.1 forgets Audible authentication

    Every time I start up iTunes 9.0.1 I have to re-authorize my Audible.com account. This only happens on my newest computer and only affects the Audible authorization (not the iTMS authorization). The main reason this is annoying is because if I have m

  • Where we maintain the CST & VAT numbers for a plant which is not a register

    Hi All, Where we maintain the CST & VAT numbers for a plant which is not a registered for Excise? we are printing it on the invoice output. on debugging it is known that it comes from the table AUSP, after checking the table CABN. Any body knows abou

  • Download trial error

    Hi! I'm trying to download a trial of InDesign and the Adobe page states that it is "downloading now", but there has been no change in this status nor any pop-up or block that I can see that needs actioning. I've restarted the process once (full comp

  • Navigation bar on top of slideshows

    i'd really like to be able to place a clients logo and site navigation bar on a layer above the slideshow lightbox creates so the user can access the menu from within the slideshow