cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1108
Views
2
Helpful
6
Replies
robert.los1
Beginner

Direct I/O with serial port C819

I want to do some direct i/o with the serial port of the c819, but there is no io.h in the sdk. Is it possible to compile a C program with outb, inb, ioperm in de iox sdk?

6 REPLIES 6
Steve Zhang
Cisco Employee

Hi Robert,

Cisco C819 IOx SDK does not provide the file io.h.

What's is your purpose to use direct I/O for serial interface? Basically C819 serial devices are handled by the virtio-console device driver and using raw-socket TCP between IOS and Host/Guest OS for transport. It does not expose the low level interfaces, and it just exposes for the high level applications.

Thanks,

Steve

Hello Steve,

I would like to interface to an old rtu (kind of plc). This rtu (ADLP80 protocol) has only an serial interface (tx,rx,ground). An asynchronous serial line as specified in the standard RS232-C by EIA.The protocol consists by a set of words. In the protocol itself there is een start,stop en checksum, so the standard modern UART will not work with the extra start en stop bit.The dedicated bitstream needs to be transferred.So I need to implement this bitstream like a "bit bang", hence I thought of outb() en inb().

The overall meaning is to convert local serial data to ip and with cisco 819 iox (linux) and a serial cable I thought there is way.

Any other ideas ?

Thanks in advance.

Thanks,

Robert

Hi Robert,

Is it possible that you receive all the data over the serial interface and do further analysis based on the protocol at the application level? I mean, once you receive all the data, you may use the application to analyze the data such as the start bit, stop bit, checksum, etc.

Hope it helps.

Steve

Hello Steve,

It's a master/slave communication. My software would be the master and it has to poll the rtu/slave. The poll frame and the received data is based on the ADLP80 protocol. The pollframe should be a bitstream (in this case 23 bits=startsequence+word+crc+par+stop) without the start/stop bit of an UART, otherwise the rtu will not send his data.

So, to get all the data over de serial interface for further analysis I have to send a specific pollframe, which in this case is a bit of problem because of the extra start/stop bit (UART).

Robert

Hello Steve,

Can you explain me how to enable the serial port on the 819 ?

When I look at Linux I see:

LZW-LMSW#virtual-service connect name iox console
Connecting to appliance. Enter Ctrl-^ followed by x, then "disconnect" to return to router prompt
Trying 192.168.3.2, 17681 ... Open

[root@P1020RDB ~]#
[root@P1020RDB ~]#
[root@P1020RDB ~]# dmesg | grep tty
Kernel command line: root=/dev/ram rw console=ttyS0,115200
serial8250.0: ttyS0 at MMIO 0xe0004500 (irq = 42) is a 16550A
console [ttyS0] enabled, bootconsole disabled
[root@P1020RDB ~]#

I can assume that /dev/ttyS0 is ready for doing some serial communication ?

Greetings,

Robert

Hi Robert,

For how to enable the serial interface for C819, please refer to Chapter 3.2 of "C819 IOx Modbus RTU Client Application Setup Guide.pdf". It provides how to configure the serial interface for Guest OS accessing. The device should be "/dev/vport0p2".

Thanks,

Steve

Content for Community-Ad

This widget could not be displayed.