set.DataInterval issue

Comments & issues
Post Reply
angel.sanchez1
Fresh meat
Posts: 2
Joined: Wed Jun 14, 2023 3:05 am
Contact:

set.DataInterval issue

Post by angel.sanchez1 »

Hello, I am trying to read the voltage ratio in a DAQ 1500_0 and I have two channels running at the same time.

What I want is to read the voltage ratio with a the minimum data interval, which is 20 ms.

I am trying to call the handler when the VoltageRatioChange event occurs, and I am using setDataInterval(dataInterval) to adjust that the VoltageRatioChange event happen every 20 ms. But it does not work, I tried with many values for dataInterval but it always report values every 250 ms, which is the default value.

How can I fix this and report values every 20 ms changing the DataInterval?

My main code is:

Code: Select all

def main(): #función principal
    voltageRatioInput0 = VoltageRatioInput() #Se abre el primer canal
    voltageRatioInput1 = VoltageRatioInput() #Se abre el segundo canal
    
    voltageRatioInput0.setHubPort(0)   #Se define el puerto al que se conectan ambos canales antes de definir el canal
    voltageRatioInput0.setChannel(0)   #Se asigna el primer canal al canal 0
    voltageRatioInput1.setHubPort(0)
    voltageRatioInput1.setChannel(1)   #Se asigna el segundo canal al canal 1
    
    voltageRatioInput0.setOnVoltageRatioChangeHandler(onVoltageRatioChange0) #se ejecuta el handler cada vez que cambia la lectura del voltaje de salida
    voltageRatioInput1.setOnVoltageRatioChangeHandler(onVoltageRatioChange1)

    
    voltageRatioInput0.openWaitForAttachment(5000)  #Abre los dos canales y espera a que se acoplen correctamente
    voltageRatioInput1.openWaitForAttachment(5000)

        
    voltageRatioInput0.setDataInterval(data_interval) #se especifica que el canal reporte un nuevo cambio en el voltaje cada data_interval ms
    voltageRatioInput1.setDataInterval(data_interval)

    voltageRatioInput0.setBridgeGain(BridgeGain.BRIDGE_GAIN_128)
    voltageRatioInput1.setBridgeGain(BridgeGain.BRIDGE_GAIN_128)
User avatar
Patrick
Lead Developer
Posts: 616
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: set.DataInterval issue

Post by Patrick »

When both channels are being used the minimum data interval is 100ms. This is specified on the specifications tab on the product page.

-Patrick
angel.sanchez1
Fresh meat
Posts: 2
Joined: Wed Jun 14, 2023 3:05 am
Contact:

Re: set.DataInterval issue

Post by angel.sanchez1 »

Ok, I didn´t see that on the spefications but you´re right. Thank you so much for answering so quick!

-Angel
Post Reply

Who is online

Users browsing this forum: No registered users and 57 guests