ts-7000
[Top] [All Lists]

[ts-7000] TS-7500 rs-485

To:
Subject: [ts-7000] TS-7500 rs-485
From: "nxtcomputing" <>
Date: Fri, 08 Jan 2010 15:35:08 -0000
I am trying to communicate over the RS-485 port on a TS-7500 with TS-752 board. 
I have connected pins 1 and 6 on the DB-9M port of the TS-752 board to a RS-458 
device. I have tried to configure the ports using the following...

#xuartctl --port 0 --server --speed 9600
ttyname=/dev/pts/0
#xuartctl --port 1 --server --speed 9600
ttyname=/dev/pts/1

then in a program i tried to send over the both of the ports with no luck...

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include "convert.h"
using namespace std;
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <termios.h>
#define BAUDRATE B9600            
#define _POSIX_SOURCE 1
#define FALSE 0
#define TRUE 1
volatile int STOP=FALSE;

int main(void) {        
        int fd;
        struct termios oldtio, newtio;
        fd = open("/dev/pts/0", O_RDWR | O_NOCTTY);
        if (fd <0) {
                perror("/dev/pts/0");
                exit(-1);
        }

        tcgetattr(fd, &oldtio); //save current settings
        bzero(&newtio, sizeof(newtio)); //clear new port settings

        newtio.c_cflag = BAUDRATE | CS8 | CLOCAL | CREAD | PARENB; 
        newtio.c_iflag = IGNPAR | IGNBRK;
        newtio.c_oflag = OPOST;

        newtio.c_lflag = 0;
        tcflush(fd, TCIFLUSH);
        tcsetattr(fd, TCSANOW, &newtio);
        
        char data[50];
        sprintf(data,"%c0101%cAC11R1C1A1P%c",0x02,0x1b,0x04);
        
        write(fd,&data[0],18);
        printf("sent on serial line: %s\n",&data[0]);   
        tcsetattr(fd, TCSANOW, &oldtio); //restore old setting
}

any ideas?




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

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>
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