We need little HW solution that is connected with computer via Ethernet and communicates with other proprietary device via RS232. Problem is that communication on serial port is very very critical - after getting some header bytes from the device there must be some bytes sent within specific timeframe. Any normal multitasking OS is mostly unusable for that. Communication itself is not that fast on the other hand (9600 bauds), 264 bytes every half a second or so.
Now I'm not sure if programming model for Arduino allows to sit on serial port most of the time and then deal with Ethernet communication very fast. I'm also not sure how buffers on ethernet shield works, etc. Is Arduino usable for such an application?
Also - I'm not too much into controllers for last 10 years and I'm quite lucky to even know Arduino. So if you know about any other better suited device your advice is more than welcome. Non-programmable eth/rs232 bridges are mostly unusable (we tried Cisco terminal servers for example, no way to time communication precisely), so I guess it must be some programmable microcontroller.
In worst case we could do also with two serials (maybe Mega board would be better), but Eth allows us more flexible communication from our SW solution.
Problem is that communication on serial port is very very critical - after getting some header bytes from the device there must be some bytes sent within specific timeframe. Any normal multitasking OS is mostly unusable for that.
I don't know that I agree. Most modern operating systems have some concept of high priority tasks that are probably capable of responding withing small numbers of milliseconds, and then there are the "real time" operating systems.
Is Arduino usable for such an application?
I don't think so? Too much of the network side is hidden off inside the wiznet chip, and I haven't seen its quirks well-documented. If you can accept somewhat random network behavior as long as you can fiddle with the serial port in real-ish time, it might work.
So if you know about any other better suited device your advice is more than welcome. Non-programmable eth/rs232 bridges are mostly unusable (we tried Cisco terminal servers for example, no way to time communication precisely), so I guess it must be some programmable microcontroller.
Sorry about the cisco. We gave up on obscure async protocols in favor of density for standard protocols rather a long time ago, more or less. If you couldn't get one of the standard options, or "dispatch machine" (which has a fixed but smallish timeout) to work, it was probably hopeless.
If you're willing to put up with something that is that physically large, some sort of x86 PC box running linux or qnx or similar might be the easiest solution.
Thank you for really valuable answer. I'll check those devices you mentioned.
Most modern operating systems have some concept of high priority tasks that are probably capable of responding withing small numbers of milliseconds, and then there are the "real time" operating systems.
Customer made some tests with original DOS application over Windows - it was obviously naive and not working reliably. About high priority tasks... after third byte on the input to PC I need to assure that every one from next 258 bytes are sent within specific timeframe related to received byte. There is no other flow control and the other unit doesn't do anything else just waits for data and ignores the whole block if it doesn't like anything about the timing. Customer uses DOS for years - the problem is that old PCs are ... well old - and new are not supported + there are more reasons to change the whole application - but boxes on serial ports must stay.
Generally I'd like to be in control during the block recieve and transmission, after that there seems to be ~200 ms time before next block.
BTW: what you mean by random network behavior? Isn't it possible to handle communication between serial data blocks? PC would either send me some control message or request to get data, in that case I'd just send something back. There is no other required communication over ethernet.
QNX came to my mind too. PC box is not the problem, it can be that big. I'm just a bit afraid of anything too complex, because the task is actually quite simple - only time criticial during the block transmission. To hack some microcontroller might be easier than mess with QNX and all around in the end - but I might be wrong and I'll look at QNX. Linux is no problem, but I have to first try it against the device. Never did RS232 in it.
We wanted ot use ethernet, because the rest of the application is some server for SCADA system - and we're good with Java. That's why we tried that terminal server first before we learned that it's no go because of the awkwardness of the protocol.
I'll check your links, seems quite promissing but I have to dig deeper before I find out anything. If I get some results, I'll post them just for sake of closing the thread.