How to format/sen​d VISA messages in 'C' for PXI

How do I format/send VISA commands to a PXI Switch device such as
- niSwitch_InitWithTopology(instr, topology, VI_FALSE, VI_TRUE, &switchSession); using ANSI C ?  How do I query the result ? 
I am able to use VISA commands to Open, Find Resources etc., but I would like to use VISA (message based) commands to perform various functions such as Self-Test, MakeConnection etc.  I am using ANSI C under VC++.  I am new to PXI and VISA and I tried to make this work using the following snippet, but get nonsensical results.
viPrintf (instr, "niSwitch_InitWithTopology(instr, topology, VI_FALSE, VI_TRUE, &switchSession)\n");
viPrintf (instr,"niSwitch_self_test (instr, &SelfTestResult, testMessage)\n");
viScanf (instr, "%s", testMessage);
Thanks in advance for any help.

Hi pxi_user,
A function with a C Function Prototype such as:
ViStatus niSwitch_InitWithTopology (ViRsrc resourceName, ViConstString topology, ViBoolean simulate, ViBoolean resetDevice, ViSession* vi);
returns whether or not the function was successful.  This is stored in a ViStatus variable.  This, I am guessing, is what you are interested in.
Please check out some C Examples to see how we perform error handling.  Normally, in our example VIs, we will use the method outlined in niSwitchErrorHandler.  Please view this program and then another that shows its use.  I would recommend the C programs located in the following folders:
C:\Program Files\IVI\Drivers\niSwitch\Examples\CVI\niSwitchEr​rorHandler
C:\Program Files\IVI\Drivers\niSwitch\Examples\CVI\niSwitchCo​ntrollingAnIndividualRelay
In the end, the function will look something like below:
niSwitchCheckErr(niSwitch_InitWithTopology(resourc​eName, topology, VI_FALSE, VI_TRUE, &switchSession));
If this does not assist you, please let me know what the results you are currently getting look like.  Thanks!
Chad AE
Applications Engineer

Similar Messages

  • How do I show number of messages in mailboxes for Mail?

    I can't figure out how to show the number of messages in my mailboxes. When I go to View > Message Attributes, Number is grayed out. Nothing in Customize Toolbar that would suggest #. Any advice? Thanks!

    no, like in classic, there was a column "#" which showed how many messages you had in that particular email account. but all that info is in the email itself, but no total of emails for that mailbox. When I go to View > Message Attributes, "Number" is grayed out. thanks for your input.

  • How to format iPod Nano on a Mac but for a PC

    WE got my dad an iPod nano. It's an 8 gb. He did not have a computer so we were loading up for him on our Macbook. Now he has a PC that uses Windows and he's got high speed internet. He downloaded iTunes and wants to control his iPod himself now. However, the Nano is formated for a Mac and won't work on his computer.
    Can I re-format the nano using my MacBook? I need to re-format it to work on his computer. I was unable to do anything with it on his computer last night.

    Here's what I want to do: using my MacBook, I want to re-format or "restore" the ipod nano to work on a PC using Windows.
    You cannot. When you Restore on iTunes for Mac, it will format the iPod with HFS+, which Windows cannot read.
    When you Restore with iTunes for Windows, it will format it FAT32, which will work iTunes for Macs or Windows.
    So Restore it with iTunes for Windows and then you can use it with either computer. It will only take a few minutes to Restore it.

  • How can I put number VISA on my account  for IPAD ?

    I cannot choose the payment when I am inside in my account . I have a stop . I write my address, my email all information requested but after I cannot put my VISA. How can I do ?  many thanks to everybody who can help me.

    Have you tried a reset - hold the Home and Sleep/Wake buttons down together for 15 secs and your iPad should restart automatically. Then try changing your account

  • How do I "Select All" email messages at once for deletion rather than touching each one?

    I receive many emails each day and many of them I would like to delete all at once.  But the only way so far I have been able to figure out how to do that is to manually select each and every one of the emails I want to delete then hit delete.
    That is fine when I only have 5 or 6 email to get rid of, but I regularly have anywhere from 50 to 200 at a time to delete.
    I cannot locate a "Select All" option in any of the menus.
    Any Ideas?
    Thanks
    Jerry

    from within the inbox, sent, trash:
    menu/select, menu/select all, delete.

  • How to format to show pounds (lbs) and stone, for UK weight?

    As the title suggests, I want to have a weight loss table, to show the date in one column, and my weight in another. I know there is already a template available in Numbers '09, but it does not display the weight in the format I am used to- ie pounds and stone. As this system is awkward (14 lbs in 1 stone) I am not sure if there is a way to display it AND display that information correctly on a chart in the same spreadsheet.
    Any ideas?

    Actually I have just made my table work very well with my chart, which shows the amount of the D column (which is the total sum of (Stones*14)+Pounds). However, when I proceed to hide column D, the chart loses its data and doesn't show the bars based on that data anymore. It only shows the bars when I have the D column unhidden. Is there a way for the chart to work with hidden columns?
    EDIT: Never mind. Still learning, and just found the option in the Chart Inspector to show hidden data

  • How to format the text  in a Digital Signature for a PDF in landscape orientation?

    I have a custom Digital Signature plug-in which prompts the user to enter few details on a dialog and then renders the signature. Now, the problem is for a page which has PDPageGetRotate value as 90. In this case, the entire content(text) in the signature is rendered reversed i.e its displayed upside down. However, for a page in portrait mode, i.e with rotation value as 0, signature is correctly displayed.
    Can anybody help me by explaining which callback/method to use to frame the text appearance? I think there needs to be some change in the parameters passed to DigSigAPCreateLayeredStreamEx, am i correct?
    Let me know any comments/suggestions on this issue of correctly rendering text in a digital signature for a rotated page.

    Just setup the appropriate transformation matrix.

  • How do I add to my message the request for a recipient to notify me that he has received the e-mail?

    Thank you very much for your help.

    Thank you, that was very kind of you. I am not exactly illiterate, but anything to do with technology makes the words swim in a grey haze. Have a nice day.

  • How to validate a date in message mapping

    Hi experts,
                    how to validate a date in message mapping. For ex:  if date comes as 2008/02/31, then file it shold not get processed.how to achieve this in message mapping. Please help .
    Thanks&Regards,
    Reyaz Hussain

    Hi,
    There are few simple ways for date validation as follow,
    1.If you would like to handle it in XI only, then in message mapping you could verify about it with the help of generating smart exception.
    For e.g in mapping there is one Date conversion API i.e. somthing DateTransformation It converts the incoming date format to required format. Here give the date format i.e expected from Sender File.
    If in case the format miss-matched then it will create the exception.
    You could handle this exception with the use of [Alert notification|http://help.sap.com/saphelp_nw04/helpdata/en/2c/abb2e7ff6311d194c000a0c93033f7/frameset.htm] and could be even able to notify to sender system about it.
    2. The another solution is easy for SAP synchornous communication --If you are passing the file data to SAP, then you could use below function modules to verify date format in receiver RFC/BAPI or inbound IDOC program. If the sy-subrc is not 0 then don't process further.
    CONVERT_DATE_FORMAT
    ISU_DATE_FORMAT_CHECK
    Thanks
    Swarup

  • Unable to publish in Swf format. Get error message: 'Swf compilation failed. Note: Please verify if any of the actionscript keywords is used as user variable name'. Anyone know how to fix?

    Unable to publish in Swf format. Get error message reads: 'Swf compilation failed. Note: Please verify if any of the actionscript keywords is used as user variable name'. Anyone know how to fix?

    Hi There,
    Can you tell me the Operating System and Captivate version you are using?
    Also can you confirm if you are getting this issue will this one project or all the projects? Try to copy paste this project on a new blank project and then try to publish.
    Regards,
    Mayank

  • How do I use the VIs for the Fluke Hydra Series 2620a multimeter?

    This message refers to the VIs found at this link:
    http://sine.ni.com/apps/we/niid_web_display.download_page?p_id_guid=E3B19B3E9468659CE034080020E74861
    How do I use the VIs for the Fluke Hydra Series 2620a multimeter? I am conducting a Senior Design Project at Temple University. It is a Control System where I need to read voltages from sensors and output voltages to different system components. I am trying to set up a VI using the VIs found above to make sure that I can successfully read and send voltages. There was no documentation given with the 2620a VIs.

    Unfortunately, you've got a very old driver for an old instrument. The only available help is to turn on Context Help and move your mouse over the VI icon. It doesn't appear to have any help for individual controls and indicators. The only good news is that it appears to be a simple instrument with only a few functions. There's some main ones line initialize (to set serial port), configure channel, configure instr, and read values. One main thing is whether you're using gpib or serial, Each front panel has a setting. If it's gpib, set the port to the gpib address. If it's serial, set the port to one number less than the com port you're connected to. For example, if you're using Com1, set the port to 0. For the other controls, I'm afraid that you're going to have to try and compare what's there with the controls and settings of the actual instrument. Having access to the instrument manual will be essential. I would engourage you to experiment a little. There's probably very little chance of damaging the instrument especially if nothing is hooked up to it. Send a command and see what happens or set the instrument up manually and see if you can reproduce that via remote control.

  • How do I stop Serial "VISA Read" from giving me packets instead of available bytes.

    Dear Labvillians,
    Highlight:
    How do I stop serial "VISA read" from giving me packets instead of bytes?
    Background:
    I have a system that serially publishes 14 byte packets on a semi-regular interval.
    At busy times, the producer of these these packets queues the data, effectively producing super-packets in multiples of 14 bytes sometimes as large as 8 packets (112 bytes).
    My protocol handler has been designed to processes bytes, packets or super-packets.
    My application now has multiple devices and the order of message processing is critical to correct functionality.
    My observation is that the VISA read waits until the end of a packet/ super-packet before passing the data to the application code. (See Plot Below)
    My expectation is that VISA read should give me available bytes, and not get too smart for itself and wait for a packet.
    I have observed this on PXI, Embedded PC, cFP and most recently, cRIO
    I have experimented with the cRIO's Scan interface rate, which helps with reducing the packet backlog but doesn't resolve to sub-packet byte read.
    I understand that one solution is to Write FPGA code to handle it and pass the bytes through R/T-FIFO, and there are some great examples on this site.
    Unfortunately this doesn't help with non FPGA devices.
    I have also dabbled in event based serial reads but it is diabolical on vxWorks devices.
    Any Help is appreciated
    iTm - Senior Systems Engineer
    uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
    Solved!
    Go to Solution.

    Sometimes Talking to yourself is helpful.
    I hope this is a useful Nugget for someone in the future
    iTm - Senior Systems Engineer
    uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT

  • How to format new hard drive for Apple TV when you can't use old HD

    I need to know how to format a new HD to install in my Apple TV where I can't use the old HD to clone or otherwise create the new structure on the new HD.
    I have an Apple TV that was syncing to a Mac Mini that had a defective HD and logic board. I was unable to backup the Apple TV to the Mac Mini for some time before I had the mini repaired by AppleCare.
    When the mini came back, it registered on the Apple TV as a new computer and I couldn't sync with it without losing hundreds of dollars of content.
    All was okay until the other night when Apple's defective update for the ATV erased ALL my content. I updated it to 3.1 this morning, which Apple indicated might fix the problem. It didn't. The old content is all gone.
    My ATV is out of warranty, so I removed the old HD and copied the files from the "Purchased" folder to my mini. That saved most 101 items that I purchased since 12/08 (but not all for some reason). I lost all content prior to 12/08 that I purchased, as well as some content since 12/08 that I purchased.
    I need to keep the old HD untouched until I can purchase data recovery software. I'd like to just put a spare IDE HD in that I have into the ATV and just start over with what is in my Mac mini iTunes.
    So, how does one do that? I'm not gifted with vast Unix knowledge or experience and I don't want to clone the old HD and risk losing more data if it writes to the HD for some reason.
    Thanks.

    Hi Atagahi,
    Firstly, have you emailed Apple iTunes support indicating your issue? There have been instances in which Apple will allow re-downloading of all content you've purchased on the iTunes store.
    Secondly, I highly recommend you get an external usb hard drive, attach it to your mini and use it as a Time Machine drive to keep your iTunes purchases safe. It's a fact of life that all hard disk drives will eventually fail. The Apple TV should never be used as any kind of permanent storage space; think of it as a 'temporary holding' zone. And as you've unfortunately already experienced, a glitch wiped out all content on the Apple TV.
    As regards your original question, it seems like there have been folks who've done just that...taken the internal drive in the Apple TV out and attached it to a mac and copied files from the Apple TV hard drive. I have not had to do such, so I cannot offer any help here except for Linda's suggestion on googling the net for solutions.
    Good luck and hope you get all your purchased content back Atagahi!
    Message was edited by: Alec

  • Can someone please tell me how to format a new disk to ZFS format?

    I have a Sun v240 with Solaris 10 update 8 installed on a single 73GB harddisk. Everything is working fine. I just purchased a another identical harddisk online. I plugged the disk into my v240 and ran 'devfsadm' and solaris found the new disk. I want to add this disk to my existing ZFS pool as a mirror. However, this disk was originally formatted with a UFS file system. So when I run:
    zpool attach rpool c1t0d0 c1t1d0I get:
    /dev/dsk/c1t1d0s0 contains a ufs filesystem.I understand the error message but I don't know how to format the disk to have a ZFS file system instead. Note that I am extremely new to Solaris, ZFS, and pretty much everything Sun - I bought this server on eBay so that I could learn more about it. It's been pretty fun so far but need some help here and there.
    For some reason I can't find a single hit on Google telling me how to just simply format a disk to ZFS. Can I use the 'format' command? Maybe you don't "format" disks for ZFS? I have no idea. I might not have the right terminology. If so, apologies. Can anyone help me on this?
    Thanks a lot! =D
    Jonathon

    Yes, you were right. The partitions were totally different. Here is what I saw:
    For c1t0d0:
    # format
    Part      Tag    Flag     Cylinders         Size            Blocks
      0       root    wm       0 - 14086       68.35GB    (14087/0/0) 143349312
      1 unassigned    wm       0                0         (0/0/0)             0
      2     backup    wm       0 - 14086       68.35GB    (14087/0/0) 143349312
      3 unassigned    wm       0                0         (0/0/0)             0
      4 unassigned    wm       0                0         (0/0/0)             0
      5 unassigned    wm       0                0         (0/0/0)             0
      6 unassigned    wm       0                0         (0/0/0)             0
      7 unassigned    wm       0                0         (0/0/0)             0For c1t1d0:
    # format
    Part      Tag    Flag     Cylinders         Size            Blocks
      0       root    wm       0 - 12865       62.43GB    (12866/0/0) 130924416
      1       swap    wu   12866 - 14079        5.89GB    (1214/0/0)   12353664
      2     backup    wm       0 - 14086       68.35GB    (14087/0/0) 143349312
      3 unassigned    wm   14080 - 14086       34.78MB    (7/0/0)         71232
      4 unassigned    wm       0                0         (0/0/0)             0
      5 unassigned    wm       0                0         (0/0/0)             0
      6 unassigned    wm       0                0         (0/0/0)             0
      7 unassigned    wm       0                0         (0/0/0)             0So then I ran the following:
    # prtvtoc /dev/rdsk/c1t0d0s0 | fmthard -s - /dev/rdsk/c1t1d0s0
    fmthard:  New volume table of contents now in place.Then I rechecked the partition table for c1t1d0:
    # format
    Part      Tag    Flag     Cylinders         Size            Blocks
      0       root    wm       0 - 14086       68.35GB    (14087/0/0) 143349312
      1 unassigned    wu       0                0         (0/0/0)             0
      2     backup    wm       0 - 14086       68.35GB    (14087/0/0) 143349312
      3 unassigned    wu       0                0         (0/0/0)             0
      4 unassigned    wu       0                0         (0/0/0)             0
      5 unassigned    wu       0                0         (0/0/0)             0
      6 unassigned    wu       0                0         (0/0/0)             0
      7 unassigned    wu       0                0         (0/0/0)             0Woo-hoo!! It matches the first disk now! :)
    Then I tried to attach the new disk to the pool again:
    # zpool attach -f rpool c1t0d0s0 c1t1d0s0
    Please be sure to invoke installboot(1M) to make 'c1t1d0s0' bootable.
    Make sure to wait until resilver is done before rebooting.
    bash-3.00# zpool status
      pool: rpool
    state: ONLINE
    status: One or more devices is currently being resilvered.  The pool will
            continue to function, possibly in a degraded state.
    action: Wait for the resilver to complete.
    scrub: resilver in progress for 0h0m, 0.40% done, 0h58m to go
    config:
            NAME          STATE     READ WRITE CKSUM
            rpool         ONLINE       0     0     0
              mirror-0    ONLINE       0     0     0
                c1t0d0s0  ONLINE       0     0     0
                c1t1d0s0  ONLINE       0     0     0  30.3M resilvered
    errors: No known data errorsBoo-yah!!! ++Does little dance++
    Then, after resilvering completed I ran:
    # installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c1t1d0s0I think I'm starting to understand this now. I also shutdown the server to the OpenBoot prompt and booted off of the new disk and it worked! Also, my bootup time to login has drastically decreased - I would say it's about half the time it was before I added the mirror disk. So I believe the server is properly reading from both disks simultaneously in order to get better bandwidth. Cool! :)
    Thanks for the help!
    Jonathon

  • How can I solve this error message? Some of your photos, including the photo "IMG_0374.jpg", were not copied to the iPad "(my name's) iPad" because they cannot be displayed on your iPad.

    how can I solve this error message? "Some of your photos, including the photo “IMG_0374.jpg”, were not copied to the iPad “(my name’s) iPad” because they cannot be displayed on your iPad."
    There were 273 photos in the event syncing from my Mac, but only the last 103 made it to the ipad. Most of the photos were taken by an iphone. I would appreciate any thoughts or insights - thanks.

    Adrian-
    That error message suggests the photo is somehow corrupt.
    Do you have the Apple Camera Connection Kit?  You can set up a USB thumb drive with MS-DOS FAT-32 format and copy your photos to it into a folder named DCIM.  Assuming they have an 8 character plus suffix name, the iPad will recognize them and give you the option of transferring them via the Kit's USB adapter.
    Once they are transferred, you can find out if there is a problem with any.
    Fred

Maybe you are looking for

  • My Epson Stylus RX700 is no longer supported...any ideas?

    Upgraded to Lion today and can't get my Epson Stylus RX700 scanner to open anymore b/c "PowerPC applications are no longer supported"...and doesn't seem to have what I need on the Epson page...

  • No Startup Chime on the Boss's MacBook

    My boss is currently in Mexico and his MacBook has started having problems. He can turn it on, the power light comes on and the HD starts spinning, but it never gets to the startup chime. It simply continues to run with a black screen until he holds

  • Live meeting v806362.215 won't install with sccm 2012

    I'm trying to install Live Meeting 2007 client v806362.215 under SCCM 2012 application model using the .MSI.  "I get a message that says the installer was interrupted before Microsoft Office Live Meeting 2007 could be installed.  You need to restart

  • Asynchronous XI- RFC and RFC- XI scenario - strange problem

    Hello XI-Xperts, I've come to really strange problem, which I would like to share with you and possibly get an explanation. I have an asynchronous scenario with ending XI->RFC. The RFC function in R/3 has got an optional parameter called SENDER, whic

  • Error 1430

    I am a fairly inexperienced Labview user and when I run the program I created in order to Read Analog Input Signals I get this error message 1430 <Occured at Open/Create/Replace File in NI_HTML_lvclassave Report to File.vi->Voltage - Continuous Input