FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
Monday
I am using datalayer library to consume the data from PLC. But once PLC is shutdown and repower, the subscribe pipe line will break down. I can/t receive the subscribe data. And the connection state from datalayer is still connected.
So how to detect shutdown event and triggle reconnect action.
Tuesday - last edited Tuesday
Hello ,
could you please expand the description about the calling application a bit (SDK, Nodered, ?)
Thanks!
Do you know these states to check?
Bye
Tuesday
For example, in node red, you can see the node state is still authenticated, but the virtual environment already stopped.
So how to get the Ctrlx PLC state and monitor the shutdown the event?
Wednesday - last edited Wednesday
As the READ node in your picture above is event driven you would have to trigger it again to get a response that provider is not longer available. If you are using subscription you should automatically get a message that connection timed out. Feel free to have a look to our Node-RED examples that are part of the node-red-contrib-ctrlx-automation.
Wednesday
It works sometimes, but not for each time.
Is it related to the virtual environment?
Wednesday
When I redeploy the node red project, subscribe status turns to failed
Wednesday - last edited Wednesday
Are the subscription nodes to the localhost? In other words, is Node-RED running on the VirtualControl that is offline? In this case, Node-RED would be completely unresponsive.
If not, check your error interval and keep alive interval on the subscriptions.
Wednesday
No, node red is not running on the virtual machine, it is running on the localhost.(A standart node red instance)
Wednesday
I use the default configuration.
Wednesday
By default, this will only check the subscription connection once per 60s. Try reducing this to 10s and trying again. In this case, you should wait a maximum of 10s after the control goes offline for an error message.
Wednesday
I find there is a rule, when double click the stop button, the connection state won't be updated.
But when I click the stop button for one time, when the virtual environment turns offline, the state below node will also be updated(to subscribed failed).
The ctrlx works version is ctrlX WORKS WRK-V-0120.2.
It is so interesting.
Thursday
Beware that clicking stop once will shutdown the ctrlX COREvirtual ending all processes properly. When clicking twice the emulation will be killed, like as holding shutdown button on a PC or removing power.
Thursday
If I use standalone node-red project to subscribe a variable from the real ctrlx PLC. What will happens if I power off the ctrl PLC instead of stoping it in ctrlx works. Will the subscribe status turns to failed or stay the same just as I double click the stop button in virtual test environment?
Because, when I use CtrlxCore library to connect ctrlx PLC and subscribe the data, when PLC is powered off, my connect status won't change.
What't the reason for it?
Friday - last edited Friday
As I do not get your last sentence and complete topology completely, could you please confirm my summary:
A Node-RED installation on a PC is used and there our node-red-contrib-ctrlx-automation library to subscribe to data on a ctrlX CORE connected that PC. When switching off the ctrlX COREs power supply, the subscription node does not react to this, even if you lowered the timeout settings mentioned above?