Hello,
The PLECS Electrical>Sources component library has both a Controlled Current Source and a Controlled Voltage Source block. These have control signal input ports, so the drive signal can be any logic that you design, measure, or apply processing to existing signals. Just beware of creating algebraic loops in your model.
Regards,
Kris