sapoleon
Member
Hi,
a simple question, I don't know if it has a simple answer:
How can I identify in which instance DB I'm working of a certain FB?
To explain a little better, I have a FB, and I want to access a certain value of it, but the value will change according to the instance DB... so, how can I know which value it is?
a second question is,
How can I pass a certain value in an instance DB to a function call in a FB?
I am trying to use SFC17 for generating alarms, and I have a lot of them. We have a CPU315, that will collect from a lot of inputs that came from different machines, and generate the alarms.
What I am making, is a FB that generates the alarms for every machine (10 alarms, like 30 machines). So, I want to make an instance of this FB for every machine, but I have to pass a parameter, that is fixed in the DB, but the DB is changing from machine to machine...
example code:
//associated values
//double integer
L #MachineNo //machine number
L 10000
*D
L 2 //first alarm
+D
T DID 32
CALL "ALARM_SQ"
SIG :=DB406.DBX0.1
ID :=W#16#EEEE
EV_ID :=#EV_ID2
SD :=DB2.DBD32
RET_VAL:=#retvalue2
in DBn.DBD32 I have the machine and error number that I want to pass for an error description.
Is it even possible to do?
thanks
ps, does is has something to do with DI?
a simple question, I don't know if it has a simple answer:
How can I identify in which instance DB I'm working of a certain FB?
To explain a little better, I have a FB, and I want to access a certain value of it, but the value will change according to the instance DB... so, how can I know which value it is?
a second question is,
How can I pass a certain value in an instance DB to a function call in a FB?
I am trying to use SFC17 for generating alarms, and I have a lot of them. We have a CPU315, that will collect from a lot of inputs that came from different machines, and generate the alarms.
What I am making, is a FB that generates the alarms for every machine (10 alarms, like 30 machines). So, I want to make an instance of this FB for every machine, but I have to pass a parameter, that is fixed in the DB, but the DB is changing from machine to machine...
example code:
//associated values
//double integer
L #MachineNo //machine number
L 10000
*D
L 2 //first alarm
+D
T DID 32
CALL "ALARM_SQ"
SIG :=DB406.DBX0.1
ID :=W#16#EEEE
EV_ID :=#EV_ID2
SD :=DB2.DBD32
RET_VAL:=#retvalue2
in DBn.DBD32 I have the machine and error number that I want to pass for an error description.
Is it even possible to do?
thanks
ps, does is has something to do with DI?
Last edited: