04-16-2012 08:33 AM
Hi Osowaji,
Is there a specific delay each time on between the x-axes on your graphs?
Also would it be possible to please attach your LabVIEW coding for the SIT? Dependant on how your data is being read and then outputted to your graph, we may be able to use the "Build waveform" function and then adjust the t0 value on it.
Thanks,
04-16-2012 09:21 AM
There is no specific delay per say Tori.I have attached a screenshot of the scope from simulink together with the labview from panel.The simulation for the screenshot was set at 400s.Also find attached the Labview VI.Thanks
04-18-2012 10:54 AM
Hi osowaji,
To avoid delay between your LabVIEW user interface and Simulink model, you would be best to build you Simulink model into a dll, using Simulink's real-time workshop as this would allow you to configure timing parameters.
There may be some delay caused by your VI waiting 50ms every time the loop runs. To check this, right click on the Wait (looks like a stopwatch) and then go to replace >> timing palette >> wait until next ms multiple. Let me know if this makes any diffference to the delay that you are seeing.
Kind regards,
04-18-2012 11:12 AM
04-19-2012 04:51 AM
Hi Osowaji,
Looking at the coding, there's a chance the difference in time scales could be caused by a variety of factors such as different units or even the Timestamps data from your "Get current data" VI not being outputted to anything.
What I would recommend as the next step for you would be create a new Simulink model which just has your step input going straight to a scope, then reading this back in LabVIEW. Do you still have this same issue of different scales? And is it as noticeable?
Kind regards,
04-19-2012 05:31 AM
Hi Tori,thanks again for your assistance.I just tried what you suggested but its still the same.The y-axis(amplitude) is okay but the x-axis(time) is not.Find attached a screen shot of both the scope in simulink and the graph from labview simulated at 10 and 20sec so you see.Thanks
04-19-2012 08:02 AM
Hi osowoaji,
I believe I can now see where the route of your issue may be occurring.
Please take a look at the example of using a LabVIEW user interface for your Simulink model. Near the bottom of this page, under the downloads header, there is a file entitled sine_wave.vi. I believe this may be what you based your own VI on.
If you take a look at the SIT_Indicator_Cases for loop, and the "0" case within that, you can see that the data being outputted into the sine wave output is showing a waveform data type, whereas your output only shows an array of doubles. The additional information that is being converted into a waveform by the VI before the for loop (has 2 orange and a blue wire going in) contains information both about the values but also regarding the timestamp.
I hope this is made clearer by the screenshot below:
As your coding is lacking the Timestamp sent by the Simulink code, this is likely to explain why your time axis do not match between LabVIEW & Simulink.
I have edted the sinewave example to match the user interface that you created. I have attached this for LabVIEW 2010.
Please let me know whether this works as expected.
Kind regards and best wishes,
04-19-2012 09:33 AM
Hi osowoaji,
Attached for 8.5 as requested.
Thanks,
04-19-2012 10:04 AM
Hi Tori,i still could not open the 8.5 as it was asking for a particular add on but what i did was look at the block diagram(the edited one you sent) and added the missing vis to mine and its working fine now giving me the same time when i put both axis on auto scale.I cant thank you enough for your help.Thanks once again
Osowoaji
04-19-2012 10:07 AM
Hi osowoaji,
Great to here that fixed the issue!! As mentioned before, as the timestamp information was lacking, LabVIEW was missing the information regarding the timing for the signal.
Best of luck with the rest of your application!