LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Global Variable from Control and simulation

Solved!
Go to solution

Hi!

 

I have a probem with the exporting data from the Simulation loop as graph.

 

I have created global variable, but in the front panel is not refreshed or exported needed data, but in the file as global variable do ?!

 

I would like to collect (gather) all data after simulation as Excel data file (export plot data to Excel or save to the speadsheet file) as well as to the terminal image.

 

Please find attached my files - anyone have an idea or solution ?!

 

There must be some easy hint Smiley Frustrated

 

Thanks!

 

Vasco

Download All
0 Kudos
Message 1 of 13
(4,118 Views)
Solution
Accepted by topic author VASCO-1

1) Why are you making this problem so much more complex than it needs to be by using a global variable and another loop like that?

2) Why did you wire the VI's path into the image function? You are trying to overwrite the VI on disk with the image?

3) Make sure not to ignore error outputs.

 

The code shown in the attached screenshot runs fine. I'll take kudos if this helped you.

 

graph_image.png

Message 2 of 13
(4,114 Views)

Hi!

 

Thank You for the hint and advice ... here is also my answer ...

Vasco-global-variable-answer.jpg

0 Kudos
Message 3 of 13
(4,092 Views)

OK, I guess you really do want to overwrite the VI with the exported image of the waveform since you did not take my advice there. Smiley Surprised

0 Kudos
Message 4 of 13
(4,087 Views)

Hi!

 

Here is my modification .... Smiley Wink

 

I have another doubt ... why the data from export plot data differs from those saved by the "regular" Excel file ...

 

Why is the simulation loop finishing faster than the simulation loop is set .... 0 up to 60 seconds with the time step 1 second .... ?!

 

 

Vasco-1-data-flow.jpg

0 Kudos
Message 5 of 13
(4,075 Views)

If you are questioning why the two excel spreadsheets have different values, it is because you are getting different data. The collector has data for the entire simulation. For the graph, you can see that the first 55 seconds of the simulation has scrolled off and are gone.

 

I'm not sure what you mean regarding the speed of the simulation loop. Are you wanting it to run in real-time, as in one second of simulation takes one second to complete? If so, you need to change to hardware timing in the simulation parameters (same place you modified the final time). You'll need to switch to a fixed step-size ODE solver like Euler (RK1) and turn on the "Auto Period" option.

0 Kudos
Message 6 of 13
(4,071 Views)

Hi !

 

Thanks for the tip ... it helped me a lot ...

 

Right now, I would like to make similar (or same) simulation as in the SIMULINK. There is very useful command Generate arbitrarily shaped periodic signal, which makes the easy for engineer to simulate working profile (load).

 

Among the LV C&S commands, I could not find something similar ... Lookup Table 1D Function .... is very close, but gives very "funny" results .... even for the Interpolate/extrapolate ....

 

Have any idea how to cope with it ?!

 

Vasco-simulation-signal-profile.jpg

0 Kudos
Message 7 of 13
(4,063 Views)

I know of no equivalent block. Though not ideal, it shouldn't be too difficult to create your own subVI that takes in the input, simulation time, and period and produces the desired periodic signal.

0 Kudos
Message 8 of 13
(4,059 Views)

Hi!

 

Then, I assume has to be done by certain segments/parts and combined together - ramp, square etc. ....

 

I think the plant model should be done as the subVI and the control VIs (like ramp) are then analysed ...

 

I will also ask around and give You a feedback ....

 

Best regards!

Smiley Happy

 

0 Kudos
Message 9 of 13
(4,057 Views)

Hi!

 

Do You know why my code is not working .... funny answer Error - 20013 ... Anlysis: The width must meet: 0 < width < samples.

 

Do You know how to make grids on the graph dased and not solid lines ?! 

 

Thanks!

Smiley Happy

 

 

0 Kudos
Message 10 of 13
(4,050 Views)