12-11-2024 10:59 PM - edited 12-11-2024 11:17 PM
Greetings,
I am trying to use the VISA VIs for the first time to interface with a dual channel Sorensen benchtop power supply (I can provide the part number in the morning if that's important). I borrowed a routine from a previous project that my retired colleague wrote since I'm not very familiar with instrument communication in LabVIEW. That VI seemed to run fine on its own, but when I put it in the main loop of my larger program, it lags significantly and is no longer feasible for real time operation. I did make some modifications to what my colleague had, but nothing that I would think would cause performance issues.
I've attached a VI with exactly what I wrote for communication with the power supply in my main program, just on its own to reduce clutter (when I remove this part from my main program, it runs fine. So I'm fairly sure the VISA VIs are causing the issue). I'm assuming (hoping) this is just the result of a simple error I am overlooking due this being my first time using these functions. Let me know if there's anything I can clarify, and thanks in advance for any help!
12-12-2024 02:22 AM
A project file alone does not contain any code. Make sure to attach your source.
12-12-2024 06:14 AM - edited 12-12-2024 06:15 AM
Apologies. See attached for the new project folder.
12-12-2024 06:30 AM
The main read/write VI.
12-12-2024 09:40 AM
The project still has no idea about the locations of your VIs and if we try to add them, there are conflicts..
Your toplevel also seems to be in the subVI folder, seems confusing.
Your toplevel VI is a greedy loop that cannot be stopped, just aborted. It calls a single subVI but almost nothing is connected except the resource and error. I recommend a more reasonable connector pane. You can use clusters for related controls/indicators.
(You seem to be using "bytes at port", which is most often incorrect, especially if there is a termination character.)
I am not a "hardware guy", so hopefully somebody else can help, but there is definitely code smell here.
12-12-2024 01:56 PM
Hi humble,
@humble_programmer wrote:
I borrowed a routine from a previous project that my retired colleague wrote since I'm not very familiar with instrument communication in LabVIEW. That VI seemed to run fine on its own, but when I put it in the main loop of my larger program, it lags significantly and is no longer feasible for real time operation. I did make some modifications to what my colleague had, but nothing that I would think would cause performance issues.