News:

  • August 29, 2026, 02:17:58 PM

Login with username, password and session length

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

DLTimmons

  • Hero Member
  • *****
  • Posts: 232
Moving serial input data between Do-More CPU's
« on: February 20, 2013, 02:14:26 PM »
Hi

I have a conveyor system that will have 4 do-more's in it, one working as a master that is connected to a pc by a rs-232 link. The other three will be controlling a section of the system. Two sections will have a bar code scanners  one of these scanner will read three bar code label back to back the other will be just one label the third section will have two scanners one read one label the other reading 3 labels. Each label will have 12 charters to read on each label keeping track of where each label is very important as this how an ASRS crane knows where to pick the bin from. I need to get this bar code info to the master CPU. I am trying to find the cleanest way to pass this data to the master any suggestions. I will need most of the peerlink for hand shaking between sections and the master. Is modbus the best way?

If Rel 1.1 will let you use Ctrio's and Serio's in remote racks that would be the way to do it.

Donnie

DLTimmons

  • Hero Member
  • *****
  • Posts: 232
Re: Moving serial input data between Do-More CPU's
« Reply #1 on: February 20, 2013, 02:43:58 PM »
If using Modbus how do you move the string data to Modbus server data registers and back to a string on the receiving side?

Greg

  • HostTech
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 702
  • Hmmm...
    • Host Engineering, Inc.
Re: Moving serial input data between Do-More CPU's
« Reply #2 on: February 20, 2013, 05:07:50 PM »
Modbus TCP would certainly be a good way to move this data. The question is, do you want your 3 "slaves" to send data to your "master"? Or do you want your "master" to poll the slaves? There are many ways to do this, but here's a possible outline:

Slaves send data:
1. In slave read barcode data using STREAMIN and store in a byte structure you created or simply N-memory, D-memory or V-memory
2. In slave use MWX to write this memory to holding registers (MHR-memory) in the master
3. In master use STRPUTB to move the MHR-memory bytes (characters) to SS-memory (short string).

Master polls data:
1. In slave read bardcode data using STREAMIN and store directly in MHR-memory.
2. In master use MRX to read slave's MHR-memory and store in N-, D- or V-memory.
3. In master use STRPUTB to move the N-, D- or V-memory to SS-memory (short string).

Technically, you could use a custom UDP protocol (using PACKETIN/PACKETOUT) to send from the slave to the master as well instead of MRX/MWX.
There are two types of people in the world; those that can extrapolate from incomplete data sets.

plcnut

  • Hero Member
  • *****
  • Posts: 815
    • premiersi.com
Re: Moving serial input data between Do-More CPU's
« Reply #3 on: February 20, 2013, 05:33:28 PM »
What kind of speeds are you talking about? How far apart are the barcodes? How fast are they moving? Do you have to trigger the reader: serial, discrete, or is does it stream data constantly?
And then how much time do you have to do something with the data?
Circumstances don't determine who we are, they only reveal it.

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

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: Moving serial input data between Do-More CPU's
« Reply #4 on: February 20, 2013, 06:38:06 PM »
Which DoMore CPU are you using?

DLTimmons

  • Hero Member
  • *****
  • Posts: 232
Re: Moving serial input data between Do-More CPU's
« Reply #5 on: February 21, 2013, 10:31:28 AM »
Greg

I was thinking of polling based of a peerlink bit to request a read from the master CPU. That is the slave would set a bit once the master saw that bit it would read the data from the slave. once confirmed the slave could clear the data till the next read
Each of the three slave CPu would handle the local control of the bar code scanner's that are rs232 into a Serio card

I have two ways the barcodes are read one reads only one bin label then there several minutes before a new read happens the other reads three bins a couple of seconds apart then does not see any other bins for sereval minutes.

I currently have one set of the barcodes being read by a WinPLC One one end of the system I will be changing this over to a Do-more as the two end will be running off the same master.

plcnut

the two ends are about 300 foot apart

ATU

I'm using the DM1E

plcnut

  • Hero Member
  • *****
  • Posts: 815
    • premiersi.com
Re: Moving serial input data between Do-More CPU's
« Reply #6 on: February 21, 2013, 11:02:41 AM »
You shouldn't have any problem with handling the data at those speeds. The system I'm working on now scans codes on a conveyor at approx 12" apart at 120fpm and has plenty of time. I trigger the reader via rs232 and then receive the response at 115 kbaud. 
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 #7 on: February 21, 2013, 12:12:14 PM »
I'm using an external trigger on the scanner

What is more a problem now is moving the string into the modbus register on one CPU and retreiving it on the other. STRGETB works on the front end but the back STRPUTB works but you have to know the number of bytes. You can use a fixed number of byte but it adds A lot of ..... to the end of the string that will kind of mess with the PC. Looks like I will have to pass a string length along with the string byte data.

Is there a way to convert decial to hex? My PC passes a checksum value as Hex in the string. CHECKSUM give a decial value.

Donnie

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6174
  • Yes Pinky, Do-more will control the world!
Re: Moving serial input data between Do-More CPU's
« Reply #8 on: February 21, 2013, 12:36:12 PM »
Is there a way to convert decial to hex? My PC passes a checksum value as Hex in the string. CHECKSUM give a decial value.

There is no difference in the data encoding of 0xA and 10. If you are referring to conversion of the string data to it's numeric value, then you will need to do a STR2INT instruction and specify hex.
"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

DLTimmons

  • Hero Member
  • *****
  • Posts: 232
Re: Moving serial input data between Do-More CPU's
« Reply #9 on: February 21, 2013, 01:08:10 PM »
Bob

I was just about to reply and you beat me to it.  How to a turn a integer into a hex string to send the proper reply is the next step?

Big program one step at a time :)

plcnut

  • Hero Member
  • *****
  • Posts: 815
    • premiersi.com
Re: Moving serial input data between Do-More CPU's
« Reply #10 on: February 21, 2013, 01:13:00 PM »
STR2INT is great, It will give you the length in the instruction as well.
Circumstances don't determine who we are, they only reveal it.

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

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: Moving serial input data between Do-More CPU's
« Reply #11 on: February 21, 2013, 03:28:38 PM »
How large are the data strings from each reader?

DLTimmons

  • Hero Member
  • *****
  • Posts: 232
Re: Moving serial input data between Do-More CPU's
« Reply #12 on: February 21, 2013, 04:27:39 PM »
10 Readable charaters

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: Moving serial input data between Do-More CPU's
« Reply #13 on: February 21, 2013, 04:54:04 PM »
Why couldn't you use Peerlink for all the coms between PLC's?

DLTimmons

  • Hero Member
  • *****
  • Posts: 232
Re: Moving serial input data between Do-More CPU's
« Reply #14 on: February 21, 2013, 05:52:14 PM »
I will be needing most of the peerlink for control interlocks between the 4 cpu's I would have to have over 80 bytes for the scanner data along.