How to use AsIO Library function AsIOFListDP() to get the pointer of a certain IO?

Hi Community,

I’m working on a simulation project that uses B&R library AsIO to force the input tag status hence when we deploy the program on a real PLC, we don’t need to change the program at all.

My question is: AsIO uses either AsIOListDP() or AsIOFListDP() to get the pointer to each IO. Since I’m only interested in the IO tags that are used in the program, I’m expecting AsIOFListDP() to get the specific IO’s pointers. However, the help file is not clear enough to me and the example came with AsIO doesn’t use this specific function.

A simple version of my question is: how to use AsIOFListDP() or other methods to get the pointer of a specific PLC IO say X1.DigitalInput01 so other AsIO library functions can force the input value?

If there is anything unclear about my question, please comment and I’ll try to be as descriptive as possible.

Thanks for the help.

Hello,

as you already know the functionblocks AsIOListDP() and AsIOFListDP() can iterate through the list of IO datapoints. The help mentions that only existing I/O datapoints are retrieved, meaning that all available I/O datapoints are retrieved not only the ones which are linked to a PV.
You can check if a PV is linked and therefore if the I/O is used in your program by using the functionblock AsIOPVInfo().

To access a datapoint of an I/O you have to use the name anyway. So the pointer to string you get from the AsIO(F)ListDP() functionblock for the name can be reused.

BR Fabian

Hi Fabian,

Thank you for your reply.

I found that unfortunately AsIOFListDP()'s filtering string only works on output. I’m more interested in the inputs as I’m making some simulation functions. I guess I’ll need to arrange the number of IO each PLC scan will force to save my scan time.

1 Like