From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sorensen XEL USB contol works but not great

I am new with LabVIEW and I am trying to develope a program to control my power supply. I updated a small program I got on this site but it does not  do exactly what I want. Essentially, I would like to be able to select voltage and current and be able to turn on the output which, from the manual I need to use OP 0 to turn off the output and OP 1 to turn it on

 

Was wondering if anyone can help out?

0 Kudos
Message 1 of 6
(2,669 Views)

Good Afternoon,

 

So I looks like you are trying to communicate with your power supply using VISA commands.  Since you are new to LabVIEW, I would first suggest opening up Measurement and Automation Explorer and opening a VISA Test Panel for the serial port connected to the power supply and trying to communicate that way.  This will allow you to verify that you are sending the correct commands, carriage return, etc. without having to run the LabVIEW code every time.

 

Also, have you been able to run code you attached with your power supply?  What kind of behavior have you seen?  I hope you have a great rest of the day!

 

-Cody C

0 Kudos
Message 2 of 6
(2,656 Views)

Yes I did have MAX check if the code works and it does  OK. I also am able to run my labview code but it is just my program look awkward

When I run the code it does as expected, it gives me the ID of the unit and sets the power supply voltage and current

 

I wanted to be able to set the current from the frint panel insead of doing it in the code and was hoping someone can give me hints

0 Kudos
Message 3 of 6
(2,649 Views)

I have created a VI that seems to work OK so far

 

Was wondering if anyone had suggestions on improving it or if they see errors in my code

 

Any help is appreciated

 

 

0 Kudos
Message 4 of 6
(2,624 Views)

Senior,

 

Your code is looking good.

You may consider routing your errors outside of the while loop and using a single error handler.

Also, the sequence structures may not be necessary. You can use your error wires to verify code execution order.

 

Daniel

Applications Engineer
National Instruments
0 Kudos
Message 5 of 6
(2,612 Views)

Thanks

 

I will add your suggestions and test it out

DJR

0 Kudos
Message 6 of 6
(2,561 Views)