Sign in to follow this  
Followers 0
DaveHarbon

Serial Comms

10 posts in this topic

I'm doing some serial comms to a non Omron temperature analyser at the moment using a SCU41-V1 (set up as unit 1) using port 2 seial using a ciff11 adaptor to RS 485. I'm having trouble finding in any of the manuals the ready to receive bit following a Send from Serial Port (Omron _CPU015_TXD function block). There is a completion flag on this function block but this is obviously not the same time period of the received data. My understanding is that the data string is received at an input buffer and then you can receive the data with the _CPU014_RXD function block. I need to check that the data has been received before I call the receive function. Sorry, My config is CJ1M+CPU13+ETN21(Unit0)+SCU41-V1(Unit1) Many thanks Dave Edited by DaveHarbon

Share this post


Link to post
Share on other sites
Hi Dave, Have you got this manual ? CS1 / CJ1 Serial Communications Boards Operation Manual Page 257. The ready to receive bit you are after is 1500 + (25x1) + 7 bit 8. So that would make CIO 1532.8 Bit ON = receiving, bit OFF=ready.

Share this post


Link to post
Share on other sites
Hi PDL, Yes, i've got the manual and realised that this is where the indicator is for local unit ready to receive. Thanks Interestingly it's 1500 + (25x1) + 17 bit 8 as i'm using port 2. I can see the RD2 light flicker (At about the SD2) but i'm still having trouble receiving the data. Is it possible my data coming back is corrupt? Dave

Share this post


Link to post
Share on other sites
I would not jump that conclusion. Can you tell us a bit more about your setup of the unit? Some screen shots of the I/O table unit settings of port 2 would help. What exactly is your "trouble receiving the data"?

Share this post


Link to post
Share on other sites
I think you may be using the wrong bit. If you are looking for the bit that indicates that there is a complete message (ie met the terminator or specified length), then this is the reception complete bit. So, unit 1 port 2 would be 1544.06

Share this post


Link to post
Share on other sites
Thanks PMCR, Will this work with the Omron _CPU015_TXD function block as this uses TXD in the function not RXDU as in the in the case of the CS/CJ unit? I'm a little unclear about this. Cheers Dave

Share this post


Link to post
Share on other sites
Dave The 1544.06 should be used to trigger the CPU014_RXD function block. I have not used this function block, but it appears to support both the built in serial port as well as SCU modules with the RXDU instruction inside the function block. If you want my personal opinion, I would write the ladder without the function blocks. I find I can debug a specific function like a serial send or recieve if I am looking directly at my own code. Don't misunderstand this to mean that I don't like function blocks. They are great, but for a simple item like sending data out a serial port, I would rather author all the code. Sending data out a serial port should be 1 rung of ladder. Attached is an example of how simple TXDU RXDU can be. Note: I did not have a chance to test this on hardware, but I am fairly confident that it will work as is. TXDURXDUExample.cxp

Share this post


Link to post
Share on other sites
Thanks PMCR That's got it, it looks like i've been trying to use a sledge hammer to crack a nut. I've not done serial comms before and thought it might be better using a FB to ease the code, but like you say, it's even more simple and easier to use the basic commands! Many thanks for this and everybody else's help, Great forum, great help - Cheers Dave Edited by DaveHarbon

Share this post


Link to post
Share on other sites
Dave Your analogy of the sledgehammer and the nut is right on. Using a function block for something like this uses much more program space, and ultimately can be more difficult to troubleshoot than writing the straightforward ladder. Good luck with your project. PMCR

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0