09-27-2010 06:40 AM - edited 09-27-2010 06:42 AM
Hi to everybody. I'm reading data from an instrument via RS-232 at 2400baud (as mentioned on its guide). It takes, at least, 120ms to execute a single command (send and read with LV). Now I have to read several parameters and the overall cycle time increases, just to read 5 it takes 600ms 120x5.
How can I improve? I can't get below 120ms without errors.
Thank you
09-27-2010 02:50 PM
09-27-2010 08:58 PM
At 2400 baud you can only transmit about 28 characters in the 120ms cycle time you are seeing, and that doesn't account for the delay in the instrument to generate the response. I don't know how many characters your query involves (count the request and the response), but it seems unlikely that you really have any room for improvement at this baud rate.
09-28-2010 01:33 AM - edited 09-28-2010 01:35 AM
I just send less than 28 characters. Under 120ms I get a lot of not correct responses, even on 120ms responses are not 100% correct, that's why I'm using a median filter. In this example I'm reading just 2 parameters and cycle time is 240ms.
I must add that the serial interface is not a "true" one but an isolated usb to rs-232 converter. The instrument manifacturer declares 30ms response time. Unfortunately my direct rs-232 ports are not isolated and I need the isolation.
Regards
09-28-2010 07:30 AM
Well, once you subtract the 30ms of response time, and 2ms of USB latency, you effectively have only 88ms to actually transfer data with your 120ms period. This will only get you 21 bytes transferred.
09-28-2010 07:44 AM
Please don't count response time like that.
As stated from the manifacturer it should take 60ms for a send-receive cycle, now I'm adding 2ms USB latency. I'm still 58ms over.
Commands are 8-9-10 bytes long, responses also don't exceed that number.
09-28-2010 12:45 PM
09-29-2010 01:34 AM
Hi since the VI is not in reentrant mode even I run them in parallel they will be executed one after one, so no problem about that. In fact despite parallel execution the overall time is 2x120ms=240ms.