Hello Guest it is November 29, 2022, 07:53:10 PM

Author Topic: Inputs  (Read 7235 times)

0 Members and 1 Guest are viewing this topic.

Inputs
« on: October 15, 2008, 05:36:45 PM »
I have a DL06 connected to my Mach PC via modbus.  I have about 60 modbus outputs that work fine and do what they should.  For some reason I can't figure out the inputs.  The first output coil is 2048, so I addressed the first input as 12048 as the AD spreadsheet.  I am running the inputs through a brain to trigger an LED, but no success.

Also, I go into the Configure Modbus screen and I get a "timeout" error when I poll the PLC. 

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Inputs
« Reply #1 on: October 16, 2008, 11:11:15 AM »
rkowas:

  A few things, and this is perhaps because you where unclear in your post, first off there are NO "8's" in Octal, and you are posting about Outputs above but asking about Inputs.

In Automation Direct PLCs, and when using with Brians ("Read the Using Brains doc, it will help you").

At any rate, your better off using Holding registers both for Inputs and Outputs in the PLC and your Modbus setup.
In the PLC you have a Large Range of "User Memory called Variable Memory".

If you would like to be able to use "discrete INputs/OUTputs" then in the memory range you select Use "Bit Of Word" addressing, that will allow discrete Bit Use.
Currently (Until Brian fixes the "Bit of Word" Input/Output filtering in Brians), you will have to waste an entire word per discrete I/O you use.

for Example in the PLC Data coming into it from mach can come into Address start Range of: 1400  if 1400 was wanted to be a discrete bit, then it would be B1400.0
your next discrete from mach would be B1401.0 etc.

The output range that goes back to mach would be for example 1600, if you wanted a Discrete bit going back that started at that range then B1600.0

So The outputs coming from the PLC that go to Mach would be address Octal 1600 in the Modbus Input lets say config 0 for inputs the Decimal address would start at: 896
The INputs comming INTO the PLC from Mach would be address Octal 1400 in the Modbus OUTputs lets say config 1 for outputs the decimal address would start at 768

You would then choose how many of each input/output words you would send and recieve in each config.

scoot


fun times
Re: Inputs
« Reply #2 on: October 16, 2008, 11:43:17 AM »
OK,

I am actually posting about inputs.  My outputs are working correctly.  The question is more about setting the modbus address range for a given block on inputs.  I know that the modbus address range for the outputs is 2048-2150, which corresponds to the automation direct spreadsheet that gives the Octal to modbus decimal address conversion.  That spreadsheet also tells me that the input range should start at 12048.  My issue is how to get Mach to respond to it, or somehow verify that it is indeed 12048.

Is there a way to poll the modbus to tell me when a particular input is fired?

Thanks

Roger

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Inputs
« Reply #3 on: October 17, 2008, 02:40:02 PM »
Read the Brain How to doc under member docs.
fun times
Re: Inputs
« Reply #4 on: October 17, 2008, 08:17:29 PM »
I just went through all of the brain videos again, where is the "Read the Brain How to doc under member docs" at?  Is it on the yahoo forum?

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Inputs
« Reply #5 on: October 20, 2008, 12:03:56 PM »
fun times
Re: Inputs
« Reply #6 on: October 23, 2008, 01:47:06 PM »
OK, I have gone through your "brain how to" over and over.  I understand it, and it helped,but I believe my configuration is correct and I still can't read my inputs.  I attached screenshots of the modbus config and the brain that I am using to check the status of those inputs.  Hopefully somebody can see something wrong and point me in the right direction.  Again, all of the outputs work correctly (with a different brain), I just can't read the change in the inputs.
Re: Inputs
« Reply #7 on: October 23, 2008, 06:21:37 PM »
I found the problem...  There was a strand of a wire in the connector for the serial bus.  I assume it was sending errant signals, and just happened to be on the input side. 

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Inputs
« Reply #8 on: October 24, 2008, 11:34:57 AM »
Just a quick note:

Your serial protocol should be 8-N-2 (not 8-N-1), 8n1 works like that a little because of a default setting but it will throw in an occasional bug, So switch your Mach serial protocol to 8n2, and change your Com Port2 in the PLC to 8N2 also.

Further, Unless you are using a USB to Serial adaptor you can set your Refreash rates down to 25ms from 50 they are now. If using an USB adapter then depending on model you might want to set your "Time Out" upto about 40-50ms to account for the translation time overhead.

Also: On your Brains, the Discrete "Bit-of-Word" filtering really doesnt work right (is on Brians to-do list) in Brains, I noticed you had some Inputs that where using Digit.  Only if your are only looking at the very lowest bit with discrete will it work. If your trying to look at other individual bits in that incomming or outgoing word, then it doesnt work.

Also2:  Another thing (little bug thing), is that on your inputs that go to LEDs, if you want the LED to "Light Up" when the input Goes to 1, then you will need to put an "Invert" lobe after your input.

One Final thing you might want to consider: When the Sepia Modbus Module "dies", it dies SILENTLY!!! so if your Modbus Coms do drop out, you will never know it other than your PLC will no longer communicate/function with Mach.
It is good to put a "Com Watchdog" function in both your Brain and your PLC ladder. If the coms do Drop (and they are notorious for doing it with USB to Serial adapters (depending on Brand), not to bad with straight serial) You can put that if a timeout from a com loop between your PLC and Brians goes for ********* amount of time then it will Estop Mach and your PLC will Kill its outputs...........  (been there, done that.........)

Scott

fun times
Re: Inputs
« Reply #9 on: October 24, 2008, 11:51:04 AM »
Thanks for the input Scott.  For the protocol and the brains with the digits, I was debugging trying to figure out where the inputs went.  I put in just about every configuration for X0 so if I had something setup incorrectly it would show up.

Once the inputs started working, I figured out the invert lobe (also it was in your how-to).

Good tip on the modbus watchdog.  I will put that in, but I am working on straight serial.

Roger