FactoryIO 2.5.2 WebAPI + OpenPLC driver

Hi all,

I need to use Factory I/O WebAPI in my cybersecurity project, as I would like to automate it by not touching the Factory I/O GUI (if it is possible).

Basically, I have tried and the api only allows me to write values for coils, but I cannot write values for inputs.

i.e.

REQUEST
curl -X PUT -d ‘[{“name”: “Start Button 0”, “value”: true}]’ -H “Content-Type: application/json; charset=utf-8” http://127.0.0.1:7410/api/tag/values/by-name

RESPONSE

[{“name”: “Start Button 0”, “code”: 406, “error”: “You are not allowed to set the value of an input tag.”}]


REQUEST
curl -X PUT -d ‘[{“name”: “Start Button 0 (Light)”, “value”: 1}]’ -H “Content-Type: application/json; charset=utf-8” http://127.0.0.1:7410/api/tag/values/by-name

I’m not at pc and don’t remember the answer, but I’m sure the start button light comes on without error.

I think it may be a communication problem between webapi and openplc, but I am not sure and I am looking for someone who has encountered the same problem or something similar.

Hi,

You cannot write values to sensors but you can force sensors using the PUT verb and the endpoint api/tag/values-force.

I found a way to avoid hitting the run key by adding ‘scene.start_in_run_mode = True.’ and set scene with ‘scene.load_from_path(“c:\…” )’
no way to stream the scene so far…

Hi,

What do you mean by streaming the scene? If you are trying to toggle between Edit/Run modes, you can use the Factory I/O (Run) actuator tag.

The 'goal is to create a kind of dashboard where the current scene is shown among other things. The various tags and configurations in auto.cfg allow me to directly start a scene, even if the window is not focused, but I can’t extract the scene and do for example streaming to a web page. If is not possible and i may say, consider to integrate this feature in the nexts software updates.

I understand now, thanks for the feedback.