From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
07-09-2020 05:51 PM
Hi All,
So I'm having a really basic issue here, VISA Write and Read are taking a long time in-between loops. Setup: I am communicating with a Keithly 6485 Picoammeter using LabView, using a NI USB to GPIB adapter cable, using SCIP (488) commands.
Here's the measurement goal. Take 100 measurements, send them over, save them, rinse and repeat.
I mean the code is stupid simple at this point. The VI sets up the meter, Writes 'take a measure', then Reads the measurements sent, and then Loops over 'take a measure' and Read.
HERE'S THE PROBLEM: The meter takes 100 measurements in about 70 milliseconds, great, but time between loops is crazy long, in this case 60+ milliseconds.
I've tried so much. And read so so much. Please send help 🙂
Thanks!!!
07-09-2020 10:49 PM
Think about it. You have to send a command. It has to receive it. It has to take a measurement. It has to send the results back. You have to read it. That's a lot of stuff going on.
Some instruments have a "streaming" mode where you don't send explicit read commands, but just "drink from the firehose".
I have to ask why it's so important to take current measurements so quickly.
07-10-2020 05:54 AM
@fupper47 wrote:
HERE'S THE PROBLEM: The meter takes 100 measurements in about 70 milliseconds, great, but time between loops is crazy long, in this case 60+ milliseconds.
I'm not sure what you mean by "time between loops". Are you referring to iterations of the loop? Between what points in your code are you observing this 60ms? I do have a big concern that you have ever-growing array on your While loop. First of all, that should be a FOR loop since you know how many iterations will happen (you can enable the conditional terminal to abort early). Secondly, you really should look at using a Producer/Consumer so that you are logging the data to the file while you are acquiring data. This will save memory and post processing time.
07-15-2020 10:56 AM
Hi Bill,
Yeah so we're doing some advanced Chem research, pulsing a cell 500-1000 Hz, so wanting to read current changes from that, and not trying to spend $$$ doing it because it's just a small piece of the experiment. Unfortunately, a direct current measure is what were after here.
Yeah, that is a lot of data getting transferred around. I just feel like the whole process shouldn't take so long. There has to be something slowing down the process. Each Read only gets you 28 Kbytes max, is GPIB really that slow? I understand it takes time to gather measurements, but sending them over to the PC should happen at light speed compared to everything else. I mean data transferred rates are much much greater than 1 KHz, so what's the hold up? I switched the binary data, and that only gets you marginal gains in speed.
You're right about 'streaming' data. I've looked into that also. I just can't find where this instrument does that, I think I might be too dumb to do it. So I've had no success with that.
Thanks for the reply and good comments!
07-15-2020 11:06 AM
Hi!
Yes, 'time between loops' would mean the time it takes to perform 1 loop.
Not doing FOR loops because we don't know how many loops will be needed. No matter though, WHILE loops vs. FOR loops makes no change to the timing.
Excellent tip for looking into the Producer/Consumer model!!! I haven't seen or used this before. Do you have any good tips or links for using this with VISA READ and VISA WRITE with 488.2 device or similar?
Thanks so much for you help!
07-15-2020 11:47 AM
@fupper47 wrote:
Excellent tip for looking into the Producer/Consumer model!!! I haven't seen or used this before. Do you have any good tips or links for using this with VISA READ and VISA WRITE with 488.2 device or similar?
Just take your read data and enqueue it. Your processing loop can interpret the data however you need it to and log it.
07-15-2020 11:59 AM
For clarity, can you go into further detail about how exactly this would work?
I not a total newb on LabView, but this seems like a more advanced topic.
Take your time if you need to, I'm in no rush.
Thanks again!
07-15-2020 12:36 PM - edited 07-15-2020 12:37 PM
An EXTREMELY crude example here. This is far from acceptable in my opinion, but it hopefully shows the general structure.
07-15-2020 12:42 PM
Awesome! I will have to get into it and try to set this up to see how it goes.
Thanks for you efforts!
07-15-2020 03:16 PM
There's something in the manual about buffering. I wonder if this can be used to do "batch" readings, and if so, would that be acceptable?