04-14-2022 07:01 PM
Hello Friends,
I'm trying to design a VI to control my power supply via serial port, controls are "set voltage - set current and output on-off". The VI is working but I can control only voltage or current when I start the VI, if voltage control works, current control doesn't work or vice versa, here is the VI that I have attached, please help me to solve this problem.
Solved! Go to Solution.
04-14-2022 08:10 PM - edited 04-14-2022 08:11 PM
Please attach the VI in an older version - preferably 2016 as most of the users don't use the latest LabVIEW yet.
I have not seen the VI but from your description it sounds like you want the VI to be continuously running to react to your changes in the front panel, if you implementation was not in such a way, it is expected that you've configure the values before you run the VI
04-14-2022 08:56 PM
I have attached again as 2016 version
04-14-2022 09:31 PM
Verifying against the commands (from this post), your implementation is correct. Only one suggestion is to add a 100ms or 500ms delay inside the loop as you're bombarding the power supply continuously with the same set of commands.
What makes you think that the current value is not changing? are you looking at the current readback?
Since you're using the power supply in CV mode, the current will remain actual as long as the current limit is not reached.
04-14-2022 10:44 PM - edited 04-14-2022 10:46 PM
When the output is in "off" state, I can adjust preset voltage or current but not both. When i shut down my power supply and power up again both works, but just sometimes. Its weird. I can see the changes on the display of the power supply, I don't know where is the problem. I have already put delay in loop and set to 500ms, 100ms, 50ms, nothing changed. Its original software works as expected but very badly designed and has very ugly UI, so I want to design my own UI, and it's a good starting point to start learning Labview I guess.
04-14-2022 11:02 PM - edited 04-14-2022 11:04 PM
This is the original UI also made with Labview, but so ugly, source files has been extracted I think, I cannot find them in installation folder.
04-15-2022 02:39 AM - edited 04-15-2022 02:42 AM
If i put each command block into a flat sequence for sequential execution, is it good or bad idea? I think my power supply accepts only one command at a time.
04-15-2022 06:01 AM
@BerkayBtr wrote:
If i put each command block into a flat sequence for sequential execution, is it good or bad idea? I think my power supply accepts only one command at a time.
No, do not use the Flat Sequence Structure. You are already using data flow, via the error wire, to set the order that things happen.
Many devices cannot handle several commands coming in quick succession. Just adding a simple delay (use Stall Dataflow.vim) between your commands will fix this. The amount of time to wait depends on many factors (the device, the communication bus, the command itself, etc.). Generally speaking, 100ms is more than long enough. I did work with an oscilloscope that needed several seconds to handle certain commands.
04-15-2022 12:24 PM
Thank you crossrulz, I will try "stall dataflow"
04-16-2022 04:41 AM
I have tried "Stall Dataflow.vim" between commands, still same behaviour, cannot adjust both presets, but when I stop and then start the VI, it adjust the preset value as seen on the front panel as soon as I start the VI. By the way, my English is not so good, sorry for that, hope I can express my problem well.