Results 1 to 24 of 24

Thread: Data trace send/rec port serial rs232c

  1. #1
    OptiBoard Novice
    Join Date
    May 2015
    Location
    Brasil
    Occupation
    Optical Laboratory Technician
    Posts
    7

    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

  2. #2
    Banned
    Join Date
    Jul 2010
    Location
    St. Cloud, Minnesota
    Occupation
    Ophthalmic Technician
    Posts
    3,089
    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.

  3. #3
    OptiBoard Novice
    Join Date
    May 2015
    Location
    Brasil
    Occupation
    Optical Laboratory Technician
    Posts
    7
    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

  4. #4
    ABOM Wes's Avatar
    Join Date
    Nov 2007
    Location
    Earth
    Occupation
    Optical Laboratory Technician
    Posts
    3,194
    Wesley S. Scott, MBA, MIS, ABOM, NCLE-AC, LDO - SC & GA

    “As our circle of knowledge expands, so does the circumference of darkness surrounding it.” -Albert Einstein

  5. #5
    Master OptiBoarder MakeOptics's Avatar
    Join Date
    Aug 2011
    Location
    none
    Occupation
    Other Eyecare-Related Field
    Posts
    1,327
    Quote 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.

  6. #6
    OptiBoard Novice
    Join Date
    May 2015
    Location
    Brasil
    Occupation
    Optical Laboratory Technician
    Posts
    7
    Wes, thanks for the feedback.
    I've already read those guides and unfortunately I didn't had success.
    Tks,
    Eduardo

  7. #7
    OptiBoard Novice
    Join Date
    May 2015
    Location
    Brasil
    Occupation
    Optical Laboratory Technician
    Posts
    7
    Quote 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

  8. #8
    Master OptiBoarder MakeOptics's Avatar
    Join Date
    Aug 2011
    Location
    none
    Occupation
    Other Eyecare-Related Field
    Posts
    1,327
    Quote 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 at 02: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.

  9. #9
    ABOM Wes's Avatar
    Join Date
    Nov 2007
    Location
    Earth
    Occupation
    Optical Laboratory Technician
    Posts
    3,194
    Quote 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.
    Wesley S. Scott, MBA, MIS, ABOM, NCLE-AC, LDO - SC & GA

    “As our circle of knowledge expands, so does the circumference of darkness surrounding it.” -Albert Einstein

  10. #10
    ABOM Wes's Avatar
    Join Date
    Nov 2007
    Location
    Earth
    Occupation
    Optical Laboratory Technician
    Posts
    3,194
    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:	80 
Size:	36.5 KB 
ID:	11996
    Wesley S. Scott, MBA, MIS, ABOM, NCLE-AC, LDO - SC & GA

    “As our circle of knowledge expands, so does the circumference of darkness surrounding it.” -Albert Einstein

  11. #11
    Master OptiBoarder MakeOptics's Avatar
    Join Date
    Aug 2011
    Location
    none
    Occupation
    Other Eyecare-Related Field
    Posts
    1,327
    Quote 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:
    Click image for larger version. 

Name:	IMG_20150527_155034.jpg 
Views:	80 
Size:	36.5 KB 
ID:	11996
    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.

  12. #12
    Objection! OptiBoard Gold Supporter shanbaum's Avatar
    Join Date
    May 2000
    Location
    Manchester, CT USA
    Occupation
    Other Optical Manufacturer or Vendor
    Posts
    2,976
    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.

  13. #13
    Master OptiBoarder MakeOptics's Avatar
    Join Date
    Aug 2011
    Location
    none
    Occupation
    Other Eyecare-Related Field
    Posts
    1,327
    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 at 11: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.

  14. #14
    Master OptiBoarder MakeOptics's Avatar
    Join Date
    Aug 2011
    Location
    none
    Occupation
    Other Eyecare-Related Field
    Posts
    1,327
    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.

  15. #15
    OptiBoard Novice
    Join Date
    May 2015
    Location
    Brasil
    Occupation
    Optical Laboratory Technician
    Posts
    7
    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

  16. #16
    Master OptiBoarder MakeOptics's Avatar
    Join Date
    Aug 2011
    Location
    none
    Occupation
    Other Eyecare-Related Field
    Posts
    1,327
    The 1st HTML5 App based Tracer Interface. Sure I have seen ActiveX components in browsers that allow interface with a tracer, but that requires IE or some hacking around, this is a chrome app that can work on a cheap $199 chromebook and be just as functional without having to install drivers through VisionWeb to upload traces. Ain't technology grand.

    I was able to interface and initialize a National Optronics 4Ti Tracer via the OMA handshake method outlined in the DCS. Traces can be archived, viewed to scale, and uploaded to VisionWeb to transmit to the lab. Archived traces can also be loaded and viewed in the software.

    Thank you Barry Santini for the offer to donate a Tracer, had I not have purchased one I would have taken you up on the offer.

    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.

  17. #17
    Master OptiBoarder MakeOptics's Avatar
    Join Date
    Aug 2011
    Location
    none
    Occupation
    Other Eyecare-Related Field
    Posts
    1,327
    Next phase of development auto populate visionweb with the trace from the tracer or a locally saved OMA file (e.g like from silhouette labs). Locally saved traces can currently be pulled into the software and viewed as well as saved from the program.

    Next steps:
    1) Auto load visionweb.
    2) Shape modifications.
    3) Drill editor.
    4) Connect to edger for a full browser based mini-LMS.



    INDUSTRY FIRST HTML5 TRACER SOFTWARE, INDUSTRY FIRST LINUX TRACER SOFTWARE, INDUSTRY FIRST MAC TRACER SOFTWARE
    Last edited by MakeOptics; 07-02-2015 at 11:30 AM.
    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.

  18. #18
    OptiBoard Novice
    Join Date
    May 2015
    Location
    Brasil
    Occupation
    Optical Laboratory Technician
    Posts
    7
    Hello. I have another question about the communication.
    I'm connecting with the tracer and receiving the data when I press the button to scan the frame glasses (because I'm sending a "REQ" command manually).
    But now I need to initialize the process of scan the frame glasses without pressing manually the button, just sending a command with my program. But I can't establish a requisition, the tracer didn't answer and I don't know how to do it.

    This's what i'm sending:
    <FS>REQ=TRC<CR/LF>
    STATUS=5;INITIALIZE<CR/LF>
    JOB=1<CR/LF>
    DO=B<CR/LF>
    TRCFMT=1;1000;E;R;F<CR/LF><RS><GS>


    Does anyone have some idea?
    Tks,
    Eduardo

  19. #19
    Objection! OptiBoard Gold Supporter shanbaum's Avatar
    Join Date
    May 2000
    Location
    Manchester, CT USA
    Occupation
    Other Optical Manufacturer or Vendor
    Posts
    2,976
    Quote Originally Posted by edu23800 View Post
    Hello. I have another question about the communication.
    I'm connecting with the tracer and receiving the data when I press the button to scan the frame glasses (because I'm sending a "REQ" command manually).
    But now I need to initialize the process of scan the frame glasses without pressing manually the button, just sending a command with my program. But I can't establish a requisition, the tracer didn't answer and I don't know how to do it.

    This's what i'm sending:
    <FS>REQ=TRC<CR/LF>
    STATUS=5;INITIALIZE<CR/LF>
    JOB=1<CR/LF>
    DO=B<CR/LF>
    TRCFMT=1;1000;E;R;F<CR/LF><RS><GS>


    Does anyone have some idea?
    If the tracer allows you to do that, it is not doing it in a standard way, because the standard provides no way to do it. I recommend pushing the button.

  20. #20
    OptiBoard Novice
    Join Date
    May 2015
    Location
    Brasil
    Occupation
    Optical Laboratory Technician
    Posts
    7
    Quote Originally Posted by shanbaum View Post
    If the tracer allows you to do that, it is not doing it in a standard way, because the standard provides no way to do it. I recommend pushing the button.
    I use as example the "Tracer Utility" to do the integration in my own software and the tracer utility is able to inicialize the process without pressing any button in the tracer, so, as I can see, the tracer does have this function.
    Did you know how to proceed?
    Tks,
    Eduardo

  21. #21
    Master OptiBoarder MakeOptics's Avatar
    Join Date
    Aug 2011
    Location
    none
    Occupation
    Other Eyecare-Related Field
    Posts
    1,327
    Quote Originally Posted by edu23800 View Post
    I use as example the "Tracer Utility" to do the integration in my own software and the tracer utility is able to inicialize the process without pressing any button in the tracer, so, as I can see, the tracer does have this function.
    Did you know how to proceed?
    Why don't you create a virtual com port, loop back the tracer utility program to your virtual com port and monitor the commands being sent. That way you can figure out the specific command to start tracing remotely. Like Robert mentioned their is no standard way of doing what you are asking, but the standards do allow for custom or experimental commands which are ignored by standard compliant equipment. Usually those records start with an underscore "_", if you monitor a virtual port and see any record with an "_" this would most likely be your remote button code.
    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.

  22. #22
    OptiBoard Novice
    Join Date
    Jan 2023
    Location
    Rosario
    Occupation
    Optical Laboratory Technician
    Posts
    1
    Thank you for your enormous contribution. I have read this thread carefully. If possible, could you tell me where to get the information on these links?
    Thank you for your enormous contribution. I have read this thread carefully. If possible, could you tell me where to get the information on these links?

  23. #23
    ABOM Wes's Avatar
    Join Date
    Nov 2007
    Location
    Earth
    Occupation
    Optical Laboratory Technician
    Posts
    3,194
    Wesley S. Scott, MBA, MIS, ABOM, NCLE-AC, LDO - SC & GA

    “As our circle of knowledge expands, so does the circumference of darkness surrounding it.” -Albert Einstein

  24. #24
    ABOM Wes's Avatar
    Join Date
    Nov 2007
    Location
    Earth
    Occupation
    Optical Laboratory Technician
    Posts
    3,194
    Wesley S. Scott, MBA, MIS, ABOM, NCLE-AC, LDO - SC & GA

    “As our circle of knowledge expands, so does the circumference of darkness surrounding it.” -Albert Einstein

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. National Optronics 4T Tracer S/N 4T-7068 2 Serial Ports OMA Compatible
    By Ocular Dexter in forum Optical Marketplace
    Replies: 8
    Last Post: 03-22-2012, 02:34 PM
  2. Refurbished 4T Tracer w/serial ports
    By Ocular Dexter in forum Optical Marketplace
    Replies: 7
    Last Post: 02-19-2012, 09:59 PM
  3. Nidek RT-5100 Serial Port Settings
    By WaipapaEyecare in forum General Optics and Eyecare Discussion Forum
    Replies: 0
    Last Post: 04-25-2010, 04:40 PM
  4. Trace Data Question
    By EdSheridan in forum General Optics and Eyecare Discussion Forum
    Replies: 6
    Last Post: 10-22-2006, 06:55 PM
  5. Nidek ICE-9000 serial communications
    By tlstephan in forum General Optics and Eyecare Discussion Forum
    Replies: 4
    Last Post: 12-06-2005, 03:15 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •