07-20-2011 10:20 AM
Documentation for niscope suggests that the trigger level limit is:
Trigger Level <= Vertical Range/2 + Vertical Offset
Trigger Level >= -(Vertical Range/2) + Vertical Offset
With the following setup, I get unexpected results.
Vertical Range: 200 mV/Div (hardware would be in the 2V Full Scale range)
Vertical Offset: 0V
I can set the trigger to 1 V or -1 V and the scope performs as expected.
If I set the trigger level to something outside the valid range I see an error returned from niscope_readWaveform.
(Requested trigger level is not valid with the configured vertical range and vertical offset combination.)
This would appear to be a valid error message as the trigger level is outside the limits for the trigger level based on the hardware scale.
The Vertical Offset component in the limit calculation is what perplexes me.
It appears to state that the trigger level can be set outside of the hardware limit (+/- vertical scale/2) based on the vertical offset.
I.E. In the above scenario I should be able to set the trigger level to +1.1V if the vertical offset is set to 0.1V. (2V/2 + 0.1)
I have tried several different scenarios, but I seem to get the error message from above any time the trigger level is set outside the
hardware limit.
Am I right in assuming that the trigger level is limited to (+/- vertical scale / 2) regardless of the vertical offset?
07-22-2011 12:23 PM
I've got a few questions to clarify how you are using the PXI-5114.
What signal are you triggering off of? Are you triggering off of the external trigger, the signal itself, or something else? The external trigger line has a hardware vertical range of +/- 5V regardless of vertical range on the acquisition. Any additional information could be helpful.
According to Triggering: Trigger Level Property:
With a Vertical Range of 2V, and an offset of +0.1V, you will get a range of -0.9 <= Trigger Level <= 1.1. Is there a reason that you want to trigger so close to the top end of the range?
If you are getting an error, do you have an error code you can provide?
Thank you,
Aaron
07-25-2011 10:13 AM
Here is some more information as requested:
Input: Channel 1
Trigger Source: Channel 1
Trigger Mode: Edge Triggered
Vertical Range: 0.2V Full Scale
Vertical Offset: 0V
Trigger Level: 0.09 Volts
In the above state the scope works as expected.
Changing the trigger level to 0.1 causes the following error to be returned from the scope. (As you can see in the
error below, the value sent to the scope is actually slightly larger than 0.1 -- I know why the value is slightly larger,
and this is irrelevant to the issue I am trying to figure out. The important thing to note is that the value is outside the
valid trigger level range which would be 0.1V as shown in the error message.)
Essentially, I would expect an error at this point since the level is outside the range of Vert Range/2 + offset or 0.2V/2 + 0.
(The error message below is a combination of the information returned from niScope_error_message and niScope_errorHandler along with some text
included with the cout used to display the error messages.)
niscope_ReadWaveform returned: Requested trigger level is not valid with the configured vertical range and vertical offset combination.
CH0 - no trigger but not a timeout!!!
CH0 - errS = o
errD = Error BFFA4070 occurred at o.
Possible Reasons:
Requested trigger level is not valid with the configured vertical range and vertical offset combination.
Device: Dev2
Property: Trigger Level
Invalid Value: 100.000001 e-3
Maximum Value: 100.0 e-3
Minimum Value: -100.0 e-3
Status Code: -200422
At this point I would expect to be able to enter an offset value to allow the trigger level setting to be valid. I have not
had any success from this point on. I enter a 0.01V offset which should be valid:
Trigger Level <= Vertical Range FS / 2 + offset
Trigger Level <= 0.2V/2 + 0.01
Trigger Level <= 0.11
0.100000001 <= 0.11
I am still seeing the error from above. The error does not change with the vertical offset. I.E. The maximum and minumum trigger
value in the error message does not appear to include the vertical offset in the calculation. I am able to set the trigger level to 0.09 and
verify that the scope display reflects the vertical offset entered.
In response to your question regarding why I would want to trigger so close to the top of the range: I am essentially building
a gui for the scope, and while trying to implement limits for the trigger level I ran into the unexpected results seen above. I
fully expected to need to incorporate the vertical offset into the limits as shown in the spec for the trigger level, but when I
do the scope appears to not allow anything outside the hardware range itself regardless of offset. (Is there something obvious
that I am missing here?)
thanks,
tim