FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
Dear Community User! We are updating our platform to a new
system.
Read more: Important
information on the platform change.
03-19-2024 05:01 PM
Hello,
is there a way to mount/remove an USB device connected at XF01 (CoreX3) via PLC commands?
Just found ways with Node-Red.
Because all things like detecting an USB, read and write files, and so on, ware possible with PLC commands.
In any way I want to avoid using different programing which only makes punsh of functions and ends in a mixed up result.
It would be a great pleasure if doing this
and maybe this
with PLCcommands only.
Are there any hints?
Thanks
Solved! Go to Solution.
03-19-2024 07:14 PM
Hello @alink ,
Yes, all of this should be possible using the cltrX Storage API. You will need to implement a REST client in the PLC to make these requests. You can view the endpoints and play around with making REST calls in the interactive Swagger UI documentation. You can access this via the ctrlX OS web interface.
Example:
03-20-2024 12:03 PM - edited 03-20-2024 12:04 PM
Hello @Sgilk
thanks for reply. Maybe I forget to mention but it should be possible with a own visu. There I'd like to set a PLC command to mount / remove a USB device. Because to copy files from PLC to USB or USB to PLC is working fine. But it is nonsense when it is not possible to "mount" / "remove" the device with PLC commands. And I really don't want that customer uses ctrlX Web Interface or that I have to use other tools to program any action for this.
03-20-2024 12:49 PM
As an addition to @Sgilk The mentioned interface above are not limited to be used via our web UI but are describing standardised REST APIs that can be triggered/used from anywhere. E.g. also from PLC.
The API description can be easily found via the ctrlX OS web UI.
03-27-2024 02:19 PM
Right now, I found another way to get it working. It's not what I'd like to have but good enough to have a first solution:
With my own Visu (CoDeSys WebVisu) I placed the "webbrowser" element and browse to ctrlX OS Web infterface.
In ctrlX OS Web Interface there is a new user "user" with restricted permission just to manage "storage".
There the user can "mount"/"remove" a USB storage device.
With that, I reached what I wanted to have:
-Customer / user musn't start a webbrowser or call another page
-Customer / user can do it from my Visu
-No further code, software, program or anything is needed
What I don't like:
-Customer has contact with base system (ctrlX). Thanks to limited permissions it should be save but who knows what customer does intendend/unintendend
@CodeShepherd are there any plans to implement the function in DataLayer? Because status request is possible, giving commands like mount and remove would be great and makes it much easier and safer (not for me, for my customers).
Thanks guys for hints and help
03-27-2024 06:06 PM
@alink ,
This is exactly the idea behind the REST API. When you are clicking in the web interface via your browser, REST API calls are made behind the scenes. You can do the same thing in PLC code without requiring the user to click through.
04-02-2024 08:23 AM - edited 04-02-2024 08:29 AM
There are no plans to introduce such functionality in the data layer, as far as I know. But like also mentioned above simply use the cltrX Storage API.
Steps to go:
2 weeks ago
Is there a HTTPS library that would works to send REST request? We need to this this mount/unmount from PLC directly (No Nodered, or WebIQ). Customer is using Codesys webvisu.
Thanks
2 weeks ago
I believe the Codesys IIoT library should contain this functionality, have you taken a look at that option?
https://developer.community.boschrexroth.com/t5/Store-and-How-to/CODESYS-IIoT-Libraries/ba-p/45735
2 weeks ago
Thats Stephen!.
I think i got the wrong library before. iiot lib seems to work