Program wok in PLCSim but not in PLC

Indiaum

Member
Join Date
Jan 2010
Location
Brasil, Minas Gerais
Posts
54
Hi!

I'm trying to build a program to get, whenever a fault occurs, it's data and time. (In attach.)

In PLCSim it works fine, but when i try o run it in PLC, it does not work.

To help:

Falha = Fault
Data = Date
Hora = Time
Indice = Index
Quantidade = Quantity


Network 1
Get time and date from system

Network 2
Opens the instance DB

Network 3
Verifies if an input "Falha_XX" changed from "0" to "1" and transfer its relative number to an Interger(Falhas).

Network 4
Verify if the interger "Falhas" is greater than "0", which implies that a fault occured.
If yes, write this interger to a position in the array, and date and time in another array.
Reset interger "Falha".

Network 5
Verify limits, to avoid memory overflow.

Network 6
Just to search both arrays for an espcific position.

Sorry about my english, and hank you for your time.
 
You are using Temp variables for your edge detection in FB1 - these should be STAT variables.
 
Last edited:
Thank you very much!! It's my first STL program and i'm still trying to figure it out everything.

Is it possible to use STAT variables by it's address instead by it's name, like in the temp vars with "L"?
 
Last edited:
Thank you very much!! It's my first STL program and i'm still trying to figure out everything.

Is it possible to use STAT variables by it's address instead by it's name, like in the temp vars with "L"?

yes, with DIX or pointing to instance data block (DB) where stat variable is located, but why you would want do that?

If you use absolute address you need to change addresses to code allways if you add variables beginning or somewhere between DB-block.
 
Last edited:
Hello,

You should be able to use DI addresses (instance data block)

Examples:
DIX 0.0 for bit
DIB 0 for byte
DIW 0 for word/integer
DID 0 for double word/double integer/real

Simply note the addresses of what you want to use from the Block Interface.

Regards.
 
Last edited:
yes, with DIX or pointing to instance data block (DB) where stat variable is located, but why you would want do that?

If you use absolute address you need to change addresses to code allways if you add variables beginning or somewhere between DB-block.

Yes, i had to change them a lot! You are right, i'll try to use the names. Thank you very much guys.
 
Use an array of bools for your stats for the edge detection storage bits. There is no trying involved here - use the named stat variables.
 

Similar Topics

I have an old Sentry Palletizer (S/O Number 3007 / Serial Number 1172) that has lost its program as the backup battery died years ago. I can...
Replies
0
Views
106
Hi All, As a precaution my company has been collecting copies all the HMI and PLC programs. I have recorded copies of most of our sites...
Replies
0
Views
73
So basically i have 2 queries : 1. I have a program file of S7-300 PLC which i want to migrate in RSLogix500.In short i want to convert my simatic...
Replies
15
Views
277
Hi, i am using DVP-14SS2 PLC, after program written to plc, when power is reset, plc doesn't run. always need to connect to pc for the run mode.
Replies
0
Views
39
Hi all, hope you are having a great day, I am in need of your help to create a AOI or program that does this kind of job: I have a IO Link...
Replies
26
Views
569
Back
Top Bottom