Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Mod 9217 sampling rate in Python

Hi everyone,


I want to measure both Voltage and Temp from a NI9215(V) and NI9217(°C). I want both working on variable sampling rates, which can be manually edited in the Code, which is working for the Voltage. When reading out only the voltage, i can change the sampling rate, no problem. But when i add the RTD the sampling rate of both is limited to 1Hz.

 

Long time searching and trying i cant really understand and fix this. Maybe you can help! 🙂

 

this is the code with which i currently read out the data from the RTD: (https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019ZWxSAM&l=de-DE adapted from here)

 task.ai_channels.add_ai_rtd_chan("cDAQ1Mod2/ai0", units=TemperatureUnits.DEG_C, rtd_type=RTDType.PT_3750, resistance_config=ResistanceConfiguration.FOUR_WIRE, current_excit_source=ExcitationSource.INTERNAL, current_excit_val=0.001)
 task.timing.cfg_samp_clk_timing(10, source="", active_edge=Edge.RISING, sample_mode=AcquisitionType.FINITE, samps_per_chan=1000)

 It works but not at the desired sampling rate.

 

Hopefully you can understand my problem and know a solution

 

Best regards, Benedikt

 

P.S: if necessery i can upload the whole code

 

I checked in the Automatoin and Measurement Explorer witht the testpanel, where the module is working fine with higher sampling rates...

0 Kudos
Message 1 of 2
(1,559 Views)

hello,

 

i installed two more sensors to measure the temperature and it seems this slows down the whole process even more...

 

i checked the timings of the individual steps and it appears, the most time is used by reading the data with:

data = task.read(number_of_samples_per_channel=1)

 

i got 3 Modules with:

1.) 20 Slots measuring the Voltage

2.) 8 Slots measuring the Temp

3.) 8 Slots measuring the Temp

 

By Changing the number_of_samples_per_channel in any direction follows a crash...

Honestly i don't know where the problem seems to be. because the reading of only the Voltage is no problem, but when adding 3 Temps it totally crashes.

Thanks everybody!

0 Kudos
Message 2 of 2
(1,530 Views)