Results 1 to 4 of 4

Thread: hold off Girder while plugin completes action

  1. #1
    Join Date
    Jun 2001
    Location
    Boom, near Antwerpen, Belgium
    Posts
    49

    Default

    I'm still developing the Q14 plugin and have
    a problem: when closing Girder it is possible
    to execute an action like pulse an output
    line for xxxx milliseconds. The pulsing is accomplished by a timer in the DLL itself and works just fine, but.

    If Girder closes down it has to wait for the action to complete, I tried creating an event object and waiting for it to become signaled (but then everything freezes), or create a new thread when the plugin is loaded, but then Girder blocks immediately.

    Does anyone have a sample or can somebody help me out pls?!

  2. #2
    Join Date
    Feb 2001
    Location
    Plano, TX, USA
    Posts
    3,055

    Default

    Sorry, I don't have a good answer for you. :sad:

    If you have to complete an action of some sort (pulsing a data line), there isn't much that you can do (in a single process model) but hold off the plugin unload until you have completed the action.

    An alternate approach would be a multi-process (client/server) model. When your plugin loads, have it spawn and "attach to" a new process that accepts commands and executes those commands. Each action would have the plugin post another command to the server process. On unloading of the plugin, it could post an "exit" command to the server process which would cause it to exit when it reaches that command.

    I hope this helps.
    Mark F

  3. #3
    Join Date
    Jan 2000
    Location
    Jupiter, FL
    Posts
    11,348

    Default

    The best thing in the current framework would be to NOT return the clean_up_device
    until the device actually finished _ALL_ its
    threads. this is not only the best thing but this HAS to be the case because the code gets unloaded right after you exit from the clean_up device thus if a thread is still running the code will be ripped out from under its foundation.

  4. #4
    Join Date
    Jun 2001
    Location
    Boom, near Antwerpen, Belgium
    Posts
    49

    Default

    I found a solution by taking over some code from the Parallel port plugin sample.

    Probably one of my previous solutions worked too, but it was placed in the DllMain(DLL_PROCESS_ATTACH) call which seems to be too early.

    Now I've put it in the setsupportex and close_dll calls and it's fine (have to verify it with the actual HW this evening, but I see a delay when closing Girder, as expected).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •