C#: Controlling a power supply using VISA libraries and the device USB-TP PIA4850. Not able to read the power supply output properlyAre there any good C# to usb device libraries?Control USB port's power?Reading from USB device and sending queries to it, in C#Creating a Dynamic Chart using MScharts in C#Is Automapper supposed to work with private setters OOB?Xamarin MonoAndroid Azure mobile service InsertAsyncPython VISA in Matlab 2015. Not able to readStructure for controlling/monitoring external equipment in C# MVVM?Power cycling a USB device?Labview VISA timeout, aborting issue

Extract more than nine arguments that occur periodically in a sentence to use in macros in order to typset

What does chmod -u do?

How to explain what's wrong with this application of the chain rule?

Recommended PCB layout understanding - ADM2572 datasheet

15% tax on $7.5k earnings. Is that right?

Why does AES have exactly 10 rounds for a 128-bit key, 12 for 192 bits and 14 for a 256-bit key size?

Can I still be respawned if I die by falling off the map?

Creepy dinosaur pc game identification

Can I visit Japan without a visa?

Why is so much work done on numerical verification of the Riemann Hypothesis?

How to hide some fields of struct in C?

On a tidally locked planet, would time be quantized?

Can the US President recognize Israel’s sovereignty over the Golan Heights for the USA or does that need an act of Congress?

Why did the EU agree to delay the Brexit deadline?

Store Credit Card Information in Password Manager?

Can a College of Swords bard use a Blade Flourish option on an opportunity attack provoked by their own Dissonant Whispers spell?

What is the English pronunciation of "pain au chocolat"?

What exact color does ozone gas have?

PTIJ: Haman's bad computer

Angel of Condemnation - Exile creature with second ability

Mixing PEX brands

What are some good ways to treat frozen vegetables such that they behave like fresh vegetables when stir frying them?

Why would a new[] expression ever invoke a destructor?

Yosemite Fire Rings - What to Expect?



C#: Controlling a power supply using VISA libraries and the device USB-TP PIA4850. Not able to read the power supply output properly


Are there any good C# to usb device libraries?Control USB port's power?Reading from USB device and sending queries to it, in C#Creating a Dynamic Chart using MScharts in C#Is Automapper supposed to work with private setters OOB?Xamarin MonoAndroid Azure mobile service InsertAsyncPython VISA in Matlab 2015. Not able to readStructure for controlling/monitoring external equipment in C# MVVM?Power cycling a USB device?Labview VISA timeout, aborting issue













1















I am tring to control a power supply (from Kikusui), using the Kikusui device, USB-TP PIA4850. I use the library, Ivi.Visa.Interop. Following is the code where I am succesfully able to control the power supply, by setting the desired voltage.



(Link to programming guide: https://www.kikusui.co.jp/kiku_manuals/P/PIA4800/english/index.html)



(Link to operation manual: https://www.kikusui.co.jp/kiku_manuals/P/PIA4850_E5.pdf)



Using Ivi.Visa.Interop;
namespace USBTPTest

class USBTPController


private IResourceManager3 rm = new ResourceManager();
private IMessage iMessage;

public USBTPController() //to get the address of the device connected and open the address if found

string[] adrsList = rm.FindRsrc("?*");
if (adrsList.Count() != 0)

Open(adrsList[0]);



public bool Open(string str)

string addr = str;
iMessage = (IMessage)rm.Open(addr, AccessMode.NO_LOCK, 0, "");

//iMessage.WriteString("TRM 2");
iMessage.WriteString("NODE 5");
iMessage.WriteString("CH 1");
iMessage.WriteString("REM 1");
bOpened = true;
return true;


public bool SetVoltage(float vol) //method to set the desired voltage to the power supply, when called with an appropriate argument


The set voltage is checked by a multimeter on the power supply terminals. Similarly current is also set and checked. Until here the code runs and gives the expected results.



public string ReadVOut()

iMessage.WriteString("VOUT?"); //Query OUT(ON/OFF) measurement value
string VOutStatus;
VOutStatus = iMessage.ReadString(1024); //Read from PIA
return VOutStatus;

public string ReadIOut()


iMessage.WriteString("IOUT?"); //Query OUT(ON/OFF) measurement value
string COutStatus;
COutStatus = iMessage.ReadString(1024); //Read from PIA
return COutStatus;






The problem occurs when I read the voltage/current values being outputted. Although I am able to read the values correctly, sometimes reading Voltage using ReadVOut() gives current and vice versa. I am not able to figure out if its a fault in the code or in the power supply I am connected to, or something else. And kind of help/ideas/leads would be much appreciated.










share|improve this question




























    1















    I am tring to control a power supply (from Kikusui), using the Kikusui device, USB-TP PIA4850. I use the library, Ivi.Visa.Interop. Following is the code where I am succesfully able to control the power supply, by setting the desired voltage.



    (Link to programming guide: https://www.kikusui.co.jp/kiku_manuals/P/PIA4800/english/index.html)



    (Link to operation manual: https://www.kikusui.co.jp/kiku_manuals/P/PIA4850_E5.pdf)



    Using Ivi.Visa.Interop;
    namespace USBTPTest

    class USBTPController


    private IResourceManager3 rm = new ResourceManager();
    private IMessage iMessage;

    public USBTPController() //to get the address of the device connected and open the address if found

    string[] adrsList = rm.FindRsrc("?*");
    if (adrsList.Count() != 0)

    Open(adrsList[0]);



    public bool Open(string str)

    string addr = str;
    iMessage = (IMessage)rm.Open(addr, AccessMode.NO_LOCK, 0, "");

    //iMessage.WriteString("TRM 2");
    iMessage.WriteString("NODE 5");
    iMessage.WriteString("CH 1");
    iMessage.WriteString("REM 1");
    bOpened = true;
    return true;


    public bool SetVoltage(float vol) //method to set the desired voltage to the power supply, when called with an appropriate argument


    The set voltage is checked by a multimeter on the power supply terminals. Similarly current is also set and checked. Until here the code runs and gives the expected results.



    public string ReadVOut()

    iMessage.WriteString("VOUT?"); //Query OUT(ON/OFF) measurement value
    string VOutStatus;
    VOutStatus = iMessage.ReadString(1024); //Read from PIA
    return VOutStatus;

    public string ReadIOut()


    iMessage.WriteString("IOUT?"); //Query OUT(ON/OFF) measurement value
    string COutStatus;
    COutStatus = iMessage.ReadString(1024); //Read from PIA
    return COutStatus;






    The problem occurs when I read the voltage/current values being outputted. Although I am able to read the values correctly, sometimes reading Voltage using ReadVOut() gives current and vice versa. I am not able to figure out if its a fault in the code or in the power supply I am connected to, or something else. And kind of help/ideas/leads would be much appreciated.










    share|improve this question


























      1












      1








      1








      I am tring to control a power supply (from Kikusui), using the Kikusui device, USB-TP PIA4850. I use the library, Ivi.Visa.Interop. Following is the code where I am succesfully able to control the power supply, by setting the desired voltage.



      (Link to programming guide: https://www.kikusui.co.jp/kiku_manuals/P/PIA4800/english/index.html)



      (Link to operation manual: https://www.kikusui.co.jp/kiku_manuals/P/PIA4850_E5.pdf)



      Using Ivi.Visa.Interop;
      namespace USBTPTest

      class USBTPController


      private IResourceManager3 rm = new ResourceManager();
      private IMessage iMessage;

      public USBTPController() //to get the address of the device connected and open the address if found

      string[] adrsList = rm.FindRsrc("?*");
      if (adrsList.Count() != 0)

      Open(adrsList[0]);



      public bool Open(string str)

      string addr = str;
      iMessage = (IMessage)rm.Open(addr, AccessMode.NO_LOCK, 0, "");

      //iMessage.WriteString("TRM 2");
      iMessage.WriteString("NODE 5");
      iMessage.WriteString("CH 1");
      iMessage.WriteString("REM 1");
      bOpened = true;
      return true;


      public bool SetVoltage(float vol) //method to set the desired voltage to the power supply, when called with an appropriate argument


      The set voltage is checked by a multimeter on the power supply terminals. Similarly current is also set and checked. Until here the code runs and gives the expected results.



      public string ReadVOut()

      iMessage.WriteString("VOUT?"); //Query OUT(ON/OFF) measurement value
      string VOutStatus;
      VOutStatus = iMessage.ReadString(1024); //Read from PIA
      return VOutStatus;

      public string ReadIOut()


      iMessage.WriteString("IOUT?"); //Query OUT(ON/OFF) measurement value
      string COutStatus;
      COutStatus = iMessage.ReadString(1024); //Read from PIA
      return COutStatus;






      The problem occurs when I read the voltage/current values being outputted. Although I am able to read the values correctly, sometimes reading Voltage using ReadVOut() gives current and vice versa. I am not able to figure out if its a fault in the code or in the power supply I am connected to, or something else. And kind of help/ideas/leads would be much appreciated.










      share|improve this question
















      I am tring to control a power supply (from Kikusui), using the Kikusui device, USB-TP PIA4850. I use the library, Ivi.Visa.Interop. Following is the code where I am succesfully able to control the power supply, by setting the desired voltage.



      (Link to programming guide: https://www.kikusui.co.jp/kiku_manuals/P/PIA4800/english/index.html)



      (Link to operation manual: https://www.kikusui.co.jp/kiku_manuals/P/PIA4850_E5.pdf)



      Using Ivi.Visa.Interop;
      namespace USBTPTest

      class USBTPController


      private IResourceManager3 rm = new ResourceManager();
      private IMessage iMessage;

      public USBTPController() //to get the address of the device connected and open the address if found

      string[] adrsList = rm.FindRsrc("?*");
      if (adrsList.Count() != 0)

      Open(adrsList[0]);



      public bool Open(string str)

      string addr = str;
      iMessage = (IMessage)rm.Open(addr, AccessMode.NO_LOCK, 0, "");

      //iMessage.WriteString("TRM 2");
      iMessage.WriteString("NODE 5");
      iMessage.WriteString("CH 1");
      iMessage.WriteString("REM 1");
      bOpened = true;
      return true;


      public bool SetVoltage(float vol) //method to set the desired voltage to the power supply, when called with an appropriate argument


      The set voltage is checked by a multimeter on the power supply terminals. Similarly current is also set and checked. Until here the code runs and gives the expected results.



      public string ReadVOut()

      iMessage.WriteString("VOUT?"); //Query OUT(ON/OFF) measurement value
      string VOutStatus;
      VOutStatus = iMessage.ReadString(1024); //Read from PIA
      return VOutStatus;

      public string ReadIOut()


      iMessage.WriteString("IOUT?"); //Query OUT(ON/OFF) measurement value
      string COutStatus;
      COutStatus = iMessage.ReadString(1024); //Read from PIA
      return COutStatus;






      The problem occurs when I read the voltage/current values being outputted. Although I am able to read the values correctly, sometimes reading Voltage using ReadVOut() gives current and vice versa. I am not able to figure out if its a fault in the code or in the power supply I am connected to, or something else. And kind of help/ideas/leads would be much appreciated.







      c# visa






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 11 at 0:27







      Himanshu Soni

















      asked Mar 8 at 1:56









      Himanshu SoniHimanshu Soni

      134




      134






















          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55055656%2fc-controlling-a-power-supply-using-visa-libraries-and-the-device-usb-tp-pia485%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55055656%2fc-controlling-a-power-supply-using-visa-libraries-and-the-device-usb-tp-pia485%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

          Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

          2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived