Signal function based on "From File"

I’m trying to generate a step-type control signal from a CSV using a “From File” block, feed it into “Compare to Constant” (≥ setpoint), and trigger an output when the CSV value crosses that threshold. I have this set up, but the comparator doesn’t seem to switch when the value reaches the setpoint. I’m trying to use this in place of a Step block, but I can’t get it to work. What’s the correct way to configure this so the compare output engages reliably when the CSV value exceeds the setpoint?

Hello, could you share your model? It would be easier to understand the issue you are running into

battery_charger_with_PI.plecs (160.9 KB)

Controlled Current test (1).xml (1.6 KB)

The plexim forum won’t allow for sending csv files, so i changed the extension to a “.xml” file. After downloading the files, please change the extension of the xml back to “.csv“ for proper functionality. I hope you are able to make the conversion back to csv without issues, but if you have an issue, please let me know.

There are 2 “From File” blocks and they are in the “Controller“ and the “Plant” subsystem. I circled them in red so hopefully they are easy to spot.

Thank you for your help.

Hi 5aj,

Thanks for sharing the model.

When I run the offline simulation I see the results you expect to see (I’m running PLECS 4.9.7):

Maybe I’m not understanding the issue you are running into. Could you share some scope images showing the problem? Also what would be helpful is to know what version of PLECS you are running, what operating system you are running the simulation on (e.g. Windows vs macOS).