RSLogix 500 ~ invert data ~ other ideas welcome

geniusintraining

Lifetime Supporting Member + Moderator
Join Date
Jun 2005
Location
SC
Posts
8,280
Good evening everyone (or good morning)

I am writing a program that has a analog input, I have scaled it to my 0-10v and its working great.... ((for that))

Now I THINK I need to invert the data, as I need to control the PREset of a timer with it, the value of the timer needs to be 25 for a fast speed and 100 for the slow speed, I have made another scale, that scales the input to 0-100 and I can move a 25 into the integer if the value drops below 25.... so now I have 25-100 when I turn the pot.... but with the pot turned down (to the left) and the meter at 0 the scaled value is 100, when I turn the pot to the right and the meter goes up to 10Vdc the scaled value goes to 0

And re-wiring the input is not a option (-+ +-)

SO.... I think, I need to invert the data and I will be done, but I have not found any way to invert the integer

This is a MicroLogix 1000 1761-L20BWA-5A

Many thanks
 
Same way you would do it, to watch a timer count down. Subtract the scaled value from 100, sense it's already inverted it should count up as the voltage goes up. If I understand your problem correctly.
 
Last edited:
IF I understand what you're saying, maybe this will help ...

when the pot is in its "slow" position you get 25 at the input ... and you want the preset to be 100 ...

when the pot is in its "fast" position you get 100 at the input ... and you want the preset to be 25 ...

if that's correct, try multiplying the input by -1 (negative one) and then adding 125 to the result ...
 
Thanks Mickey and Ron, I will try them both in the AM

Let me try a little better detail, T4.0 will reset once it times out, I am changing the PRE by the input, scaling 0.4 to N7:10, but its opposite of what I need, if the input is turned down, the PRE goes to 25, if the input is turned up then the PRE goes to 102 and the timer is slower

So I think Ron's idea will work....

5a.jpg
 
Why don't you use the SCP (scale with parameters)
You can program that for the oposite operation
 
thanks Ron
Makes sense dosen't it
Oh Bugger
I'll mark that in my little knowledge bank
 
Would it be possible to use a second SCL instruction using the first output as the inverse input to the second SCL?
 
And, I would ALWAYS put a "range-check" of the value I am putting into the Timer Preset.

If that ever goes negative, the processor will fault.
 
PERFECT!!!

I was able to use some other logic so they could learn more on how it works, for anyone looking at what I did (with the help from my friends)

6) scaled the input
7) used a NOT to invert the logic, this was the same result as Ron's and Gil47 just another way
8) added 100 to the negative number (125 ended up a little to slow)
9) MOVed the value to the PREset of the timer
10) any time that the value would drop below 25 this logic moves a 25 value into the preset of the timer or that speed would be to fast

Thanks again :)

a6.jpg
 
7) used a NOT to invert the logic, this was the same result as Ron's and Gil47 just another way

double-check that part, Mark ...

I think that NEG (Negate) might be more to your liking ...

DISCLAIMER: I haven't had time to go over all of what you posted - but that particular part just sort of "looks fishy" ...

another quick suggestion:

personally I'd do the "range limit" thing BEFORE I moved the value into the timer's preset ...
 
Last edited:
I thought that he just wanted to make a number negative ...

for example: 54 should become -54 ...

if you NOT 54 I don't think you'll get -54 ... I'm pretty sure that you'll get -55 instead ...

don't worry about me ... I'll run it through a processor later at the lab and then (maybe) I'll catch up with the rest of you guys ...

party on ...
 
Last edited:

Similar Topics

Hi Everyone, I am not proficient in RSLogix 500 so I have a question regarding the evaluation of N7:0 data as an input. So as I understand in...
Replies
1
Views
98
I have a little bit of experience with Allen-Bradley. I have a Micrologix 1500 (RSLogix 500) and a PanelView Plus 7 (FactoryTalk View Studio ME)...
Replies
3
Views
196
buen dia. tengo una falla al pasar los tags de mi plc SLC 5 0/4 a mi panel me aparece un error Problem writing value " " to item <tag name>...
Replies
1
Views
94
Will someone please convert this logic to pdf?
Replies
2
Views
137
Hello, Haven't been on in a while. I need to generate a bit level pdf of the I/O for RSLogix 500. I can generate a report but it just shows the...
Replies
1
Views
171
Back
Top Bottom