11-04-2023 12:40 PM
Hello everyone,
I'm new to the LabVIEW and working on upgrading a system that already exist in my university.
I have two VI's that need to be connected, dynamically loaded and run together...
The first VI, called "Measurements & Control VI - Simulation" which represent the VI of the system, where in it we control some electronic valves in the system and reading some measurements from the instruments in the system. And from it I will Dynamically call and run the other VI.
The second VI, called "Save Data VI", where in it, I will opening some files and save the Data.
-------------------------------------------------------
I currently have two issues"
1- I need to read and show the instruments measurements took in the M&C VI to be shown in the "Save Data VI" and be able to save them.
2- When I press the "call button" for the "Save Data VI" from the "M&C VI" and press the "Create new file", the "M&C VI" pauses for around 1 second, where collecting measurements and controlling will be stopped for 1 second, this may affect the system, specially for the controls.
How can I solve this issue??
NOTE: Our system uses two cDAQ-9185 Chasses for measurements and controls, that are synchronized to each other.
Best Regards,
Ata Alkhatib
Solved! Go to Solution.
11-04-2023 05:54 PM
1. Configure the Connector Pane, so that you can wire to the Save Data VI. See Create and Configure a LabVIEW SubVI
2. The Wait(ms) function is wired with a value of 1000ms. Reduce this value and the loop will run and response faster.
11-04-2023 09:26 PM - edited 11-04-2023 09:26 PM
Thanks for your reply!
I followed your comments but it didn't work.
- I removed the "wait function" for 1 second, and still same issue presence , it will stop for around 1 second and then continue running.
- I connected the terminals for the "Save Data VI", but it stopped working well.
Is there a way where I can do it using the Invoke node ? and keep calling and running the "Save Data VI" dynamically.
And maybe a solution for the 1 second pause.
I will try to upload an illustration video.
Best regards,
Ata
11-06-2023 01:05 AM - edited 11-06-2023 01:11 AM
Hi Ata,
@ataalkhatib97 wrote:
I followed your comments but it didn't work.
- I removed the "wait function" for 1 second, and still same issue presence , it will stop for around 1 second and then continue running.
- I connected the terminals for the "Save Data VI", but it stopped working well.
You still don't provide down-converted VIs as asked for in your other thread! (File->Save for previous)
11-06-2023 01:28 PM
Hi GerdW,
Thanks for answering and advising.
Regarding your comments below:
You still don't provide down-converted VIs as asked for in your other thread! (File->Save for previous)
Thanks you for letting my know how, Please find the original files attached in 2019 ver. In the call path I input the string ' Save Data VI', and open it, click on open new file to create a new CSV file, then start collecting data.
Best Regards,
Ata
11-06-2023 02:05 PM
Hi ata,
@ataalkhatib97 wrote:
- Please define "stopped working well"!
- - What I mean by stopped working well, that it wasn't responding to the "Open new file" and "collect data" booleans, I couldn't open new files every time and collect the data when ever I want.
- Your code cannot "stop for 1 second" and then "continue running": Once the loop is stopped it stays stopped…
- - It is not stopped... it is lagged or paused for 1 second and then continue running normally.
There are no "open new file" and "collect data" buttons in your latest VIs…
The lagging of "1 second" may relate to the wait function in one of your VIs…
@ataalkhatib97 wrote:
- - My plan is to have 1 VI for collecting measurements from instruments and controlling the valves, and the other separate VI to collect the measurements, because I don't want the collecting data process to affect the collecting and controlling in anyway.. is there a better way to do it ?
I still don't know why you need an event structure to start/call another VI. You forgot to define a default VI name so I also don't know which VI you try to call/run…
Why don't you place another subVI instead fo the whole event structure?
11-07-2023 08:43 AM
Hello,
I re-structured the VI and replaced the even structure with a sub VI.
Now, like before, it only runs for 1 time and then "WORKFLOW" paused, the Boolean buttons of "Save Readings and Create new file (SETPOINT File)" are not working/responding.
The random numbers below will represent the measurements for the system.
Best Regards,
Ata Alkhatib
11-07-2023 09:24 AM
Hi Ata,
@ataalkhatib97 wrote:
Now, like before, it only runs for 1 time and then "WORKFLOW" paused, the Boolean buttons of "Save Readings and Create new file (SETPOINT File)" are not working/responding.
Without looking at your code: did you remove any loop from your subVI?
Again THINK DATAFLOW: the loop will only iterate when the code within has finished!
11-07-2023 12:14 PM
Hello GerdW! Aka Knight Of NI.
Thanks a lot, now it is working perfectly after following your comments and making some additions:
1- I removed the while loop from the "Save Data VI" --> The sub VI.
2- I made a default path for the Test file to be generated, where I should only change or add a new Test File "Name", and once I click the "Create new file SETPOINT" it will open immediately without pausing or lagging.
"Previously what I was trying to do, is to create this new file when the "Choose file to write window" pop up, and that why it pauses.
3- I added a extra safety switch "Active", because in case the file path and name wasn't inserted in the file path window before clicking on the "Create new file SETPOINT", the system will pause or maybe stopped.
**Please let me know if any further improvement can be done!
Thanks once more!
Best Regards,
Ata Alkhatib