News:

  • June 10, 2026, 06:53:13 AM

Login with username, password and session length

Author Topic: Do-More & ASCII  (Read 25092 times)

scott.lawrence

  • Jr. Member
  • **
  • Posts: 16
Do-More & ASCII
« on: October 02, 2013, 01:15:36 PM »
I have an application where I need to communicate with a Miyachi Welder, an RS-485 device. This app used to have a DL260 & F2-CP128. The Co-Pro would handle RX/WX comms, once I got the string formatted correctly.

I recently changed the configuration to a Do-More. I had an ethernet Modbus/ASCII gateway for the communications, and all was ok... sometimes. Once in a while, the gateway would not send the data back to the Do-More.

I decided to replace this set-up with the H2-SERIO-4 to take advantage of native string processing. I tested this config on my desk, and can see the string from the Do-More in a terminal program. I can even send a response to the Do-More.

However, when trying to communicate with the welder, there is no response...

The format for the string, from the welder manual, is <soh> <@> <command> <count> <data> <cksum> <eot>. I am using a STRPRINT to put this in SS0
 "$01" "01RR00300129" "$04"
 with the $ for <soh> & <eot> characters.

Still nothing from the device...


** the DIPs on the module are "No Term" & "RS485", no term b/c there is a resistor on the welder comms port.

Anyone here have any success/solutions with this type of issue?


BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6158
  • Yes Pinky, Do-more will control the world!
Re: Do-More & ASCII
« Reply #1 on: October 02, 2013, 04:26:32 PM »
Obviously wiring is the first concern.

When the spec says <@> is it talking about the literal '@'? I don't see that in the request string.

The default STRPRINT setting is to insert a space between each script term. Make sure that is off.

Presumably the welder doesn't need a data terminator other than the EOT...but with ASCII commands CR/LF have been known to both help and hinder.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

scott.lawrence

  • Jr. Member
  • **
  • Posts: 16
Re: Do-More & ASCII
« Reply #2 on: October 02, 2013, 04:40:31 PM »
Bob, thanks for replying...and I've double, even triple checked the wiring  ::)

Quote
When the spec says <@> is it talking about the literal '@'? I don't see that in the request string.

no, not a literal '@'.. this is the address, or in my case, 01 at the start of the string (not $01, as this is <soh>)

Quote
The default STRPRINT setting is to insert a space between each script term. Make sure that is off.

it is off...


BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6158
  • Yes Pinky, Do-more will control the world!
Re: Do-More & ASCII
« Reply #3 on: October 02, 2013, 04:54:38 PM »
Sadly, I've never hooked up such a device...so I'm not much help.

With RS232, stuff like this usually ends up being ground related. Guessing that isn't an issue with RS485 though. Again, not much help.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3827
    • Host Engineering
Re: Do-More & ASCII
« Reply #4 on: October 02, 2013, 05:01:37 PM »
I assume EVERYTHING is ASCII except for the SOH/EOT framing characters.  Make sure you have the right number of ASCII characters for each part of the frame, and that those numbers are formatted correctly (e.g. is the value 10 "10"? "A"? "0A"? "0010"? "000A"? or ...?)

scott.lawrence

  • Jr. Member
  • **
  • Posts: 16
Re: Do-More & ASCII
« Reply #5 on: October 03, 2013, 09:18:16 AM »
franji1, the pdf for the older manual can be found here... http://www.miyachiamerica.com/servlet/servlet.FileDownload?retURL=%252Fapex%252FProducts_ResistanceWelding_ISASeries&file=015300000004HH0AAM


the difference between that manual & the software we are using is the <cnt> ... the manual shows 2 bytes whereas the new software uses 3.


all commands are ASCII, as follows...

<@> device address, ASCII decimal

<cmd> two character ASCII command (in my case, RR is report read)

<cnt> ASCII decimal data byte count

<data> optional ASCII data (for writes)

<cksum> ASCII hex, sum of all fields except <soh>, <cksum>, & <eot>, maskedd off with 0xFF


here is the test code

http://i.imgur.com/SqOSaAM.jpg

C1 & C6 are just toggle bits, and the timer was optional, but didn't affect the outcome...

« Last Edit: October 03, 2013, 09:27:25 AM by scott.lawrence »

MikeS

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 264
    • Host Engineering, Inc.
Re: Do-More & ASCII
« Reply #6 on: October 03, 2013, 09:21:14 AM »
when working near welding equipment, electrical noise is likely suspect, so proper grounding and termination are a must.

try enabling the termination resistor in the SERIO-4 module, typically in 485-land, both ends of the cable have termination resistors, even if there are only two connections.

Good design costs a lot. Bad design costs even more.

scott.lawrence

  • Jr. Member
  • **
  • Posts: 16
Re: Do-More & ASCII
« Reply #7 on: October 03, 2013, 09:32:09 AM »
Mike, I tried it yesterday, when I hooked up the test rig, didn't make a difference.

As far as noise, I don't think it's suspect. Like I stated before, this was working with a DL260 & Co-Pro, then working again (for the most part) with an ethernet Modbus/ASCII gateway.

This issue, I'm sure, has more to do with formatting the string correctly.... at this point, I'm not even getting a NAK back from the welder  ???

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3827
    • Host Engineering
Re: Do-More & ASCII
« Reply #8 on: October 03, 2013, 09:40:28 AM »
I'll work the protocol side while others work the electrical.

Here's the relevant information w/details:

Definition of Command Elements
<soh> 1 BYTE The data packet will start with a SOH (start of header 0x01)
character .
<@> 2 BYTES This is the RS-485 address of the unit to which data is requested
converted into ASCII decimal numbers. (“01" - “30"). The first
two characters of the unit ID serve as the RS-485 address.
<cmd> 2 BYTES This is a two character ASCII string denoting the command.
(i.e. “IA”).
<cnt> 2 BYTES This is a count of data bytes to follow, converted into an ASCII
HEX number. (“00" - “FF").
<data> n BYTES aThis is optional BINARY data.
Multiple binary byte ordering [LSB][…][MSB].
<cksum> 2 BYTES This is a two charter ASCII HEX string calculated from the sum
of all fields except <soh>, <cksum>, and <eot>. Then masked
with 0xFF.
<eot> 1 BYTE This terminates the transmission. (End transmit 0x04).

And I found this for the specific command Report Read:
REPORT “RR” Read Request # (1-8 or Retransmission = 0x0FF) 1 Byte

Taking your example, I've chunked out the protocol from your string literal

$01 - SOH
01 - Address 1
RR - command, Report Read
00 - Number of Data Bytes (this should be 01 for the 1 byte report request # 1-8)
30 - this needs to be the report #, let's say #1, which is 01 (up to 08 or FF)
01 - this also looks wrong
29 - cksum
$04 - EOT

Try
"$0101RR0101xx$04" (need the new xx checksum value - I'll let you figure that out)

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3827
    • Host Engineering
Re: Do-More & ASCII
« Reply #9 on: October 03, 2013, 09:54:14 AM »
I forgot to take into account the 3 byte cnt. So that means that the value is ASCII of a 3 digit hex value 000 thru FFF, or in decimal, 0 thru 4095.

This doesn't make too much sense because they show LSByte...MSByte for Data, where each byte is 2 characters ("00" thru "FF"), so where do you stick the extra half byte of a 3 byte cnt?  For the cnt, either "001" or "010"?  Can you show us where they talk about this 3 byte cnt somewhere?

scott.lawrence

  • Jr. Member
  • **
  • Posts: 16
Re: Do-More & ASCII
« Reply #10 on: October 03, 2013, 10:08:49 AM »
franji1, here is a screencap...

http://i.imgur.com/ClpkDzL.jpg

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3827
    • Host Engineering
Re: Do-More & ASCII
« Reply #11 on: October 03, 2013, 10:12:51 AM »
Thanks!  THAT makes sense:

$01 - SOH
01 - Address 1
RR - command, Report Read
00 - Number of Data Bytes (this should be 001 for the 1 byte report request # 1-8)
30 - this needs to be the report #, let's say #1, which is 01 (up to 08 or FF)
01 - this also looks wrong
29 - cksum
$04 - EOT

Try
"$0101RR00101xx$04" (need the new xx checksum value - I'll let you figure that out)

LWgreys

  • Hero Member
  • *****
  • Posts: 117
Re: Do-More & ASCII
« Reply #12 on: December 01, 2013, 02:50:05 AM »
Uploaded a short ladder which includes checksum!
Did it on the simulator which I think is one of the best tools ever for PLC ladder testing and debugging.
Also make sure you have a signal ground and terminated at each end.
In the H2-SerIO-4 Turn on the 120 ohm switch.
RS-485 requires termination at both ends of the wire run.
« Last Edit: December 01, 2013, 03:10:03 AM by LWgreys »

LWgreys

  • Hero Member
  • *****
  • Posts: 117
Re: Do-More & ASCII
« Reply #13 on: December 01, 2013, 10:41:22 AM »
Windows 7 does not have terminal software so I did a internet search.
I found this terminal software I thing is great for testing your serial port data.
I have already tried it out with my Do-More and H2-SERIO.
No I do not have the -4, but do use the FA-ISOCON universal, isolated RS-232C to RS-422/RS-485 converter.
It's call "RealTerm: Serial Capture Program"
Here is the link:http://realterm.sourceforge.net/

Uploaded image of RealTerm, trying it out with your string data.
« Last Edit: December 01, 2013, 10:57:16 AM by LWgreys »

LWgreys

  • Hero Member
  • *****
  • Posts: 117
Re: Do-More & ASCII
« Reply #14 on: December 01, 2013, 11:53:38 AM »
In case you still having problem check wiring.
I uploaded a PDF of the wiring diagrams for both RS422 & RS485.
The diagrams are from the FA-ISOCON manual, but all other manual have the same diagrams.
« Last Edit: December 01, 2013, 11:58:01 AM by LWgreys »