LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

creating VI to control Keithley 2231A-30-3 triple channel Power supply

Attach your code!  Hard to tell what you are doing wrong with just the error message.

 

As GerdW said, Read that Fine Manual, it contains all the answers.

0 Kudos
Message 11 of 24
(3,251 Views)

hello to all,

I still have some problem with my vi. I have made small vi to control Power supply. I have attached my code below. there are some issues, please help me to solve it.

1. Using this vi, it is possible to write voltage and current to the power supply, but I cannot read back it.

2. also i cannot make it possible to set limit of voltage and current,above this limit it cannot accept the values.

3. To change the channel, I have to put power supply on local mode, then change the channel and put power supply on remote mode.

0 Kudos
Message 12 of 24
(3,234 Views)

Hi Yash,

 

don't use BytesAtPort, you don't need it to read terminated strings!

 

2. also i cannot make it possible to set limit of voltage and current,above this limit it cannot accept the values.

There surely are commands to set voltage/current limits for your device. Did you look that up in your manual?

 

3. To change the channel, I have to put power supply on local mode, then change the channel and put power supply on remote mode.

What does the manual say about this behaviour?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 13 of 24
(3,232 Views)

thanks for the immediate response.

yes, I read the manual, but I think there is a problem with commands actually. I will try further and check it again. 

0 Kudos
Message 14 of 24
(3,228 Views)

I am currently fighting with the exact same issues as you with the exact same instrument 2231a-30-3 with the 2231a-001. Its "good" to hear that its not just me that is experiencing these issues.

 

I have contacted Keithley support and am trying to work through the issues. I will respond back if I discover anything.

0 Kudos
Message 15 of 24
(3,215 Views)

Ok, I've discovered the issue with the drivers and am currently fixing it. I will upload the corrected drivers once I am done making the revisions.

 

The problem is that every write action needs to end with a line feed character. I discovered this in the Keithley forums...https://forum.tek.com/viewtopic.php?t=125420

 

Also, the *IDN? was expecting the instrument to return 22x0 instead of 22xx. So that has also been changed. I'm sure there will be other little things that come up as well, but I will try to update the driver to a working condition for the 2231a-30-3.

0 Kudos
Message 16 of 24
(3,218 Views)

The commands in the manual and the driver are correct.  What you've done is copy&paste the code from the driver without understanding it and thus muddle the commands in the process.  "Measure:%s:DC?" is not a  command, but "MEASure:VOLT:DC?" is a valid command.  So learn the exact syntax of the commands or USE THE DRIVER VIS!  

 

Here's a simple example of using the drivers.  You can use this example to build a more useful VI to suit your needs.

 

1st subVI initializes communication.

2nd subVI Enables the channel.

3rd subVI set the Max Voltage limit.

4th subVI sets the channel as voltage...should probably switch the order of 3rd and 4th.

5th subVI sets the instrument to remote/local...not needed really.

6th subVI makes a voltage measurement and displays "Voltage Reading"

7th subVI reads the instrument error status and will display an error if one has occurred.

8th subVI closes instrument communication.

 

k22xx_simple_setup.png

 

 

 

0 Kudos
Message 17 of 24
(3,216 Views)

thanks to all.

 cstorey: thanks. reading problem solve. I cannot open your vi because I am using lab-view version 16. Can you please send this vi again in version 16?. BTW thanks for your guidance.

0 Kudos
Message 18 of 24
(3,202 Views)

Here's a 2015 version.  Also note that based on the comments above I disabled the ID Query and made the second subVI the "Set Mode to Remote" VI. k22xx_simple_setup2.png

 

 

Hope this helps.

Craig

0 Kudos
Message 19 of 24
(3,195 Views)

Great work here

Would it be possible for you to share the complete Labview project for 2231A

0 Kudos
Message 20 of 24
(3,077 Views)