DQChart Control > Properties > Ymax

Previous | Next

Ymax

Applies to:

DQChart Active X Control

Description:

Sets or returns the positive rail of the chart. Default is 32,768. This property is useful to increase the size of your waveforms visually (magnifying the waveform). This does not change the actual size of the chart in pixels. The height of the chart can be drawn as large as your screen and Ymax will still be 32,768.

The actual value of Ymax and Ymin in volts is dependent on the hardware device and the gain index (see also Gain Factors and Settings). For example, if you are using a DI-720 USB with a gain index of 0 (i.e., +/-10Volts = Ymax/Ymin = +/-32768) and you know your readings will be between 0 and 5 volts - you can cut Ymax in half (16384) and set Ymin to 0 to maximize the visual presentation on your chart. In this example, the top of the chart would represent 5 volts, the bottom of the chart would represent 0 volts and the center of the chart would represent 2.5 volts. See Example 1 below.

For another example, let's say you will be measuring between -0.5 and 0.5 volts. Using a 720 USB you can set the gain index to 3 (i.e., +/-1.25 Volts). Now Ymax = 32768 = 1.25V and Ymin = -32768 = -1.25V. 0.5/1.25 = 0.4 (0.5 is 40% of the maximum). 40% of 32768 = 13107. Now we can set Ymax to be 13107 and Ymin to be =-13107 and the top of the chart will equal 0.5V and the bottom of the chart will equal -0.5V. See Example 2 below.

Waveforms can also be magnified with mouse operations. See the Lock property.

Syntax:

DQChart1.Ymax=variable (where variable determines Ymax)

Variable:

Long

Example 1:

Dim A(10000) As Integer

 

Private Sub DataqSdk1_ NewData(ByVal Count As Integer)

DQChart1. Chart (DataqSdk1. GetData)

DataqSdk1. GetDataEx A(0), Count

'convert the data into volts and display:

Label1.Caption = Format((A(0) And &HFFFC) / 32768 * 10, "0.00")

End Sub

 

Private Sub Start_Click()

'top of the chart on a 720 USB is 5 volts

DQChart1. Ymax = 16384

'bottom of the chart on a 720 USB is 0 volts

DQChart1. Ymin = 0

DataqSdk1. ADChannelCount = 1

DataqSdk1. EventPoint = 20

DataqSdk1. Start

End Sub

 

Private Sub Stop_Click()

DataqSdk1. Stop

End Sub

Example 2:

Dim A(10000) As Integer

Dim GainList(32) As Integer

Dim ChannelList(32) As Integer

 

Private Sub DataqSdk1_ NewData(ByVal Count As Integer)

DQChart1. Chart (DataqSdk1. GetData)

DataqSdk1. GetDataEx A(0), Count

'convert the data into volts:

Label1.Caption = Format((A(0) And &HFFFC) / 32768 * 1.25, "0.00")

End Sub

 

Private Sub Form_Load()

ChannelList(0) = 0

'gain index of 3

GainList(0) = 3

End Sub

 

Private Sub Start_Click()

'top of the chart is 0.5 volts using a 720 USB with a gain index of 3

DQChart1. Ymax = 13107

'bottom of the chart is -0.5 volts using a 720 USB with a gain index of 3

DQChart1. Ymin = -13107

DataqSdk1. ADChannelCount = 1

DataqSdk1. EventPoint = 20

DataqSdk1. ADGainList (GainList)

DataqSdk1. ADChannelList (ChannelList)

DataqSdk1. Start

End Sub

 

Private Sub Stop_Click()

DataqSdk1. Stop

End Sub

 

Reference Materials | Top