vary a DB numbers at a BLOCK_DB input of a FC

rick-brinkman

Member
Join Date
Dec 2012
Location
Overijssel
Posts
21
I use a FC that copy's data from one database to one other.
This FC has two inputs of type BLOCK_DB (One input for a DB number to copy from and one DB number to copy to). Unfortunately the DB number of one BLOCK_DB input isn't constant

So what I want is to change the DB number at a BLOCK_DB input conditionally.
If it’s possible, how can I do this?


Thanks in advance.
 
You could create a local variable of format WORD and an INT input.

Example

in = DB_No Format INT

temp = tDB Format WORD


Code would be

L #DB_No
T #tDB

OPN DB[#tDB]
 
I use a FC that copy's data from one database to one other.
This FC has two inputs of type BLOCK_DB (One input for a DB number to copy from and one DB number to copy to). Unfortunately the DB number of one BLOCK_DB input isn't constant

So what I want is to change the DB number at a BLOCK_DB input conditionally.
If it’s possible, how can I do this?
Thanks in advance.

Your function have only one input address for source and another one for destination.You can't use the costant for input , because you need to specific the Db number , start address to copy and length of data to copy.In this case normally is used the data type Any.
You need to put for DB example:
Code:
 P#DB100.DBX0.0 BYTE 55
for I example:
Code:
 P#I100.0 BYTE 55
for Q example:
Code:
 P#Q100.0 BYTE 55
for M example:
Code:
 P#M100.0 BYTE 55
DB_Temp:
Code:
 P#DB_Temp.DBX0.0 BYTE 55
 
Last edited:

Similar Topics

Sir, I have Siemens mm440 drive .which is using for conveyors .it's speed is controlling through pot (analog input 0-10 volt) But i am facing...
Replies
44
Views
11,310
Hello, I have a glyco system that chills several product tanks. We have a problem with over presurizing the glycol system when only a few tanks...
Replies
6
Views
2,218
Hello again I am working on a roller that needs to change speed when the machine changes. The roller is driven with a 90Vdc motor and currently I...
Replies
19
Views
5,522
Hello, I have a motor which requires me to vary the voltage in order to control the speed. I wish to do this from the PLC using an output...
Replies
9
Views
6,943
i have problem in vary pwm duty cycle using pwm instruction in OMRON cq1h PLC.i have value that need to be used to run my motor.the value is from...
Replies
5
Views
4,541
Back
Top Bottom