News:

  • August 29, 2026, 01:28:08 PM

Login with username, password and session length

Author Topic: Moving serial input data between Do-More CPU's  (Read 48095 times)

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: Moving serial input data between Do-More CPU's
« Reply #15 on: February 21, 2013, 06:10:09 PM »
What if you broadcast the scanner data 1 character at a time?

plcnut

  • Hero Member
  • *****
  • Posts: 815
    • premiersi.com
Re: Moving serial input data between Do-More CPU's
« Reply #16 on: February 21, 2013, 07:33:08 PM »
10 Readable charaters
That only requires a 14 byte string. And with as much time as you have you only need to move one code at a time. If you posted the string into peer link with an identifier to tell which scanner it came from, and have the Plc that is receiving it turn on an acknowledge bit. I believe you could easily move the data with peer link.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
https://premiersi.com

DLTimmons

  • Hero Member
  • *****
  • Posts: 232
Re: Moving serial input data between Do-More CPU's
« Reply #17 on: February 22, 2013, 10:08:23 AM »
I would much reather have each scanner read in it own location much easier to keep track of and match to proper location. Plus why waste the peerlink band with with something that only needs to be read every few minutes.

I was working with serial port reading strings and noticed that each string has a leading period and a trailing period is this the do=more way of showing nonreadable charters. If so how do I strip them from the leading edge?

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3843
    • Host Engineering
Re: Moving serial input data between Do-More CPU's
« Reply #18 on: February 22, 2013, 11:01:04 AM »
I was working with serial port reading strings and noticed that each string has a leading period and a trailing period is this the do=more way of showing nonreadable charters. If so how do I strip them from the leading edge?
Yes, it's impossible to display non displayable characters (e.g. CR/LF etc.), so in Ladder Status it replaces those characters with a PERIOD.

I recommend looking at DataView where it has multiple display formats for STRINGs.

* ASCII (default, also same format as what is displayed in Ladder Status) - all displayable ASCII characters are shown, non-ASCII and control characters get replaced with a "."
* Quoted - handles anything/everything, just as if you had to enter a string literal containing THAT character sequence in an instruction.  Hence, it uses the $-based escape sequence for non-displayable characters (e.g. Hello<CR><LF> is shown as "Hello$0D$0A"
* Hexadecimal - dumps the characters in groups of 4 as their hex equivalent, e.g.
48 65 6C 6C   6F 0D 0A
* 4/8/16/24/32 Hex/ASCII - both Hexadecimal and ASCII.  If you've ever seen binary editors or debuggers where you see raw bytes followed by their ASCII equivalent, that's what this is.  You can display 4, 8, 16, 24, or 32 characters per line (so you can view long strings in your Data View as either tall/thin or wide/short).

Attached is a screen shot showing those formats of the STRING Hello<CR><LF> with the last two being 4 Hex/ASCII and 8 Hex/ASCII

Look at the Data View to see if these are non-critical data.  If so, then use the STRSUB instruction to EXTRACT the "middle" out of the string.  Offsets are 0-based, so to skip the first character, you would use STRSUB with Starting Offset of 1, whth a Length of 10 (you mentioned 10 readable characters), or possibly 8 if that length of 10 also included these two extra control characters.
« Last Edit: February 22, 2013, 11:04:47 AM by franji1 »

DLTimmons

  • Hero Member
  • *****
  • Posts: 232
Re: Moving serial input data between Do-More CPU's
« Reply #19 on: February 22, 2013, 11:54:38 AM »
" Offsets are 0-based, so to skip the first character, you would use STRSUB with Starting Offset of 1, " Visual Basic uses base 1

Ok that along with the fact the pc that is sending the command string I decodeing is send the following "TxString = Chr(10) + TxString + Checksum + Chr(13)"

That is why I see the leading period in the string in the Do-More

This is turning into one big tought elephant, alot of chewing ::)

plcnut

  • Hero Member
  • *****
  • Posts: 815
    • premiersi.com
Re: Moving serial input data between Do-More CPU's
« Reply #20 on: February 22, 2013, 12:09:02 PM »
String manipulation in the DoMore is really quite easy. Have you looked at any of the examples posted in the forum here? Bobo posted one for a GET request that may help you see how some of it works.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
https://premiersi.com