Qbasicnews.com
QBasicProgram simulates a PID controller - Printable Version

+- Qbasicnews.com (http://qbasicnews.com/newforum)
+-- Forum: QBasic (http://qbasicnews.com/newforum/forum-4.html)
+--- Forum: QB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-11.html)
+--- Thread: QBasicProgram simulates a PID controller (/thread-8162.html)



QBasicProgram simulates a PID controller - Marcus - 09-29-2005

Hey Qbasicer!!

I'm new in this forum......so please be sensitive with me Smile
ok, I'm doing an internship and I have to simulate a closed controll loop for some controlled systems. My colleague has already written a code in Qbasic (good old programming!) for the controller....but my boss wants to simulate it in matlab-simulink....so is there a possibility to run the qbasic code in matlab or is there any qbasic emulator....or mybe I can run it in C++(but I hate C++)!! How easy or difficult would it be to transform the Qbasic code into a matlab m-file?

It would be great when anybody could give me a hint or a solution...


cheers

Marcus[/code]


Re: QBasicProgram simulates a PID controller - MystikShadows - 09-29-2005

Quote:Hey Qbasicer!!

I'm new in this forum......so please be sensitive with me Smile
ok, I'm doing an internship and I have to simulate a closed controll loop for some controlled systems. My colleague has already written a code in Qbasic (good old programming!) for the controller....but my boss wants to simulate it in matlab-simulink....so is there a possibility to run the qbasic code in matlab or is there any qbasic emulator....or mybe I can run it in C++(but I hate C++)!! How easy or difficult would it be to transform the Qbasic code into a matlab m-file?

It would be great when anybody could give me a hint or a solution...


cheers

Marcus[/code]

Hi Marcus,

I don't think matlab can run QB code directly. However, I do believe the formulas, logic branching and such can be reproduced. If you save your QB source as text (should be an option when you save that file from the QB IDE) you should be able to copy the parts you need into matlab and make minor adjustments in matlab for them to work so all the work is not totally wasted.

Any user interface code might not work as Matlab doesn't seem to support this per se so that part will have to be redone in matlab itself in whichever way best suits the needs of the simulation.

Like I said, the minding behind the QB program should work however. you just need to reproduce that mind set into matlab's own system.

Hope this helps,