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-02-2014 11:49 AM
@PatanGova wrote:
Hi Omar,
I observed these with the vi you posted
Replytime MaxReplytime LoopCount
4006 4006 1
4018 4022 2
4011 4022 3
4016 4022 4
4050 4050 5
4144 4144 6
And the Readbuffer values are being updated(changing) after 30seconds(around).
4 seconds for a read? There's part of your problem. But let's break this up some more. Added benchmarking for the VISA Write as well. Also created an indicator so we can make sure the loop is iterating. I also removed the parsing of the data since this issue seems to be around the communications.
07-02-2014 11:49 AM
It's taking over 4 sec for your device to reply to your message request.
Either there is a problem with the message request that you are sending or there is a problem with your device.
Maybe your device is too busy doing other higher priority things and will address low level stuff every 4 sec.
Did you write the code on your device?
Does the reply string look EXACTLY like what you expect?
Any Errors or Warnings?
I would expect this one
VISA: (Hex 0x3FFF0006)
The number of bytes transferred is equal to the requested input count.
More data might be available.
07-02-2014 12:13 PM
Going all the way back to the beginning and re-reading your posts,I think we might have a missing 0xFF
From your very first post, first line your wrote
"I am trying communicate with a microcontroller that needs this data 0x01 0x2A 0xFF 0xFF 0xFF 0xFF 0xFF 0x0D to start transmitting data back."
But the VI is only sending 0x01 0x2A 0xFF 0xFF 0xFF 0xFF 0x0D. Add a 0xFF element to the array
Right click on the array Data Operations/Insert Element Before and add a 0xFF
07-02-2014 12:14 PM - edited 07-02-2014 12:20 PM
Hi crossrulz,
I tired your posted vi and the following observations were made
1) After 30 seconds
Iterations=14020 ReplyTime=2 Write Time=0 ,Max Replytime=4,MaxWriteTime=1
2) After 30 seconds(when restarted the vi again)
Iterations=14252 ReplyTime=2 Write Time=0 ,Max Replytime=5,MaxWriteTime=4
3) After 20 seconds(when restarted the vi again)
Iterations=9550 ReplyTime=2 Write Time=0 ,Max Replytime=5,MaxWriteTime=1
The Values in the “readbuffer” are changing very fast(seems like they the samples are getting).
Thanks.
07-02-2014 12:19 PM
Hi Omar,
No, by mistake I wrote it as 0x01 0x2A 0xFF 0xFF 0xFF 0xFF 0xFF 0x0D in the first post but it should be 0x01 0x2A 0xFF 0xFF 0xFF 0xFF 0x0D the one we are using is correct.
Thanks.
07-02-2014 12:56 PM
Also, you may wish to flush your read buffer before sending your request to make sure you are getting 'clean' data and not bytes left over from an incomplete read. This will synchronize your read with your writes.
Since you seems to have it working, add back in the data parsing stuff.
A note about Windows timing, it seems you should be able to loop well under 10 ms per loop, but every now and then Windows will step in and go off for 30 ms or so to take care of other stuff. Try this to see what your loop time is and what the Max loop time is after letting it run for 60 sec or so.