From: b m. <bri...@in...> - 2009-04-08 10:39:35
|
Hi Robert, I double checked and using a simulation run of 0.1 seconds- the S-Function completed 13 cycles. This validates that the simulation is running at 120 cyles per "sim second." One thing to keep in mind though- Simulink is not necessarily run in real-time, so a "sim-second" may not last an "actual" second. So 10 seconds in Simulink may not take 10 seconds in real-time. I take it this is what you are are talking about. Now, it's not that I'm saying that you are incorrect, just that it's possbile that the issue resides in the fact that Simulink, and in fact JSBSim, are not necessarily truly running in real-time. On our commercial sims that run on Windows PCs, the sim real-time application is augmented with a 3rd party real-time application. Brian ----- Original Message ----- From: "Roberts, David J." <dro...@mi...> Date: Tuesday, April 7, 2009 13:39 Subject: [Jsbsim-matlab] compiling mex file for S-Function To: "jsb...@li..." <jsb...@li...> > Brian, > > Stuart pointed me towards your mathworks submission. I > tried your sfuntest3.mdl and it works nicely. I'm > interested in making use of it. > > I noticed it is slower than JSBSim. I think this is > probably due to use of the GetPropertyValue() method at > 120hz. From looking at JSBSim source I notice that > comments suggest using the GetNode() function and then using the > node's getDoubleValue() function for calls at 120hz. > > I'm going to try to modify JSBSimInterface.cpp & > JSBSimInterface.h to incorporate this. Do you have > the mex statement that you used to compile JSBSim_SFunction.mexw32? > > I tried with the following statement: > > mex -g JSBSim_SFunction.cpp JSBSimInterface.cpp MexJSBSim.cpp > SfunInterface.cpp stdafx.cpp -I"..\JSBSim\src\" - > L"..\JSBSim\lib\" > When I do this I get an error concerning MexJSBSim.cpp at line > 111. The compiler spits out: 'JSBSimInterface::Open' : > cannot convert parameter 1 from 'const mxArray *' to 'std::string'. > > Is there a compile option that I'm forgetting that handles data > type conversions? > > Regards, > > David Roberts > > |