Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

CWAI, vertical range adjustment through error handling

Greetings!
I set CWAI "ErrorEventMask" property as follow
<
CWAI.ExceptionOnError = False
CWAI.ErrorEventMask = cwdaqConfiguringChannelLimits
>
to get channel overload error and correct the vertical range. Why it does not work
in spite of the fact that I apply voltage more than UpperLimit value.

hardware:
PCI-MIO-16E-4
software:
Win XP, VB6
Meas Studio 1.0 (CW DAQ 3.0.536)
ni-daq 6.9.2f8
ni-visa 2.6.0
ivi engine 1.8.3
cvi rt 6.0.4.105
Thanks!
0 Kudos
Message 1 of 4
(3,777 Views)
Hello vitaly,

I think if you just change the exception on error back to true, then it will work for you. By setting exception on error to false, you are asking the program not to post errors to the user as events.

The event mask just controls which errors will be raised and which will not.

Hope that helps!

John Nieri
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,777 Views)
Hi John, I changed the "exception" to true and it did't bring the positive results, I can't take the overload error.
Thanks!
0 Kudos
Message 3 of 4
(3,777 Views)
Hello vitaly,

I am posting a new answer to your original question because it is independent of my first answer. After looking more closely at what you were actually trying to do, I realized that the answer is not as simple as I proposed before.

The ErrorEventMask is a mask that tells Visual Basic when it is possible to produce events (especially error events). This is the allowed context for events. You can set the value of the mask such that VB will allow events to be produced when you are configuring, starting, or reading data, or any combination of those.

However this does not add any new events to those that already exist on the control.

To illustrate, there are several errors that could occur during the configuration of an analog input acquisition. If the event mask is set to include the analog input configuration context, then if an error occurs, an event will be generated that notifies you of the event. If the mask does not include analog input configuration, then you would just have to check the returned value in your program to see if any errors occurred.

The answer to your question is that the ErrorEventMask is not quite the thing that you need. If you want to check for input voltages going above your limit, then there are a few ways you could do it.

One is in software: Observe your incoming data and look for flat areas at the top/bottom of your range (you can check your channel input limits programatically). This is the indicator that you have reached the limits.

Another you might be able to do in hardware, though it will be more involved: If you have analog triggering hardware, you could use the analog triggering hardware and create an outside of range trigger. When your signal goes very close to the limits of your range, then you could stop acquisition and reconfigure your input limits.

One more alternative is the same as the hardware analog triggering, except use software analog triggering.

You can find out about the analog (hardware and software) triggering methods on our website. Just search at http://www.ni.com/support for example programs and other documents about it. Additionally, there are example programs included with NI-DAQ that demonstrate analog triggering.

I hope this helps!

Regards,

John Nieri
Applications Engineer
National Instruments
Message 4 of 4
(3,777 Views)