LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Asynchronous Timers

Can I change the priority of the asynchronous timer thread?
0 Kudos
Message 1 of 5
(3,769 Views)
Technically, you could do it through SDK calls, but there isn't a really clean way to do it without editing the asynctimer control source code (which is provided). It would be much better to use the CVI Multithreading library to create a new Thread Pool (group of threads) and use the SetThreadPoolAttribute function to set the priority. Then create a Thread function that runs a UI with a regular timer.

Best Regards,

Chris Matthews
Measurement Studio Support Manager
0 Kudos
Message 2 of 5
(3,769 Views)
 hi Chris Matthews:
   one question:                    
    I want to send precise sine analog  signal and receive the 429 signal use two Asynchronous Timers,display them on the stripchart .I couldn`t find the way to control the other Asynchronous Timers.
  two qusetion:
  how to difine the globle variable in more than one c files.now ,I define them in one head file,including the head file in all c files.
 complying error:  multidefine link error .
    
  hope your answer
  thank you!
                                                                                                           lento                                                                  
          
0 Kudos
Message 3 of 5
(3,482 Views)
lento wrote:
> two qusetion:
> how to difine the globle variable in more than one c files.now ,I define them in one head file,including the head file in all c files.
> complying error:  multidefine link error .

this is
basic C: #include means literally what it means. it includes the text of the header file into the source file. now, declaring a variable in a header file really defines it ! if you include your header 2 times, you define your variable 2 times, with the same name, thus a symbol defined multiple times.

so, in the header, declare your variable as extern. in one of the source file (only in one, the best being the file first initializing the variable) define your variable and initialize it, in the other file just use your variable. beware not using it while it is still uninitialized...

e.g.:
in variable.h:
extern int variable;

in variableinit.c:
#include "variable.h"

int variable = 0;

void init()
{
    variable = ....; // initialize your variable
}


in variableuse.c:
#include "variable.h"

void use()
{
    printf( "%i\n", variable );
}

Message 4 of 5
(3,472 Views)
 
         thanks for dummy_decoy's reply!
                                                                           lento


帖子被lento在01-28-2008 03:50 AM时编辑过了
0 Kudos
Message 5 of 5
(3,452 Views)