LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx, specify resource occpaied

Solved!
Go to solution
I am using a below function to get the digital port status of DAQ card. DAQmxErrChk(DAQmxReadDigitalU32 (Handle, 1, 10.0, DAQmx_Val_GroupByChannel, &SSR, 1, &read, NULL)); whole code as below: error = Init_DA_Brds (1, &BoardCode); DAQmxErrChk(DAQmxResetDevice ("DAQmxDev1")); DAQmxErrChk(DAQmxCreateTask ("", &Handle)); DAQmxErrChk(DAQmxCreateDIChan (Handle, "DAQmxDev1/port0/line6", "", DAQmx_Val_ChanForAllLines)); DAQmxErrChk(DAQmxReadDigitalU32 (Handle, 1, 10.0, DAQmx_Val_GroupByChannel, &SSR, 1, &read, NULL)); DAQmxErrChk(DAQmxClearTask (Handle)); however, some of times i get error that DAQ resource has been occpaid. later on , if i try to reset in Max, also a error report, whatever i reset the driver in traditional DAQ according to instruction. do someone know this problem ? ( i am using CVI 7.1+ DAQmx 9.0.2) B.R Gerry
Download All
0 Kudos
Message 1 of 7
(4,497 Views)

Hi, Muks

 

Firsty, thanks very much for you attention. 🙂 

however, i am not sure i understand you question correctly. this problem was not occured at first time of program running.  and once this happend , the only way to solve is restarting the computer .

 

 

B.R

Gerry

0 Kudos
Message 4 of 7
(4,426 Views)

Hi~

 

Seems that you are switching the device between DAQmx and Traditional DAQ. This may be helpful.

0 Kudos
Message 5 of 7
(4,387 Views)

Hi,

 

 i have used inital function before i call that one

 

error = Init_DA_Brds (1, &BoardCode);

DAQmxErrChk(DAQmxResetDevice ("DAQmxDev1"));

 

 

 

B.R

Gerry

0 Kudos
Message 6 of 7
(4,382 Views)
Solution
Accepted by Gerryli

i have found the reason.  another threading also read the digital line in order to have the flag.  it looks DAQmx does not support this one as well.  because my previous version was made by traditional driver, and i did not see any problem.

 

 

anyway, thanks for all peoples attention!

 

B.R

Gerry

0 Kudos
Message 7 of 7
(4,333 Views)