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
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
add a comment |
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
add a comment |
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
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
c# visa
edited Mar 11 at 0:27
Himanshu Soni
asked Mar 8 at 1:56
Himanshu SoniHimanshu Soni
134
134
add a comment |
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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