plc_seti() and plc_geti()


Thread Starter

Mario de Sousa

Hi all,

I have added the above mentioned functions to the plc interface. They set/return an inverted value of the plc point.

Note that what you get from plc_geti() is not necessarily equal to ~plc_get().

For example, for a 4 bit plc point, with current status set to 0xF, plc_get() will return 0x000F, ~plc_get() will give you 0xFFF0, and plc_geti() will give you 0x0000.

The same goes for plc_seti().

I added these functions because they are useful for the generic io library, that allows the user to configure an output/input as inverted logic. I could have the io library do the inverting, but we already have the mask for the inversion inside the gmm, so it doesn't quite make much sense to duplicate it in the io library.



Mario J. R. de Sousa
[email protected]

The box said it requires Windows 95 or better, so I installed Linux

LinuxPLC mailing list
[email protected]