Converting Bool to Float in Studio5000

Use a For/Next loop with each itiration being:

Float_Array[x] = Boolean_Array[x]

If it doesn't like the math then just use two rungs:

XIC Boolean_Array[x] MOV 1.0 Float_Array[x]

XIO Boolean_Array[x]. MOV 0.0 Float_Array[x]
 
Last edited:
Why?

You could try moving a hard coded number when the bit is on and then another move when the bit is off.
 
Thanks Bernie for your reply.
I checked MOV & COP before but not accepted.
That's a correct response because MOV and COP don't accept booleans as parameters.

As Bernie pointed, you can move 1.0 or 0.0 to the float array according to the boolean value you are evaluating.

XIC Boolean_Array[x] MOV 1.0 Float_Array[x]

XIO Boolean_Array[x]. MOV 0.0 Float_Array[x]

Code:
 Boolean_Array[x]   |-----MOV----------|
------| |-----------|             1.0  |
                    |   Float_Array[x] |
                    |------------------|
If the float array is reset before entering to the FOR loop, you'd not need to evaluate the false condition of the boolean value.
 

Similar Topics

Is there anyway to convert a BOOL to a INT (DINT or SINT) in ladder logic. I am working in RSLogix5000 and am attempting to count 4 Discrete...
Replies
3
Views
5,500
Hello everyone, can anyone help me with covert the STL code to ladder. Iam using plc s71200. A %DB1.DBX33.7 // angel of vaccum...
Replies
2
Views
208
Hello PLCs Forum, I am in a bit of a pickle and was hoping someone could offer me some help. I have a .rss file and just need to see the ladder...
Replies
2
Views
122
Hello nice to meet you, im new in here, I'm currently trying to convert code written in STL for a S7-400 to SCL for an S7-1500, because when i run...
Replies
5
Views
317
Hello, did anybody know, if there exist an converting cable like the1492-CM1746-M01 (for an 1746-IB16 to an 5069-IB16), for an 1746-HSCE to an...
Replies
3
Views
389
Back
Top Bottom