AdvancedHMI Software

General Category => Support Questions => Topic started by: jazzplayermark on January 14, 2019, 08:19:09 AM

Title: AB Analog output
Post by: jazzplayermark on January 14, 2019, 08:19:09 AM
Is there a way to read an Allen Bradley output module value? I'm wanting to use output 2.0 and read the value directly into a digital panel meter. I can modify the plc program to make an integer but it's hard taking this equipment down to do so.
Title: Re: AB Analog output
Post by: larryhts on January 14, 2019, 02:41:27 PM
Do you have an off line copy of the ladder that you can look at? If so there should  be at tag that is being used by the PLC in the conversion you need for the meter.
Title: Re: AB Analog output
Post by: jazzplayermark on January 14, 2019, 02:53:23 PM
The output module can be addressed by 3 different SCPs depending rung logic. Each scaling module uses a different integer for the input value so the only thing common to them is the actual output. I'm thinking I just don't know how to address it properly in AHMI. I'm just trying to read the entire word from the output module.

I'm attaching a sample.
Title: Re: AB Analog output
Post by: jazzplayermark on January 14, 2019, 03:12:03 PM
I almost have it. I had to use just the module number '2' in this case... I am still having a problem where the value isn't stable. It flashes between the actual value in the plc and another number. Still chasing that down. Perhaps I just can't reliably read directly from this type output.
Title: Re: AB Analog output
Post by: Phrog30 on January 14, 2019, 06:37:18 PM
That's really the wrong way to do it. Having 3 SCPs is silly. Is there ever a time where the code is calling more than one? That would explain the "flashing".  My suggestion wherever you have values constantly changing in the PLC, use a buffer and point the HMI to this address. The HMI driver will every now and again see the values mid scan. Here's an example, if you have five rungs, the first clears a word, then the following rungs will move and not zero value. You will see the HMI flash values between zero and one of the others. No matter how slow you have the poll rate.
Title: Re: AB Analog output
Post by: larryhts on January 15, 2019, 06:33:11 AM
I believe this is speed profiling. The step timers are to change the speed or value of the output for some process.
Not knowing what the output controls I can't say why it would be needed, I would look for the step bits output coil and see what is causing the flicker. You could graph the O:2.0 and maybe see the steps. The flicker may be on purpose. There are many reasons to vary an analog output, IE: fill valves, conveyor speed, Mixer motors, for a few. If you could graph the output it might give you an understanding of the process.
Title: Re: AB Analog output
Post by: Phrog30 on January 15, 2019, 11:12:13 AM
I understand the purpose, I don't understand why someone chose to use three separate SCPs.  They all use the same scaling.  A better approach would be to simply use one SCP with the input as N7:0 (for example), then:
1. MOV N7:64 to N7:0 when B3:20/0 is high
2. MOV N11: to N7:0 when B3:20/1 is high
3. MOV N7:63 to N7:0 when B3:20/2 is high
If you understand PLC scan, then what is possible is if B3:20/0,/1,&/2 are all high at the same, the last one high wins, but the HMI can and will see, on occasion, the value O:2.0 from the 1st SCP, then maybe the 2nd SCP, so on.  To get around this, replace O:2.0 with another address, like N7:1, then add a rung to MOV N7:1 to O:2.0.  Then if you read O:2.0 the HMI will not see it flash, it will always be the latest, up-to-date value.

Title: Re: AB Analog output
Post by: jazzplayermark on January 15, 2019, 03:54:16 PM
Yes I would have done it exactly as you described. I'm working with someone else's plc program.

I don't have a choice in the matter either as the customer won't take their equipment down for a software change. I either have to make my end work with what's there or not incorporate that data into the final solution.

I just ran a histogram on the output in the plc and it's rock solid. the machine is idling right now so the value is not changing. My display however is changing from 2375 to 9. Perhaps there is something about how the driver handles reading a whole output word versus bits.

I'm reading the value into a digitalpanelmeter and also a meter. The results are the same.
Title: Re: AB Analog output
Post by: Phrog30 on January 15, 2019, 04:09:01 PM
Archie could answer better than me, but it may be an issue from reading IO.

You can't do online edits? If you can, then you can easily modify the code without taking the process down.
Title: Re: AB Analog output
Post by: jazzplayermark on January 15, 2019, 05:41:35 PM
I haven't approached them about that. They've had some bad experiences in the past with other integrators so I'm trying to not scare them off too soon :)

thank you for the suggestions.
Title: Re: AB Analog output
Post by: DavidSr on January 15, 2019, 09:48:12 PM

If you understand PLC scan, then what is possible is if B3:20/0,/1,&/2 are all high at the same, the last one high wins, but the HMI can and will see, on occasion, the value O:2.0 from the 1st SCP, then maybe the 2nd SCP, so on.  To get around this, replace O:2.0 with another address, like N7:1, then add a rung to MOV N7:1 to O:2.0.  Then if you read O:2.0 the HMI will not see it flash, it will always be the latest, up-to-date value.
Not debating your main point but Are you sure about that. PLCs do not update output image table mid scan, only at the end unless an immediate (I/O ) instruction is used.  I don't see how any program could read an incorrect value Like you said Last one wins.
Title: Re: AB Analog output
Post by: bachphi on January 15, 2019, 10:52:59 PM
You can just create another parallel SCP with output N7:2 for example.
SCP is just a linear equation y = mx + b .
You can also use CPT with expression like : ((RawInput - Ch0Min) * ((Ch0EngMax-Ch0EngMin) / (Ch0Max-Ch0Min)))+ Ch0EngMin
Title: Re: AB Analog output
Post by: Phrog30 on January 16, 2019, 06:33:54 AM

If you understand PLC scan, then what is possible is if B3:20/0,/1,&/2 are all high at the same, the last one high wins, but the HMI can and will see, on occasion, the value O:2.0 from the 1st SCP, then maybe the 2nd SCP, so on.  To get around this, replace O:2.0 with another address, like N7:1, then add a rung to MOV N7:1 to O:2.0.  Then if you read O:2.0 the HMI will not see it flash, it will always be the latest, up-to-date value.
Not debating your main point but Are you sure about that. PLCs do not update output image table mid scan, only at the end unless an immediate (I/O ) instruction is used.  I don't see how any program could read an incorrect value Like you said Last one wins.
Oh, you are right. I'm so used to using controllogix now that I forgot the old stuff IO updated synchronous. Controllogix is asynchronous.