ts-7000
[Top] [All Lists]

[ts-7000] Problem write on rs-485 TS7800

To:
Subject: [ts-7000] Problem write on rs-485 TS7800
From: "rodriguezromain62" <>
Date: Wed, 19 May 2010 08:20:55 -0000
Hello all, I have a problem with the function write(fd,data,sizeof(data));

I use a rs-485 to get value of a PT100 temperature sensor.
I put a 0 to bit 15 on register 0xE800000C to get rs-485 ON
the PT100 needs a command to return temperature, so I need to send some char, 
like "TAI".

I try this : fprintf(stderr,"%c",write(fd, 'T', 1));
             fprintf(stderr,"%c",write(fd, 'A', 1));
             fprintf(stderr,"%c",write(fd, 'I', 1));

But it doesnt work, I dont have a "TAI" print to my screen, I have "???"
I guess its not the good way.

init :

if ((fd = open(devname, O_NOCTTY | O_RDWR)) == -1) {
                perror("Can't open serial line");
                exit(1);
        }
        FD_ZERO(&readfd);
        FD_ZERO(&exceptfd);
        signal(SIGINT, catch_int);
        tcgetattr(fd, &oldsetting);
        memcpy(&newsetting, &oldsetting, sizeof(newsetting));
        cfmakeraw(&newsetting);
                cfsetspeed(&newsetting, speed);
        }
        tcsetattr(fd, TCSANOW, &newsetting);
        
        numfds = (fd > STDIN_FILENO? fd : STDIN_FILENO) + 1;
        while (1) {
                timeout.tv_sec = 1;
                timeout.tv_usec = 0;
                //FD_SET(STDIN_FILENO, &readfd);
                FD_SET(fd, &readfd);
                //FD_SET(STDIN_FILENO, &exceptfd);
                FD_SET(fd, &exceptfd);
                select(numfds, &readfd, NULL, &exceptfd, &timeout);



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

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