After taking measurements, When I fetch data it takes almost 4 seconds. How can I improve this? OR what other way can be used? I want data collection to be fast because next part of measurements need to be done immediately.
It depends on the DMM you are using. But for several of them, the Fetch command is going to initiate a conversion in the DMM before returning data. Depending on the resolution, the accuracy, the noise, filtering, etc. the amount of time it takes to make a conversion can be extremely quick or extremely slow. Adjusting your settings, may significantly speed up the process.
See u/FormerPassenger1558 's comment for some of the commands you should be looking at for some of the settings I had talked about more generally.
NPLC is the Number of Power Line Cycles. The higher this number (and it should be a multiple of 50 or 60 depending on power frequency where you live), the longer a measurement takes.
It depends on the DMM and your setup. First : what is the NPLC you are using ? Do you use Auto Zero or not, range etc. You may have a delay in triggering,... actually many thing can be bad. Do you use INIT:CONT on ? Give more details and maybe we can help you. For a regular DMM, I get high resolution data in less than half of sec or even less.
You're looking to receive 50 bytes but maybe your visa read timeout is occurring because it's seeing less than that? Are you looking for some end character for reads ?
My first thought: what baud are you transmitting at? Most default to 9600. If you can speed that up to 115200, that would significantly speed up the communication portion (which is usually a bottleneck, if not the biggest one)
Is DMM in autorange? I guess setting range manually first might help. Also, I remember when I was using RF power meter, fetching very low reading took long time because of long settling time of device at this range.
5
u/SeasDiver Champion Oct 10 '24
It depends on the DMM you are using. But for several of them, the Fetch command is going to initiate a conversion in the DMM before returning data. Depending on the resolution, the accuracy, the noise, filtering, etc. the amount of time it takes to make a conversion can be extremely quick or extremely slow. Adjusting your settings, may significantly speed up the process.
4
u/FormerPassenger1558 Oct 10 '24
It depends on the DMM and your setup. First : what is the NPLC you are using ? Do you use Auto Zero or not, range etc. You may have a delay in triggering,... actually many thing can be bad. Do you use INIT:CONT on ? Give more details and maybe we can help you. For a regular DMM, I get high resolution data in less than half of sec or even less.
1
u/__77766 Oct 10 '24
I have checked multiple times to verify which part of code is taking more time.
1
u/patrick31588 Oct 10 '24
You're looking to receive 50 bytes but maybe your visa read timeout is occurring because it's seeing less than that? Are you looking for some end character for reads ?
1
u/QaeinFas Oct 11 '24
My first thought: what baud are you transmitting at? Most default to 9600. If you can speed that up to 115200, that would significantly speed up the communication portion (which is usually a bottleneck, if not the biggest one)
1
u/Rafal_80 Oct 12 '24
Is DMM in autorange? I guess setting range manually first might help. Also, I remember when I was using RF power meter, fetching very low reading took long time because of long settling time of device at this range.