News:

  • June 25, 2026, 05:37:09 PM

Login with username, password and session length

Author Topic: RJ12 Serial Port Compatibility  (Read 32452 times)

Mike Nash

  • Hero Member
  • *****
  • Posts: 652
RJ12 Serial Port Compatibility
« on: August 19, 2016, 07:40:46 PM »
I need to experiment with getting a Do-more to talk to an ASCII RS422 device.

I have an F2-UNICON which is designed to work with the pinout such as found on the D0-05 Port 2.

I have also found the pinout changes quite a bit between the H2-DM1(E), the H2-SERIO(-4), the D0-05 Port 1 and the D0-05 Port 2. I think the cable that comes with the F2-UNICON may have both pins 1 and 6 tied together on the the F2-UNICON, but I have not verified this.

Which of these ports/devices can it work with?

Have I killed any plugging it into a D0-06 Com 1 or an H2-DM1E Port 2 before I realized these differences?

I was only wanting to work on the programming and do not intend to use the F2-UNICON if we do this job. And of course it is now the weekend and I don't have these with me.
« Last Edit: August 19, 2016, 07:42:35 PM by Mike Nash »

Mike Nash

  • Hero Member
  • *****
  • Posts: 652
Re: RJ12 Serial Port Compatibility
« Reply #1 on: August 19, 2016, 10:09:35 PM »
After looking into the crypt of RS232 mysteries, I think I have convinced myself that Pin 6 of the Do-more Port 2 is safe since it is an input. Also, I can set it to ignore CTS.

Pin 5 of the D0-05/D0-06 Port 1 is safe since that is an input on the F2-UNICON for RTS from the PLC side.

And if I had an H2-SERIO, Pin 2 is safe because it is an input and there should be no power to the F2-UNICON from it. If the F2-UNICON were provided 5V from the terminal strip, the CTS on the SERIO shouldn't mind.

But we will probably just use an H2-SERIO-4 and skip any converter. There probably wouldn't be more than 3 feet of cable involved.

Mike Nash

  • Hero Member
  • *****
  • Posts: 652
Re: RJ12 Serial Port Compatibility
« Reply #2 on: August 20, 2016, 09:49:12 AM »
 ??? Digging a little deeper online and it looks like 232 has been modified so many times since 1962 that the signals are "whatever" anyone wants. I hope RTS isn't "Release The Smoke!" on my stuff.

It is but it isn't but it might be yet.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6161
  • Yes Pinky, Do-more will control the world!
Re: RJ12 Serial Port Compatibility
« Reply #3 on: August 20, 2016, 02:56:34 PM »
The pinouts were chosen with the intention of you not burning anything up inadvertently, but when you put power on a comm cable, stuff happens. Sorry for any confusion.
"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

Mike Nash

  • Hero Member
  • *****
  • Posts: 652
Re: RJ12 Serial Port Compatibility
« Reply #4 on: August 20, 2016, 04:49:25 PM »
No need for sorrow. :) To be fair, the info I have been able to find only shows the F2-UNICON to be compatible with the D2-240 bottom port and D0-05 Port 2. But if the cable fits... So I did.

I suspect that it will work. I just realized when I was playing around in a hurry that it might have been a mistake.

The 422 device I want to connect to was in a fire at one time and isn't precisely what I need to talk to (same brand, different function), but does work and will allow me to get Do-more ASCII working to prove it out. I wrote a QB45 program nearly 22 years ago that could talk to them. The old laptop I had could even talk to the 422 port with it's 232 port, though later ones didn't work so well. Back to those variable standards.

Mike Nash

  • Hero Member
  • *****
  • Posts: 652
Re: RJ12 Serial Port Compatibility
« Reply #5 on: August 23, 2016, 09:03:36 PM »
Just a follow up. After I finally realized the F2-UNICON 422 terminals are

 + - - +    instead of
 + - + -    like I assumed...

I got the Do-more to work very well with it on the built-in serial port.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6161
  • Yes Pinky, Do-more will control the world!
Re: RJ12 Serial Port Compatibility
« Reply #6 on: August 23, 2016, 09:49:55 PM »
Awesome.
"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

Mike Nash

  • Hero Member
  • *****
  • Posts: 652
Re: RJ12 Serial Port Compatibility
« Reply #7 on: August 25, 2016, 05:15:23 PM »
Follow up part 2.

I have finally used Stage programming for something, even if it is just testing. The ASCII comms using StreamIn and StreamOut is finally something that seemed suitable and it is very, very clean. I still won't find it real useful for most of the things I do, but I like it quite well for this.

If I had a need to only occasionally send a parameter to a device, would a task work for this, or does it need to be a program?

Second question, can I change the serial port settings on-the-fly (such as auto setup of comms looking for a response?)

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: RJ12 Serial Port Compatibility
« Reply #8 on: August 25, 2016, 05:57:30 PM »
If I had a need to only occasionally send a parameter to a device, would a task work for this, or does it need to be a program?
You need to use a program.
A task is intended to only be active for a single scan (this can be bypassed using a YIELD or a looping instruction), and therefore is not intended to run multi-scan instructions.

Quote
Second question, can I change the serial port settings on-the-fly (such as auto setup of comms looking for a response?)
This can be done using DEVWRITE, but (as I understand it) this is writing to the Do-more flash which has a finite number of writes.
Circumstances don't determine who we are, they only reveal it.

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

Mike Nash

  • Hero Member
  • *****
  • Posts: 652
Re: RJ12 Serial Port Compatibility
« Reply #9 on: August 25, 2016, 06:18:37 PM »
Thanks plcnut,

I was thinking more along the lines of SETUPSER which does allow me to set the communications parameters, and I have gotten it to change them to what I needed after I set the serial port intentionally incorrectly in System Configuration. I can always play with it more, but it was irksome to get all my ducks lined up to be sure I had the wrong mode before enabling SETUPSER so I figured I would ask. I was wondering if an Auto Configure would be feasible in ladder. I would probably never use it but...

I have used tasks and programs previously, but the tasks were run once then quit, even if it did take over a minute to complete all the For-Next loops. :)

Mike Nash

  • Hero Member
  • *****
  • Posts: 652
Re: RJ12 Serial Port Compatibility
« Reply #10 on: August 25, 2016, 07:21:26 PM »
OK, SETUPSER can indeed be used to Auto Configure the serial port to detect a device's settings. Caveat? No variables in SETUPSER so it requires quite a number of steps to test all possibilities.

I have a question regarding handling programs and stages and maybe I should start a new topic, but I'm not going to.

I have a program called SerialComs, with a number of stages and each just calls the next unless there is an error. This is the one that will just run all the time we'll say.

I have another program called AutoConfig that has all the stages to go through changing settings, streaming out and in and checking for success.

If I want to stop running SerialComs and run AutoConfig, I can't seem to figure how to do that cleanly. This is where the stages seem to stump me. Most things I have tried cause a warning or will stop the subprogram from functioning even when it is "Run". Any suggestions?

Mike Nash

  • Hero Member
  • *****
  • Posts: 652
Re: RJ12 Serial Port Compatibility
« Reply #11 on: August 25, 2016, 07:52:07 PM »
HALT in Main appears to be a bad choice if the subprogram is running communications. EXIT from within the subprogram works well, but I am not sure how to handle it cleanly where stages are involved. If I have to wait until it gets to a stage I know it must get to, or an error handler then two EXITs will work. But in a case where I may not have a stage I will always get to, or may need to get out of before completion, what should I be using?

If I don't HALT SerialComs before trying to run AutoConfig, it may just jump back into SerialComs instead.

Mike Nash

  • Hero Member
  • *****
  • Posts: 652
Re: RJ12 Serial Port Compatibility
« Reply #12 on: August 25, 2016, 08:35:04 PM »
So I dug around and found a cryptic comment BobO made "If you really don't want to see it, just clear it from ladder code." regarding Driver Error ST143 http://forum.hosteng.com/index.php/topic,1670.msg14118.html#msg14118

Since I am generating errors due to STREAMIN timeouts while hunting for valid comm settings, I found I could RST ST143 once I got a successful response. But I still have all the "Operation timed out in STREAMIN @00000204 (STREAMIN at AutoConfig@76)" errors showing in the System Status. I can MEMCLEAR LastERR0-7 but that doesn't keep those errors out of the Status. I know these will happen and would only want to clear or prevent them at a known event. Is there a way to do this?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6161
  • Yes Pinky, Do-more will control the world!
Re: RJ12 Serial Port Compatibility
« Reply #13 on: August 25, 2016, 10:01:09 PM »
I'm at ADC finishing up some critical testing of the new hardware, and will be back in the office tomorrow evening. Will speak to this when I'm not posting from a cell phone.
"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

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: RJ12 Serial Port Compatibility
« Reply #14 on: August 26, 2016, 10:05:46 AM »
Since I am generating errors due to STREAMIN timeouts while hunting for valid comm settings, I found I could RST ST143 once I got a successful response. But I still have all the "Operation timed out in STREAMIN @00000204 (STREAMIN at AutoConfig@76)" errors showing in the System Status. I can MEMCLEAR LastERR0-7 but that doesn't keep those errors out of the Status. I know these will happen and would only want to clear or prevent them at a known event. Is there a way to do this?

Maybe each time that you have a failure, you could RST ST143, and MEMCLEAR LastERR0. This would only clear the message that was produced by that specific error.
Circumstances don't determine who we are, they only reveal it.

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