Function Block with Any, PLC Functions in firmware

emilg

Level-1
Beiträge
52
Reaktionspunkte
1
Zuviel Werbung?
-> Hier kostenlos registrieren
Hello

Is it possible to make a Function Block with "Any", Instead of Fx. Word or DWord?
Why isn't there a Scale function in the PLC Firmware libary?
I also need a X-Y conversion, with 5-10 Points, Like this:
X0 0,0 X1 10,0 X2 50,0 X4 500,0
Y0 0,0 Y1 8,0 Y2 20,0 Y4 100,0

X-Y Conversion and Y-X Conversion?


Now i need to make a Scale_R, _W, _DW and.......?
It coud be nice to have in the firmware. The Old PLC Brand i used before have all that in the firmware....

(I Use ILC191 ME/AN)

-Emil
JCJElektro.dk
 
Hello Emil,


it is not possible to use the Any type in self created FBs. This is only possible in FW FBs as they are created in a different way.

There isn't a scaling option as this is a simple "rule of three" math problem.

As for your other questions. We are not really sure what you are talking about. "Scale_R, _W, _DW" & "X-Y Conversion and Y-X Conversion"??

Mark

Your request is handled under the following ticket number: 00068751
 
Zuviel Werbung?
-> Hier kostenlos registrieren
I have made a FB, for Scale_Real, And Scale_Word and Scale_DWord. It will be nice to have a Scale_Any in the firmware. But as i can undestand it's not posible to get.

X-Y Conversion (Can alsow be used for scaleing)
See:
xy.jpg
And in Simulation:
xy_test.png
 
Hello Emil,

Still not really sure what you are talking about. If it is just two arrays of X and Y coordinates you could create buffer arrays and use them to swap the values.
I don't think that there is predefined a function block for that.

Mark
 
@Mark:
I think, the TE is searching for a function (or something like this) which is able to do a conversion for a non-linear dependance.

@TE:
If I understood you right, I think that you need to programm you own function, depending on your curve.

Greetings
Larry
 
Zuletzt bearbeitet:
Zuviel Werbung?
-> Hier kostenlos registrieren
Hi again.

It works a little like the scale function.
Here is a little from the Help File:
help.png
You made a Curve, in this case 3 Points.
1: X0 Y100
2: X100 Y0
3: X300 Y100

Example: Y to X
"40" (Register D95) on the Y axis, it's read out on the X axis to "60" (Register D30)

The other example;
"250" (from Counter C30) on the X axis, it's read out on the Y axis to "75" (Register D90)
 
I think, I understood you right.
The conversion-method normaly is used with an linear dependancy (only 2 points on 1 graph).
To do what you are thinking about it is nescessary to check, in which area from the curve you are to make the right conversion.
Therefore you have do develop your own method ...

Greetings
Larry
 
Zuletzt bearbeitet:
Zurück
Oben