LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Export Data from another VI and Pause issue while Dynamically calling another VI

Solved!
Go to solution

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.

Measurments & Control  VI - Simulation.png

 

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?? 

Save Data VI.png

 

NOTE: Our system uses two cDAQ-9185 Chasses for measurements and controls, that are synchronized to each other.

 

Best Regards,

Ata Alkhatib

0 Kudos
Message 1 of 9
(865 Views)

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.

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 2 of 9
(828 Views)

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.

 

Measurments & Control  VI - Simulation_rev01.png

 

 

Best regards,

Ata 

0 Kudos
Message 3 of 9
(782 Views)

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.


  • The upper left loop will run as fast as possible and generate some random numbers.
  • When you stop the loop then (and only then!= your subVI will execute: THINK DATAFLOW!
  • The loop in the upper right will execute only once after the other loop has finished (THINK DATAFLOW!) because the stop condition is always TRUE…
  • The event structure at the bottom will wait for an event and try to call&run some subVI (for which reason?)…
  • Please define "stopped working well"!
  • Your code cannot "stop for 1 second" and then "continue running": Once the loop is stopped it stays stopped…
  • DON'T USE THE "RUN CONTINUOUS" BUTTON!

You still don't provide down-converted VIs as asked for in your other thread! (File->Save for previous)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 9
(739 Views)

Hi GerdW,

 

Thanks for answering and advising.

 

Regarding your comments below:

 

  • The upper left loop will run as fast as possible and generate some random numbers.
  •      -Yes, those random numbers represents instruments collecting measurements in the actual systems.  
  • When you stop the loop then (and only then!= your subVI will execute: THINK DATAFLOW!
  •      - Understood, then I cannot use the collecting data sub VI in this case to pass the measured date to the collect reading file and take readings, I may use the Invoke node ? but I didn't understand how it work and how can I call the values from another VI.
  • The loop in the upper right will execute only once after the other loop has finished (THINK DATAFLOW!) because the stop condition is always TRUE…
  •      - Those represents the signals I'm going to generate using DAQmx to control the valves in my actual system, should I combine both while loops in the same loop?
  • The event structure at the bottom will wait for an event and try to call&run some subVI (for which reason?)…
  •     - 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 ? 
  • 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.
  • DON'T USE THE "RUN CONTINUOUS" BUTTON!
  •      - I'm not using it.

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

Download All
0 Kudos
Message 5 of 9
(716 Views)

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?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 9
(704 Views)

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. 

Control Simulation_rev02.png

 

Best Regards,

Ata Alkhatib

Download All
0 Kudos
Message 7 of 9
(664 Views)

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!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 9
(658 Views)
Solution
Accepted by topic author ataalkhatib97

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.

 

ataalkhatib97_0-1699380595931.png

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 

 

Download All
0 Kudos
Message 9 of 9
(648 Views)