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: 

Programmable power supply

Solved!
Go to solution

Hello, I want to design control software for my power supply which has serial interface, but the communication protocol is non-standard so i cannot find any driver for it, I only have serial communication command set, I'm very new at LabView and I dont know where to start, commands are looking simple, just set voltage/current and read output - disable/enable output and read CC-CV state, should I create driver first refer to command set? Or how can I define these non-standard command set? Please can you help me? 

0 Kudos
Message 1 of 11
(2,540 Views)
Solution
Accepted by topic author BerkayBtr

I would start by making a VI for each of these commands.  I would also go so far as to make this into a class so that the class can hold the VISA Session and the "machine address".  You could even make a VI for that prepends the machine address and Line Feed (\n) and write to the supply.  I would also make a VI that sends a command and then reads the reply.  You can use these two lower level VIs in each of your other VIs for each command.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 11
(2,525 Views)

It sounds like you should probably start with establishing communication with the device using a simple VI, which will show you how to use the nodes you need. I'd look at the basic example you can find by going to Help-Find Examples and browsing here:

avogadro5_0-1649372755897.png

And tweaking the "*IDN?\n" constant to be a command for your device.

Message 3 of 11
(2,519 Views)

This video will be a crash course for you - https://labviewwiki.org/wiki/VIWeek_2020/Proper_way_to_communicate_over_serial

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 4 of 11
(2,518 Views)

Thanks for your answer, I've already estabilished test connection with NI-MAX and send commans and got right responses, I have watched tenth of videos about simple serial communication but what I don't know is how to design a voltage/current knob to adjust voltage from front panel instead of sending single command with simple example, as I told I'm totally new to LabView I have started to learn 1 week ago

0 Kudos
Message 5 of 11
(2,490 Views)

Thanks for suggestion.

0 Kudos
Message 6 of 11
(2,489 Views)

To be honest, this is the simplest command set I have seen for an instrument (maybe the instrument is simple enough)

 

 

ZXY6010S Communication Protocol/Command List
----------------------------------------------------------------------------
a command returns machine model
v command returns firmware version
su command sets voltage
si command sets ampere
so command sets output stage
sa command clears AH value
-----------------------------------------------------------------------------
ru command reads output voltage
ri command reads output current
rc command reads CC - CV state
rt command reads temperature
ro command reads output state On or Off
ra command reads AH value
------------------------------------------------------------------------------

Machine Model: Aa\n ----- Returns machine model
Firmware Version: Av\n ----- Returns firmware version
------------------------------------------------------------------------------

WRITE Commands:

("A" Represents machine address, can be selected A to Z)

Voltage WRITE: AsuXXXXX\n ----- Ex. Asu00258\n Sets voltage as 2.58V
Ampere WRITE: AsiXXXX\n ----- Ex. Asi0250\n Sets ampere as 2.50A
Output State WRITE: Aso0\n = Off
Aso1\n = On
Clear AH Value: Asa0\n
------------------------------------------------------------------------------

READ Commands:

Voltage READ: Aru\n ----- Returns Ex. Aru01120 - 11.20V
Current READ: Ari\n ----- Returns Ex. Ari0924 - 9.24A
CC-CV State READ: Arc\n ----- Returns Arc0 means CC - Arc1 means CV
Temp READ: Art\n ----- Returns Ex. Art50 - 50C
Output State READ: Aro\n ----- Returns Aro0 means OFF - Aro1 Means ON
AH READ: Ara\n ----- Returns Ex. Ara000010 - 0.10AH

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 7 of 11
(2,455 Views)
Solution
Accepted by topic author BerkayBtr

Hi BerkayBtr,

 


@BerkayBtr wrote:

Thanks for your answer, I've already estabilished test connection with NI-MAX and send commans and got right responses, I have watched tenth of videos about simple serial communication but what I don't know is how to design a voltage/current knob to adjust voltage from front panel instead of sending single command with simple example, as I told I'm totally new to LabView I have started to learn 1 week ago


For this, you probably want to use "Format into String" or similar.

 

An example might be like this (here I do the full command in one part, but I also would suggest something like what Crossrulz mentioned with separate VIs to set the address and \n parts).

 

cbutcher_0-1649388256657.png

 

Here the "Display Style" of both the front panel indicator ("Command to Set Voltage") and the Format String on the block diagram are set to "\" or '\' Codes Display (via right click menu):

cbutcher_1-1649388314293.png

 

This can be helpful to see the characters like the '\n'.

 

The other part that you might or might not know about is the "Connector Pane" (top right on the front panel):

cbutcher_2-1649388413873.png

Clicking in here allows you to set the externally accessible controls and indicators for your VI (so you can use it in other VIs more effectively). This is similar to setting parameters or return values in text-based programming languages (if you're more familiar with that concept).

See Building the Connector Pane for more information.

 

 


GCentral
Message 8 of 11
(2,450 Views)

Yes my power supply is very simple with just basic functions

0 Kudos
Message 9 of 11
(2,444 Views)

Thank you very much friend, this suggestion will help me a lot.

0 Kudos
Message 10 of 11
(2,443 Views)