Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

CreatePeriodChannel

I have created a period measurement task using Measurement Studio v8.
The task works great under Visual Studio 2003. However, when I copied the code over to Visual Studio 2005, I get an error if the incoming pulses stop while the task is running.
The error message:

A first chance exception of type 'NationalInstruments.DAQmx.DaqException' occurred in NationalInstruments.DAQmx.dll

I cannot trap this error as it occurs in National Instruments dll and the dll does not pass the error up to my program.

The code runs great under VS2003, but I get this error under VS2005. My code is identical for both versions.

As long as pulses are fed to the counter, everything works fine. But if the pulses stop, I get this error. Once I get this error, I must destroy the task and regenerate a new one.

Has anyone else seen this sort of behaviour?

0 Kudos
Message 1 of 6
(4,613 Views)
Never mind, I found my problem.
0 Kudos
Message 2 of 6
(4,601 Views)

Tengo el mismo problema y no se como repararlo.

Comienzo a adquirir normalmente pero de un moemnto a otro se detiene la adquisicion y el resto de mi aplicación

 

Gracias

 

 

0 Kudos
Message 3 of 6
(4,304 Views)
Hello There,

Remember that the assembly (NationalInstruments.DAQmx.dll) for VS2003 is not the same that for VS2005. There are based on two different versions of .NET Frameworks.
Probably DWK can share what was the solution here for feature customers.

(Carlos, te recomiendo que escribas tu pregunta en Inglés o que la coloques en estos foros para que tengas más éxito en tu búsqueda)
Gerardo O.
RF SW Engineering R&D
National Instruments
0 Kudos
Message 4 of 6
(4,294 Views)

I cannot read Spanish, so I am not sure of the details of your request.

I am sorry that I did not include my solution. That was rude of me.

I have gone back and examined the code for that project, but I did not include any notes about the problem. This project was not placed under source control, so I cannot trace the changes I made to the code. I have looked for notes from that time, but I cannot find any mention of this problem.

I do know that I re-installed Measurement Studio about that time.

Also, looking at the code, I may have experienced an array bounds problem in my DataReadyEventHandler.

I am sorry I cannot be of more help.

0 Kudos
Message 5 of 6
(4,292 Views)
Sorry Dwk,

The phrase in Spanish was meant only for the previous post (which was also in Spanish) to make sure that all comments are in the same language. The link that I provided was actually the Spanish forums in case he has more questions.

My only suggestion was the Assembly your code was using. Make sure you are now pointing to the new assembly:
Once you install VS2003 and VS2005, then you install DAQmx, you should have two assemblies folders:

C:\Program Files\National Instruments\MeasurementStudioVS2003\DotNET\Assemblies\
C:\Program Files\National Instruments\MeasurementStudioVS2005\DotNET\Assemblies\


And two example folders:

C:\Program Files\National Instruments\MeasurementStudioVS2003\DotNET\Examples
C:\Program Files\National Instruments\MeasurementStudioVS2005\DotNET\Examples


Each example is actually pointing to the correspondent assemblies. The most simple thing to do, is to take one of the examples and just change the code so that all the project properties remain in your new code.
Again sorry for the confusion and thank you for including your solution.
Gerardo O.
RF SW Engineering R&D
National Instruments
0 Kudos
Message 6 of 6
(4,284 Views)