Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

improve cycle speed

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

0 Kudos
Message 1 of 8
(4,126 Views)

start with increasing the baudrate if possible on your device.

second show us your code by attaching your vi to the message.

greetings from the Netherlands
Message 2 of 8
(4,107 Views)

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.

0 Kudos
Message 3 of 8
(4,092 Views)

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

0 Kudos
Message 4 of 8
(4,084 Views)

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.

0 Kudos
Message 5 of 8
(4,066 Views)

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.

0 Kudos
Message 6 of 8
(4,062 Views)

Hi

 

Why are you running both vi's in parallel?

Do not forget that you now don'tknow which vi sends first or last and maybe both commands are sent immediately after each other and I don't know if your serial line can handle that.

greetings from the Netherlands
Message 7 of 8
(4,046 Views)

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.

0 Kudos
Message 8 of 8
(4,013 Views)