04-07-2022 04:37 PM
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?
Solved! Go to Solution.
04-07-2022 05:48 PM
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.
04-07-2022 06:07 PM
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:
And tweaking the "*IDN?\n" constant to be a command for your device.
04-07-2022 06:08 PM
This video will be a crash course for you - https://labviewwiki.org/wiki/VIWeek_2020/Proper_way_to_communicate_over_serial
04-07-2022 08:07 PM - edited 04-07-2022 08:13 PM
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
04-07-2022 08:09 PM
Thanks for suggestion.
04-07-2022 10:17 PM
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
04-07-2022 10:28 PM
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).
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):
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):
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.
04-07-2022 11:30 PM
Yes my power supply is very simple with just basic functions
04-07-2022 11:32 PM
Thank you very much friend, this suggestion will help me a lot.