ts-7000
[Top] [All Lists]

[ts-7000] RS-485 problem on TS-7200

To:
Subject: [ts-7000] RS-485 problem on TS-7200
From: "pngatlin" <>
Date: Tue, 18 May 2010 15:38:05 -0000
I have written a C program that opens the device (/dev/ttyAM1), configures the 
port for RS-485HD (using ioctl as shown in ts7200 manual), and reads the data 
being sent by the device.  This program worked during a few days of testing.  
However, now when it gets executed all I get is garbage characters being 
printed out. Nothing has changed except that the computer was physically moved 
from one location to another.  Now, even when I do testing in the lab with 
another ts-7200 computer I get the same garbage results.

Anyone encounter such inconsistency or similar with RS-485 devices on ts-7200?

In case it helps...here is my open and port configuration:

#define TIOC_SBCS485 _IOW('T',0x71, int) /*TS RTS/485 mode Set */
#define AUTO485HD 4
#define BUFFERSIZE 4109
#define BAUDRATE 19200

/* Open the port */
        fd = open(dev, O_RDWR | O_NOCTTY); 
        if (fd < 0) {
                printf("ERROR! Failed to open %s\n", dev);
                return -1;
        }

/* Configure the port */
  //-->Set the port speed
    tcgetattr(fd,&ti_prev);     
        tcgetattr(fd, &ti);
        cfsetospeed(&ti, BAUDRATE);
        cfsetispeed(&ti, BAUDRATE);
        ti.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
        
        tcsetattr(fd, TCSANOW, &ti);

  //-->Enable RS-485 in half duplex mode
    mcr = AUTO485HD;
    status=ioctl (fd, TIOC_SBCS485, &mcr); //from TS Linux manual
    if (status) {
     printf("ERROR PORT 1! TIOCSERSETRS485 failed %i\r\n", status);
     return -1;
    }



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
  • [ts-7000] RS-485 problem on TS-7200, pngatlin <=
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU