Default Status of Variables

damica1

Member
Join Date
Aug 2015
Location
Illinois
Posts
839
What is the correct procedure setting the default value of Boolean variable?

What I mean is if you have several inputs that can be in either True/False state, how would you set these variables for the FIRST SCAN?

Thanks
 
That probably depends a lot on what hardware you are using.

In general practice, you should never use a variable while it has an undetermined value. It is often a good idea to set everything to zero on the first scan, however, specific variables may need to be true, depending on your program logic.

If you can, don't start your sequence or your real logic until you can confirm that your inputs are active.
 
That's a wide open question. It's a bit like asking "what pressure should my tyre be?"

Is it a car, truck, bicycle, forklift, childrens scooter, or a pallet jack?

Are you using it on concrete, bitumen, sand, grass, dirt, or in the swimming pool?

Are you racing on it, carrying a heavy load, floating down the river with it around your waist, or putting it in the boot as a spare (or in the trunk for all you americans ;))?

The question is meaningless without context.
 
... if you have several inputs that can be in either True/False state, how would you set these variables for the FIRST SCAN?

I don't think you need to worry about it.
If your system powers up and you have a power on delay, all your I/O will be scanned and your inputs will be updated.

If it's a non-CompactLogix or non-ControlLogix then the I/O update occurs before the logic scan anyway.

Or maybe you're not talking about AB PLC?
 

Similar Topics

I am working with Twincat 3. I am trying to store some images in files and when PLC restarts I want to read those files and get the images...
Replies
0
Views
62
Hello all, I am looking for a way to have a user get logged out after an X amount of time because to default so that user privilages are no...
Replies
4
Views
654
I've got a G4(board only)with a MMI port problem. I do not know the IP, but I believe that port works. Is there a way to reset the device to...
Replies
1
Views
596
I've got a SIMATIC HMI KTP1200 and hooking it up to PLC (s7-1200) for first time. On the HMI setup screen, it's asking me to enter: IP address...
Replies
5
Views
1,432
I'm working with a 1734-AENT PointIO module (manual) connected to a 1769-L30ER controller over fiber ethernet. The 1734 PointIO module has some...
Replies
3
Views
1,065
Back
Top Bottom