I have a FB already written in a sample project.
FB7 and FB8 and FB80.
FB7 and FB8 are called by FB80.
I would like to change the names on FB7 and 8 to FB77 and FB78 to eliminate a conflict in my other program and also so I can easily tell which FB7 and FB8 are which.
Siemens has more than one FB7 that does the same thing, but only one works. So I would like to rename the one that works so I can easily tell which is which.
The tricky bit is the fact that FB80 calls FB7 and FB8 and uses an instance DB for all 3 FBs.
And the FBs are all in STL. WHich I am not expert in, but I can follow along.
I added the new blocks to the stat area of FB80 the same way the others were.
I changed the names and updated the calls and went through the FB80 code and used find and replace to update all the FB7 and FB8 references to FB77 and FB78 respectively.
Everything looks great except for one variable near the bottom of FB80.
The line of code refers to a bool in the stat area of FB8 named "null".
But there is no such variable inthe actual FB!
It appers to be a reset of some sort in the code.
I made a copy of the original FB8 and just renamed it FB78 so anything in the old one should be in the new one.
Another odd thing is the syntax which I thought was consistant in STL.
The old FB has a line like this "AN #fb8_DONE"
But when I change the block number in the reference it will not compile unless I change the syntax to this "AN #fb_78.DONE"
Original: "AN #fb8_DONE"
New edit: "AN #fb78_DONE"
does not work even though the new block is named the same as the old block with only the addition of the "7"
Works :#fb_78.DONE"
Got this syntax by copying the variable from the interface area and pasting it in the STL code.
That part is odd and I would love to hear why the two are different.
But the real problem is this line:
JC s8f
A #fb8_null
R #fb8_null
S #fb_78.REQ
JC stat
There is no fb8 null shown in the stat area! What does this reference point to?
I seem to remember running into something similar when I changed a FB before. Like if I removed some variable and left a reference to it, it would compile and just ignore the reference. But it would not allow a new use of the reference. This is a vague memory.
Here are my 2 questions:
1) What does "#fb8_null" refer to in this FB?
2) Why must I use a different syntax to make the same command work?
See attachment for the interface area of the FB and the code reference.
Notice all those " #fb_78.****" references in there? Those used to reference fb8.
FB7 and FB8 and FB80.
FB7 and FB8 are called by FB80.
I would like to change the names on FB7 and 8 to FB77 and FB78 to eliminate a conflict in my other program and also so I can easily tell which FB7 and FB8 are which.
Siemens has more than one FB7 that does the same thing, but only one works. So I would like to rename the one that works so I can easily tell which is which.
The tricky bit is the fact that FB80 calls FB7 and FB8 and uses an instance DB for all 3 FBs.
And the FBs are all in STL. WHich I am not expert in, but I can follow along.
I added the new blocks to the stat area of FB80 the same way the others were.
I changed the names and updated the calls and went through the FB80 code and used find and replace to update all the FB7 and FB8 references to FB77 and FB78 respectively.
Everything looks great except for one variable near the bottom of FB80.
The line of code refers to a bool in the stat area of FB8 named "null".
But there is no such variable inthe actual FB!
It appers to be a reset of some sort in the code.
I made a copy of the original FB8 and just renamed it FB78 so anything in the old one should be in the new one.
Another odd thing is the syntax which I thought was consistant in STL.
The old FB has a line like this "AN #fb8_DONE"
But when I change the block number in the reference it will not compile unless I change the syntax to this "AN #fb_78.DONE"
Original: "AN #fb8_DONE"
New edit: "AN #fb78_DONE"
does not work even though the new block is named the same as the old block with only the addition of the "7"
Works :#fb_78.DONE"
Got this syntax by copying the variable from the interface area and pasting it in the STL code.
That part is odd and I would love to hear why the two are different.
But the real problem is this line:
JC s8f
A #fb8_null
R #fb8_null
S #fb_78.REQ
JC stat
There is no fb8 null shown in the stat area! What does this reference point to?
I seem to remember running into something similar when I changed a FB before. Like if I removed some variable and left a reference to it, it would compile and just ignore the reference. But it would not allow a new use of the reference. This is a vague memory.
Here are my 2 questions:
1) What does "#fb8_null" refer to in this FB?
2) Why must I use a different syntax to make the same command work?
See attachment for the interface area of the FB and the code reference.
Notice all those " #fb_78.****" references in there? Those used to reference fb8.