dose of the device does not react to the C++ code

Hello.

I have meassuring keithley 237 system, connected to the port COM4.

And I commands manual keithley insturment.

When I use assistant LabView Instrument IO and put in "query and analyze" the steps of these commands, the device reacts as it should.

But when I try to write and run my own C++ code, device does not react.

just no reaction at all!

Maybe someone can help me and tell me what's missing.

Here's my C++ code:

#include #include "visa.h"

using namespace std;int main (int argc, char *argv[]){       ViStatus status;    ViSession defaultRM, instr;    /* Open Default RM */    status = viOpenDefaultRM(&defaultRM);

    if (status != VI_SUCCESS) {        /* Error Initializing VISA...exiting */             return -1;        }

    /* Access other resources */    status = viOpen(defaultRM, "ASRL4::INSTR", VI_NULL, VI_NULL, &instr);

    // here I send commands to device    viPrintf(defaultRM, "F1,0X");           //  "F1,0X" and all another symbols in "" are just commands from keithley manual.          viPrintf(defaultRM, "B1E-6,0,X");    viPrintf(defaultRM, "L11,0X");    viPrintf(defaultRM, "P3X");    viPrintf(defaultRM, "O0X");    viPrintf(defaultRM, "N1X");    viPrintf(defaultRM, "H0X");

    viClose(instr);    viClose(defaultRM);

return 0;}

Hello

There is an obvious problem in your code: viPrintf () accepts as a first parameter a session handle, which is "instr" variable returned by viOpen () in your case. Using the default resource manager leads to incorrect results (BTW, you must add to your code an error checking: I expect viPrintf () to return VI_ERROR_INV_OBJECT or similar error).

As long as an additional indicator, I noticed that you use no termination for your messages: you should check in the documentation for the device if you need to add a stop character (the instruments most want a '\r' or '\r\n' sequence at the end of the messages to accept).

Tags: NI Software

Similar Questions

  • I want to open a file and read by clicking the icon of reading, but hearing does not react.

    I recently moved my computer with Windows 7 in Spain. Everything works fine, but not my Adobe Audition CS5.5. I want to open a file, and then click my play button to play the file, but Adobe does not react. Anyone know what could be the problem?

    I would try to check your hardware configuration to ensure that your playback device is selected and set up correctly

    In the main menu, select Edition > Preferences > Audio hardware

  • my iphone 6s is stolen I had activated find my iphone, but now the device does not appear on my icloud find my iphone please suggest what to do.

    my iphone 6s is stolen I had activated find my iphone, but now the device does not appear on my icloud find my iphone please suggest what to do.

    If your iPhone, iPad or iPod touch is lost or stolen - Apple supports

  • SD-R2312 device does not appear in the hardware Manager

    I have several problems with my Toshiba SD-R2312 Windows XP. Cannot open CD, device does not appear in the hardware Manager, drive is not displayed anywhere.

    First time it happened, I was able to reactivate it as described here.
    http://www.TechSpot.com/VB/all/Windows/t-28912-desperation-Toshiba-DVDROM-malfunction-possible-missing-driver.html

    After working for a few weeks, the drive is 'gone' once again, same symptoms as the first time.
    Try the registry fix again, I found that there are still "UpperFilters" (which I've deleted again), but not Lowerfilters.
    However, which did not help this time.

    I have no "unknown" devices that I could delete (see http://forums.computers.toshiba-europe.com/forums/thread.jspa?threadID=6548&messageID=22638).

    Does anyone have an idea how to get the drive working again? Is there a way to prevent that from happening again?

    Thanks in advance.

    Hello

    If the drive is not displayed in Windows Explorer, perhaps this method can help. Try it!

  • Fingerprint reader does not react anymore while the software seems to work (Thinkpad E530 Windows 10)

    I used logg in via the reader of fingerprints (windows 10) with no problems, now the fingerprint reader does not react anymore when I pull the finger. I managed to remove all the passwords in the password manager (still not sure about it as I don't really understand how all the components work together) hoping that would solve the problem. Not the fingerprint reader software keeps asking me to register a new finger. Everything seems to work fine (I can pick a finger to be registered, type my password windowns) until I asked me to draw the finger on the fingerprint reader: nothing happens! The indicator that shows how the finger was scanned shows nothing at all. Looks like the software works, but the fingerprint reader itself is dead. However, looking into the information system the "TouchStrip Fingerprint Sensor' (WBF mode advanced) seems to work fine.

    Help, please. I don't have any idea how to find out what's not here.

    Thank you very much for the tip! He works in fact :-). Even if it does not seem logical to me, as I never put it in place a front pin - and fingerprint reader work very well even without PIN code. But who cares - the main thing is it works now! So thanks a lot again :-)!

  • I get an error code, ""this device does not work properly because Windows cannot load the drivers required for this device. " (Code 31) "on the computer.

    My drive hard seagate is not recognized on my laptop, I can see it in the legacy of the laptop but has an exclamation deside it, there a message when I tried to solve the problems, error was not fixed, the device status is "this device does not work properly because Windows cannot load the drivers required for this device. (Code 31) »

    Is anyone know how can I access my hard drive again?

    Thank you

    Hello

    You has made changes to the system before the error appearing?  Cancel the changes.

    (1) in Device Manager > right click on the driver, and then select uninstall

    Reboot and Windows will reload the driver

    (2) remove the upper & lower filters that cause errors in Code 31

    http://pcsupport.about.com/od/driverssupport/HT/UpperFilters-LowerFilters.htm

    Access the manufacturer's Web site and search for updated driver

  • Driver VGA Dual-Mode Camera installs but the device does not appear in the list of devices to Windows Photo Gallery

    Driver VGA Dual-Mode Camera installs but the device does not appear in the list of devices to Windows Photo Gallery

    Hello

    I will need to know the brand and model of the device in order to help you solve it.

    You see the device listed in the Control Panel, hardware and sound, scanners and cameras?
    Brent
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • This device does not work properly because Windows cannot load the drivers required for this device. (Code 31)

    Original title: this device does not work properly because Windows cannot load the drivers required for this device. (Code 31) in graphics AMD - 8151 HyperTransport (MC) AGP3.0 Tunnel

    This device does not work properly because Windows cannot load the drivers required for this device. (Code 31) in the graphics AMD - 8151 HyperTransport (MC) AGP3.0 Tunnel, what do I do to fix this help please.

    Jake

    Hey Jake,

    Follow these methods.

    Method 1: Follow these steps:

    (a) restart your computer if you have not already done so. There is always the possibility that the error Code 31 that you see was caused by a temporary problem with Device Manager. If so, a simple reboot can solve the Code 31.

    (b) have you install a device or a change in the Device Manager, just as the Code 31 error appeared? If so, it is very possible that the modification caused the Code 31 error.

    (c) cancel the change if you can restart the computer and then check again the error Code 31. Depending on the changes, some solutions may include:

    Remove or reconfigure newly installed unit.

    Restore a version prior to updating the driver.

    Use system restore to undo the Device Manager recent related changes.

    http://Windows.Microsoft.com/en-us/Windows-Vista/system-restore-frequently-asked-questions

    (d) to remove the registry values filters upper and lower. A common cause of errors in Code 31 is the corruption of two registry values in the class of the CD-ROM/DVD-ROM drive registry key.

    Note: This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following link. http://Windows.Microsoft.com/en-us/Windows-Vista/back-up-the-registry

    Method 2: Update the latest graphic drivers.

    Updated a hardware driver that is not working properly

    http://Windows.Microsoft.com/en-us/Windows-Vista/update-a-driver-for-hardware-that-isn ' t-work correctly

  • My cd rom device does not work because its configuration in the registry is damaged, (error Code 19).

    My cd rom device does not work because its configuration in the registry is damaged, (error Code 19). Tried all the easy solutions (update - was active), any ideas? Thank you

    Hello

    ·         What is the accurate and complete error message?

    ·         You will remember to do recent changes on the computer before this problem?

    I suggest you follow the steps mentioned below:

    Method 1:

    Race fix from the following link and check if the problem persists:

    http://support.Microsoft.com/mats/cd_dvd_drive_problems/en-us

    Method 2:

    If the previous step fails, follow the steps in the link:

    http://support.Microsoft.com/kb/929461

    Method 3:

    If the previous step fails, follow the steps in the link:

    http://TechNet.Microsoft.com/en-us/library/cc772156 (WS.10) .aspx

  • The device does not seem to be pluged?

    Please which hat an en ansewr this

    When I used the Microsoft fix it I get this answer "the device does not appear to be pluged?

    Hi ArtanLala,

    1 are you facing sound problems?

    2 what Microsoft Fixit did you run?

    3. using external speakers?

    If you are facing problems with the sound, you can check with headphones and see if the sound works fine.

  • Computer does not recognize network. -This device does not work properly because Windows cannot load the drivers required for this device. (Code 31)

    Hello!

    I have problems connecting to my network. I stay in a House (not my own) and I can't connect to the network in this House. When I choose the option 'connect to a network', nothing happens. I followed the instructions to display the "Device Manager" and watch the 'map', and he said:

    "This device does not work properly because Windows cannot load the drivers required for this device. (Code 31)

    Click on 'Search for solutions' to send data about this device to Microsoft and to see if there is a solution available. »

    When I click on this button, nothing happens... Should I simply wait for Microsoft to return to me - or is there something else I need to do?

    Thank you!

    Hello

    You must get the drivers latset for m computer support site.

    Delete the "false: entry in Device Manager and install the new drivers."

    Jack-MVP Windows Networking. WWW.EZLAN.NET

  • Error: This device does not work properly because Windows cannot load the...

    I get this error message "this device does not work properly because Windows cannot load the drivers required for this device. (Code 31) "via a wired connection. And that's the Microsoft 6to4 adapt #7 and the same card but the #4 one.  Are these drivers or another file that I could use DL?

    Hi JasonBedgood,

    1. Once you get the error message?
    2. did you of recent changes on the computer?

    This error occurs if the required driver is not installed or the driver is damaged.

    I suggest that you update the driver for the device and check.

    How can I update the driver for network card on the computer

    1. click on Start, click Control Panel, and then double-click System.
    2. click the tab hardware , and then click Device Manager.
    NOTE: If you are prompted for an administrator password or for confirmation, type the password, or click continue.
    3. click on network adapters to expand.
    4. under network adapters, double-click the entry for Microsoft 6to4and then click driver .
    5. click on Update driver software.
    6. follow the Wizard update software driver to update the driver for NICs .

    Updated a hardware driver that is not working properly
    http://Windows.Microsoft.com/en-us/Windows-Vista/update-a-driver-for-hardware-that-isn ' t-work correctly

    If the device driver update did not help then check the link below for one of the thread with the question and try the steps mentioned by Lionel Chen on January 9, 2008
    http://social.technet.Microsoft.com/forums/en-us/itprovistahardware/thread/3a503cdb-e61c-44BC-97c4-0b38b0e5f929/

    I hope this helps!

    Halima S - Microsoft technical support.
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • My DVD player does not work and all the information I can find is "this device does not work correctly.

    Hi, I have Windows Vista and I use a computer laptop Dell studio. When I insert a disc into my CD/DVD drive, the drive spins and it looks like it is about to start and makes the same noise start several times and then just stops. My computer does not record that there is a disc there. If I double click on the DVD drive in 'My computer' it ejects my disc and says "insert the disc in drive E".

    I went on the 'repair' Microsoft online scanner and it told me that there is a problem, but he can fix it. In Device Manager, under CD/DVD-ROM readers I have Optiarc DVD +-RW AD - 7640S. Under device status - general - properties, it says "this device does not work correctly. He also says that I have the updated driver.

    I even uninstalled the driver as a last resort and then restarted my computer. It reinstalled the driver for me, but there was no change. Please help me!

    Hello

    Step 1: Please do all the same underneath if you did some before as is often total
    a process that solves the problem.

    Try this - Panel - Device Manager - CD/DVD - double click on the device - driver tab.
    Click on update drivers (this will probably do nothing) - RIGHT click ON the drive - uninstall.
    RESTART this will refresh the default driver stack. Even if the reader does not appear to continue
    below.

    Then, work your way through these - don't forget the drive might be bad, could be a coward
    cable or slight corrosion on the contacts (usually for a laptop) and other issues.

    Your CD or DVD drive is missing or is not recognized by Windows or other programs
    http://support.microsoft.com/kb/314060 - a Mr Fixit

    The CD drive or the DVD drive does not work as expected on a computer that you upgraded to
    for Windows Vista
    http://support.Microsoft.com/kb/929461

    When you insert a CD or a DVD, Windows Vista may not recognize the disc
    http://support.Microsoft.com/kb/939052

    Your CD or DVD drive cannot read or write media - A Mr Fixit
    http://support.Microsoft.com/GP/cd_dvd_drive_problems

    CD/DVD drive does not appear in Windows Vista, or you receive this error during Windows Vista
    Setup after booting from the DVD (AHCI)
    http://support.Microsoft.com/kb/952951
    Drive CD - R or CD - RW Drive is not recognized as a recordable device
    http://support.Microsoft.com/kb/316529/

    Hardware devices not detected or not working - A Mr Fixit
    http://support.Microsoft.com/GP/hardware_device_problems

    Another possibility is that the cables are loose. Remove ALL power, then make sure that the cables in both
    ends. Remove and replace, do not just tight. For laptops, you can often clean power and
    contacts data with a pencil eraser.

    Some DVD players do not use the Windows default drivers so check with the manufacturer of system and
    manufacturer of device to see if there is a firmware or drivers for your drive if necessary.

    ===============================

    Step 2: You have disc problems as the CD/DVD is actually 4 discs in 1 case (CD & DVD
    Burn and CD and DVD read). So it is not unusual for 1 or 2 operational so that other parts
    do it right.

    Did you follow the Troubleshooting Guide for the reader who still does not work? There are some registry
    entries that do not fix the resolution of problems and those who "could" be the cause.

    Check with your Maker system and a device for the two possible firmware updates and the
    correct registry entries for your car.

    Here are the keys in my opinion, are those in question - for the CD/DVD drive of course subkeys as
    There will be other subkeys in these keys. Do not forget to ask involved specific keys as well as the
    Parameters.

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\IDE

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\0001\System\CurrentControlSet\Enum\IDE

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\ {4D36E965-E325-11CE-BFC1-08002BE10318}

    -----------------------------------------------------------------------

    You can probably find more info here and maybe even the exact registry for your CD/DVD settings
    drive from someone with the same model.

    Forums - a lot of expert real help
    http://Club.myce.com/

    CD/DVD units
    http://www.myce.com/storage/

    I hope this helps.
    Rob - bicycle - Mark Twain said it is good.

  • Huawei Mobile Connect 3 G Modem this device does not work properly because Windows cannot load the drivers required for this device. (Code 31).

    System: Windows 7 Ultimate 64-bit. QC processor 2.5 Ghz, 4 GB RAM, Nvidia 9600GT. The work of modem very well until about a month. Uninstalles the device, I reinstalled it but the same messages. I've updated the driver and software, still nothing. In safe mode, the modem driver is loaded and the devicemanager reports that the device is functioning properly. Once the system is booted in normal mode divcemanager reports: this device does not work properly because Windows cannot load the drivers required for this device. (Code 31). Help, please. I check the settings for the 6to4 drivers and there is no problem.

    Thanx

    Hi rui2010,
     
    Place your machine in a clean boot State to see if another application is in conflict with the modem.
    If this fails, I recommend you reach out to the community Hauwei for assistance:

     
    Aziz Nadeem - Microsoft Support

    [If this post was helpful, please click the button "Vote as helpful" (green triangle). If it can help solve your problem, click on the button 'Propose as answer' or 'mark as answer '. [By proposing / marking a post as answer or useful you help others find the answer more quickly.]

  • Screen saver does not react when I "wiggle" the mouse or press "Esc"; 'Enter', etc.

    I had the same screen saver running for centuries (it goes right through my photos), but in the last few weeks, I am unable to find the screen to 'wake up' 'wiggle' of the mouse or press "Esc"; 'Enter' etc etc.  Its very frustrating because I have to press several keys at random and then wait about 5 minutes for the screen saver turns off.  I'm still on Windows 7 and it is up to date.

    No idea how to get the screensaver to respond normally again?

    Hi Christine,

    I understand that your computer screen saver does not react when you move the mouse or press ESC.

    This problem may be due to the following reasons:

    • Several processes that run in the background.
    • Problem with screen saver.

    Please follow the methods and check them off below if it helps:

    Method 1: Clean boot

    IF this problem is caused by several programs running in the background, clean boot will help you understand.

    Put your system to the clean boot state helps determine if third-party applications or startup items are causing the problem. You must follow the steps in the article mentioned below to perform a clean boot.

    How to perform a clean boot in Windows

    http://support.Microsoft.com/kb/929135

    Note: After troubleshooting, consult this section «How to reset the computer to start normally after a boot minimum troubleshooting»

    Method 2: Change the default screen saver

    Please refer to the following article which will help you change the wallpaper and check if it helps:

    http://Windows.Microsoft.com/en-us/Windows7/change-screen-saver

    Hope this information helps, for assistance please answer.

Maybe you are looking for