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

What defenses are there against being summoned by the Gate spell?

How do I deal with an unproductive colleague in a small company?

Did Shadowfax go to Valinor?

Why can't we play rap on piano?

When a company launches a new product do they "come out" with a new product or do they "come up" with a new product?

Do infinite dimensional systems make sense?

How can I prevent hyper evolved versions of regular creatures from wiping out their cousins?

How old can references or sources in a thesis be?

If human space travel is limited by the G force vulnerability, is there a way to counter G forces?

What is a clear way to write a bar that has an extra beat?

Why "Having chlorophyll without photosynthesis is actually very dangerous" and "like living with a bomb"?

Java Casting: Java 11 throws LambdaConversionException while 1.8 does not

What does the "remote control" for a QF-4 look like?

Does an object always see its latest internal state irrespective of thread?

High voltage LED indicator 40-1000 VDC without additional power supply

How is the claim "I am in New York only if I am in America" the same as "If I am in New York, then I am in America?

Is it possible for a square root function,f(x), to map to a finite number of integers for all x in domain of f?

Can an x86 CPU running in real mode be considered to be basically an 8086 CPU?

Is it legal for company to use my work email to pretend I still work there?

Are astronomers waiting to see something in an image from a gravitational lens that they've already seen in an adjacent image?

"You are your self first supporter", a more proper way to say it

What does "Puller Prush Person" mean?

Maximum likelihood parameters deviate from posterior distributions

Watching something be written to a file live with tail



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






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








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

          1928 у кіно

          Захаров Федір Захарович

          Ель Греко