Announcement

Collapse
No announcement yet.

Data trace send/rec port serial rs232c

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Data trace send/rec port serial rs232c

    Hello. I'm a system developer and i'm initializing a integration with the Tracer LT 980 Satellite Nidek, using serial port RS232c.
    I'm having troubles in establishing a session with the device. I've done the configuration of the serial port (9600,8,N,1), as I've read in the OMA Protocol, as soon as I made a connection with the Tracer automatically will be send a request of initialization.


    According the OMA Protocol, I have to send the following datas:


    <ACK>
    <FS>ANS=INI<CR/LF>
    STATUS=0<CR/LF>
    <RS>
    <GS>


    But, before I send those datas, I have to received these datas:


    <FS>REQ=INI<CR/LF>
    <RS>
    <GS>


    Besides not receive any datas sending "REQ=INI", I don't receive any information of the device.
    I've tried sending those commands bellow, but i don't get any answer as well. Only when I send "<ENQ>(ASCI 5 ou 0x05)", I receive a "<ACK>(ASCII 6 ou 0x06)" and nothing else.


    <LF><DLE><SOH><STX>REQ=TRC<DLE><ETX>
    0x10,0x02,0x05,0x01,0x07,0x06,0x10,0x03,0x0E


    My main question is : Which is the correct way to send those codes?


    ps.: The fields between tags "<>" will be changed to ASCII Code.


    Thanks,
    Eduardo
    Tks,
    Eduardo

    #2
    Go back to the basics.

    Check your wiring of the -232 plugs - do the correct pins have continuity all the way through the system?
    Check the length of the wiring - -232 has a max length of about 25-50 meters to ensure proper signal strength
    If you need a null-modem, is it in place? Is it the correct one?

    Double check your protocols on ALL the machines in the connection.
    Double check that the machine is capable of -232 reception, meaning there is no problem with the -232 interface.
    Double check that the machine is configured to receive data through the -232 line instead of another line.

    Comment


      #3
      Hello Mike, thanks for the answer.
      I've already done all those checks. I'm using the software "Utility Tracer" and it's working well, and the program is able to read the datas sent by the Tracer LT 980.
      It's in my own application that I don't know how to send datas and receive the answers.

      Regards,
      Eduardo
      Tks,
      Eduardo

      Comment


        #5
        Originally posted by edu23800 View Post
        Hello. I'm a system developer and i'm initializing a integration with the Tracer LT 980 Satellite Nidek, using serial port RS232c.
        I'm having troubles in establishing a session with the device. I've done the configuration of the serial port (9600,8,N,1), as I've read in the OMA Protocol, as soon as I made a connection with the Tracer automatically will be send a request of initialization.


        According the OMA Protocol, I have to send the following datas:


        <ACK>
        <FS>ANS=INI<CR/LF>
        STATUS=0<CR/LF>
        <RS>
        <GS>


        But, before I send those datas, I have to received these datas:


        <FS>REQ=INI<CR/LF>
        <RS>
        <GS>


        Besides not receive any datas sending "REQ=INI", I don't receive any information of the device.
        I've tried sending those commands bellow, but i don't get any answer as well. Only when I send "<ENQ>(ASCI 5 ou 0x05)", I receive a "<ACK>(ASCII 6 ou 0x06)" and nothing else.


        <LF><DLE><SOH><STX>REQ=TRC<DLE><ETX>
        0x10,0x02,0x05,0x01,0x07,0x06,0x10,0x03,0x0E


        My main question is : Which is the correct way to send those codes?


        ps.: The fields between tags "<>" will be changed to ASCII Code.


        Thanks,
        Eduardo
        That is a newer tracer so you can be sure it supports auto format initialization, The specs say 1000 points around a lens and you have USB, LAN, and Serial (RS232C). My guess is that the baud rate you've choosen is too slow. Try to get into the settings of the tracer and get the baud rate. Then match that rate on your computer. Before you even get there check your cable to make sure it is a Null modem or Straight through depending on if your tracer is considered a if it is a DTE device you need a null modem cable a DCE needs a straight through. You can buy a simple adapter at radoi shack to cross over your cables if you need to. Anyway once your sure that the device and host have the channels to communicate, then try turning the machine on while connected and software running your machine should send the request for initialization. From there your response packet looks good enough it should elicit a response.
        http://www.opticians.cc

        Creator of the industries 1st HTML5 Browser based tracer software.
        Creator of the industries 1st Mac tracer software.
        Creator of the industries 1st Linux tracer software.

        Comment


          #6
          Wes, thanks for the feedback.
          I've already read those guides and unfortunately I didn't had success.
          Tks,
          Eduardo

          Comment


            #7
            Originally posted by MakeOptics View Post
            That is a newer tracer so you can be sure it supports auto format initialization, The specs say 1000 points around a lens and you have USB, LAN, and Serial (RS232C). My guess is that the baud rate you've choosen is too slow. Try to get into the settings of the tracer and get the baud rate. Then match that rate on your computer. Before you even get there check your cable to make sure it is a Null modem or Straight through depending on if your tracer is considered a if it is a DTE device you need a null modem cable a DCE needs a straight through. You can buy a simple adapter at radoi shack to cross over your cables if you need to. Anyway once your sure that the device and host have the channels to communicate, then try turning the machine on while connected and software running your machine should send the request for initialization. From there your response packet looks good enough it should elicit a response.
            Hello MakeOptics, according to the guide, I've set the tracer's baud rate to 9600 and besides, as I said, I'm using another software (Utility Tracer) to make communication tests and the software made a perfectly communication, returning all calculated datas.
            My only problem is when I use my own software, cause I can't find a way to send any request that makes sense to the Tracer. Do you have any example of data exchange with a tracer?
            Tks,
            Eduardo

            Comment


              #8
              Originally posted by edu23800 View Post
              Hello MakeOptics, according to the guide, I've set the tracer's baud rate to 9600 and besides, as I said, I'm using another software (Utility Tracer) to make communication tests and the software made a perfectly communication, returning all calculated datas.
              My only problem is when I use my own software, cause I can't find a way to send any request that makes sense to the Tracer. Do you have any example of data exchange with a tracer?
              What programming language are you using?

              The only reason, I suggested checking connection speed and cabling is the very same reason computer repair techs ask you if it's plugged in or turned on, it saves us both a lot of aggravation. It sounds like you have everything set up, so it's the communication.


              Try tracing a frame and sending that data to your software. The reasoning is the device initializes communication and we can use a no initialization protocol which is supported by all devices, that should allow you to see the data being sent. If we can get data transferred to your host then post that data and we will interpret and go from there. I have studied the protocol very well, but have always been lacking a tracer to test code on, so if you post packets I can walk you through what they mean and the correct response.

              You can also purchase software from Eltima that creates a virtual com port so that you can monitor Ulility Tracer's raw data, this will allow you to see the handshake in progress by performing what's referred to as "a man in the middle", this hack can allow you to eaves drop on the current setup. This will allow you to see a days worth of data and determine how to code that example. I found it much easier then interpreting the DCS manual, but ultimately I use both. I discussed this tactic with an industry software provider, and over the years I was able to circumvent a PhiTracer's lock codes through VisionWeb and even had that software available here on this forum before the heat caught up with me. That was when my nickname was PhiTrace which was really me trying to stay anonymous and post that one bit of software for my clients.
              Last edited by MakeOptics; 05-27-2015, 12:21 PM.
              http://www.opticians.cc

              Creator of the industries 1st HTML5 Browser based tracer software.
              Creator of the industries 1st Mac tracer software.
              Creator of the industries 1st Linux tracer software.

              Comment


                #9
                Originally posted by edu23800 View Post
                Hello MakeOptics, according to the guide, I've set the tracer's baud rate to 9600 and besides, as I said, I'm using another software (Utility Tracer) to make communication tests and the software made a perfectly communication, returning all calculated datas.
                My only problem is when I use my own software, cause I can't find a way to send any request that makes sense to the Tracer. Do you have any example of data exchange with a tracer?
                PM sent.

                Comment


                  #10
                  How is the serial connector pinned out? The Nidek/Santinelli machines need a null modem connector. Pin 2 should be green wire instead of red, pin 3 should be red wire instead of green. Pin 5 should be yellow wire. The next bit of instruction may sound odd, but I've hooked up a few dozen of these: jump pins 4 and 6 to each other, and pins 7 and 8 to each other as well. See crappy picture:
                  Click image for larger version

Name:	IMG_20150527_155034.jpg
Views:	1
Size:	36.5 KB
ID:	869445

                  Comment


                    #11
                    Originally posted by Wes View Post
                    How is the serial connector pinned out? The Nidek/Santinelli machines need a null modem connector. Pin 2 should be green wire instead of red, pin 3 should be red wire instead of green. Pin 5 should be yellow wire. The next bit of instruction may sound odd, but I've hooked up a few dozen of these: jump pins 4 and 6 to each other, and pins 7 and 8 to each other as well. See crappy picture:
                    [ATTACH=CONFIG]11996[/ATTACH]
                    4 and 6, signify that there is no DSR/DTR communication.
                    7 and 8, signify that there is no RTS/CTS communication.

                    Newer equipment can both talk and listen at the same time "full duplex", older equipment used to actually send a signal through one of the above lines and wait for a response back before transmitting data. By creating a loop in essence when a signal goes over the DSR or RTS line it loops right back to itself as a response signal on the DTR or CTS lines and begins communication. Thanks for sharing that, I used to set up com0com and modify those variables to virtually connect, never actually though of using a jumper.
                    http://www.opticians.cc

                    Creator of the industries 1st HTML5 Browser based tracer software.
                    Creator of the industries 1st Mac tracer software.
                    Creator of the industries 1st Linux tracer software.

                    Comment


                      #12
                      The DCS requires the device (the tracer, in this case) to initiate the communications session. If the tracer isn't doing that, it could be that it will only send with one or both of the handshake lines high - DTR and CTS. You might try looping DTR and DSR, and CTS and RTS, on the the tracer's side of the connection, as Wes recommended.

                      Those lines don't actually transport signals; they're either high or low, indicating ready or not.

                      There is literally nothing you can (or must) send to the tracer to get it to send data to you. It must initiate the session.

                      Comment


                        #13
                        Code:
                        //VCA Reserved Characters Hexidecimal values un-escaped
                        
                        
                        var FS = '\u001C';
                        var GS = '\u001D';
                        var DC1 = '\u0011';
                        var DC3 = '\u0013';
                        var ACK = '\u0006';
                        var NAK = '\u0015';
                        var ESC = '\u001B';
                        var RS = '\u001E';
                        var SUB = '\u001A';
                        var CR = '\u000D';
                        var LF = '\u000A';
                        var field_seperator = '\u003B'; // hex for ";"
                        var label_seperator = '\u003D'; // hex for "="
                        var code_seperator = '\u002C'; // hex for ","
                        var mandatory_record_flag = '\u002A'; //hex for "*"
                        var unknown_data_indicator = '\u003F'; // hex for "?"
                        
                        
                        function VCArecords(stream) {
                        	var records = {};
                        	var temp = [];
                        	var lines = stream.split(CR + LF);
                        	
                        	for(var x in lines) {
                        		temp = lines[x].split(label_seperator);
                        		
                        		//every record set
                        		if(records.hasOwnProperty(temp[0])) {
                        			records[temp[0]] = records[temp[0]].concat(temp[1].split(field_seperator));	
                        		} else {
                        			records[temp[0]] = temp[1].split(field_seperator);
                        		}	
                        	}
                            records.RR = records.R.slice(0,records.TRCFMT[1]+1);
                            records.RL = records.R.slice(records.TRCFMT[6]*(-1));
                            if(records.hasOwnProperty("A")) {
                                records.AR = records.A.slice(0,records.TRCFMT[1]+1);
                                records.AL = records.A.slice(records.TRCFMT[6]*(-1));
                            }
                            if(records.hasOwnProperty("ZFMT")) {
                                records.ZR = records.Z.slice(0,records.ZFMT[1]+1);
                                records.ZL = records.Z.slice(records.ZFMT[6]*(-1));
                            }
                            if(records.hasOwnProperty("ZA")) {
                                records.ZAR = records.ZA.slice(0,records.ZFMT[1]+1);
                                records.ZAL = records.ZA.slice(records.ZFMT[6]*(-1));
                            }
                        
                        
                        	return records;
                        }
                        Example: (fiddle) http://jsfiddle.net/4g0p309r/5/

                        This is a Javascript library that takes in a stream and returns an object that has OMA records in it. Not to be used for commercial purposes, without express consent.

                        Yes, Javascript is useful two examples:

                        1. Chrome now has Serial support baked into the new version.
                        2. Node.js

                        Documentation:

                        The function returns an object which can be referenced using dot notation to gain access to all valid labels that are available in the OMA file. Keep in mind that this combines all record sets with similar labels, however (R, A, Z, ZA) record sets also have a corresponding (RR, RL, AR, AL, ZR, ZL, ZAR, ZAL) record set for each eye .

                        The TRCFMT and ZFMT, data is combined for right and left, I access the data array position 1 for the right lens and 6 for the left lens.

                        No error checking, if anyone plans on using the code I can work with them to refine.

                        If anyone is willing to donate a tracer (OMA Compliant) I can further develop this into an open source trace software for uploading to Vision Web with the possibility of Shape Modification. The above code is an interpretation function, but before I can put any effort into a communications function I would need a unit to test it on. Here is a proof of concept to prove it can and will be done when funds or equipment are available.

                        Last edited by MakeOptics; 05-30-2015, 09:55 AM. Reason: refactored code and included JS Fiddle
                        http://www.opticians.cc

                        Creator of the industries 1st HTML5 Browser based tracer software.
                        Creator of the industries 1st Mac tracer software.
                        Creator of the industries 1st Linux tracer software.

                        Comment


                          #14
                          New and improved version.

                          http://www.opticians.cc

                          Creator of the industries 1st HTML5 Browser based tracer software.
                          Creator of the industries 1st Mac tracer software.
                          Creator of the industries 1st Linux tracer software.

                          Comment


                            #15
                            The problem that tracer wasn't sending any data, was that the communication wasn't made in the OMA protocol, but in the machine's language. That's why I coudn't translate anything.
                            But now, I'm receiving in the OMA pattern, and sending exactly what you guys told me, I've made the connection perfectly. Thanks for everyone for the time and the patience.
                            Tks,
                            Eduardo

                            Comment

                            Working...
                            X