Unity, EBool, Latched coils

MRobert

Member
Join Date
Jan 2006
Location
Vienna
Posts
37
I have to convert a 984 PLC to Unity and have the following problem.


1. In Modsoft are 2 types of coils, normal and latched. Normal coils go zero at startup of the PLC, no matter of their values before shutdown.
Latched coils keep their last value before shutdown.
I do not see a latched coil in Unity. How do I make normal and latched coils in Unity?


2. What is the difference between Bool and EBool variables and how to use them in Unity? Are they interchangeable? When is it allowed to use each of the types. And more important, When is it Not allowed to use each type?

Regards,
Robert
 
Equivalent of latch /unlatch in unity is set/reset. I do not know the difference between bool and ebool. I always use ebool. Are you using FBD or LADDER? In ladder it's S and R, in FBD it's SET and RESET. You find these under EDIT-->FFB INput ASSISTANCE.
 
Last edited:
I use BOOL when I need to access bits of the word. I declare a variable with address, for example, %MW10.3, and it's type is BOOL. The difference of EBOOL is that it also contains information about edges.

I think you can try to use unlocated variables as "Normal" coils, and located ones - as "Latched".
 
Thank you for answering.

Located variables are also used for communicating with IO and HMI via Modbus.
Most of this variables have to be zero after shutdown and restart.
Maybe there are more solutions for this issue?

If I did understand you right, so EBool is like Bool but with extra information and features (edge dedection) that dont have to be used. So EBool can be used as Bool but Bool cant always be used as EBool.
Please write me if I have understand right.

Regards,
Robert
 
You can copy BOOL to EBOOL and EBOOL to BOOL, they are compatible. But you can't use BOOL as an effective parameter in FBs (EFBs, DFBs) when the formal one is EBOOL.

EBOOL Variables are:
- internal bits (%M)
- inputs (%I)
- outputs (%Q)
BOOL variables are:
- system bits (%S)
- word extracted bits (%MWx.y)
- module error bits
- channel error bits
etc.

You can initialize any located variables on the first scan (ST example):
IF %S1=1 (*WARM RESTART*)
THEN
Coil_1 := 0;
Coil_2 := 0;
END;
 
Robert
Your definition of Bool and Ebool is correct. Just for interest a variable declared as either type will use a byte of memory, except if the variable is a located bit in a word. In this case it must be a Bool and it only uses the single bit.
To retain (or clear) the state of any variable there are properties for each variable to determine how they behave (right click and select properties then look at the properties window)
 
I am using EBOOL for passing input/output variables to a CUSTOM
DFB, but I get an error saying that they need to be unlocated EBOOL's. This seems like a major issue to me, that you cant modify the contents of an EBOOL in a DFB. Am I doing something wrong here?

The error I get is:

(E1225 DFB cannot access EBOOL variable mapped to State Ram on Quantum target, unlocated EBOOL required)


I am using Unity 3.0 on a Quantum 434 12U

Thanks!

**Update**

I dont seem to get the error, if I declare seperate input and output variables instead of using the input/output variable. I wonder why.
 
Last edited:

Similar Topics

Hi, I want to do something in Unity Pro XL. I need to build a DFB to test the output card of our project. (Out 1 ON, then 5 sec later Out 1 OFF...
Replies
0
Views
1,928
Hello, I am using Unity pro V15. I have Quantum CPU 671 and Ethernet NOE 77101 configured. I have configured IO scanning on NOE. I have attached...
Replies
5
Views
175
HELLO MY FRİENDS ı have problem. ı tought you can solved thıs problem for me. First of all When I checked all the cable connections of the...
Replies
0
Views
401
Hi All, I haven't installed Unity Pro in years and needed to install it recently. I initially tried installing Version 11.1 and the whole...
Replies
3
Views
709
GitHub Link: https://github.com/Automation-Standard/Open-Industry-Project This is a little side project I've been working on that I felt would be...
Replies
14
Views
3,422
Back
Top Bottom