Using callbacks with a USB connected VISA instrument?

I have an Agilent 34972 connected by USB to a Windows 7 machine. I am using LabWindows/CVI and the VISA drivers.
I cannot find a way to setup a callback which will react to an ALARM event on the Agilent, ie. the Agilent is set up so that certain signal combinations generate an alarm (it could be any other event in the instrument for that matter - it ends up in the STB register, similar to that on a GPIB instrument) and I want my LabWindows program to react to this event (e.g. run a callback routine). With GIPB I have the ibnotify() etc., but I cannot find the equivalent on this combination (USB/VISA).
Any ideas?
Solved!
Go to Solution.

Well, it always help formulating ones problem into a question. Sometimes it get you out in corners of the documentation you didn't see the first round. So I solved my problem with the following snippets - if anyone else ends in the same alley as I. AM I doing to much, or should things be arranged differently? At least it works.
In the main program I have:
vierr = viOpenDefaultRM (&sesHandle);/* open a VISA session */
vierr = viOpen (sesHandle,
"USB0::0x0957:: .......::0::INSTR",
VI_NULL, VI_NULL, &agHandle);/* connect to the instrument */
bufferHandle = (ViBuf)malloc(MAX_CNT+1);/* I don't know what this is for ... MAX_CNT is 1024 */
 vierr = viInstallHandler(agHandle, VI_EVENT_SERVICE_REQ, myCallback,
bufferHandle);/* Tell the driver what function to call on a SRQ event */
vierr = viPrintf (agHandle, "*CLS\n");/* Clear message queues on the Agilent */
vierr = viPrintf (agHandle, "STAT:ALARM:ENABLE 2\n"); /* Enable alarm 2 - the criterea to raise ALARM2 are set elsewhere */
vierr = viPrintf (agHandle, "*SRE 2\n"); /* Enable RSQ on Alarm register */
vierr = viEnableEvent(agHandle, VI_EVENT_SERVICE_REQ, VI_HNDLR, VI_NULL); /* Enable the driver to detect events */
The CallBack is defined prior to main as
ViStatus _VI_FUNCH myCallback(ViSession vi, ViEventType etype,
ViEvent eventContext, ViAddr userHandle)
ViStatus status;
ViUInt16 stb;
status = viReadSTB(vi, &stb); /* Read the stats bit */
if (stb & 2) { /* Check that it is an alarm - bit-mapping is device dependent */
/* do the actions for the alarm state */
vierr = viPrintf (agHandle, "*CLS\n"); /* Clear the status - this is necessary to be able to call again */ 
return VI_SUCCESS;

Similar Messages

  • Can I use the instrument I/O assistant express vi to communicate with a USB connected instrument ?

    Can I use the instrument I/O assistant express vi to communicate with a USB connected instrument ? My PC is running Windows 2000 et Labview7 express.
    where can I get information or examples on the assistant and USB communication ?

    Yes you can - the Instrument I/O Assistant communicates with message-based instruments through VISA. VISA 3.0 supports USB instruments and VISA 3.0 is the version of VISA that installs with the Assistant.

  • HT201210 I'm trying to update my iOS to 6.0, using iTunes (with my 4s connected via USB and WiFi is on also). I get a message that 'there are purchased items on my iPhone that have not been transferred to my iTunes library. Yet, I can't find those items!

    I'm trying to update my iOS to 6.0, using iTunes (with my 4s connected via USB and WiFi is on also). I get a message that 'there are purchased items on my iPhone that have not been transferred to my iTunes library. Yet, I can't find those items! Help!  There is not error message number just the text message. I've searched for an answer but have found nothing on "transfering items purchased to your iTunes library".

    Right click on your device icon on the left pane of iTunes and click on transfer pur....

  • I am attempting to convert 8mm video cassettes to dvd using a video cassette player, elgato video capture with rca/usb connections to the mac, editing in imovie and burning on idvd. The picture quality is awful. What can I do?????

    I am attempting to convert 8mm video cassettes to dvd using a video cassette player, elgato video capture with rca/usb connections to the mac then editing in imovie and burning dvd-r using idvd. The picture quality is awful. What can I do??????

    At what point is the video quality bad?  Is it bad on capture?  I would recommend using an s-video 1394 firewire converter instead.  They capture the video at a higher bit rate.  If you have a lot of 8mm tapes to capture, invest in a stand alone DVD recorder.  They capture and compress in one shot.  If you need to rip it back from the DVD into iMovie again, I would recommend using DVDxDV.

  • Hi i got a mac mini but when i connect it to my smartax mt882 modem via ethernet it says device not connected can anyone solve this issue it work fine with the usb connection but the ethernet is giving me problems plz help

    hi i got a mac mini but when i connect it to my smartax mt882 modem via ethernet it says device not connected can anyone solve this issue it work fine with the usb connection but the ethernet is giving me problems plz help

    Hello, give this a try...
    Make a New Location, Using network locations in Mac OS X ...
    http://support.apple.com/kb/HT2712
    10.5, 10.6, 10.7 & 10.8…
    System Preferences>Network, top of window>Locations>Edit Locations, little plus icon, give it a name.
    10.5.x/10.6.x/10.7.x/10.8.x instructions...
    System Preferences>Network, click on the little gear at the bottom next to the + & - icons, (unlock lock first if locked), choose Set Service Order.
    The interface that connects to the Internet should be dragged to the top of the list.
    For 10.5/10.6/10.7/10.8, System Preferences>Network, unlock the lock if need be, highlight the Interface you use to connect to Internet, click on the advanced button, click on the DNS tab, click on the little plus icon, then add these numbers...
    208.67.222.222
    208.67.220.220
    (There may be better or faster DNS numbers in your area, but these should be a good test).
    Click OK.

  • MBA with ATT USB Connect 900

    Has anyone had any experience using the AT&T USB Connect 900 for 3G networking on the MacBook Air? The ATT device has the advantage of session pricing plans.
    Thanks,

    I tired of hassling with an Option GT Ultra Express. The card itself worked fine, but Option's software ***** rocks. It can be cajoled into working on 10.5.4, though restarts and sleeps are still problematic.
    I just received an 881 to replace it and am using right now. The OSX "filter" driver was right on the card -- I installed it and rebooted. The card was then recognized natively when inserted without the Watcher software. The battery is easily overlooked -- pull the packaging completely apart to find it. Why exactly this thing has a battery at all isn't clear to me, but at least it works, and seems to get a somewhat better signal than the (spit) Option card.

  • Can charge my iphone 4 with the USB connected to a pc but cannot charge my iphone4 with wall charge

    Why ca I charge my iphone 4 with the USB connected to a pc but cannot charge my iphone 4 with wall charge?

    If it charges when connected to a computer USB, it can't be the phone.  Try a different cable.

  • How to use labview with gpib to connect with Agilent PNA E8362B ?i am newbie ..just started to work on labview about a fortnite bck and a novice in interfacing skill ..so plzzzzz explain me in a litle detail

    how to use labview with gpib to connect with Agilent PNA E8362B ?i am newbie ..just started to work on labview about a fortnite bck and +i am a novice in interfacing(networking... jst know tidbits) skill ..so plzzzzz explain me in a litle detail

    Sir
    We were able to solve that problem...but now could you advice as to which DC power supply we should use (preferably avalable in India) so that it can be controlled by Labview (through a gpib/rs232/any other port) to give a square wave of desired frequency/other parameters.
    Regards
    Shivam

  • How to use labview with gpib to connect with Agilent PNA E8362B ?

    how to use labview with gpib to connect with Agilent PNA E8362B ?i am newbie ..just started to work on labview about a fortnite bck and +i am a novice in interfacing(networking... jst know tidbits) skill ..so plzzzzz explain me in a litle detail

    Duplicate Post.

  • I want to transfer music from my MacBook to my Imac. Do I need a cord with double USB connections? Pro to my Imac

    I want to transfer music from my MacBook to my Imac.  Do I need a cord with double USB connections?

    How about a USB flash drive? How about burning a CD or DVD?

  • Want to use my mac as wifi hotspot with 3G USB connection

    Howdy Folks,
    I'd like to try an alternative to my local internet provider, which has now increased to $240/mo for less than 2mb/sec service. (I live in a remote place with just one provider)
    The local cellular company offers 3G USB internet "sticks", and I would like to see if I can use that to tether my MacBook Pro as a hot spot.
    And, better yet, is there a way to expand that to my Airport Extreme?
    Or, use the USB connection on an Airport Express directly?
    Anyone know a solution(s)?
    I have a small cafe, so the purpose beyond personal use, would be to provide WiFi access for up to about 6 additional users.
    Thanks in advance!

    Ok, thanks. I'm still confused. So I turn Wi-Fi off and I try to select "personal hotspot" under "cellular data" and I get the following message: "wifi is off - personal hotspot will only be available over Bluetooth and USB. Do you also want to enable it over wifi?" Then it gives me two choices 1) Turn on Wifi  or 2) Bluetooth and USB Only. If I choose 1 like I did today the bluebar appears but it's connected over a crappy wifi network...if I choose #2 the blue bar never appears and the ipad isn't a hotspot???

  • Using windows vista I can not get the install to complete and work properly with a usb connection.

    I am running Vista (32 bit) and I was trying to update to new HP software.  Tried using full software install from file on HP website (release 14.0 full version).  When I try to install, it will not recognize the usb connection of the software.  I tried going back to version that came with the printer and had a similar problem.  Now I am stuck not being able to get either version 12 (which came with the system) or version 14 (new update on website).
    I need help trying to figure out how to get the software to go through and connect properly using usb and having the scan function working.......
    Any ideas.

    Hi,
    Have you tried plugging the USB into a differnt port at the back of your PC?
    IS the USB directly connected to your PC and not through any USB hub or extention?
    Do you see any response while plugging the USB to your computer?
    If yes, please clarify.
    I would also suggest trying a different USB cord, not longer than 2-3 meters long and check for any difference.
    Shlomi
    Say thanks by clicking the Kudos thumb up in the post.
    If my post resolve your problem please mark it as an Accepted Solution

  • Hi need a vi to communicate with a usb connecting to 4 sensors

    hello
              i m working with labview 7... and working on sensors(strain gauge type sensors).... my job is to communicate with a usb cable that is connected to those sensors without the help of drivers.. so i need a Vi for that.... and after that i need to physically look at the incoming data on the computer so another Vi for that... pls help me as my deadline is near

    hi dennis
    yes it uses visa... i m sending u the vi and the sub vi s also....have a look and help me furthere pls... my deadline is till this sunday...i would really appreciate ur help
    Attachments:
    Reset_Com.vi ‏27 KB
    Initialize_Com.vi ‏71 KB
    Close_Com.vi ‏22 KB

  • Can't print with airport usb connection only

    i have spent the last 3 days searching for help to fix my problem - PLEASE HELP!!!
    using:
    imac osx 10.6.8
    canon image class mf8350cdn
    airport extreme base station
    I cannot seem to print wirelessly with my imac using just the USB connection on the airport router.  I can print with the printer locally when it's "hardwired" directly to a usb on the back of the imac.  I can print if i connect a cat5 network cable from the printer to the airport. i can print wirelessly with a PC when the printer is connected with a usb to the airport.  i just can't do this with my imac via the usb connection on the router.  my error message is a Canon CMFP Printer Driver telling me printer is not responding - check the power.....try sending again.
    I believe i have tried everything!!!  While i am newer to mac and not the greatest at networking, i have manipulated every setting to match up with all of the online help i can get (trying to not have to send this question!!) and no luck.
    i have deleted printers and jobs, reinstalled everything, i changed the cable, downloaded the latest drivers from canon and apple, i updated the firmware on the printer. i even reinstalled my osx and confirmed all is updated on my imac.
    i don't want to scan or fax this way - so that is not my issue -- it's just plain old printing using that usb port.
    i need all of my other ports on the airport for other things, so i cannot sacrific this one for printing - i just want to use the usb as my printer connection to print with all of the machines i have.
    hope my question makes sense and that someone will take the time to give a reply.
    thanks!!
    p.s. the closest discussion that matches my issue seems to be this one:
    https://discussions.apple.com/message/12367897#12367897
    but, i still can't seem to get there..........

    The most comprehensive set of troubleshooting instructions for printing problems involving Airport printers is found at:
    http://docs.info.apple.com/article.html?artnum=107418
    It is possible your printer simply cannot be made to work in this manner, and is more often than not a problem with multifunction printers.

  • IMovie 9 with Refurb Macbook with only USB connection

    Is it possible to import video into iMovie with a Mini DV camera through a USB connection (since that is ALL that is on my Macbook)?
    If so...why have iMovie on a computer that doesn't have a Firewire input? Why did they even make these?

    Hi -
    guitargirl wrote:
    Is it possible to import video into iMovie with a Mini DV camera through a USB connection (since that is ALL that is on my Macbook)?
    No.
    If so...why have iMovie on a computer that doesn't have a Firewire input? Why did they even make these?
    I think because people are/have been moving away from tape based cameras to hard disc & memory card based video cameras, which do use the USB port to connect and not firewire.
    Hope this helps.

Maybe you are looking for

  • 10.6.2 Update kernel panics iMac

    HELP! A mate of mine upgraded his iMac to 10.6.2 on Friday and now it won't boot up. It gets as far as showing the apple logo but then shows a load of text detailing the error: something along the lines of: "Version mis-match between Kernel and CPU P

  • HomeInterface.class in PortableRemoteObject.narrow

    Hi I understand we do a JNDI look up to get the stub (HomeInterface object) and then narrow it down to ensure the object becomes RMI/IIOP compliant and it is of HomeInterface type, the following code snippet does what I have hence stated Context cx =

  • Jar file of Helliker.ID3 package

    Hey guys, I am facing a problem with making a jar file of hellikar.id3 package.I am importing hellikar.id3.ID3v2FormatException class but it is giving class not found error.I tried to set the classpath but its not working.Can any body please tell me

  • Hola, adquirí la suscripcion plan de Fotografia da Creative Cloud y el lightroom 5 no quiere abrir Dice " Tu versión de prueba ha caducado"

    Hola, adquirí la suscripcion plan de Fotografia da Creative Cloud y el lightroom 5 no quiere abrir Dice " Tu versión de prueba ha caducado"

  • Problem updating 5800 software

    You have to update my 5800 has been successfully install the update and I am now the problem Akny I can not log messages to the final I do not know why For information, I've updated the system again and also did not solve the problem, what is the sol