Shop OBEX P1 Docs P2 Docs Learn Events
BS2 to industrial controller using rs232 - Page 2 — Parallax Forums

BS2 to industrial controller using rs232

2»

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2014-01-22 10:52
    @Trooks FoE - fibre over Ethernet? Nothing quite so speedy. Usually nothing much over 19.2K is required on wired or wireless things I work on.
  • xanatosxanatos Posts: 1,120
    edited 2014-01-31 13:54
    Hi jelecguy31,

    I may be late to the party here, but I had almost identical issues communicating with a standard industrial piece of equipment, and what got me going was as follows...

    First, do not pause at all after your SEROUT. You send that and as soon as that device gets it it'll start spewing.

    Next, since you know the response code you're expecting, use WAIT in your SERIN command. Does the device always respond with something consistently? In my first application, no matter what it was sending, it would prefix the response with ">", so in my SERIN command, I would wait for ">". That single thing solved all my garbage issues.

    Once that was established, it was just a series of WAITs and SKIPs to get the exact data I needed from the device. I have used this knowledge to great advantage now on a dozen different serially communicating devices. I hope this was helpful.

    SERIN Ctx, T9600, [WAIT(">"), SKIP 23, dsvx, SKIP 4, STR serStr\11, SKIP 26, STR serStr2\2]

    Dave
Sign In or Register to comment.