08-13-2024 03:20 AM
Could you please check now? Otherwise, I will try on another laptop. Somehow it seems not to change the version. I tried several times.
Thank you
08-13-2024 03:55 AM - edited 08-13-2024 03:56 AM
Hi Raj,
@HarshRaj18 wrote:
Could you please check now? Otherwise, I will try on another laptop. Somehow it seems not to change the version. I tried several times.
It changes the LabVIEW version when you use SaveForPrevious…
On your VI: why don't you cleanup the block diagram? Readable code helps to minimize problems!
See this:
08-13-2024 07:50 AM
One of my suspicions was correct. Each time you write your command, the device sends the OK response and then the data. So you need two reads after the sending the command. The first read will be the OK and the second read will be your data.
08-13-2024 08:31 AM - edited 08-13-2024 08:34 AM
I just took longer to do a clean up than I should have. But here is how I would set this up. The main thing I did here was create a subVI for sending the command. The insides of that subVI are concatenating the carriage return to the command (I do not trust the VISA property), write the command, read the acknowledgement, and output if it was an actual ACK. I then use this for the setup and the data request.
08-18-2024 08:37 PM
Hello,
Sorry for late follow up. I hope these files are in 2019 version. Here I attach the file provided by you with a little modification. It works fine and responds quickly to the flow change value, however, it is not in the right format after data collection. A modified file is attached to show how I want to record the data. But my modified file doesn't respond to the flow change value quickly. I am attaching the Excel file as well. Please feel free to do any medication and suggest any changes—a huge thanks for your guidance.
08-19-2024 02:42 AM
Hi,
I could solve the earlier problem and the instrument is logging the data correctly. However, I want to use this data logging file to control a PID system. How can I use the same "Flow Modified PID" file (which is already working for data logging) in the file "TSIFlow PID Test" as subVi so that it shows the same value it is reading in the logging file? It reads the Flow, Temp, and Pressure with logging file but when I use it as SubVi, it doesn't read anything in the PID Vi ("TSIFlow PID Test" marked in Blue).
In short, data logging is done but I can't use that Vi to control the PID. I can clarify if it needs more clarification. Thank you.
08-19-2024 02:54 AM
Somehow the Vi were not attached, here it is in 2019 version. Also, the Zip file contains all the three files together.
08-19-2024 03:02 AM
Hi Raj,
@HarshRaj18 wrote:
How can I use the same "Flow Modified PID" file (which is already working for data logging) in the file "TSIFlow PID Test" as subVi so that it shows the same value it is reading in the logging file? It reads the Flow, Temp, and Pressure with logging file but when I use it as SubVi, it doesn't read anything in the PID Vi ("TSIFlow PID Test" marked in Blue).
You need to OBEY DATAFLOW!
Important: set a better icon on your subVI… (Open icon borders are really annoying!)
08-19-2024 07:55 AM
@GerdW wrote:
- Other option: run the current subVI in parallel to your MainVI and communicate between both VIs using queues or channels…
I would go so far as to break up this application into three loops.
1. Data reading loop: Reads the measurements from the device.
2. Main loop: handles the State Machine and PID control.
3. Logging loop: Saves the data to the log file.
The idea here is to use Queues to pass the data from the reading loop to the other two loops who do whatever it is they need to do with the data.