Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Big Problem.....HELP!!!

Big Problem.....HELP!!!

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++comdata-structures
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sunnygirl
    wrote on last edited by
    #1

    hello @all, i try to explain what i want / must do: i have something like this: int i=0; while(i<5) { // reading out a com // get datasets and process them // send the processed datasets to MATLAB to get a diagram // the diagram is seen in my mfc-program (but came from matlab) i++; } the only problem is the while loop. without these, the program part runs perfectly. however i need a while loop or something like that. i think, the problem lie in the fact that the program sends the data to matlab and then directly in the code continues to go. possibly different processes run off parallel. i think i must have something that waits so long, till matlab is ready with the diagram (i tried Sleep(1000) but it do not work). maybe somebody know, if matlab has got a 'instruction' or if i can make something like a 'queue'. thank you very much sunny

    X 1 Reply Last reply
    0
    • S Sunnygirl

      hello @all, i try to explain what i want / must do: i have something like this: int i=0; while(i<5) { // reading out a com // get datasets and process them // send the processed datasets to MATLAB to get a diagram // the diagram is seen in my mfc-program (but came from matlab) i++; } the only problem is the while loop. without these, the program part runs perfectly. however i need a while loop or something like that. i think, the problem lie in the fact that the program sends the data to matlab and then directly in the code continues to go. possibly different processes run off parallel. i think i must have something that waits so long, till matlab is ready with the diagram (i tried Sleep(1000) but it do not work). maybe somebody know, if matlab has got a 'instruction' or if i can make something like a 'queue'. thank you very much sunny

      X Offline
      X Offline
      xxhimanshu
      wrote on last edited by
      #2

      :cool:hi, have you tried using for loop too. i guess you would have.I don't think two processes can be running in parellel bcz you are calling your diagram from MATLAB then when it's dissolved then only the program execution will continue. that means there is something else wrong. I will suggest debugging the program step by step by putting a breakpoint just before the loop and then f10 or f11. i guess u know all that. how to debug. I guess you will reach a solution then. cheers.. Himanshu

      S 1 Reply Last reply
      0
      • X xxhimanshu

        :cool:hi, have you tried using for loop too. i guess you would have.I don't think two processes can be running in parellel bcz you are calling your diagram from MATLAB then when it's dissolved then only the program execution will continue. that means there is something else wrong. I will suggest debugging the program step by step by putting a breakpoint just before the loop and then f10 or f11. i guess u know all that. how to debug. I guess you will reach a solution then. cheers.. Himanshu

        S Offline
        S Offline
        Sunnygirl
        wrote on last edited by
        #3

        thanks for reply. i tried a for loop, too. i tried a thread and i tried to debug.....but i still don´t know, what´s wrong. sunny

        X 1 Reply Last reply
        0
        • S Sunnygirl

          thanks for reply. i tried a for loop, too. i tried a thread and i tried to debug.....but i still don´t know, what´s wrong. sunny

          X Offline
          X Offline
          xxhimanshu
          wrote on last edited by
          #4

          :cool:hi, i guess you are having problems with the debugging side. why don't you try to step into the process to see what it does and well how does it perform..is it going the expected way or not..if anywhere you see unexpected behavior thats the place u were looking for. put all the variables in watch and look for them too. what else..if not then try executing a exe of matlab exmple i guess that should work fine..and produce expected results.because maybe the interfacing u are doing is wrong anywhere..just check it thats all i can say without looking at ur code.. cheers.. Himanshu

          S 1 Reply Last reply
          0
          • X xxhimanshu

            :cool:hi, i guess you are having problems with the debugging side. why don't you try to step into the process to see what it does and well how does it perform..is it going the expected way or not..if anywhere you see unexpected behavior thats the place u were looking for. put all the variables in watch and look for them too. what else..if not then try executing a exe of matlab exmple i guess that should work fine..and produce expected results.because maybe the interfacing u are doing is wrong anywhere..just check it thats all i can say without looking at ur code.. cheers.. Himanshu

            S Offline
            S Offline
            Sunnygirl
            wrote on last edited by
            #5

            thanks for reply. the problem when i debug oder run my program is the transition between the: 'data send to matlab' and the 'new start of the function'. the program falls. sunny

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups