Siemens and Initialization when Entering a Function Block

Join Date
Apr 2002
Location
Burlington, Ontario
Posts
186
Ladies & Gentlemen,

Im still in the process of startng to learn Siemens PLC's, so please bear with me...


What Im trying to do is to initialize some parameters in a function block, based on an initialization request. If im setting and resetting bits on the request no problem. But how would you reset a registar to zero?

Example: (inside FB)



Network 1:

A #Initialize_Request
FP #Initialize_OS
= #Initialize

Network 2:

A #Initialize
= #Test_Bit



The above code works as I expect. If there is an initialize request, the "#Test_bit" is on for one scan. No problem.

Instread of toggling a test bit, how would I reset some values to zero?? This is what I have tried..I know it is wrong because the value I am writing to is passed back out of the function and it is always zero. Eg.. the oneshot isnt requesting the transfer of 0.00 to "out". It is constantly tranfering.



Network 1:

A #Initialize_Request
FP #Initialize_OS
= #Initialize

Network 2:

A #Initialize
A(
L 0.00
T Out
)



I hope someone can lead me into the right direction. I know what I want to do, but just dont know how to do it in the Siemens PLC.
Damn differences in PLC..o_O

Thanks,

Andrew Evenson
 
A #Initialize_Request
FP #Initialize_OS
JCN H001
L 0
T out
H001: Nop 0

Should do the trick. The plc then jumps over the code when rlo is zero. And in this case rlo is only one for one scan when Initialize is set to one
 
Just remember that, not all operations are RLO dependant. This means that you cannot use bits alone to do functions like add, transfer etc. You must use other ways of blocking the code under these circumstances such as the jump statement shown by Bratt.

Cheers
 

Similar Topics

Hello, I have a CPU 317-2DP Firmware Version V2.1.8. In TIA Portal only V2.6 is available, and there is no option to upgrade FW. Then I open it...
Replies
2
Views
98
HI everyone, i am new to Siemens plc programming and i am in need of some help. yesterday we had an S7-1200 CPU 1214C fail to turn on an output to...
Replies
9
Views
300
Hi PLC people, think about this scenario: The PLC is somehow connected to the same network with the facilities` network. Then someone connects to...
Replies
2
Views
106
Hello everyone, I've had this issue for the last 2 days where I try to assign the profisafe address to an IO block (6ES7 146-6FF00-0AB0) but when...
Replies
5
Views
160
Hello, good morning, I have been having two problems with the Tia Portal software. The first is that I have installed it on my computer and...
Replies
5
Views
197
Back
Top Bottom