inputs to numbers

walters

Member
Join Date
Feb 2005
Location
reusel
Posts
185
can someone tell me how i can convert 4 inputs to one number
i shal explain my self

i must connect a thumbwheel on 4 inputs of a logo PLC how can i convert the high input to a number for example


I0.0=1
I0.1=0
I0.2=0
I0.3=1

so the number the plc have to see is 9

it doesn't have to be displayed on a 7 segment display but i must count with the number inserted
 
can you explain that cause i never heard of pseudocode before and the zecond thing is that the program im using only knows FBD programmingregards walters
 
Sorry Walters,

PseudoCode just means pretend code or if you like an English
language representation of what the logic needs to be.
It is useful either as in this case I don't know what
programming language you use or it is usefull to get
ideas down on paper (or screen as comments) before you
code it.
I write Pseudocode a bit like C but leave out all the
formatting that is required for genuine C.
Regards.........John
 
normally i have no problems with any programming language except ladder but with this program im forced to use function block's and because i dont know the program (alpha programming that is) i cant find a block that converts the 4 signals into a number if i found that the rest of the program is easy to write
 
Walters,
There probably isn't a block to do as you wish.
Refering to the PseudoCode do the logic in steps.
First clear the result
Then test the first input and if it is TRUE then add one to result
Then test the second input and if it is TRUE then add two to result
Then test the third input and if it is TRUE then add four to result
Finally test the fourth input and if it is TRUE add eight to result

For your 1 0 0 1 example the result will now be 9.
 
i think that is going to be a problem. it seems to be that there is no ADD function in this program.
im have to work with the followning functions:
Boolean
Set/Reset
Delay
One Shot
Switch
Alt
Flicker
Counter
Up/Down Counter
Compare
Time Switch
Gain
Schmitt Trigger
Zone Compare
Display
Hour Meter

these are all the functions except the usual and, or etc. i found in the program
 
It is a bit tedious but without ADD you could do it like this
IF 0 0 0 0 THEN Result = 0
IF 1 0 0 0 THEN Tesult = 1
IF 1 1 0 0 THEN Result = 3
IF 1 1 1 0 THEN Result = 7
IF 1 1 1 1 THEN Result = 15
etc
IF 1 0 0 1 THEN Result = 9
that is a total of 16 of these test lines
Regards............John
 
im starting to doubt that is it possible with a LOGO because the number inserted with the thumbwheel must be the parameter of the counter so if i inserted 9 the counter must count 9-8-7 etc. and i cant connect a thing to the parameter input of the counter
 
ok i now have for each number specially made a clock function that makes an output high but how cant those clocks be resetted without taking of the power????

hope to get some help soon
 
I'm not real familiar with the Siemens LOGO, but if​




you are using FBD, couldn't you use the BCD_I instruction?​





You can take up to 12 inputs (3 BCD digits) and convert it to an integer.​









 
it was a mitsubishi LOGO but i have it working allready only i hope it is possible to make it easier.

now i have it like this
for each number i have a separate and block
for example number 4

Ln i00
an i01
a i02
an i03
= m0.0

and like that for the numbers 0 - 9 its a lot of work but i couldn't make it easier with such little programming experience that i have and i didn't know the program that i had to use for this its called "alpha programming" for mitsubishi it is but that is all i know

en tho thanx for the help and if someone knows an easier way to make this let me know and you'll be well appriciated
 
try following:
put i0.0 in m0.0
put i0.1 in m0.1
put i0.2 in m0.2
put i0.3 in m0.3
read m0 as a byte and you will get back nice numbers from 0 to 15
however i do not know how to convert this in time.
other way is to use 4 timers 1 of 1 second 1 of 2 seconds and 4 and 8 seconds.
put them in cascade and presto it would be something like the input of the timer is on the i0.0 and i0.1 etc.
if timers are expired have in series with every input an notexpire one shot and all will reset. hope it helps if not just give me a call.
you know the number.
 
allready tried that but the program has aalready changede so mutch that i could make it with "LOGO comfort" with that program it was easy to get an easy program that is good to read also so allready solved the problem but thanks for the replies all
 

Similar Topics

Compactlogix controller, program has 28 conveyors that use TON's to start the conveyors. The TT sounds a warning horn during start and the DN...
Replies
10
Views
485
I am converting a SLC 500 to a Compact Logix. I plan on using a Compact Logix 5380 with conversion Kit. The problem is that the analog input cards...
Replies
1
Views
147
Hi there, I'm doing some extensive testing and commissioning with a slew of new Emerson PACSystems RX3i PLCs. It would be convenient to...
Replies
5
Views
100
Problem: Our PLC can only output 4-20mA, but the actuators it needs to control, modulate based on a 0-135Ohm signal. Buying 4 or 8 individual...
Replies
7
Views
275
Hello I need to message read the entire 16 channel raw analog inputs from a 1769-L33ER Compact Logic controller to another 1769-L33ER Compact...
Replies
8
Views
243
Back
Top Bottom